text:
These sample source codes on this page below are demonstrating how to export to jagged array in VB.NET. ByteScout Spreadsheet SDK is the SDK that can write and read, modify and calculate Excel and CSV spreadsheets. Most popular formulas are supported. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays. It can be used to export to jagged array using VB.NET.

You will save a lot of time on writing and testing code as you may just take the VB.NET code from ByteScout Spreadsheet SDK for export to jagged array below and use it in your application. Follow the instructions from the scratch to work and copy the VB.NET code. Enjoy writing a code with ready-to-use sample VB.NET codes.

ByteScout Spreadsheet SDK free trial version is available on our website. VB.NET and other programming languages are supported.

## REQUEST FREE TECH SUPPORT

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

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Spreadsheet%20SDK%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=nm_7I0PN1TY](https://www.youtube.com/watch?v=nm_7I0PN1TY)

<!-- code block begin -->

##### ****ExportToJaggedArray.VS2005.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>
    </SchemaVersion>
    <ProjectGuid>{D1167E6A-1CAC-4923-858D-CAB14AF79FEB}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.Module1</StartupObject>
    <RootNamespace>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</RootNamespace>
    <AssemblyName>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkProfile>
    </TargetFrameworkProfile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <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.Spreadsheet, Version=2.3.0.750, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\lib\Bytescout.Spreadsheet.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
  </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="Module1.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>
    <None Include="StockPricesSpreadsheet.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </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 -->

##### ****ExportToJaggedArray.VS2008.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>
    </SchemaVersion>
    <ProjectGuid>{D1167E6A-1CAC-4923-858D-CAB14AF79FEB}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.Module1</StartupObject>
    <RootNamespace>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</RootNamespace>
    <AssemblyName>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkProfile>
    </TargetFrameworkProfile>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <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.Spreadsheet, Version=2.3.0.750, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\lib\Bytescout.Spreadsheet.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
  </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="Module1.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>
    <None Include="StockPricesSpreadsheet.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </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 -->

##### ****ExportToJaggedArray.VS2010.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <SchemaVersion>
    </SchemaVersion>
    <ProjectGuid>{D1167E6A-1CAC-4923-858D-CAB14AF79FEB}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.Module1</StartupObject>
    <RootNamespace>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</RootNamespace>
    <AssemblyName>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkProfile>
    </TargetFrameworkProfile>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <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.Spreadsheet, Version=2.3.0.750, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\lib\Bytescout.Spreadsheet.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
  </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="Module1.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>
    <None Include="StockPricesSpreadsheet.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </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 -->

##### ****ExportToJaggedArray.VS2012.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <SchemaVersion>
    </SchemaVersion>
    <ProjectGuid>{D1167E6A-1CAC-4923-858D-CAB14AF79FEB}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.Module1</StartupObject>
    <RootNamespace>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</RootNamespace>
    <AssemblyName>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkProfile>
    </TargetFrameworkProfile>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <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.Spreadsheet, Version=2.3.0.750, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\lib\Bytescout.Spreadsheet.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
  </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="Module1.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>
    <None Include="StockPricesSpreadsheet.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </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 -->

##### ****ExportToJaggedArray.VS2013.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <SchemaVersion>
    </SchemaVersion>
    <ProjectGuid>{D1167E6A-1CAC-4923-858D-CAB14AF79FEB}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.Module1</StartupObject>
    <RootNamespace>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</RootNamespace>
    <AssemblyName>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkProfile>
    </TargetFrameworkProfile>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <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.Spreadsheet, Version=2.3.0.750, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\lib\Bytescout.Spreadsheet.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
  </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="Module1.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>
    <None Include="StockPricesSpreadsheet.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </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 -->

##### ****ExportToJaggedArray.VS2015.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <SchemaVersion>
    </SchemaVersion>
    <ProjectGuid>{D1167E6A-1CAC-4923-858D-CAB14AF79FEB}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.Module1</StartupObject>
    <RootNamespace>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</RootNamespace>
    <AssemblyName>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkProfile>
    </TargetFrameworkProfile>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DocumentationFile>Bytescout.Spreadsheet.Demo.VBNet.ExportToJaggedArray.xml</DocumentationFile>
    <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.Spreadsheet, Version=2.3.0.750, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\lib\Bytescout.Spreadsheet.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
  </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="Module1.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>
    <None Include="StockPricesSpreadsheet.xls">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </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 -->

##### ****Module1.vb:**

```
Module Module1

    Sub Main()
        Dim inputFile As String = "StockPricesSpreadsheet.xls"

        'Open and load spreadsheet
        Dim spreadsheet = New Spreadsheet()
        spreadsheet.LoadFromFile(inputFile)

        'Get the data from the spreadsheet
        Dim stockPrices()() As String = spreadsheet.ExportToJaggedArray()

        'Close spreadsheet
        spreadsheet.Close()

        'Display data in jagged array
        For i As Integer = 0 To stockPrices.GetLength(0) - 1
            Console.Write(stockPrices(i)(0) + " ")
            Console.Write(stockPrices(i)(1) + " ")
            Console.WriteLine()
        Next

        'Pause
        Console.ReadLine()
    End Sub

End Module

```

<!-- code block end -->


text:
'use strict';

/**
 * @ngdoc directive
 * @name dockstore.ui.directive:onFinishRender
 * @description
 * # emits event when ng-include has finished loading
 */
angular.module('dockstore.ui')
  .directive('onFinishRender', function($timeout) {
    return {
      restrict: 'A',
      link: function postLink(scope, element, attr) {
          $timeout(function () {
              scope.$emit(attr.onFinishRender);
          });
      }
    };
  });

redpajama_set_name: RedPajamaGithub


text:
#ifndef JJK_PARSER_AST__AST_NODE__HPP
#define JJK_PARSER_AST__AST_NODE__HPP

#include <list>
#include <typeinfo>
#include "ast__def.hpp"

NAMESPACE_AST_BEGIN

class File;
class Class;
class Method;

class IContext
{
public:
};

class Node: public bfc::object
{
public:
    AST_PROPERTY_DEFINE(Node*,              parent);
    AST_GETTER_DECL(Class*,                 this_class);
    AST_GETTER_DECL(CompilationUnit*,       this_compilation_unit);
    AST_GETTER_DECL(Method*,                this_method);
    AST_GETTER_DECL(Identifier*,            this_package);

    bfc::string_ptr quote_string(const char *str) {
        std::ostringstream os;
        os << "\"" << str << "\"";
        return bfc::string::make_ptr(os);
    }

public:
    // output
    virtual void debug_print(int indent) {;}

    void print_space(int width) {
        for (int i = 0; i < width; ++i) {
            printf(" ");
        }
    }

public:
    AST_IMPLEMENT_ABSTRACT(Node);
    virtual Node::pointer_type _make_clone_node() {return NULL;}
protected:
    explicit Node() {init(NULL);}
    explicit Node(Node *other) {init(other);}
private:
    void init(Node *other) {
        if (other) {
            set_parent(other->get_parent());
        }
    }
};

template <class T>
class NodeList: public Node
{
public:
    typedef T                                           element_type;
    typedef typename bfc::rc_ptr<element_type>          element_pointer_type;
    typedef typename std::list<element_pointer_type>    container;
    typedef typename container::iterator                iterator;

    iterator begin() {return m_node_list.begin();}
    iterator end()   {return m_node_list.end();}

    element_pointer_type back() {return m_node_list.back();}

    void    push_back(element_type        *node)    {m_node_list.push_back(node);       node->set_parent(this);}
    void    push_back(element_pointer_type node)    {m_node_list.push_back(node.get()); node->set_parent(this);}

    // FIXME: deep copy
    void    assign(NodeList<T> *node_list) {m_node_list = node_list->m_node_list;}
    size_t  size() {return m_node_list.size();}
    bool    empty() {return m_node_list.empty();}

private:
    container m_node_list;

public:
    AST_IMPLEMENT_ABSTRACT(NodeList);
protected:
    explicit NodeList() {;}
    explicit NodeList(NodeList *other): Node(other) {
        iterator begin = this->begin();
        iterator end   = this->end();

        for (NULL; begin != end; ++begin) {
            element_pointer_type node = *begin;
            if (!node.is_null())
                continue;

            push_back((T*)node.get());
        }
    }
public:
    // static pointer_type make_ptr() {return pointer_type(new class__());}
};

NAMESPACE_AST_END

#endif


text:
package fr.kisuke.rest.resources;

import fr.kisuke.JsonViews;
import fr.kisuke.dao.picture.PictureDao;
import fr.kisuke.entity.Pictures;
import org.codehaus.jackson.map.ObjectWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Component;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import java.io.*;

/**
 * Created by Bonheur on 02/01/2015.
 */
@Component
@Path("/files")
public class DownloadResource {
    @Autowired
    private PictureDao pictureDao;

    @GET
    @Path("full/{imageId}")
    @Produces("image/*")
    public Response getImage(@PathParam(value = "imageId") Long imageId) {
        Pictures pictureToSend = getPictures(imageId);

        //Construction de la requete du fichier
        String fileName = pictureToSend.getPath()+pictureToSend.getNameHight();
        String exactName = pictureToSend.getName();

        //Put some validations here such as invalid file name or missing file name
        return getResponse(fileName, exactName);
    }

    private Pictures getPictures(Long imageId) {
        //Recuperation de l'image de la bdd
        Pictures picture = pictureDao.find(imageId);
        Pictures pictureToSend = null;

        UserDetails userDetails = this.isAdmin();

        if (null != userDetails ) {
            for (GrantedAuthority authority : userDetails.getAuthorities()) {
                if (authority.toString().equals("admin")) {
                    pictureToSend = picture;
                } else if (authority.toString().equals("user")) {

                        if (userDetails.getUsername().equals(picture.getUser().getName())) {
                            pictureToSend = picture;
                        }

                }
            }
        }else {
                if (null == picture.getUser()){
                    pictureToSend = picture;
                }
        }
        return pictureToSend;
    }

    @GET
    @Path("medium/{imageId}")
    @Produces("image/*")
    public Response getImageMed(@PathParam(value = "imageId") Long imageId) {

        //Recuperation de l'image de la bdd
        Pictures pictureToSend = getPictures(imageId);

        //Construction de la requete du fichier
        String fileName = pictureToSend.getPath()+pictureToSend.getNameMed();
        String exactName = pictureToSend.getName();

        //Put some validations here such as invalid file name or missing file name
        return getResponse(fileName, exactName);
    }

    @GET
    @Path("low/{imageId}")
    @Produces("image/*")
    public Response getImageLow(@PathParam(value = "imageId") Long imageId) {

        //Recuperation de l'image de la bdd
        Pictures pictureToSend = getPictures(imageId);

        //Construction de la requete du fichier
        String fileName = pictureToSend.getPath()+pictureToSend.getNameLow();
        String exactName = pictureToSend.getName();
        return getResponse(fileName, exactName);
    }

    @GET
    @Path("getUploadClient")
    @Produces("application/zip")
    public Response getUploadClient() {

        String jarFile = "/srv/appli/cCloud.zip";

        //Construction de la requete du fichier
        File repositoryJarFile = new File(jarFile);
        if (repositoryJarFile != null) {

            Response.ResponseBuilder response = Response.ok((Object) repositoryJarFile);
            response.header("Content-Disposition", "attachment; filename=CloudPixClient.zip");
            return response.build();
        }
        return Response.noContent().build();
    }

    private Response getResponse(String fileName, String exactName) {
        //Put some validations here such as invalid file name or missing file name
        if(fileName == null || fileName.isEmpty())
        {
            Response.ResponseBuilder response = Response.status(Response.Status.BAD_REQUEST);
            return response.build();
        }

        File repositoryFile = new File(fileName);
        if (repositoryFile != null) {

            Response.ResponseBuilder response = Response.ok((Object) repositoryFile);
            response.header("Content-Disposition", "attachment; filename="+exactName+"");
            return response.build();
        }
        return Response.noContent().build();
    }

    private UserDetails isAdmin()
    {
        //UserDetails userDetails = null;
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        Object principal = authentication.getPrincipal();
        if (principal instanceof String && ((String) principal).equals("anonymousUser")) {
            return null;
        }else {
            return (UserDetails) principal;
        }
    }

}


text:
The following tasks are generated by [`gitbook` sub-generator](../generators/gitbook.md).

| Task | Description |
|:-----|:------------|
| `gitbook` | Manage [GitBook](https://github.com/GitbookIO/gitbook) installation with [`gitbook-cli`](https://github.com/GitbookIO/gitbook-cli). |
| `gitbook:build` | Build docs with [GitBook](https://github.com/GitbookIO/gitbook). |
| `gitbook:serve` | Serve docs at http://localhost:4000/. |

There is no task to publish docs to production. This is done automatically with [Travis CI](https://travis-ci.org/) when pushing `master` to [GitHub](https://github.com/ ). See [deployment documentation](../deployment.md) for details.


text:
import scala.reflect.Selectable.reflectiveSelectable

object B {
	val y: Int = A.x.q
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Rabenhorst's Fungi europ. exsicc. no. 1658 (1873)

#### Original name
Synchytrium bupleuri J. Kunze

### Remarks
null


text:
layout: post
title: "Ray of Enfeeblement"
date: 2015-07-30
source: PHB.271
tags: [warlock, wizard, level2, necromancy]
---

**2nd-level necromancy**

**Casting Time**: 1 action

**Range**: 60 feet

**Components**: V, S

**Duration**: Concentration, up to 1 minute

A black beam of enervating energy springs from your finger toward a creature within range. Make a ranged spell attack against the target. On a hit, the target deals only half damage with weapon attacks that use Strength until the spell ends.

At the end of each of the target's turns, it can make a Constitution saving throw against the spell. On a success, the spell ends.


text:
import random
from classical_state import ClassicalState
from pure_state import PureState

class MixedState:
    """
    A probability distribution of pure states.
    """

    def __init__(self, pure_to_probability_map):
        err = abs(1 - sum(pure_to_probability_map.values()))
        if err > 0.00001:
            raise ValueError("Probabilities must sum to 1.")
        # Discard negligible probabilities as an approximation/optimization.
        self.distribution = {
            pure_state: p
            for pure_state, p in pure_to_probability_map.items()
            if p >= 0.000001  # Discard impossible states (w/ rounding-error)
        }

    def measure(self, predicate):
        """
        :param predicate: Takes classical states and returns hashable keys.
        Determines which states the measurement distinguishes between.
        States mapped to the same result by the predicate will not be split
        into separate parts of the resulting mixed state.
        :return: A mixed state of possible measurement results.
        """
        return MixedState({
            pure_2: p2 * p1
            for pure_1, p1 in self.distribution.items()
            for pure_2, p2 in pure_1.measure(predicate).distribution.items()
        })

    def post_select(self, predicate):
        """
        :param predicate: Determines which classical states to keep. All
        non-matching states are discarded out of the mixed state and its
        superpositions (the resulting mixed state is renormalized to compensate
        for the missing weight).
        :return: A (probability, MixedState) pair with the probability of the
        desired predicate being satisfied (the post-selection's "power") and the
        renormalized mixed state bof the matching values.

        >>> a, b, c = ClassicalState(0), ClassicalState(1), ClassicalState(2)
        >>> p, q = PureState({a : 1}), PureState({b : 1})
        >>> r = PureState({c : 0.8, b : 0.6})
        >>> MixedState({p: 0.25, q: 0.75}).post_select(lambda c: c.bit(0))
        (0.75, MixedState({PureState({ClassicalState(1): (1+0j)}): 1.0}))
        >>> MixedState({p: 0.25, q: 0.75}).post_select(lambda c: not c.bit(0))
        (0.25, MixedState({PureState({ClassicalState(0): (1+0j)}): 1.0}))
        >>> MixedState({r: 1}).post_select(lambda c: c.bit(0))
        (0.36, MixedState({PureState({ClassicalState(1): (1+0j)}): 1.0}))
        >>> MixedState({r: 1}).post_select(lambda c: not c.bit(0))
        (0.6400000000000001, MixedState({PureState({ClassicalState(2): (1+0j)}): 1.0}))

        # disabled due to non-deterministic ordering of dictionaries
        # >>> MixedState({p: 0.2, q: 0.3, r: 0.5}).post_select(lambda c: c.bit(0))
        # (0.48, MixedState({PureState({ClassicalState(1): (1+0j)}): 0.375, PureState({ClassicalState(1): (1+0j)}): 0.625}))
        """
        filtered = {
            filtered_state: p_hit * p_state
            for pure_state, p_state in self.distribution.items()
            for p_hit, filtered_state in [pure_state.post_select(predicate)]
            if p_hit * p_state != 0
        }
        remaining_weight = sum(filtered.values())
        if remaining_weight == 0:
            return 0, None
        normalized = MixedState({pure_state: p / remaining_weight
                                 for pure_state, p in filtered.items()})
        return remaining_weight, normalized

    def unitary_transform(self, op):
        """
        :param: op Maps inputs to a superposition of outputs.
        Must be a unitary operation (i.e. length preserving in all cases).
        :return: The resulting mixed state, after the operation has been applied
        to each pure state within the mixed state.
        """
        return MixedState({pure_state.unitary_transform(op): p
                           for pure_state, p in self.distribution.items()})

    def collapsed(self):
        """
        Picks a classical state at random, with frequency proportional to
        the containing mixed state probabilities and containing superpositions'
         amplitudes' squared magnitudes.
        :return: A classical state from the mixed state.
        """
        t = random.random()
        for pure_state, p in self.distribution.items():
            t -= p
            if t <= 0.000001:
                return pure_state.collapsed()
        raise AssertionError("Probabilities didn't sum to 1")

    def __str__(self):
        return "\n".join("{0:.1%}: {1}".format(p, pure_state)
                         for pure_state, p in self.distribution.items())

    def __repr__(self):
        return "MixedState(" + repr(self.distribution) + ")"


text:
import paramiko
'''
Basic wrapper for Paramiko
'''
# For paramiko debugging
# paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG)

class ConnectToDevice():

    def __init__(self):
        self.hosts = []
        self.connections = []

    def add_host(self, args):
        """
        add hosts to the connection list
        """
        if args:
            self.hosts.append(args.split(','))
        else:
            print 'usage: host'

    def connect(self):
        """Connect to hosts in host list"""
        for host in self.hosts:
            self.client = paramiko.SSHClient()
            self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
            self.client.connect(host[0],username=host[1],password=host[2], look_for_keys=False, allow_agent=False)
            self.connections.append(self.client)
    # Rewrite this to use the transport class instead of SSHClient.
    def command(self,command):
        """Execute this command on all hosts in the list and return output as string"""
        if command:
            for host, conn in zip(self.hosts, self.connections):
                stdin, stdout, stderr = conn.exec_command(command)
                stdin.close()
                output = ''
                for line in stdout.read().splitlines():
                    output += "%s\n" % (line)
                return output

        else:
            return 'No command entered.'

    def close(self):
        for conn in self.connections:
            conn.close()


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class projectModel extends CI_Model{

// Count all tasks of table "task" in database for a particular user.
        public function record_count($id) {
            $query=$this->db->query("SELECT * from task where Task_id in (SELECT Task_id from member_task where member_id = $id)");
            return $query->num_rows();
        }

// Fetch data according to per_page limit.
        public function fetch_data($limit, $id,$offset) {
            $query=$this->db->query("SELECT * from task where Task_id in (SELECT Task_id from member_task where member_id = $id) limit $limit offset $offset");
            if ($query->num_rows() > 0) {
                    foreach ($query->result() as $row) {
                    $data[] = $row;
                     }
                return $data;
                }
            return false;
        }

//Fetch all the members from the table "projectmember" in database.
       public function getMemberName(){
            $query=$this->db->query('SELECT * from projectmember');
            foreach ($query->result() as $row) {
               $data[] = $row;
             }
            return $data;
        }

//Fetch the details of a particular member.
      public function getMemberDetails($id){
           $this->load->database();
           $query=$this->db->query("SELECT * from projectmember where member_id = $id");
           foreach ($query->result() as $row) {
                      	$data[] = $row;
           }
           return $data;
         }

}


text:
ES5Harness.registerTest({
    id: "15.3.4.5.2-4-4",

    path: "TestCases/chapter15/15.3/15.3.4/15.3.4.5.2/15.3.4.5.2-4-4.js",

    description: "[[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and without 'boundThis'",

    test: function testcase() {
        var func = function () {
            return new Boolean(arguments[0] === 1 && arguments.length === 1);
        };

        var NewFunc = Function.prototype.bind.call(func);

        var newInstance = new NewFunc(1);

        return newInstance.valueOf() === true;
    },

    precondition: function prereq() {
        return fnExists(Function.prototype.bind);
    }
});


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

namespace Tasks1_Task6AndTask8
{
    public class AlbumFactory
    {
        public Album CreateAlbum(string name, string artist, int year, string producer, decimal price, int numberOfSongs)
        {
            Album album = new Album(name, artist, year, producer, price);

            for (int i = 1; i <= numberOfSongs; i++)
            {
                Song song = new Song
                {
                    Name = string.Format("{0} song {1}", name, i),
                    Duration = new TimeSpan(0, 2 + i, 10 + i).ToString()
                };

                album.Songs.Add(song);
            }

            return album;
        }
    }
}


text:
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'video_grabber'


text:
package ipamperf

import (
	"github.com/golang/glog"
	"k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/api/resource"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	clientset "k8s.io/client-go/kubernetes"
	restclient "k8s.io/client-go/rest"
	"k8s.io/kubernetes/pkg/api/testapi"
)

var (
	baseNodeTemplate = &v1.Node{
		ObjectMeta: metav1.ObjectMeta{
			GenerateName: "sample-node-",
		},
		Spec: v1.NodeSpec{
			ExternalID: "foo",
		},
		Status: v1.NodeStatus{
			Capacity: v1.ResourceList{
				v1.ResourcePods:   *resource.NewQuantity(110, resource.DecimalSI),
				v1.ResourceCPU:    resource.MustParse("4"),
				v1.ResourceMemory: resource.MustParse("32Gi"),
			},
			Phase: v1.NodeRunning,
			Conditions: []v1.NodeCondition{
				{Type: v1.NodeReady, Status: v1.ConditionTrue},
			},
		},
	}
)

func deleteNodes(apiURL string, config *Config) {
	glog.Info("Deleting nodes")
	clientSet := clientset.NewForConfigOrDie(&restclient.Config{
		Host:          apiURL,
		ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Groups[v1.GroupName].GroupVersion()},
		QPS:           float32(config.CreateQPS),
		Burst:         config.CreateQPS,
	})
	noGrace := int64(0)
	if err := clientSet.CoreV1().Nodes().DeleteCollection(&metav1.DeleteOptions{GracePeriodSeconds: &noGrace}, metav1.ListOptions{}); err != nil {
		glog.Errorf("Error deleting node: %v", err)
	}
}

func createNodes(apiURL string, config *Config) error {
	clientSet := clientset.NewForConfigOrDie(&restclient.Config{
		Host:          apiURL,
		ContentConfig: restclient.ContentConfig{GroupVersion: testapi.Groups[v1.GroupName].GroupVersion()},
		QPS:           float32(config.CreateQPS),
		Burst:         config.CreateQPS,
	})
	glog.Infof("Creating %d nodes", config.NumNodes)
	for i := 0; i < config.NumNodes; i++ {
		if _, err := clientSet.CoreV1().Nodes().Create(baseNodeTemplate); err != nil {
			return err
		}
	}
	glog.Infof("%d nodes created", config.NumNodes)
	return nil
}


text:
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset=hw")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)


text:
define([
	"ts/widgets/TSWizardStep",
	"ts/t3/cluster/DeploymentTable",
	"ts/t3/cluster/renderers/GPFSRenderer",
	"ts/t3/cluster/renderers/SymphonyRenderer",
	"dojo/text!./htm/StepDeployment.htm"
],function(TSWizardStep,DeploymentTable,GPFSRenderer,SymphonyRenderer,htm){
	"use strict";
	var __super__=TSWizardStep.prototype;
	"constrcutor";
	function StepDeployment(id,initParams){
		__super__.constructor.call(this,id,initParams);
		init.call(this);
	}
	function init(){
		this.title=this.i18n.getMessage("Deployment");
		this.caption=this.i18n.getMessage("Check components to deploy");

		var table=new DeploymentTable();
		table.registerRenderer("GPFS",GPFSRenderer);
		table.registerRenderer("Symphony",SymphonyRenderer);

		this.deploymentTable=table;
		this.innerWidget=table;
	}
	"exports";
	ExtendClass(StepDeployment,TSWizardStep);
	SetProperties(StepDeployment.prototype,NONE,[
		"template",htm
	]);
	return StepDeployment;
});


text:
#include <modules/base/processors/camerafrustum.h>
#include <modules/base/algorithm/meshutils.h>

namespace inviwo {

// The Class Identifier has to be globally unique. Use a reverse DNS naming scheme
const ProcessorInfo CameraFrustum::processorInfo_{
    "org.inviwo.CameraFrustum",  // Class identifier
    "Camera Frustum",            // Display name
    "Information",               // Category
    CodeState::Experimental,     // Code state
    Tags::None,                  // Tags
};
const ProcessorInfo CameraFrustum::getProcessorInfo() const { return processorInfo_; }

CameraFrustum::CameraFrustum()
    : Processor()
    , mesh_("mesh")
    , camera_("camera", "Camera")
    , color_("color", "Color", vec4(1.f), vec4(0.f), vec4(1.f), vec4(.01f),
             InvalidationLevel::InvalidOutput, PropertySemantics::Color) {

    addPort(mesh_);
    addProperty(color_);
    addProperty(camera_);
}

void CameraFrustum::process() { mesh_.setData(meshutil::cameraFrustum(camera_, color_)); }

}  // namespace inviwo


text:
<?php

namespace Abc\Bundle\JobBundle\Tests\Model;

use Abc\Bundle\JobBundle\Model\Job;
use Abc\Bundle\JobBundle\Model\Log;
use Abc\Bundle\JobBundle\Model\LogManager;
use Monolog\Formatter\FormatterInterface;
use PHPUnit\Framework\TestCase;

/**
 * @author Hannes Schulz <hannes.schulz@aboutcoders.com>
 */
class LogManagerTest extends TestCase
{
    /**
     * @var LogManager|\PHPUnit_Framework_MockObject_MockObject
     */
    private $subject;

    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        $this->subject = $this->getMockForAbstractClass(LogManager::class);
    }

    public function testCreate()
    {
        $this->subject->expects($this->once())
            ->method('getClass')
            ->will($this->returnValue(Log::class));

        $schedule = $this->subject->create();

        $this->assertInstanceOf(Log::class, $schedule);
    }

    public function testFindByJobUsesCustomFormatter()
    {
        $ticket = 'Ticket';
        $job    = new Job();
        $job->setTicket($ticket);

        $log_A = $this->buildLog('ChannelA', 'LevelA', 'MessageA');
        $log_B = $this->buildLog('ChannelB', 'LevelB', 'MessageB');

        $job = new Job();
        $job->setTicket('Ticket');

        $this->subject->expects($this->once())
            ->method('findBy')
            ->with(['jobTicket' => $job->getTicket()], ['datetime' => 'ASC'])
            ->willReturn([$log_A, $log_B]);

        $this->assertEquals([
            [
                'channel'    => 'ChannelA',
                'level'      => 'LevelA',
                'level_name' => null,
                'message'    => 'MessageA',
                'datetime'   => null,
                'context'    => [],
                'extra'      => [],
            ],
            [
                'channel'    => 'ChannelB',
                'level'      => 'LevelB',
                'level_name' => null,
                'message'    => 'MessageB',
                'datetime'   => null,
                'context'    => [],
                'extra'      => [],
            ]
        ], $this->subject->findByJob($job));
    }

    public function testDeleteByJob()
    {
        $job = new Job();
        $job->setTicket('Ticket');

        $log_A = $this->buildLog('ChannelA', 'LevelA', 'MessageA');

        $this->subject = $this->getMockForAbstractClass(LogManager::class, [], '', null, null, null, ['delete']);

        $this->subject->expects($this->once())
            ->method('findBy')
            ->with(['jobTicket' => $job->getTicket()])
            ->willReturn([$log_A]);

        $this->subject->expects($this->once())
            ->method('delete')
            ->with($log_A);

        $this->assertEquals(1, $this->subject->deleteByJob($job));
    }

    /**
     * @param $channel
     * @param $level
     * @param $message
     * @return Log
     */
    protected function buildLog($channel, $level, $message)
    {
        $log = new Log;
        $log->setChannel($channel);
        $log->setLevel($level);
        $log->setMessage($message);

        return $log;
    }

    /**
     * Call protected/private method of a class.
     *
     * @param object &$object
     * @param string $methodName
     * @param array  $parameters
     * @return mixed
     */
    protected function invokeMethod(&$object, $methodName, array $parameters = array())
    {
        $reflection = new \ReflectionClass(get_class($object));
        $method     = $reflection->getMethod($methodName);
        $method->setAccessible(true);

        return $method->invokeArgs($object, $parameters);
    }
}


text:
static inline
void*
memcpy(void* target, const void* source, size_t count)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"

    char* target8 = (char*)target;
    char* source8 = (char*)source;

#pragma clang diagnostic pop

    --target8;
    --source8;

    while (count--) {
        *++target8 = *++source8;
    }

    return target;
}


text:
class Duree
{
    public:
    Duree(int heures = 0, int minutes = 0, int secondes = 0);
    Duree& operator-=(Duree const& duree);
    Duree& operator+=(Duree const& duree);
    void afficher() const;

    private:
    int m_heures;
    int m_minutes;
    int m_secondes;

};
Duree operator+(Duree const& a, Duree const& b);
Duree operator-(Duree const& a, Duree const& b);
#endif // DUREE_H_INCLUDED


text:
use std::io;
use std::num::Wrapping;

use super::STATIC_TABLE;
use super::HeaderTable;

/// Encode an integer to the representation defined by HPACK, writing it into the provider
/// `io::Write` instance. Also allows the caller to specify the leading bits of the first
/// octet. Any bits that are already set within the last `prefix_size` bits will be cleared
/// and overwritten by the integer's representation (in other words, only the first
/// `8 - prefix_size` bits from the `leading_bits` octet are reflected in the first octet
/// emitted by the function.
///
/// # Example
///
/// ```rust
/// use hpack::encoder::encode_integer_into;
///
/// {
///     // No bits specified in the 3 most significant bits of the first octet
///     let mut vec = Vec::new();
///     encode_integer_into(10, 5, 0, &mut vec);
///     assert_eq!(vec, vec![10]);
/// }
/// {
///     // The most significant bit should be set; i.e. the 3 most significant
///     // bits are 100.
///     let mut vec = Vec::new();
///     encode_integer_into(10, 5, 0x80, &mut vec);
///     assert_eq!(vec, vec![0x8A]);
/// }
/// {
///     // The most leading bits number has a bit set within the last prefix-size
///     // bits -- they are ignored by the function
///     // bits are 100.
///     let mut vec = Vec::new();
///     encode_integer_into(10, 5, 0x10, &mut vec);
///     assert_eq!(vec, vec![0x0A]);
/// }
/// {
///     let mut vec = Vec::new();
///     encode_integer_into(1337, 5, 0, &mut vec);
///     assert_eq!(vec, vec![31, 154, 10]);
/// }
/// ```
pub fn encode_integer_into<W: io::Write>(
        mut value: usize,
        prefix_size: u8,
        leading_bits: u8,
        writer: &mut W)
        -> io::Result<()> {
    let Wrapping(mask) = if prefix_size >= 8 {
        Wrapping(0xFF)
    } else {
        Wrapping(1u8 << prefix_size) - Wrapping(1)
    };
    // Clear any bits within the last `prefix_size` bits of the provided `leading_bits`.
    // Failing to do so might lead to an incorrect encoding of the integer.
    let leading_bits = leading_bits & (!mask);
    let mask = mask as usize;
    if value < mask {
        try!(writer.write_all(&[leading_bits | value as u8]));
        return Ok(());
    }

    try!(writer.write_all(&[leading_bits | mask as u8]));
    value -= mask;
    while value >= 128 {
        try!(writer.write_all(&[((value % 128) + 128) as u8]));
        value = value / 128;
    }
    try!(writer.write_all(&[value as u8]));
    Ok(())
}

/// Encode an integer to the representation defined by HPACK.
///
/// Returns a newly allocated `Vec` containing the encoded bytes.
/// Only `prefix_size` lowest-order bits of the first byte in the
/// array are guaranteed to be used.
pub fn encode_integer(value: usize, prefix_size: u8) -> Vec<u8> {
    let mut res = Vec::new();
    encode_integer_into(value, prefix_size, 0, &mut res).unwrap();
    res
}

/// Represents an HPACK encoder. Allows clients to encode arbitrary header sets
/// and tracks the encoding context. That is, encoding subsequent header sets
/// will use the context built by previous encode calls.
///
/// This is the main API for performing HPACK encoding of headers.
///
/// # Examples
///
/// Encoding a header two times in a row produces two different
/// representations, due to the utilization of HPACK compression.
///
/// ```rust
/// use hpack::Encoder;
///
/// let mut encoder = Encoder::new();
///
/// let headers = vec![
///     (b"custom-key".to_vec(), b"custom-value".to_vec()),
/// ];
/// // First encoding...
/// let result = encoder.encode(headers.iter().map(|h| (&h.0[..], &h.1[..])));
/// // The result is a literal encoding of the header name and value, with an
/// // initial byte representing the type of the encoding
/// // (incremental indexing).
/// assert_eq!(
///     vec![0x40,
///          10, b'c', b'u', b's', b't', b'o', b'm', b'-', b'k', b'e', b'y',
///          12, b'c', b'u', b's', b't', b'o', b'm', b'-', b'v', b'a', b'l',
///          b'u', b'e'],
///     result);
///
/// // Encode the same headers again!
/// let result = encoder.encode(headers.iter().map(|h| (&h.0[..], &h.1[..])));
/// // The result is simply the index of the header in the header table (62),
/// // with a flag representing that the decoder should use the index.
/// assert_eq!(vec![0x80 | 62], result);
/// ```
pub struct Encoder<'a> {
    /// The header table represents the encoder's context
    header_table: HeaderTable<'a>,
}

impl<'a> Encoder<'a> {
    /// Creates a new `Encoder` with a default static table, as defined by the
    /// HPACK spec (Appendix A).
    pub fn new() -> Encoder<'a> {
        Encoder {
            header_table: HeaderTable::with_static_table(STATIC_TABLE),
        }
    }

    /// Encodes the given headers using the HPACK rules and returns a newly
    /// allocated `Vec` containing the bytes representing the encoded header
    /// set.
    ///
    /// The encoder so far supports only a single, extremely simple encoding
    /// strategy, whereby each header is represented as an indexed header if
    /// already found in the header table and a literal otherwise. When a
    /// header isn't found in the table, it is added if the header name wasn't
    /// found either (i.e. there are never two header names with different
    /// values in the produced header table). Strings are always encoded as
    /// literals (Huffman encoding is not used).
    pub fn encode<'b, I>(&mut self, headers: I) -> Vec<u8>
            where I: IntoIterator<Item=(&'b [u8], &'b [u8])> {
        let mut encoded: Vec<u8> = Vec::new();
        self.encode_into(headers, &mut encoded).unwrap();
        encoded
    }

    /// Encodes the given headers into the given `io::Write` instance. If the io::Write raises an
    /// Error at any point, this error is propagated out. Any changes to the internal state of the
    /// encoder will not be rolled back, though, so care should be taken to ensure that the paired
    /// decoder also ends up seeing the same state updates or that their pairing is cancelled.
    pub fn encode_into<'b, I, W>(&mut self, headers: I, writer: &mut W) -> io::Result<()>
            where I: IntoIterator<Item=(&'b [u8], &'b [u8])>,
                  W: io::Write {
        for header in headers {
            try!(self.encode_header_into(header, writer));
        }
        Ok(())
    }

    /// Encodes a single given header into the given `io::Write` instance.
    ///
    /// Any errors are propagated, similarly to the `encode_into` method, and it is the callers
    /// responsiblity to make sure that the paired encoder sees them too.
    pub fn encode_header_into<W: io::Write>(
            &mut self,
            header: (&[u8], &[u8]),
            writer: &mut W)
            -> io::Result<()> {
        match self.header_table.find_header(header) {
            None => {
                // The name of the header is in no tables: need to encode
                // it with both a literal name and value.
                try!(self.encode_literal(&header, true, writer));
                self.header_table.add_header(header.0.to_vec(), header.1.to_vec());
            },
            Some((index, false)) => {
                // The name of the header is at the given index, but the
                // value does not match the current one: need to encode
                // only the value as a literal.
                try!(self.encode_indexed_name((index, header.1), false, writer));
            },
            Some((index, true)) => {
                // The full header was found in one of the tables, so we
                // just encode the index.
                try!(self.encode_indexed(index, writer));
            }
        };
        Ok(())
    }

    /// Encodes a header as a literal (i.e. both the name and the value are
    /// encoded as a string literal) and places the result in the given buffer
    /// `buf`.
    ///
    /// # Parameters
    ///
    /// - `header` - the header to be encoded
    /// - `should_index` - indicates whether the given header should be indexed, i.e.
    ///                    inserted into the dynamic table
    /// - `buf` - The buffer into which the result is placed
    ///
    fn encode_literal<W: io::Write>(
            &mut self,
            header: &(&[u8], &[u8]),
            should_index: bool,
            buf: &mut W)
            -> io::Result<()> {
        let mask = if should_index {
            0x40
        } else {
            0x0
        };

        try!(buf.write_all(&[mask]));
        try!(self.encode_string_literal(&header.0, buf));
        try!(self.encode_string_literal(&header.1, buf));
        Ok(())
    }

    /// Encodes a string literal and places the result in the given buffer
    /// `buf`.
    ///
    /// The function does not consider Huffman encoding for now, but always
    /// produces a string literal representations, according to the HPACK spec
    /// section 5.2.
    fn encode_string_literal<W: io::Write>(
            &mut self,
            octet_str: &[u8],
            buf: &mut W)
            -> io::Result<()> {
        try!(encode_integer_into(octet_str.len(), 7, 0, buf));
        try!(buf.write_all(octet_str));
        Ok(())
    }

    /// Encodes a header whose name is indexed and places the result in the
    /// given buffer `buf`.
    fn encode_indexed_name<W: io::Write>(
            &mut self,
            header: (usize, &[u8]),
            should_index: bool,
            buf: &mut W)
            -> io::Result<()> {
        let (mask, prefix) = if should_index {
            (0x40, 6)
        } else {
            (0x0, 4)
        };

        try!(encode_integer_into(header.0, prefix, mask, buf));
        // So far, we rely on just one strategy for encoding string literals.
        try!(self.encode_string_literal(&header.1, buf));
        Ok(())
    }

    /// Encodes an indexed header (a header that is fully in the header table)
    /// and places the result in the given buffer `buf`.
    ///
    /// The encoding is according to the rules of the HPACK spec, section 6.1.
    fn encode_indexed<W: io::Write>(&self, index: usize, buf: &mut W) -> io::Result<()> {
        // We need to set the most significant bit, since the bit-pattern is
        // `1xxxxxxx` for indexed headers.
        try!(encode_integer_into(index, 7, 0x80, buf));
        Ok(())
    }
}


