text:
The sample source code below will teach you how to make searchable PDF with PDF extractor SDK in C#. ByteScout Data Extraction Suite is the bundle that includes three SDK tools for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK. It can make searchable PDF with PDF extractor SDK in C#.

Want to save time? You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Data Extraction Suite for make searchable PDF with PDF extractor SDK below and use it in your application. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Want to see how it works with your data then code testing will allow the function to be tested and work properly.

All these programming tutorials along with source code samples and ByteScout free trial version are available for download from our website.

## REQUEST FREE TECH SUPPORT

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

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Data%20Extraction%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 -->

##### ****MakeSearchablePDF.NETCore.csproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
    <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
    <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
    <GenerateAssemblyTrademarkAttribute>false</GenerateAssemblyTrademarkAttribute>
    <GenerateAssemblyCultureAttribute>false</GenerateAssemblyCultureAttribute>
    <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <None Include="..\..\sample_ocr.pdf" Link="sample_ocr.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>c:\Program Files\Bytescout PDF Extractor SDK\netcoreapp2.0\Bytescout.PDFExtractor.dll</HintPath>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>c:\Program Files\Bytescout PDF Extractor SDK\netcoreapp2.0\Bytescout.PDFExtractor.OCRExtension.dll</HintPath>
    </Reference>
  </ItemGroup>
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDF.VS2005.csproj:**

```
<?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>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MakeSearchablePDF</RootNamespace>
    <AssemblyName>MakeSearchablePDF</AssemblyName>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr.pdf">
      <Link>sample_ocr.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDF.VS2008.csproj:**

```
<?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>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MakeSearchablePDF</RootNamespace>
    <AssemblyName>MakeSearchablePDF</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr.pdf">
      <Link>sample_ocr.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDF.VS2010.csproj:**

```
<?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>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MakeSearchablePDF</RootNamespace>
    <AssemblyName>MakeSearchablePDF</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr.pdf">
      <Link>sample_ocr.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDF.VS2012.csproj:**

```
<?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>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MakeSearchablePDF</RootNamespace>
    <AssemblyName>MakeSearchablePDF</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr.pdf">
      <Link>sample_ocr.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDF.VS2013.csproj:**

```
<?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>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MakeSearchablePDF</RootNamespace>
    <AssemblyName>MakeSearchablePDF</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr.pdf">
      <Link>sample_ocr.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****MakeSearchablePDF.VS2015.csproj:**

```
<?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>2.0</SchemaVersion>
    <ProjectGuid>{B664BC67-BC23-45C4-97A0-BE617CCAA7DA}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MakeSearchablePDF</RootNamespace>
    <AssemblyName>MakeSearchablePDF</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDFExtractor, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Bytescout.PDFExtractor.OCRExtension, Version=6.0.0.2035, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\..\sample_ocr.pdf">
      <Link>sample_ocr.pdf</Link>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****Program.cs:**

```
using System.Diagnostics;
using Bytescout.PDFExtractor;

// To make OCR work you should references "Bytescout.PDFExtractor.dll" and "Bytescout.PDFExtractor.OCRExtension.dll" from your project.

namespace MakeSearchablePDF
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create Bytescout.PDFExtractor.TextExtractor instance
            SearchablePDFMaker searchablePDFMaker = new SearchablePDFMaker();
            searchablePDFMaker.RegistrationName = "demo";
            searchablePDFMaker.RegistrationKey = "demo";

            // Load sample PDF document
            searchablePDFMaker.LoadDocumentFromFile("sample_ocr.pdf");

            // Set the location of language data files
            searchablePDFMaker.OCRLanguageDataFolder = @"c:\Program Files\Bytescout PDF Extractor SDK\ocrdata_best\";

            // Set OCR language
            searchablePDFMaker.OCRLanguage = "eng"; // "eng" for english, "deu" for German, "fra" for French, "spa" for Spanish etc - according to files in "ocrdata" folder

            // Set PDF document rendering resolution
            searchablePDFMaker.OCRResolution = 300;

            // Save extracted text to file
            searchablePDFMaker.MakePDFSearchable("output.pdf");

            // Cleanup
            searchablePDFMaker.Dispose();

            // Open output file in default associated application
            ProcessStartInfo processStartInfo = new ProcessStartInfo("output.pdf");
            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
    }
}

```

<!-- code block end -->


text:
using Newtonsoft.Json;
using System;

namespace Zenvia.Api.Models.Responses
{
    /// <summary>
    /// Classe que representa a base de vários tipos de resposta providos pelo serviço Zenvia.
    /// </summary>
    public class BaseResponse
    {
        /// <summary>
        /// Código de estado informado pelo serviço Zenvia.
        /// </summary>
        [JsonProperty("statusCode")]
        public string StatusCode { get; internal set; }

        /// <summary>
        /// Descrição do código de estado informado pelo serviço Zenvia.
        /// </summary>
        [JsonProperty("statusDescription")]
        public string StatusDescription { get; internal set; }

        /// <summary>
        /// Código de detalhe informado pelo serviço Zenvia.
        /// </summary>
        [JsonProperty("detailCode")]
        public string DetailCode { get; internal set; }

        /// <summary>
        /// Descrição do código de detalhe provido pelo serviço Zenvia.
        /// </summary>
        [JsonProperty("detailDescription")]
        public string DetailDescription { get; internal set; }