text:
package org.apache.asterix.lang.common.base;

public interface IParserFactory {

    public IParser createParser();

}


text:
//  ----------------------------------------------------
//  AIMP DotNet SDK
//
//  Copyright (c) 2014 - 2022 Evgeniy Bogdan
//  https://github.com/martin211/aimp_dotnet
//
//  Mail: mail4evgeniy@gmail.com
//  ----------------------------------------------------

using AIMP.SDK;
using AIMP.SDK.Player;
using AIMP.SDK.Playlist.Objects;
using Aimp.TestRunner.TestFramework;
using NUnit.Framework;

namespace Aimp.TestRunner.UnitTests.Player;

[TestFixture(Category = "ServicePlayer")]
public class AimpServicePlayerTests : AimpIntegrationTest
{
    public override void RunBeforeAnyTests()
    {
        base.RunBeforeAnyTests();
        ExecuteInMainThread(() =>
        {
            var pl = Player.ServicePlaylistManager.CreatePlaylistFromFile(PlaylistPath, true);
            _playlist = pl.Result;
            return pl;
        });
    }

    public override void AfterAllTests()
    {
        base.AfterAllTests();

        if (_playlist != null) _playlist.Close(PlaylistCloseFlag.ForceRemove);
    }

    private IAimpPlaylist _playlist;

    [Test]
    [Ignore("Not working in integration")]
    public void Volume_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.Volume = 20;
            AimpAssert.AreEqual(20, Player.ServicePlayer.Volume);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void IsMute_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.IsMute = true;
            AimpAssert.IsTrue(Player.ServicePlayer.IsMute);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void Position_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.Position = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.Position);
        });
    }

    [Test]
    public void AutoJumpToNextTrack_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.AutoJumpToNextTrack = true;
            AimpAssert.IsTrue(Player.ServicePlayer.AutoJumpToNextTrack);
        });
    }

    [Test]
    public void AutoSwitching_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.AutoSwitching = true;
            AimpAssert.IsTrue(Player.ServicePlayer.AutoSwitching);
        });
    }

    [Test]
    public void AutoSwitchingPauseBetweenTracks_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.AutoSwitchingPauseBetweenTracks = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.AutoSwitchingPauseBetweenTracks);
        });
    }

    [Test]
    public void AutoSwitchingCrossFade_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.AutoSwitchingCrossFade = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.AutoSwitchingCrossFade);
        });
    }

    [Test]
    public void AutoSwitchingFadeIn_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.AutoSwitchingFadeIn = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.AutoSwitchingFadeIn);
        });
    }

    [Test]
    public void AutoSwitchingFadeOut_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.AutoSwitchingFadeOut = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.AutoSwitchingFadeOut);
        });
    }

    [Test]
    public void ManualSwitching_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.ManualSwitching = true;
            AimpAssert.IsTrue(Player.ServicePlayer.ManualSwitching);
        });
    }

    [Test]
    public void ManualSwitchingCrossFade_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.ManualSwitchingCrossFade = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.ManualSwitchingCrossFade);
        });
    }

    [Test]
    public void ManualSwitchingFadeIn_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.ManualSwitchingFadeIn = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.ManualSwitchingFadeIn);
        });
    }

    [Test]
    public void ManualSwitchingFadeOut_OK()
    {
        ExecuteInMainThread(() =>
        {
            Player.ServicePlayer.ManualSwitchingFadeOut = 10;
            AimpAssert.AreEqual(10, Player.ServicePlayer.ManualSwitchingFadeOut);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void GoToNext_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var result = Player.ServicePlayer.GoToNext();
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void GoToPrev_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var result = Player.ServicePlayer.GoToPrev();
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void Pause_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var result = Player.ServicePlayer.Pause();
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void Resume_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var result = Player.ServicePlayer.Resume();
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void Stop_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var result = Player.ServicePlayer.Stop();
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void StopAfterTrack_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var result = Player.ServicePlayer.StopAfterTrack();
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void Play_QueueItem_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");
        });
    }

    [Test]
    public void Play_PlaylistItem_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var item = _playlist.GetItem(1);

            var result = Player.ServicePlayer.Play(item.Result);
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    public void Play_Playlist_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var result = Player.ServicePlayer.Play(_playlist);
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }

    [Test]
    [Ignore("Not working in integration")]
    public void Play_FileUri_OK()
    {
        ExecuteInMainThread(() =>
        {
            var result = Player.ServicePlayer.Play(PlaylistPath, PlayFlags.FromPlaylist);
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
            Player.ServicePlaylistManager.GetActivePlaylist().Result.Close(PlaylistCloseFlag.ForceRemove);
        });
    }

    [Test]
    [Ignore("TBD")]
    public void Play_QueueItem_Offset_OK()
    {
    }

    [Test]
    public void Play_PlaylistItem_Offset_OK()
    {
        ExecuteInMainThread(() =>
        {
            if (_playlist == null) Assert.Fail("Playlist not found");

            var item = _playlist.GetItem(1);
            var result = Player.ServicePlayer.Play(item.Result, 100, PlayFlags.FromPlaylist);
            AimpAssert.AreEqual(ActionResultType.OK, result.ResultType);
        });
    }
}