        public override string ToString()
        {
            return String.Format("response: [statusCode:{0}], [statusDescription:{1}], [detailCode:{2}], [detailDescription:{3}]", this.StatusCode, this.StatusDescription, this.DetailCode, this.DetailDescription);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
public class RSA implements Crypto {

	@Override
	public String encrypt(String plaintext) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String decrypt(String ciphertext) {
		// TODO Auto-generated method stub
		return null;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item type="id" name="label"/>
    <item type="id" name="devices_connected"/>
</resources>


text:
<?php

namespace Core;

class SqlFormEditorLib {

	private $columns;
	private $foreign_key_values;
	private $submit_url;
	private $data;

	public function __construct($data, $submit_url) {
		$this->data = $data;
		$this->submit_url = $submit_url;
	}

	public function addText($column, $formal_name = null) {
		$this->columns[] = array(
			"type" => "text",
			"name" => $column,
			"formal_name" => $formal_name,
		);
	}

	public function addDate($column, $formal_name = null) {
		$this->columns[] = array(
			"type" => "date",
			"name" => $column,
			"formal_name" => $formal_name,
		);
	}

	public function addForeignKey($column, $formal_name = null) {
		$this->columns[] = array(
			"type" => "foreign_key",
			"name" => $column,
			"formal_name" => $formal_name,
		);
	}

	public function addForeignValues($foreign_key_column, $key_values) {
		$this->foreign_key_values[$foreign_key_column] = $key_values;
	}

	public function output($validation = false) {
		View::output("!libs/views/sql_form_editor_lib/table", array(
			"submit_url" => $this->submit_url,
			"columns" => &$this->columns,
			"rows" => &$this->data,
			"foreign_key_values" => &$this->foreign_key_values,
			"validation" => $validation
		));
	}

}

?>


text:
%% Trains a NN on the input variables.

function nn_params = trainNN(initial_nn_params, hidden_layer_size, samples, outcomes, num_labels)
	fprintf('\nTraining Neural Network... \n')

	%  After you have completed the assignment, change the MaxIter to a larger
	%  value to see how more training helps.
	options = optimset('MaxIter', 250);

	%  You should also try different values of lambda
	lambda = 0.025;
	input_layer_size = size(samples, 2);

	% Create "short hand" for the cost function to be minimized
	costFunction = @(p) nnCostFunction(p, ...
                                   input_layer_size, ...
                                   hidden_layer_size, ...
                                   num_labels, samples, outcomes, lambda);

	% Now, costFunction is a function that takes in only one argument (the
	% neural network parameters)
	[nn_params, cost] = fmincg(costFunction, initial_nn_params, options);

	% Obtain Theta1 and Theta2 back from nn_params
	Theta1 = reshape(nn_params(1:hidden_layer_size * (input_layer_size + 1)), ...
                 hidden_layer_size, (input_layer_size + 1));

	Theta2 = reshape(nn_params((1 + (hidden_layer_size * (input_layer_size + 1))):end), ...
					num_labels, (hidden_layer_size + 1));

	fprintf('Program paused. Press enter to continue.\n');
	pause;
end


text:
@implementation DemoView

-(id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];

        self.demoAnimatioView = [[ALAnimationView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 60.0)
                                                       animationImages:[ALAnimationView animationImagesArrayWithName:@"Gears" numberOfFrames:9 numberOfZeroes:4] //<-- convenience method to populate images array;
                                                     animationDuration:0.8
                                                               repeats:YES];
        [self addSubview:self.demoAnimatioView];

        self.outputLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 300.0, 30.0)];
        self.outputLabel.textAlignment = NSTextAlignmentCenter;
        self.outputLabel.backgroundColor = [UIColor clearColor];
        self.outputLabel.textColor = [UIColor blackColor];
        self.outputLabel.text = @"Press play to start animation";
        [self addSubview:self.outputLabel];

        self.playPauseButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.playPauseButton.backgroundColor = [UIColor colorWithRed:0.0 green:0.5 blue:0.0 alpha:1.0];
        self.playPauseButton.titleLabel.textColor = [UIColor whiteColor];
        [self.playPauseButton setTitle:@"Play" forState:UIControlStateNormal];
        [self addSubview:self.playPauseButton];

        self.rewindButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.rewindButton.backgroundColor = [UIColor colorWithRed:0.0 green:0.5 blue:0.0 alpha:1.0];
        self.rewindButton.titleLabel.textColor = [UIColor whiteColor];
        self.rewindButton.alpha = 0.5;
        self.rewindButton.enabled = NO;
        [self.rewindButton setTitle:@"Rewind" forState:UIControlStateNormal];
        [self addSubview:self.rewindButton];
    }
    return self;
}

#pragma mark - Base Overrides;

-(void)layoutSubviews {
    CGRect demoAnimationViewFrame = self.demoAnimatioView.frame;
    demoAnimationViewFrame.origin.y = 30.0;
    demoAnimationViewFrame.origin.x = (self.bounds.size.width / 2.0) - (demoAnimationViewFrame.size.width / 2.0);
    self.demoAnimatioView.frame = demoAnimationViewFrame;

    CGRect outputLabelFrame = self.outputLabel.frame;
    outputLabelFrame.origin.x = (self.bounds.size.width / 2.0) - (outputLabelFrame.size.width / 2.0);
    outputLabelFrame.origin.y = demoAnimationViewFrame.origin.y + demoAnimationViewFrame.size.height + 5.0;
    self.outputLabel.frame = outputLabelFrame;

    CGRect playPauseButtonFrame = self.playPauseButton.frame;
    playPauseButtonFrame.size.width = 300.0;
    playPauseButtonFrame.size.height = 40.0;
    playPauseButtonFrame.origin.x = (self.bounds.size.width / 2.0) - (playPauseButtonFrame.size.width / 2.0);
    playPauseButtonFrame.origin.y = outputLabelFrame.origin.y + outputLabelFrame.size.height + 5.0;
    self.playPauseButton.frame = playPauseButtonFrame;

    CGRect rewindButtonFrame = self.rewindButton.frame;
    rewindButtonFrame.size.width = 300.0;
    rewindButtonFrame.size.height = 40.0;
    rewindButtonFrame.origin.x = (self.bounds.size.width / 2.0) - (rewindButtonFrame.size.width / 2.0);
    rewindButtonFrame.origin.y = playPauseButtonFrame.origin.y + playPauseButtonFrame.size.height + 5.0;
    self.rewindButton.frame = rewindButtonFrame;
}

@end


text:
A collection of components that make it easy to build interactive charts with D3.

## Installation

For details of installation and general usage, visit the [project webpage](http://d3fc.io/).

## Developing

[npm](https://www.npmjs.com/), the package manager for [Node.js](https://nodejs.org/), is used to manage the project's dependencies. [Grunt](http://gruntjs.com/), a JavaScript task runner, is used to test and build the project.

### Initial Setup

- Download or clone this repository locally
- Ensure [Node.js](https://nodejs.org/), which includes npm, is installed
- Ensure [Grunt](http://gruntjs.com/getting-started#installing-the-cli) is installed:

```
npm install -g grunt-cli
```

- Navigate to the root of your local copy of this project and install the dependencies:

```
npm install
```

### Grunt Tasks

The following Grunt tasks, found in `Gruntfile.js`, can be run from the command line. The most commonly used tasks to build and develop the project are:

- `grunt` - start a watcher which will automatically generate the project's JavaScript and CSS files in the _dist_ directory (at the root of the project) and run unit tests when files change.
- `grunt visualTests:serve` - start a watcher which will automatically generate the visual tests and serve them at http://localhost:9000/ when files change.
- `grunt site:serve` - start a watcher which will automatically generate the website and serve it at http://localhost:8000/ when files change.
- `grunt ci` - the full build run by the CI server

### Visual Tests

The project includes a number of unit tests, however, because these components are visual in nature, unit testing is not enough. This project contains a number of ad-hoc visual tests that are found within the `visual-tests` folder. To view this site, run `grunt visualTests:serve`.

## License

These components are licensed under the [MIT License](http://opensource.org/licenses/MIT).

## Sponsors

Project supported by [Scott Logic](http://www.scottlogic.com).

Browser testing provided by -

[![BrowserStack](https://scottlogic.github.io/d3fc/images/browser-stack.svg)](https://browserstack.com)


text:
package com.linecorp.centraldogma.client;

import static com.google.common.base.MoreObjects.toStringHelper;
import static java.util.Objects.requireNonNull;

import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.BiConsumer;
import java.util.function.Function;

import javax.annotation.Nullable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Maps;

import com.linecorp.centraldogma.common.Revision;

final class MappingWatcher<T, U> implements Watcher<U> {

    private static final Logger logger = LoggerFactory.getLogger(MappingWatcher.class);

    static <T, U> MappingWatcher<T, U> of(Watcher<T> parent, Function<? super T, ? extends U> mapper,
                                          Executor executor, boolean closeParentWhenClosing) {
        requireNonNull(parent, "parent");
        requireNonNull(mapper, "mapper");
        requireNonNull(executor, "executor");
        // TODO(minwoo): extract mapper function and combine it with the new mapper.
        return new MappingWatcher<>(parent, mapper, executor, closeParentWhenClosing);
    }

    private final Watcher<T> parent;
    private final Function<? super T, ? extends U> mapper;
    private final Executor mapperExecutor;
    private final boolean closeParentWhenClosing;
    private final CompletableFuture<Latest<U>> initialValueFuture = new CompletableFuture<>();
    private final List<Entry<BiConsumer<? super Revision, ? super U>, Executor>> updateListeners =
            new CopyOnWriteArrayList<>();

    @Nullable
    private volatile Latest<U> mappedLatest;
    private volatile boolean closed;

    MappingWatcher(Watcher<T> parent, Function<? super T, ? extends U> mapper, Executor mapperExecutor,
                   boolean closeParentWhenClosing) {
        this.parent = parent;
        this.mapper = mapper;
        this.mapperExecutor = mapperExecutor;
        this.closeParentWhenClosing = closeParentWhenClosing;
        parent.initialValueFuture().exceptionally(cause -> {
            initialValueFuture.completeExceptionally(cause);
            return null;
        });
        parent.watch((revision, value) -> {
            if (closed) {
                return;
            }
            final U mappedValue;
            try {
                mappedValue = mapper.apply(value);
            } catch (Exception e) {
                logger.warn("Unexpected exception is raised from mapper.apply(). mapper: {}", mapper, e);
                if (!initialValueFuture.isDone()) {
                    initialValueFuture.completeExceptionally(e);
                }
                close();
                return;
            }
            final Latest<U> oldLatest = mappedLatest;
            if (oldLatest != null && Objects.equals(oldLatest.value(), mappedValue)) {
                return;
            }

            // mappedValue can be nullable which is fine.
            final Latest<U> newLatest = new Latest<>(revision, mappedValue);
            mappedLatest = newLatest;
            notifyListeners(newLatest);
            if (!initialValueFuture.isDone()) {
                initialValueFuture.complete(newLatest);
            }
        }, mapperExecutor);
    }

    private void notifyListeners(Latest<U> latest) {
        if (closed) {
            return;
        }

        for (Map.Entry<BiConsumer<? super Revision, ? super U>, Executor> entry : updateListeners) {
            final BiConsumer<? super Revision, ? super U> listener = entry.getKey();
            final Executor executor = entry.getValue();
            if (mapperExecutor == executor) {
                notifyListener(latest, listener);
            } else {
                executor.execute(() -> notifyListener(latest, listener));
            }
        }
    }

    private void notifyListener(Latest<U> latest, BiConsumer<? super Revision, ? super U> listener) {
        try {
            listener.accept(latest.revision(), latest.value());
        } catch (Exception e) {
            logger.warn("Unexpected exception is raised from {}: rev={}",
                        listener, latest.revision(), e);
        }
    }

    @Override
    public ScheduledExecutorService watchScheduler() {
        return parent.watchScheduler();
    }

    @Override
    public CompletableFuture<Latest<U>> initialValueFuture() {
        return initialValueFuture;
    }

    @Override
    public Latest<U> latest() {
        final Latest<U> mappedLatest = this.mappedLatest;
        if (mappedLatest == null) {
            throw new IllegalStateException("value not available yet");
        }
        return mappedLatest;
    }

    @Override
    public void close() {
        closed = true;
        if (!initialValueFuture.isDone()) {
            initialValueFuture.cancel(false);
        }
        if (closeParentWhenClosing) {
            parent.close();
        }
    }

    @Override
    public void watch(BiConsumer<? super Revision, ? super U> listener) {
        watch(listener, parent.watchScheduler());
    }

    @Override
    public void watch(BiConsumer<? super Revision, ? super U> listener, Executor executor) {
        requireNonNull(listener, "listener");
        requireNonNull(executor, "executor");
        updateListeners.add(Maps.immutableEntry(listener, executor));

        final Latest<U> mappedLatest = this.mappedLatest;
        if (mappedLatest != null) {
            // There's a chance that listener.accept(...) is called twice for the same value
            // if this watch method is called:
            // - after "mappedLatest = newLatest;" is invoked.
            // - and before notifyListener() is called.
            // However, it's such a rare case and we usually call `watch` method after creating a Watcher,
            // which means mappedLatest is probably not set yet, so we don't use a lock to guarantee
            // the atomicity.
            executor.execute(() -> listener.accept(mappedLatest.revision(), mappedLatest.value()));
        }
    }

    @Override
    public String toString() {
        return toStringHelper(this)
                .add("parent", parent)
                .add("mapper", mapper)
                .add("closed", closed)
                .toString();
    }
}


text:
set -e

# Change to the location of the script
cd $(dirname $0)

# Create the output file ahead of time to ensure it is available.
output_filename=kurmaos-openstack.zip
touch ../../output/$output_filename

docker run --rm \
       -v `pwd`/../../output/kurmaos-disk.img.gz:/tmp/build/kurmaos-disk-image/kurmaos-disk.img.gz \
       -v `pwd`/../..:/tmp/build/kurmaos-source \
       -v `pwd`/../../output/$output_filename:/tmp/build/$output_filename \
       -w /tmp/build \
       apcera/kurmaos-stage4 \
       bash -c "./kurmaos-source/packaging/disk-openstack/build.sh && cp kurmaos.zip $output_filename"

echo "Compiled output available in ../../output/$output_filename"


text:
Balance your colors!!

color_balance implements algorithms for reading and applying the color information between overlapping georeferenced images with support for masking out pixels.

## Installation

    pip install color_balance

## Development

Tests may be run with [pytest](http://pytest.org/latest/).

    py.test tests

To install test dependencies:

    pip install -e .[test]

## Development Environment

The development environment is provided as a [Vagrant](https://www.vagrantup.com/) VM. This VM installs all dependencies as specified in 'init.sh'.

To start the Vagrant VM, navigate to the root directory and type:
```
    vagrant up
```
Then ssh into the vagrant environment by typing:
```
    vagrant ssh
```
Finally, navigate to the root directory, which is shared between the host machine and VM:
```
    cd /vagrant
```

Nosetests can be used to run the unit tests:
```
    nosetests ./tests
```

## Dependencies

python 2.7
python-numpy (>= 1.6)
python-gdal (< 2.0)


text:
<?php

namespace PasswordStrength\Enums;

use Eloquent\Enumeration\AbstractEnumeration;
/**
 * Class Rules
 * @package PasswordStrength\Enums
 *
 *          The available preset constants for the
 *          PasswordStrength package
 */
final class Preset extends AbstractEnumeration
{
  const SIMPLE = 'simple';
  const NORMAL = 'normal';
  const FAIR   = 'fair';
  const MEDIUM = 'medium';
  const STRONG = 'strong';
}


text:
package be.cegeka.dws.domain.pet;

public enum Race {
	CHICKEN, CAT, DOG
}


text:
"use strict";
import {ICertOptions, isICertOptions} from "../interfaces/ICertOptions";
import {isPosiviteInteger} from "../utilities/utilities";

/**
 * Created by zacharymartin on August 02, 2016.
 */

const DEFAULT_DAYS = 365;
const DEFAULT_HASH: "sha1" | "sha256" | "md5" = "sha256";
const MS_PER_DAY = 1000 * 60 * 60 * 24;

export class CertOptions implements ICertOptions {
  private readonly _serial: number;
  private readonly _hash: "sha1" | "sha256" | "md5";
  private readonly _startDate: Date;
  private readonly _endDate: Date;

  constructor(days?: number | null,
              serial?: number | null,
              hash?: "sha1" | "sha256" | "md5" | null,
              startDate?: Date | null);
  constructor(object: ICertOptions);

  constructor(arg1?: number | ICertOptions | null,
              serial?:number | null,
              hash?: "sha1" | "sha256" | "md5" | null,
              startDate?: Date | null) {
    if (isPosiviteInteger(arg1) || typeof arg1 === "undefined" || arg1 === null) {
      if (startDate instanceof Date) {
        this._startDate = startDate;
      } else if (startDate === null || typeof startDate === "undefined") {
        this._startDate = new Date();
      } else {
        throw new Error(`The CertOptions constructor argument "startDate" must be${""
        } a Date object, null, or undefined, given ${startDate}`);
      }

      let days: number;

      if (isPosiviteInteger(arg1)){
        days = <number>arg1;
      } else if (arg1 === null || typeof arg1 === "undefined") {
        days = DEFAULT_DAYS
      } else {
        throw new Error(`The CertOptions constructor argument "days" must be${""
        } a positive integer, null, or undefined, given ${arg1}`);
      }

      this._endDate = new Date(this._startDate.getTime() + (MS_PER_DAY * days));

      if (isPosiviteInteger(serial)) {
        this._serial = <number>serial;
      } else if (serial === null || typeof serial === "undefined") {
        this._serial = 1;
      } else {
        throw new Error(`The CertOptions constructor argument "serial" must be${""
        } a positive integer, null, or undefined , given ${serial}`);
      }

      if (hash === "sha1" || hash === "sha256" || hash === "md5") {
        this._hash = <"sha1" | "sha256" | "md5">hash;
      } else if (hash === null || typeof hash === "undefined") {
        this._hash = DEFAULT_HASH;
      } else {
        throw new Error(`The CertOptions constructor argument "hash" must be${""
        } equal to "sha1", "sha256", "md5", null, or undefined, given ${hash}`);
      }
    } else if (isICertOptions(arg1)) {
      this._startDate = arg1.startDate instanceof Date ?
        arg1.startDate
        :
        new Date(arg1.startDate);
      this._endDate = arg1.endDate instanceof Date ?
        arg1.endDate
        :
        new Date(arg1.endDate);
      this._serial = arg1.serial;
      this._hash = arg1.hash;
    } else {
      throw new Error(`The first argument to the CertOptions constructor should${""
      } be a positive integer for the number of days of certificate validity or${""
      } be an object conforming to the ICertOptions interface, given: ${arg1}`);
    }
  }

  get serial(): number {
    return this._serial;
  }

  get hash(): "sha1" | "sha256" | "md5" {
    return this._hash;
  }

  get startDate(): Date {
    return new Date(this._startDate.getTime());
  }

  get endDate(): Date {
    return new Date(this._endDate.getTime());
  }

  get jsonObject(): ICertOptions {
    return {
      serial: this._serial,
      hash: this._hash,
      startDate: this._startDate.getTime(),
      endDate: this._endDate.getTime()
    }
  }
}


text:
using System;
using System.Linq;
using System.Web.Http.Routing;
using System.Web.Http.SelfHost;
using AttributeRouting.Web.Http.SelfHost;
using AttributeRouting.Web.Http.SelfHost.Logging;

namespace AttributeRouting.Tests.SelfHost
{
    class Program
    {
        static void Main(string[] args)
        {
            var config = new HttpSelfHostConfiguration("http://localhost:8081");

            // Attribute Routing
            config.Routes.MapHttpAttributeRoutes();

            using (var server = new HttpSelfHostServer(config))
            {
                // Be sure to run as an admin!
                server.OpenAsync().Wait();

                Console.WriteLine("Routes:");

                config.Routes.Cast<HttpRoute>().ToArray().LogTo(Console.Out);

                Console.WriteLine("Routes:");
                Console.WriteLine("Press Enter to quit.");
                Console.ReadLine();
            }
        }
    }
}


text:
package org.slieb.throwables;

import java.lang.FunctionalInterface;
import java.lang.SuppressWarnings;
import java.lang.Throwable;
import java.util.function.Consumer;
import java.util.function.UnaryOperator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * Generated from UnaryOperator
 * Extends java.util.function.UnaryOperator to allow for a checked exception.
 *
 * @param <T> some generic flag
 * @param <E> The extension
 */
@FunctionalInterface
@SuppressWarnings({"WeakerAccess"})
public interface UnaryOperatorWithThrowable<T, E extends Throwable> extends UnaryOperator<T> {

    /**
     * Utility method to mark lambdas of type UnaryOperatorWithThrowable
     *
     * @param unaryoperatorwiththrowable The interface instance
     * @param <T> Generic that corresponds to the same generic on UnaryOperator
     * @param <E> The type this interface is allowed to throw
     * @return the cast interface
     */
    static <T, E extends Throwable> UnaryOperatorWithThrowable<T, E> castUnaryOperatorWithThrowable(final UnaryOperatorWithThrowable<T, E> unaryoperatorwiththrowable) {
        return unaryoperatorwiththrowable;
    }

    /**
     * Utility method to unwrap lambdas of type UnaryOperator and rethrow any Exception
     *
     * @param unaryoperatorwiththrowable The interface instance
     * @param <T> Generic that corresponds to the same generic on UnaryOperator
     * @param <E> The type this interface is allowed to throw
     * @throws E the original Exception from unaryoperatorwiththrowable
     * @return the cast interface
     */
    static <T, E extends Throwable> UnaryOperator<T> rethrowUnaryOperator(final UnaryOperatorWithThrowable<T, E> unaryoperatorwiththrowable) throws E {
        return unaryoperatorwiththrowable.rethrow();
    }

    /**
     * Utility method to convert UnaryOperatorWithThrowable
     * @param unaryoperator The interface instance
     * @param <T> Generic that corresponds to the same generic on UnaryOperator
     * @param <E> The type this interface is allowed to throw
     * @return the cast interface
     */
    static <T, E extends Throwable> UnaryOperatorWithThrowable<T, E> asUnaryOperatorWithThrowable(final UnaryOperator<T> unaryoperator) {
        return unaryoperator::apply;
    }

    /**
     * Overridden method of UnaryOperatorWithThrowable that will call applyWithThrowable, but catching any exceptions.
     *
     * @param v1 parameter to overridden method
     * @return the value
     */
    @Override
    default T apply(final T v1) {
        try {
            return applyWithThrowable(v1);
        } catch (final RuntimeException | Error exception) {
            throw exception;
        } catch (final Throwable throwable) {
            throw new SuppressedException(throwable);
        }
    }

    /**
     * Functional method that will throw exceptions.
     *
     * @param v1 parameter to overridden method
     * @return the value
     * @throws E some exception
     */
    T applyWithThrowable(final T v1) throws E;

    /**
     * @param defaultReturnValue A value to return if any throwable is caught.
     * @return An interface that returns a default value if any exception occurs.
     */
    default UnaryOperator<T> thatReturnsOnCatch(final T defaultReturnValue) {
      return (final T v1) -> {
        try {
          return applyWithThrowable(v1);
        } catch(final Throwable throwable) {
          return defaultReturnValue;
        }
      };
    }

    /**
     * @throws E if an exception E has been thrown, it is rethrown by this method
     * @return An interface that is only returned if no exception has been thrown.
     */
    default UnaryOperator<T> rethrow() throws E {
      return (final T v1) -> {
        try {
          return applyWithThrowable(v1);
        } catch(final Throwable throwable) {
          SuppressedException.throwAsUnchecked(throwable);
          throw new RuntimeException("Unreachable code.");
        }
      };
    }

    /**
     * @param logger The logger to log exceptions on
     * @param message A message to use for logging exceptions
     * @return An interface that will log all exceptions to given logger
     */
    @SuppressWarnings("Duplicates")
    default UnaryOperatorWithThrowable<T, E> withLogging(final Logger logger, final String message) {
        return (final T v1) -> {
            try {
                return applyWithThrowable(v1);
            } catch (final Throwable throwable) {
                logger.error(message, v1, throwable);
                throw throwable;
            }
        };
    }

    /**
     * Will log WARNING level exceptions on logger if they occur within the interface
     * @param logger The logger instance to log exceptions on
     * @return An interface that will log exceptions on given logger
     */
    default UnaryOperatorWithThrowable<T, E> withLogging(final Logger logger) {
        return withLogging(logger, "Exception in UnaryOperatorWithThrowable with the argument [{}]");
    }

    /**
     * Will log WARNING level exceptions on logger if they occur within the interface
     * @return An interface that will log exceptions on global logger
     */
    default UnaryOperatorWithThrowable<T, E> withLogging() {
        return withLogging(LoggerFactory.getLogger(getClass()));
    }

    /**
     * @param consumer An exception consumer.
     * @return An interface that will log all exceptions to given logger
     */
    @SuppressWarnings("Duplicates")
    default UnaryOperatorWithThrowable<T, E> onException(final Consumer<Throwable> consumer) {
        return (final T v1) -> {
            try {
                return applyWithThrowable(v1);
            } catch (final Throwable throwable) {
                consumer.accept(throwable);
                throw throwable;
            }
        };
    }

    /**
     * @param consumer An exception consumer.
     * @return An interface that will log all exceptions to given logger
     */
    @SuppressWarnings("Duplicates")
    default UnaryOperatorWithThrowable<T, E> onException(final java.util.function.BiConsumer<Throwable, Object[]> consumer) {
        return (final T v1) -> {
            try {
                return applyWithThrowable(v1);
            } catch (final Throwable throwable) {
                consumer.accept(throwable, new Object[]{v1});
                throw throwable;
            }
        };
    }
}


text:
#include "PipePosix.h"

namespace Titanium {

PosixPipe::PosixPipe(bool isReader)
    : NativePipe(isReader)
    , readHandle(-1)
    , writeHandle(-1)
{
}

void PosixPipe::CreateHandles()
{
    int fds[2];
    int rc = pipe(fds);
    if (rc == 0)
    {
        readHandle = fds[0];
        writeHandle = fds[1];
    }
    else
    {
        throw ValueException::FromFormat(
            "Error creating pipe: %s (%d)", strerror(errno), errno);
    }
}

void PosixPipe::Close()
{
    // Close should only be called if the process (or whatever)
    // it is attached to closes. Thus we want to make sure all
    // the output is cleared from the pipe before closing them.
    // A widowed pipe will eventually stop reading data.
    NativePipe::Close();
}

int PosixPipe::RawRead(char *buffer, int size)
{
    int n;
    do
    {
        n = read(readHandle, buffer, size);
    }
    while (n < 0 && errno == EINTR);

    if (n >= 0)
    {
        return n;
    }
    else
    {
        throw ValueException::FromString("Error reading from anonymous pipe");
    }
}

int PosixPipe::RawWrite(const char *buffer, int size)
{
    int n;
    do
    {
        n = write(writeHandle, buffer, size);
    }
    while (n < 0 && errno == EINTR);
    if (n >= 0)
    {
        return n;
    }
    else
    {
        throw ValueException::FromString("Error writing Bytes data to pipe");
    }
}

void PosixPipe::CloseNativeRead()
{
    if (readHandle != -1)
    {
        close(this->readHandle);
        this->readHandle = -1;
    }
}

void PosixPipe::CloseNativeWrite()
{
    if (writeHandle != -1)
    {
        close(writeHandle);
        this->writeHandle = -1;
    }
}

} // namespace Titanium


text:
"""Translate an ics file's events to a different timezone."""

import sys

from optparse import OptionParser
from vobject import icalendar, base

try:
    import PyICU
except:
    PyICU = None

from datetime import datetime

def change_tz(cal, new_timezone, default, utc_only=False, utc_tz=icalendar.utc):
    """Change the timezone of the specified component.

    Args:
        cal (Component): the component to change
        new_timezone (tzinfo): the timezone to change to
        default (tzinfo): a timezone to assume if the dtstart or dtend in cal
            doesn't have an existing timezone
        utc_only (bool): only convert dates that are in utc
        utc_tz (tzinfo): the tzinfo to compare to for UTC when processing
            utc_only=True
    """

    for vevent in getattr(cal, 'vevent_list', []):
        start = getattr(vevent, 'dtstart', None)
        end   = getattr(vevent, 'dtend',   None)
        for node in (start, end):
            if node:
                dt = node.value
                if (isinstance(dt, datetime) and
                        (not utc_only or dt.tzinfo == utc_tz)):
                    if dt.tzinfo is None:
                        dt = dt.replace(tzinfo = default)
                    node.value = dt.astimezone(new_timezone)

def main():
    options, args = get_options()
    if PyICU is None:
        print("Failure. change_tz requires PyICU, exiting")
    elif options.list:
        for tz_string in PyICU.TimeZone.createEnumeration():
            print(tz_string)
    elif args:
        utc_only = options.utc
        if utc_only:
            which = "only UTC"
        else:
            which = "all"
        print("Converting %s events" % which)
        ics_file = args[0]
        if len(args) > 1:
            timezone = PyICU.ICUtzinfo.getInstance(args[1])
        else:
            timezone = PyICU.ICUtzinfo.default
        print("... Reading %s" % ics_file)
        cal = base.readOne(open(ics_file))
        change_tz(cal, timezone, PyICU.ICUtzinfo.default, utc_only)

        out_name = ics_file + '.converted'
        print("... Writing %s" % out_name)

        out = file(out_name, 'wb')
        cal.serialize(out)
        print("Done")

version = "0.1"

def get_options():
    ##### Configuration options #####

    usage = """usage: %prog [options] ics_file [timezone]"""
    parser = OptionParser(usage=usage, version=version)
    parser.set_description("change_tz will convert the timezones in an ics file. ")

    parser.add_option("-u", "--only-utc", dest="utc", action="store_true",
                      default=False, help="Only change UTC events.")
    parser.add_option("-l", "--list", dest="list", action="store_true",
                      default=False, help="List available timezones")

    (cmdline_options, args) = parser.parse_args()
    if not args and not cmdline_options.list:
        print("error: too few arguments given")
        print()
        print(parser.format_help())
        return False, False

    return cmdline_options, args

if __name__ == "__main__":
    try:
        main()
    except KeyboardInterrupt:
        print("Aborted")


text:
/**
 * Панель редактирования элемента ul.
 *
 * @author dew1983@mail.ru <Suvorov Andrey M.>
 */

Ext.define(
	'FBEditor.view.panel.main.props.body.editor.ul.Editor',
	{
		extend: 'FBEditor.view.panel.main.props.body.editor.AbstractEditor',

		initComponent: function ()
		{
			var me = this;

			me.items = [
				{
					xtype: 'panel-props-body-editor-fields-id'
				}
			];

			me.callParent(arguments);
		}
	}
);


text:
package com.microsoft.azure.management.apimanagement.v2019_12_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.apimanagement.v2019_12_01.implementation.ApiManagementManager;
import com.microsoft.azure.management.apimanagement.v2019_12_01.implementation.TenantConfigurationSyncStateContractInner;
import org.joda.time.DateTime;

/**
 * Type representing TenantConfigurationSyncStateContract.
 */
public interface TenantConfigurationSyncStateContract extends HasInner<TenantConfigurationSyncStateContractInner>, HasManager<ApiManagementManager> {
    /**
     * @return the branch value.
     */
    String branch();

    /**
     * @return the commitId value.
     */
    String commitId();

    /**
     * @return the configurationChangeDate value.
     */
    DateTime configurationChangeDate();

    /**
     * @return the isExport value.
     */
    Boolean isExport();

    /**
     * @return the isGitEnabled value.
     */
    Boolean isGitEnabled();

    /**
     * @return the isSynced value.
     */
    Boolean isSynced();

    /**
     * @return the syncDate value.
     */
    DateTime syncDate();

}


text:
package io.crnk.meta;

import io.crnk.core.boot.CrnkBoot;
import io.crnk.core.engine.registry.RegistryEntry;
import io.crnk.core.engine.registry.RegistryEntryBuilder;
import io.crnk.core.engine.registry.ResourceRegistry;
import io.crnk.core.engine.url.ConstantServiceUrlProvider;
import io.crnk.core.module.ModuleRegistry;
import io.crnk.meta.model.MetaElement;
import io.crnk.meta.model.resource.MetaResource;
import io.crnk.meta.model.resource.MetaResourceRepository;
import io.crnk.meta.provider.MetaProvider;
import io.crnk.meta.provider.resource.ResourceMetaProvider;
import io.crnk.rs.internal.JaxrsModule;
import io.crnk.test.mock.models.Task;
import io.crnk.test.mock.repository.TaskRepository;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;

public class MetaModuleTest {

    private MetaModuleConfig metaModuleConfig;

    private MetaModule metaModule;

    private CrnkBoot boot;

    @Before
    public void setup() {
        metaModuleConfig = new MetaModuleConfig();
        metaModuleConfig.addMetaProvider(new ResourceMetaProvider());
        metaModule = MetaModule.createServerModule(metaModuleConfig);
        setupBoot();
    }

    private void setupBoot() {
        boot = new CrnkBoot();
        boot.addModule(new JaxrsModule(null));
        boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost"));
        boot.addModule(metaModule);
        boot.boot();
    }

    @Test
    public void testTransitiveRegistrationOfProviderDependencies() {
        MetaProvider testProvider = Mockito.mock(MetaProvider.class);
        Mockito.when(testProvider.getDependencies()).thenReturn((Collection) Arrays.asList(new ResourceMetaProvider()));

        metaModuleConfig = new MetaModuleConfig();
        metaModuleConfig.addMetaProvider(testProvider);
        metaModule = MetaModule.createServerModule(metaModuleConfig);

        setupBoot();

        Set<Class<? extends MetaElement>> metaClasses = metaModule.collectMetaClasses();

        // meta classes out of testProvider dependency (resource meta provider)
        Assert.assertTrue(metaClasses.contains(MetaResource.class));
        Assert.assertTrue(metaClasses.contains(MetaResourceRepository.class));
    }

    @Test
    public void checkName() {
        MetaModule module = MetaModule.createClientModule();
        Assert.assertEquals("meta", module.getModuleName());
    }

    @Test
    public void checkHasProtectedConstructor() {
        // TODO ClassTestUtils.assertProtectedConstructor(MetaModuleTest.class);
    }

    @Test
    public void checkRequestLocalCaching() {
        // get instance, triggers store in request local
        MetaLookup lookup = metaModule.getLookup();

        ThreadLocal<MetaLookup> lookupRequestLocal = metaModule.getLookupRequestLocal();
        Assert.assertNotNull(lookupRequestLocal.get());

        // clear global instance, still in request local
        metaModule.reset();
        Assert.assertSame(lookup, metaModule.getLookup());

        // clear request local, new instance to be returned
        metaModule.getLookupRequestLocal().remove();
        Assert.assertNotSame(lookup, metaModule.getLookup());
    }

    @Test
    public void checkRegistryUpdateTriggerMetaUpdate() {
        MetaLookup lookup = metaModule.getLookup();
        List<MetaResource> prevResources = lookup.findElements(MetaResource.class);

        ResourceRegistry resourceRegistry = boot.getResourceRegistry();
        resourceRegistry.addEntry(createRegistryEntry());

        // check request local caching against concurrent modifications
        Assert.assertEquals(prevResources.size(), metaModule.getLookup().findElements(MetaResource.class).size());

        // check new meta available for next request
        metaModule.getLookupRequestLocal().remove();
        Assert.assertEquals(prevResources.size() + 1, metaModule.getLookup().findElements(MetaResource.class).size());
    }

    private RegistryEntry createRegistryEntry() {
        ModuleRegistry moduleRegistry = boot.getModuleRegistry();
        RegistryEntryBuilder entryBuilder = moduleRegistry.getContext().newRegistryEntryBuilder();
        entryBuilder.resource().implementationType(Task.class).resourceType("someNewTask");
        entryBuilder.resourceRepository().instance(new TaskRepository());
        return entryBuilder.build();
    }

}


text:
describe('TestCafe UI', () => {
    it('Should display correct status', () => {
        return runTests('./testcafe-fixtures/status-bar-test.js', 'Show status prefix', { assertionTimeout: 3000 });
    });

    it('Hide elements when resizing the window', () => {
        return runTests('./testcafe-fixtures/status-bar-test.js', 'Hide elements when resizing the window', { skip: ['android', 'ipad', 'iphone', 'edge'] });
    });
});


text:
package tyfrontier.cleanarchitecturesample.data.cache;

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

import javax.inject.Inject;

import io.realm.Realm;
import io.realm.RealmObject;
import rx.Observable;

public class CacheServiceImpl implements CacheService {

    @Inject
    public CacheServiceImpl() {
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> void set(final Class<E> clazz, T model) {
        Realm realm = Realm.getDefaultInstance();
        realm.executeTransaction(realm1 -> realm1.createObject(clazz).map(model));
        realm.close();
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> Observable<List<T>> get(final Class<E> clazz) {
        return Observable.create(subscriber -> {
            Realm realm = Realm.getDefaultInstance();
            List<T> list = new ArrayList<>();
            for (E result : realm.where(clazz).findAll()) {
                list.add(result.map());
            }
            subscriber.onNext(list);
            subscriber.onCompleted();
            realm.close();
        });
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> long count(Class<E> clazz) {
        Realm realm = Realm.getDefaultInstance();
        long count = realm.where(clazz).count();
        realm.close();
        return count;
    }

    @Override
    public <T, E extends RealmObject & CacheObject<T>> void deleteAll(Class<E> clazz) {
        Realm realm = Realm.getDefaultInstance();
        realm.executeTransaction(realm1 -> realm1.delete(clazz));
        realm.close();
    }
}


text:
package mblog.core.persist.service.impl;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import mblog.core.data.Group;
import mblog.core.persist.dao.GroupDao;
import mblog.core.persist.entity.GroupPO;
import mblog.core.persist.service.GroupService;
import mblog.core.persist.utils.BeanMapUtils;

/**
 * @author langhsu
 *
 */
@Service
public class GroupServiceImpl implements GroupService {
	@Autowired
	private GroupDao groupDao;

	@Override
	@Transactional(readOnly = true)
	public List<Group> findAll() {
		List<GroupPO> list = groupDao.findAll();
		List<Group> rets = new ArrayList<>();

		list.forEach(po -> rets.add(BeanMapUtils.copy(po)));
		return rets;
	}

	@Override
	@Transactional(readOnly = true)
	@Cacheable(value = "groupsCaches", key = "'g_' + #id")
	public Group getById(int id) {
		return BeanMapUtils.copy(groupDao.get(id));
	}

	@Override
	@Transactional(readOnly = true)
	@Cacheable(value = "groupsCaches", key = "'g_' + #key")
	public Group getByKey(String key) {
		return BeanMapUtils.copy(groupDao.getByKey(key));
	}

}


text:
![][badge-version-img] ![][badge-info-img] ![][badge-license-img]

[中文版][readme-zh]

Rikka is written in Golang primarily, and provide Docker image.

Rikka image has been published to [DockerHub][image-in-docker-hub], just try it!

Badges above shows latest version and size of Rikka image.

## Introduction

Rikka(`りっか` in Japanese, sound like `/ɾʲikka/`, not `/rikka/`)is a integral personal image share system, includes:

- A web application (See [Demo](#demo) section)
- A REST API server (See [API Doc][api-doc])
- A CLI tool named Rikkac based on the API (See [Rikkac Doc][rikkac-doc])
- Image save plugins (See [Plugins Doc][plugins-doc] to get all available plugins)

Other parts not written in Golang (in plan):

- Android client
- iOS client

## Feature and Advantage

1. Simple and minimalist, no upload history
2. Image address can be copied to various formats
3. Many available image save plugins, such as weibo, QinNiu, UPai, Tencent Cloud, etc.
4. REST API provided
4. Modular Web server and API server
5. CLI tool provided
6. **Only guarantee support for recent versions of Chrome/Firefox/Safari**
7. Cute homepage image
8. An active maintainer :)

## Demo

There is a [Demo site][demo] built with Rikka, ~~password is `rikka`, just try it.~~ Because the free docker service provider I used stop it's free plan, the demo is on my personal VPS now. So the password is not given anymore, but you can also visit it and have a look :)

homepage:

![homepage][home]

Click `Choose` button to choose an image.

Input password`rikka`.

Click `Upload` button.

If no error happened, you will be redirect to preview page:

![view_page][view]

You will see a "Please wait" message If you uploaded a large file and save process is not finished, just wait a second.

When you see image url, you can click `Src`, `Markdown`, `HTML`, `RST`, `BBCode` button to copy image url in that format.

**But**: Once you close this page, you can't get it back except from browser history(Or you save the url).

This is intentional. The main design concept is simple, just `Upload-Copy-Close-Paste`, then you can forget Rikka.

BTW: The preview image of Demo site is saved in Rikka too. (But Github will put images which in Markdown files into its own CDN to accelerate access)

## Plugins

Truly image save back-end of Rikka is written as plugins, can be specified by `-plugin` option.

Please see [Rikka Plugins Doc][plugins-doc] for available plugins.

## API

See [Rikka API Doc][api-doc].

## CLI - Rikkac

Rikkac is a CLI tool for Rikka based on Rikka's REST API.

Build, install, configure and use guide can be found in [Rikkac Doc][rikkac-doc].

## Deploy

Want deploy Rikka system of you own? Check [Rikka Deploy Doc][deploy-doc] for deploy guide.

## Contribution

- Fork me
- Create a new branch from dev branch
- Add your code, comment, document and meaningful commit message
- Add yourself to CONTRIBUTION.md and describe your work
- PR to dev branch

Thanks all contributors!

You can see a list of contributors in [CONTRIBUTIONS.md][contributors].

## Acknowledgements

- Thanks Golang and her developers
- Thanks Visual Studio Code and her developers
- Thanks open source

## License

All code of Rikka system are open source, based on  MIT license.

See [LICENSE][license].

[readme-zh]: https://github.com/7sDream/rikka/blob/master/README.zh.md

[badge-info-img]: https://img.shields.io/docker/image-size/7sdream/rikka
[badge-version-img]: https://img.shields.io/docker/v/7sdream/rikka
[badge-license-img]: https://img.shields.io/github/license/7sdream/rikka

[image-in-docker-hub]: https://hub.docker.com/r/7sdream/rikka/

[demo]: https://rikka.7sdre.am/
[home]: https://rikka.7sdre.am/files/56c3ae9d-4d96-49c8-bc03-5104214a1ac8.png
[view]: https://rikka.7sdre.am/files/97bebf3b-9fb8-4b0c-a156-4b92b1951ae4.png

[api-doc]: https://github.com/7sDream/rikka/tree/master/api
[rikkac-doc]: https://github.com/7sDream/rikka/tree/master/rikkac
[plugins-doc]: https://github.com/7sDream/rikka/tree/master/plugins
[deploy-doc]: https://github.com/7sDream/rikka/blob/master/deploy.md

[contributors]: https://github.com/7sDream/rikka/blob/master/CONTRIBUTORS.md
[license]: https://github.com/7sDream/rikka/blob/master/LICENSE


text:
package com.njyb.gbdbase.dao.personalcenter.favorites;

import java.util.List;
import java.util.Map;

import com.njyb.gbdbas.mybatis.annotation.MyBatisReposity;
import com.njyb.gbdbase.model.personalcenter.favorites.HistoryAndFavoritesModel;

/**
 * 收藏夹 && 浏览器记录 <br>
 * 共用Dao层
 * @author WangBo
 * 2015年4月2日
 * IFavoritesDao.java
 */
@MyBatisReposity
public interface IBrowsingHistoryAndMyFavoritesDao {

	/**
	 * 查询历史收藏夹 用户id,国家名称,开始index,结束index
	 * @param userId : 用户id
	 * @return List<FavoritesModel>
	 */
	List<HistoryAndFavoritesModel> queryBrowsingHistoryByParamModel(int userId);

	/**
	 * 保存收藏夹记录
	 * @param favoritesModel : 收藏夹Bean
	 * @return 是否保存成功
	 */
	int addBrowsingHistory(HistoryAndFavoritesModel favoritesModel);

	/**
	 * 根据查询model查询我的收藏
	 * @param userId : 用户id
	 * @return List<FavoritesModel>
	 */
	List<HistoryAndFavoritesModel> queryMyFavoritesByParamModel(int userId);

	/**
	 * 添加我的收藏
	 * @param favoritesModel : 我的收藏
	 * @return 1 : 成功 2 : 失败
	 */
	int addMyFavorites(HistoryAndFavoritesModel favoritesModel);

	/**
	 * 删除我的收藏
	 * @param favoritesModel : 我的收藏
	 * @return 1 : 成功 2 : 失败
	 */
	int deleteMyFavorites(Map<String,Object> paramMap);

	/**
	 * 根据查询model查询我的收藏
	 * @param userId : 用户id
	 * @return List<FavoritesModel>
	 */
	List<HistoryAndFavoritesModel> queryMyFavoritesByParams(Map<String,Object> paramsMap);
}


text:
/*
 * iostat: report CPU and I/O statistics
 * (C) 1999-2011 by Sebastien Godard (sysstat <at> orange.fr)
 */

#ifndef _IOSTAT_H
#define _IOSTAT_H

#include "common.h"

/* I_: iostat - D_: Display - F_: Flag */
#define I_D_CPU			0x00001
#define I_D_DISK		0x00002
#define I_D_TIMESTAMP		0x00004
#define I_D_EXTENDED		0x00008
#define I_D_PART_ALL		0x00010
#define I_D_KILOBYTES		0x00020
#define I_F_HAS_SYSFS		0x00040
#define I_D_DEBUG		0x00080
#define I_D_UNFILTERED		0x00100
#define I_D_MEGABYTES		0x00200
#define I_D_PARTITIONS		0x00400
#define I_F_HAS_DISKSTATS	0x00800
#define I_D_HUMAN_READ		0x01000
/* Unused			0x02000 */
/* Unused			0x04000 */
/* Unused			0x08000 */
#define I_D_DEVMAP_NAME		0x10000
#define I_D_ISO			0x20000
/* Unused			0x40000 */
#define I_D_ZERO_OMIT		0x80000

#define DISPLAY_CPU(m)		(((m) & I_D_CPU)           == I_D_CPU)
#define DISPLAY_DISK(m)		(((m) & I_D_DISK)          == I_D_DISK)
#define DISPLAY_TIMESTAMP(m)	(((m) & I_D_TIMESTAMP)     == I_D_TIMESTAMP)
#define DISPLAY_EXTENDED(m)	(((m) & I_D_EXTENDED)      == I_D_EXTENDED)
#define DISPLAY_PART_ALL(m)	(((m) & I_D_PART_ALL)      == I_D_PART_ALL)
#define DISPLAY_KILOBYTES(m)	(((m) & I_D_KILOBYTES)     == I_D_KILOBYTES)
#define DISPLAY_MEGABYTES(m)	(((m) & I_D_MEGABYTES)     == I_D_MEGABYTES)
#define HAS_SYSFS(m)		(((m) & I_F_HAS_SYSFS)     == I_F_HAS_SYSFS)
#define DISPLAY_DEBUG(m)	(((m) & I_D_DEBUG)         == I_D_DEBUG)
#define DISPLAY_UNFILTERED(m)	(((m) & I_D_UNFILTERED)    == I_D_UNFILTERED)
#define DISPLAY_PARTITIONS(m)	(((m) & I_D_PARTITIONS)    == I_D_PARTITIONS)
#define HAS_DISKSTATS(m)	(((m) & I_F_HAS_DISKSTATS) == I_F_HAS_DISKSTATS)
#define DISPLAY_HUMAN_READ(m)	(((m) & I_D_HUMAN_READ)    == I_D_HUMAN_READ)
#define DISPLAY_DEVMAP_NAME(m)	(((m) & I_D_DEVMAP_NAME)   == I_D_DEVMAP_NAME)
#define DISPLAY_ISO(m)		(((m) & I_D_ISO)           == I_D_ISO)
#define DISPLAY_ZERO_OMIT(m)	(((m) & I_D_ZERO_OMIT)     == I_D_ZERO_OMIT)

/* Preallocation constats */
#define NR_DEV_PREALLOC		4
#define NR_DISK_PREALLOC	3

/* Environment variable */
#define ENV_POSIXLY_CORRECT	"POSIXLY_CORRECT"

/*
 * Structures for I/O stats.
 * The number of structures allocated corresponds to the number of devices
 * present in the system, plus a preallocation number to handle those
 * that can be registered dynamically.
 * The number of devices is found by using /sys filesystem (if mounted),
 * or the number of "disk_io:" entries in /proc/stat (2.4 kernels),
 * else the default value is 4 (for old kernels, which maintained stats
 * for the first four devices in /proc/stat).
 * For each io_stats structure allocated corresponds a io_hdr_stats structure.
 * A io_stats structure is considered as unused or "free" (containing no stats
 * for a particular device) if the 'major' field of the io_hdr_stats
 * structure is set to 0.
 */
struct io_stats {
	/* # of sectors read */
	unsigned long long rd_sectors	__attribute__ ((aligned (8)));
	/* # of sectors written */
	unsigned long long wr_sectors	__attribute__ ((packed));
	/* # of read operations issued to the device */
	unsigned long rd_ios		__attribute__ ((packed));
	/* # of read requests merged */
	unsigned long rd_merges		__attribute__ ((packed));
	/* Time of read requests in queue */
	unsigned long rd_ticks		__attribute__ ((packed));
	/* # of write operations issued to the device */
	unsigned long wr_ios		__attribute__ ((packed));
	/* # of write requests merged */
	unsigned long wr_merges		__attribute__ ((packed));
	/* Time of write requests in queue */
	unsigned long wr_ticks		__attribute__ ((packed));
	/* # of I/Os in progress */
	unsigned long ios_pgr		__attribute__ ((packed));
	/* # of ticks total (for this device) for I/O */
	unsigned long tot_ticks		__attribute__ ((packed));
	/* # of ticks requests spent in queue */
	unsigned long rq_ticks		__attribute__ ((packed));
	/* # of I/O done since last reboot */
	unsigned long dk_drive		__attribute__ ((packed));
	/* # of blocks read */
	unsigned long dk_drive_rblk	__attribute__ ((packed));
	/* # of blocks written */
	unsigned long dk_drive_wblk	__attribute__ ((packed));
};

#define IO_STATS_SIZE	(sizeof(struct io_stats))

struct io_hdr_stats {
	unsigned int active		__attribute__ ((aligned (4)));
	unsigned int used		__attribute__ ((packed));
	char name[MAX_NAME_LEN];
};

#define IO_HDR_STATS_SIZE	(sizeof(struct io_hdr_stats))

/* List of devices entered on the command line */
struct io_dlist {
	/* Indicate whether its partitions are to be displayed or not */
	int disp_part			__attribute__ ((aligned (4)));
	/* Device name */
	char dev_name[MAX_NAME_LEN];
};

#define IO_DLIST_SIZE	(sizeof(struct io_dlist))

#endif  /* _IOSTAT_H */


text:
namespace Perchero.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class aviosNoReq : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.DetallePrendas", "AvioId", "dbo.Avios");
            DropForeignKey("dbo.DetallePrendas", "TelaId", "dbo.Telas");
            DropIndex("dbo.DetallePrendas", new[] { "AvioId" });
            DropIndex("dbo.DetallePrendas", new[] { "TelaId" });
            AlterColumn("dbo.DetallePrendas", "AvioId", c => c.Int());
            AlterColumn("dbo.DetallePrendas", "TelaId", c => c.Int());
            CreateIndex("dbo.DetallePrendas", "AvioId");
            CreateIndex("dbo.DetallePrendas", "TelaId");
            AddForeignKey("dbo.DetallePrendas", "AvioId", "dbo.Avios", "Id");
            AddForeignKey("dbo.DetallePrendas", "TelaId", "dbo.Telas", "Id");
        }

        public override void Down()
        {
            DropForeignKey("dbo.DetallePrendas", "TelaId", "dbo.Telas");
            DropForeignKey("dbo.DetallePrendas", "AvioId", "dbo.Avios");
            DropIndex("dbo.DetallePrendas", new[] { "TelaId" });
            DropIndex("dbo.DetallePrendas", new[] { "AvioId" });
            AlterColumn("dbo.DetallePrendas", "TelaId", c => c.Int(nullable: false));
            AlterColumn("dbo.DetallePrendas", "AvioId", c => c.Int(nullable: false));
            CreateIndex("dbo.DetallePrendas", "TelaId");
            CreateIndex("dbo.DetallePrendas", "AvioId");
            AddForeignKey("dbo.DetallePrendas", "TelaId", "dbo.Telas", "Id", cascadeDelete: true);
            AddForeignKey("dbo.DetallePrendas", "AvioId", "dbo.Avios", "Id", cascadeDelete: true);
        }
    }
}


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>Angular 4 Plus Dashboard Framework</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
	    <link rel="stylesheet" href="../styles/style.css">

            Angular 4 Plus Dashboard Framework
            <button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>

                <input type="text" placeholder="Type to search">

                        Angular 4 Plus Dashboard Framework

                        Getting started

                                    README

                                        Overview

                                Modules

                                    AddGadgetModule

                                    AppModule

                                    BoardModule

                                    ConfigurationModule

                                    DynamicFormModule

                                    ErrorHandlerModule

                                    FacetModule

                                    GadgetModule

                                    GadgetSharedModule

                                    GridModule

                                    LayoutModule

                                    NotificationModule

                                    RoutingModule

                            Components

                                    AddGadgetComponent

                                    AppComponent

                                    BoardComponent

                                    BoardConfigurationComponent

                                    BoardLayoutManagerComponent

                                    CPUGadgetComponent

                                    CPUMGadgetComponent

                                    CellComponent

                                    DiskGadgetComponent

                                    DynamicFormComponent

                                    DynamicFormPropertyComponent

                                    EdgeServiceListGadgetComponent

                                    EndPointComponent

                                    EndPointDetailComponent

                                    ErrorHandlerComponent

                                    FacetComponent

                                    FilterListComponent

                                    FilterTagComponent

                                    GadgetHeaderComponent

                                    GadgetOperationComponent

                                    GridComponent

                                    HelpModalComponent

                                    JobAnalysisGadgetComponent

                                    MemoryGadgetComponent

                                    NewsGadgetComponent

                                    NotificationComponent

                                    NotificationDetailComponent

                                    PropertyListGadgetComponent

                                    SearchComponent

                                    SearchResultComponent

                                    ServiceListGadgetComponent

                                    StatisticGadgetComponent

                                    TrendGadgetComponent

                                    TrendLineGadgetComponent

                                    VisDrillDownComponent

                            Classes

                                    CheckboxProperty

                                    DropdownProperty

                                    DynamicDropdownProperty

                                    EndPoint

                                    ErrorHandler

                                    ErrorObject

                                    Facet

                                    GadgetBase

                                    GadgetConfigModel

                                    GadgetFactory

                                    HiddenProperty

                                    NgADFPage

                                    Notification

                                    NumberProperty

                                    PropertyBase

                                    PropertyPage

                                    SolutionObject

                                    Tag

                                    TextboxProperty

                            Injectables

                                    AddGadgetService

                                    CPUService

                                    ConfigurationService

                                    DiskService

                                    EdgeService

                                    EndPointService

                                    GadgetInstanceService

                                    GadgetPropertyService

                                    JobAnalysisService

                                    NewsService

                                    NotificationService

                                    ObservableWebSocketService

                                    PropertyControlService

                                    RuntimeService

                                    StatisticService

                                    TrendLineService

                                    TrendService

                            Interfaces

                                    IGadget

                            Pipes

                                    CapitalizeFirstPipe

                        Routes

                        Miscellaneous

                        Documentation coverage

                            Documentation generated using

                               Angular 4 Plus Dashboard Framework

                                   <input type="text" placeholder="Type to search">

                               Getting started

                                           README

                                               Overview

                                       Modules

                                           AddGadgetModule

                                           AppModule

                                           BoardModule

                                           ConfigurationModule

                                           DynamicFormModule

                                           ErrorHandlerModule

                                           FacetModule

                                           GadgetModule

                                           GadgetSharedModule

                                           GridModule

                                           LayoutModule

                                           NotificationModule

                                           RoutingModule

                                   Components

                                           AddGadgetComponent

                                           AppComponent

                                           BoardComponent

                                           BoardConfigurationComponent

                                           BoardLayoutManagerComponent

                                           CPUGadgetComponent

                                           CPUMGadgetComponent

                                           CellComponent

                                           DiskGadgetComponent

                                           DynamicFormComponent

                                           DynamicFormPropertyComponent

                                           EdgeServiceListGadgetComponent

                                           EndPointComponent

                                           EndPointDetailComponent

                                           ErrorHandlerComponent

                                           FacetComponent

                                           FilterListComponent

                                           FilterTagComponent

                                           GadgetHeaderComponent

                                           GadgetOperationComponent

                                           GridComponent

                                           HelpModalComponent

                                           JobAnalysisGadgetComponent

                                           MemoryGadgetComponent

                                           NewsGadgetComponent

                                           NotificationComponent

                                           NotificationDetailComponent

                                           PropertyListGadgetComponent

                                           SearchComponent

                                           SearchResultComponent

                                           ServiceListGadgetComponent

                                           StatisticGadgetComponent

                                           TrendGadgetComponent

                                           TrendLineGadgetComponent

                                           VisDrillDownComponent

                                   Classes

                                           CheckboxProperty

                                           DropdownProperty

                                           DynamicDropdownProperty

                                           EndPoint

                                           ErrorHandler

                                           ErrorObject

                                           Facet

                                           GadgetBase

                                           GadgetConfigModel

                                           GadgetFactory

                                           HiddenProperty

                                           NgADFPage

                                           Notification

                                           NumberProperty

                                           PropertyBase

                                           PropertyPage

                                           SolutionObject

                                           Tag

                                           TextboxProperty

                                   Injectables

                                           AddGadgetService

                                           CPUService

                                           ConfigurationService

                                           DiskService

                                           EdgeService

                                           EndPointService

                                           GadgetInstanceService

                                           GadgetPropertyService

                                           JobAnalysisService

                                           NewsService

                                           NotificationService

                                           ObservableWebSocketService

                                           PropertyControlService

                                           RuntimeService

                                           StatisticService

                                           TrendLineService

                                           TrendService

                                   Interfaces

                                           IGadget

                                   Pipes

                                           CapitalizeFirstPipe

                               Routes

                               Miscellaneous

                               Documentation coverage

                                   Documentation generated using

Modules

AddGadgetModule

        <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="775pt" height="284pt"
 viewBox="0.00 0.00 775.00 284.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 280)">
<title>dependencies</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-280 771,-280 771,4 -4,4"/>
<text text-anchor="start" x="362.5091" y="-42.4" font-family="sans-serif" font-weight="bold" font-size="14.00" fill="#000000">Legend</text>
<polygon fill="#ffffb3" stroke="transparent" points="149.5,-10 149.5,-30 169.5,-30 169.5,-10 149.5,-10"/>
<text text-anchor="start" x="173.129" y="-15.4" font-family="sans-serif" font-size="14.00" fill="#000000">  Declarations</text>
<polygon fill="#8dd3c7" stroke="transparent" points="262.5,-10 262.5,-30 282.5,-30 282.5,-10 262.5,-10"/>
<text text-anchor="start" x="286.2251" y="-15.4" font-family="sans-serif" font-size="14.00" fill="#000000">  Module</text>
<polygon fill="#80b1d3" stroke="transparent" points="348.5,-10 348.5,-30 368.5,-30 368.5,-10 348.5,-10"/>
<text text-anchor="start" x="372.2812" y="-15.4" font-family="sans-serif" font-size="14.00" fill="#000000">  Bootstrap</text>
<polygon fill="#fdb462" stroke="transparent" points="445.5,-10 445.5,-30 465.5,-30 465.5,-10 445.5,-10"/>
<text text-anchor="start" x="469.1732" y="-15.4" font-family="sans-serif" font-size="14.00" fill="#000000">  Providers</text>
<polygon fill="#fb8072" stroke="transparent" points="541.5,-10 541.5,-30 561.5,-30 561.5,-10 541.5,-10"/>
<text text-anchor="start" x="565.2258" y="-15.4" font-family="sans-serif" font-size="14.00" fill="#000000">  Exports</text>
<g id="clust1" class="cluster">
<title>cluster_AddGadgetModule</title>
<polygon fill="none" stroke="#000000" stroke-dasharray="1,5" points="8,-70 8,-268 759,-268 759,-70 8,-70"/>
</g>
<g id="clust2" class="cluster">
<title>cluster_AddGadgetModule_declarations</title>
<polygon fill="none" stroke="#000000" points="589,-78 589,-130 751,-130 751,-78 589,-78"/>
</g>
<g id="clust4" class="cluster">
<title>cluster_AddGadgetModule_imports</title>
<polygon fill="none" stroke="#000000" points="210,-78 210,-130 581,-130 581,-78 210,-78"/>
</g>
<g id="clust5" class="cluster">
<title>cluster_AddGadgetModule_exports</title>
<polygon fill="none" stroke="#000000" points="315,-208 315,-260 481,-260 481,-208 315,-208"/>
</g>
<g id="clust7" class="cluster">
<title>cluster_AddGadgetModule_providers</title>
<polygon fill="none" stroke="#000000" points="16,-78 16,-130 202,-130 202,-78 16,-78"/>
</g>

<g id="node1" class="node">
<title>AddGadgetComponent</title>
<polygon fill="#ffffb3" stroke="#000000" points="742.8655,-122 597.1345,-122 597.1345,-86 742.8655,-86 742.8655,-122"/>
<text text-anchor="middle" x="670" y="-99.8" font-family="Times,serif" font-size="14.00" fill="#000000">AddGadgetComponent</text>
</g>

<g id="node2" class="node">
<title>AddGadgetModule</title>
<polygon fill="#8dd3c7" stroke="#000000" points="460.0828,-187 457.0828,-191 436.0828,-191 433.0828,-187 335.9172,-187 335.9172,-151 460.0828,-151 460.0828,-187"/>
<text text-anchor="middle" x="398" y="-164.8" font-family="Times,serif" font-size="14.00" fill="#000000">AddGadgetModule</text>
</g>

<g id="edge1" class="edge">
<title>AddGadgetComponent->AddGadgetModule</title>
<path fill="none" stroke="#000000" d="M670,-122.2843C670,-143.3211 670,-175 670,-175 670,-175 470.0614,-175 470.0614,-175"/>
<polygon fill="#000000" stroke="#000000" points="470.0614,-171.5001 460.0614,-175 470.0613,-178.5001 470.0614,-171.5001"/>
</g>

<g id="node6" class="node">
<title>AddGadgetComponent </title>
<polygon fill="#fb8072" stroke="#000000" points="472.8658,-252 323.1342,-252 323.1342,-216 472.8658,-216 472.8658,-252"/>
<text text-anchor="middle" x="398" y="-229.8" font-family="Times,serif" font-size="14.00" fill="#000000">AddGadgetComponent </text>
</g>

<g id="edge5" class="edge">
<title>AddGadgetModule->AddGadgetComponent </title>
<path fill="none" stroke="#000000" stroke-dasharray="5,2" d="M398,-187.1061C398,-187.1061 398,-205.991 398,-205.991"/>
<polygon fill="#000000" stroke="#000000" points="394.5001,-205.9909 398,-215.991 401.5001,-205.991 394.5001,-205.9909"/>
</g>

<g id="node3" class="node">
<title>CommonModule</title>
<polygon fill="#8dd3c7" stroke="#000000" points="572.6681,-122 569.6681,-126 548.6681,-126 545.6681,-122 461.3319,-122 461.3319,-86 572.6681,-86 572.6681,-122"/>
<text text-anchor="middle" x="517" y="-99.8" font-family="Times,serif" font-size="14.00" fill="#000000">CommonModule</text>
</g>

<g id="edge2" class="edge">
<title>CommonModule->AddGadgetModule</title>
<path fill="none" stroke="#000000" d="M466.9245,-122.0225C466.9245,-139.3734 466.9245,-163 466.9245,-163 466.9245,-163 466.2384,-163 466.2384,-163"/>
<polygon fill="#000000" stroke="#000000" points="470.0638,-159.5002 460.0637,-163 470.0637,-166.5002 470.0638,-159.5002"/>
</g>

<g id="node4" class="node">
<title>FacetModule</title>
<polygon fill="#8dd3c7" stroke="#000000" points="442.8669,-122 439.8669,-126 418.8669,-126 415.8669,-122 353.1331,-122 353.1331,-86 442.8669,-86 442.8669,-122"/>
<text text-anchor="middle" x="398" y="-99.8" font-family="Times,serif" font-size="14.00" fill="#000000">FacetModule</text>
</g>

<g id="edge3" class="edge">
<title>FacetModule->AddGadgetModule</title>
<path fill="none" stroke="#000000" d="M398,-122.1061C398,-122.1061 398,-140.991 398,-140.991"/>
<polygon fill="#000000" stroke="#000000" points="394.5001,-140.9909 398,-150.991 401.5001,-140.991 394.5001,-140.9909"/>
</g>

<g id="node5" class="node">
<title>MdButtonModule</title>
<polygon fill="#8dd3c7" stroke="#000000" points="335.6123,-122 332.6123,-126 311.6123,-126 308.6123,-122 218.3877,-122 218.3877,-86 335.6123,-86 335.6123,-122"/>
<text text-anchor="middle" x="277" y="-99.8" font-family="Times,serif" font-size="14.00" fill="#000000">MdButtonModule</text>
</g>

<g id="edge4" class="edge">
<title>MdButtonModule->AddGadgetModule</title>
<path fill="none" stroke="#000000" d="M329.4367,-122.0225C329.4367,-139.3734 329.4367,-163 329.4367,-163 329.4367,-163 330.0694,-163 330.0694,-163"/>
<polygon fill="#000000" stroke="#000000" points="325.7641,-166.5002 335.7641,-163 325.764,-159.5002 325.7641,-166.5002"/>
</g>

<g id="node7" class="node">
<title>AddGadgetService</title>
<ellipse fill="#fdb462" stroke="#000000" cx="109" cy="-104" rx="84.5112" ry="18"/>
<text text-anchor="middle" x="109" y="-99.8" font-family="Times,serif" font-size="14.00" fill="#000000">AddGadgetService</text>
</g>

<g id="edge6" class="edge">
<title>AddGadgetService->AddGadgetModule</title>
<path fill="none" stroke="#000000" d="M109,-122.2843C109,-143.3211 109,-175 109,-175 109,-175 325.6471,-175 325.6471,-175"/>
<polygon fill="#000000" stroke="#000000" points="325.6471,-178.5001 335.6471,-175 325.6471,-171.5001 325.6471,-178.5001"/>
</g>
</g>
</svg>

        <button id="zoom-in" class="btn btn-default btn-sm">Zoom in</button>
        <button id="reset" class="btn btn-default btn-sm">Reset</button>
        <button id="zoom-out" class="btn btn-default btn-sm">Zoom out</button>

        Infos

        Source

File

            src/app/add-gadget/add-gadget.module.ts

Declarations

                                AddGadgetComponent

Providers

                                AddGadgetService

Imports

                                    FacetModule

Exports

                                    AddGadgetComponent

import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {AddGadgetComponent} from './add-gadget-component';
import {AddGadgetService} from './service';
import {FacetModule} from './facet/facet.module';
import {MdButtonModule} from '@angular/material';

@NgModule({
    imports: [
        CommonModule,
        FacetModule,
        MdButtonModule
    ],
    declarations: [
        AddGadgetComponent
    ],
    providers: [
        AddGadgetService
    ],
    exports: [
        AddGadgetComponent
    ]
})
export class AddGadgetModule {
}

 results matching ""

No results matching ""