text:
package strd.util

import java.nio.ByteBuffer

/**
 * $Id$
 * $URL$
 * User: bulay
 * Date: 7/29/13
 * Time: 7:02 PM
 */
object StrdSerializer {

  val schema = new SerialSchema
  val serializer = new DynamicSerializer(schema)

  def write[T](o: T) = {
    val clazz = o.getClass

    val dbb = ByteBuffer.allocate(1024)
    val s = schema.serializer(clazz)

    s.write(dbb, o)
    dbb.array()
  }

  def read[T](bytes: Array[Byte])(implicit m: Manifest[T]) = {
    val dbb = ByteBuffer.wrap(bytes)
    val s = schema.serializer(m.runtimeClass)
    s.read(dbb).asInstanceOf[T]
  }

}

object Test extends App {

  StrdSerializer.schema.analyzeObject(Tst2(1, 0L until 5L))

  val w = StrdSerializer.write(Tst(10, "dddd", Some(76)))
  println(StrdSerializer.read[Tst](w))

  val ser = new DynamicSerializer(StrdSerializer.schema)

  val dbb = ByteBuffer.allocate(1024 * 1024 * 10)
  val tst2 = Tst3(7, 0 until 5 map(i => Tst(i, "ddd" + i, Some(i))) toArray)

  println(tst2)
  ser.write(dbb, tst2)
  dbb.position(0)
  val readed = ser.read(ByteBuffer.wrap(dbb.array())).asInstanceOf[Tst3]
  readed.list.foreach(x => print(s"$x "))
  println()
  println(tst2)
  println(readed)
  //assert(tst2.equals(readed))
  println(readed)

}

/*object Test2 extends App {

  var q : Array[Int]= Array(1, 3, 4, 5, 6, -1)
  Tst3(5, q)
  val x = Tst3(1, q)
  val field = x.getClass.getDeclaredField("list")
  val field1 = x.getClass.getDeclaredField("id")
  val offset = JUnsafe.unsafe.objectFieldOffset(field)
  val offset1 = JUnsafe.unsafe.objectFieldOffset(field1)

  val typ = field.getType
  println(typ.getName + " " + field.getType.isArray)
  val base = JUnsafe.unsafe.arrayBaseOffset(typ)
  val index = JUnsafe.unsafe.arrayIndexScale(typ)
  println(JUnsafe.unsafe.arrayBaseOffset(typ))
  println(JUnsafe.unsafe.arrayIndexScale(typ))
  println("-------------")
  println(offset)
  //println(JUnsafe.unsafe.get)
  println(JUnsafe.unsafe.getLong(x, offset))
  println(JUnsafe.unsafe.getInt(x, offset))
  println(JUnsafe.unsafe.getInt(x, offset + 4))
  println(JUnsafe.unsafe.getInt(x, offset + 8))
  println(JUnsafe.unsafe.getInt(x, offset + 12))

  println("---------")
  println(JUnsafe.unsafe.getInt(x, offset + base))
  println(JUnsafe.unsafe.getInt(x, offset + base + 4))
  println(JUnsafe.unsafe.getLong(x, offset + base))
  println("_____________")
  println(JUnsafe.unsafe.getInt(x, offset + base + 8 + index * 4))
  println(JUnsafe.unsafe.getInt(x, offset1))

  println("add size " + JUnsafe.unsafe.addressSize())

  val arr = JUnsafe.unsafe.getObject(x, offset)
  println(arr)
  println(JUnsafe.unsafe.getInt(arr, base + index * 4L))
  println(JUnsafe.unsafe.getInt(arr, base - 4L))
  //println(JUnsafe.unsafe.getAddress(arrAdr))

  val bytes = new Array[Byte](index * 6)
  JUnsafe.unsafe.copyMemory(arr, base, bytes, JUnsafe.unsafe.arrayBaseOffset(bytes.getClass), index * 6)

  val o2 = java.lang.reflect.Array.newInstance(typ.getComponentType, 6)//new Array[Int](6)
  JUnsafe.unsafe.copyMemory(bytes, JUnsafe.unsafe.arrayBaseOffset(bytes.getClass), o2, base, bytes.length)

  println(o2.asInstanceOf[Array[_]].mkString)

  def normalize(value: Int): Long = {
    if (value >= 0) value
    else (~0L >>> 32) & value
  }

}*/

case class Tst(id: Int, name: String, address: Option[Long])

case class Tst2(id: Int, list: Seq[Long])

case class Tst3(id: Int, list: Array[Tst])


text:
from __future__ import division, print_function

try:
    from astropy.io import fits as pyfits
except ImportError:
    try:
        import pyfits
    except ImportError:
        raise ImportError('You need astropy or pyfits modules')

import os
import numpy as np

def TPF2Im(filename,newdir=True):
    """
    Convert Kepler/K2 TPF to a bunch of images
    """
    with pyfits.open(filename) as f:
        objname = f[0].header['OBJECT']
        #replace spaces with underscore in objname
        objname = objname.replace (" ", "_")

        fluxarr = f[1].data['FLUX']
        cadnum = f[1].data['CADENCENO']
        time = f[1].data['TIME']
        quality = f[1].data['QUALITY']

        if newdir:
            outdir = objname
            try:
                os.stat(outdir)
            except:
                os.mkdir(outdir)
        else:
            outdir = '.'

        outname = np.array([],dtype=str)
        for num,image in enumerate(fluxarr):
            hdu = pyfits.PrimaryHDU(image)
            hdulist = pyfits.HDUList([hdu])

            hdulist.writeto('{0}/{1}-{2:05d}.fits'.format(outdir,objname,cadnum[num]))

            outname =  np.append(outname,'{0}-{1:05d}.fits'.format(objname,cadnum[num]))
        fmt = ['%s','%.9f','%i',]
        outarr = np.array([outname,time,quality]).T
        np.savetxt('{0}/{1}_filelist.txt'.format(outdir,objname), outarr,fmt='%s')

if __name__ == '__main__':
    ## test on my local machine if it works
    path = '../data'
    fn = path + '/kplr060017806-2014044044430_lpd-targ.fits'
    TPF2Im(fn)


text:
package com.klogicapps.tv.content;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.content.Context;

import com.klogicapps.tv.misc.AppUtils;

public class ChannelSetManager {
  private Context context;
  private List<String> defaultChannelIds;
  private Map<ChannelCode, String> mChannelIDMap;

  public ChannelSetManager(Context context, int channels_array_resource) {
    super();

    this.context = context.getApplicationContext();

    defaultChannelIds = defaultChannelIds(context, channels_array_resource);
  }

  public static void saveChannelSet(Context context, ChannelSet set) {
    AppUtils.instance(context).saveChannelIds(set.getChannelIds());
  }

  public static ChannelSet loadChannelSet(Context context) {
    List<String> result = AppUtils.instance(context).channelIds();

    if (result != null && result.size() > 0)
      return new ChannelSet(null, result);

    return null;
  }

  private List<String> defaultChannelIds(Context context, int channels_array_resource) {
    List<String> result = new ArrayList<String>();

    // get the hard coded defaults if nothing found in prefs above
    String[] defaultChannels = context.getResources().getStringArray(channels_array_resource);
    List<ChannelCode> channelCodes = new ArrayList<ChannelCode>();
    for (String c : defaultChannels) {
      channelCodes.add(ChannelCode.valueOf(c));
    }

    for (ChannelCode code : channelCodes)
      result.add(channelIDForCode(code));

    return result;
  }

  // -------------------------------------------------------------
  // static prefs stuff

  public boolean needsChannelSwitcher() {
    // using the default ids since a user could edit his list to one item
    // then relaunch and be unable to switch
    return defaultChannelIds.size() > 1;
  }

  public ChannelSet channelSet() {
    ChannelSet result = loadChannelSet(context);

    if (result == null)
      result = new ChannelSet(null, defaultChannelIds);

    return result;
  }

  public ChannelSet channelSet(List<String> channels) {
    return new ChannelSet(null, channels);
  }

  public void resetToDefaults() {
    AppUtils.instance(context).saveChannelIds(null);
  }

  // -------------------------------------------------------------

  private String channelIDForCode(ChannelCode code) {
    if (mChannelIDMap == null) {
      mChannelIDMap = new HashMap<ChannelCode, String>();

      mChannelIDMap.put(ChannelCode.SPOTLIGHT,   "UCBR8-60-B28hp2BmDPdntcQ");
      mChannelIDMap.put(ChannelCode.MUSIC,   "UC-9-kyTW8ZkZNDHQJ6FgpwQ");
      mChannelIDMap.put(ChannelCode.POPULAR, "UCF0pVplsI8R5kcAqgtoRqoA");
      mChannelIDMap.put(ChannelCode.CONNECTIONS, "UC07XXQh04ukEX68loZFgnVw");
      mChannelIDMap.put(ChannelCode.NEURO_SOUP, "UCf--Le-Ssa_R5ERoM7PbdcA");
      mChannelIDMap.put(ChannelCode.VICE, "UCn8zNIfYAQNdrFRrr8oibKw");
      mChannelIDMap.put(ChannelCode.ROGAN, "UCzQUP1qoWDoEbmsQxvdjxgQ");
      mChannelIDMap.put(ChannelCode.LUKITSCH, "UCULJH9kW-UdTBCDu27P0BoA");
      mChannelIDMap.put(ChannelCode.KHAN_ACADEMY, "UC4a-Gbdw7vOaccHmFo40b9g");
      mChannelIDMap.put(ChannelCode.TOP_GEAR, "UCjOl2AUblVmg2rA_cRgZkFg");
      mChannelIDMap.put(ChannelCode.ANDROID_DEVELOPERS, "UCVHFbqXqoYvEWM1Ddxl0QDg");
      mChannelIDMap.put(ChannelCode.NERDIST, "UCTAgbu2l6_rBKdbTvEodEDw");
      mChannelIDMap.put(ChannelCode.CODE_ORG, "UCJyEBMU1xVP2be1-AoGS1BA");
      mChannelIDMap.put(ChannelCode.MAX_KEISER, "UCBIwq18tUFrujiPd3HLPaGw");
      mChannelIDMap.put(ChannelCode.RT, "UCpwvZwUam-URkxB7g4USKpg");
      mChannelIDMap.put(ChannelCode.PEWDIEPIE, "UC-lHJZR3Gqxm24_Vd_AJ5Yw");
      mChannelIDMap.put(ChannelCode.BIG_THINK, "UCvQECJukTDE2i6aCoMnS-Vg");
      mChannelIDMap.put(ChannelCode.REASON_TV, "UC0uVZd8N7FfIZnPu0y7o95A");
      mChannelIDMap.put(ChannelCode.JET_DAISUKE, "UC6wKgAlOeFNqmXV167KERhQ");
      mChannelIDMap.put(ChannelCode.THE_VERGE, "UCddiUEpeqJcYeBxX1IVBKvQ");
      mChannelIDMap.put(ChannelCode.XDA, "UCk1SpWNzOs4MYmr0uICEntg");
      mChannelIDMap.put(ChannelCode.YOUNG_TURKS, "UC1yBKRuGpC1tSM73A0ZjYjQ");
      mChannelIDMap.put(ChannelCode.GATES_FOUNDATION, "UCRi8JQTnKQilJW15uzo7bRQ");
      mChannelIDMap.put(ChannelCode.JUSTIN_BIEBER, "UCHkj014U2CQ2Nv0UZeYpE_A");
      mChannelIDMap.put(ChannelCode.COLLEGE_HUMOR, "UCPDXXXJj9nax0fr0Wfc048g");
      mChannelIDMap.put(ChannelCode.YOUTUBE, "UCBR8-60-B28hp2BmDPdntcQ");
      mChannelIDMap.put(ChannelCode.TECH_CRUNCH, "UCCjyq_K1Xwfg8Lndy7lKMpA");
      mChannelIDMap.put(ChannelCode.TWIT, "UCwY9B5_8QDGP8niZhBtTh8w");
      mChannelIDMap.put(ChannelCode.ENGADGET, "UC-6OW5aJYBFM33zXQlBKPNA");
      mChannelIDMap.put(ChannelCode.VSAUCE, "UC6nSFpj9HTCZ5t-N3Rm3-HA");
      mChannelIDMap.put(ChannelCode.SVB, "UCJLo-ihNo6sVMPvRzGVPRoQ");
    }

    return mChannelIDMap.get(code);
  }

  private static enum ChannelCode {NEURO_SOUP, KHAN_ACADEMY, VSAUCE, SVB, ENGADGET, TWIT, TECH_CRUNCH, YOUNG_TURKS, XDA, CONNECTIONS, CODE_ORG, JUSTIN_BIEBER, THE_VERGE, REASON_TV, BIG_THINK, ANDROID_DEVELOPERS, PEWDIEPIE, YOUTUBE, VICE, TOP_GEAR, COLLEGE_HUMOR, ROGAN, LUKITSCH, NERDIST, RT, JET_DAISUKE, MAX_KEISER, GATES_FOUNDATION, POPULAR, MUSIC, SPOTLIGHT}

}