text:
Today we will explain the steps and algorithm of implementing conversion progress GUI and how to make it work in your application. ByteScout Image To Video SDK was made to help with conversion progress GUI in C#. ByteScout Image To Video SDK is the software development kit that can take a set of images and generate video slide show from them. Includes built-in support for 100+ of 2-D and 3-D slide transitions effects. Supports output in WMV, AVI, WEBM video formats.

Fast application programming interfaces of ByteScout Image To Video SDK for C# plus the instruction and the C# code below will help you quickly learn conversion progress GUI. To do conversion progress GUI in your C# project or application you may simply copy & paste the code and then run your app! Code testing will allow the function to be tested and work properly with your data.

ByteScout Image To Video SDK is available as free trial. You may get it from our website along with all other source code samples for C# applications.

## REQUEST FREE TECH SUPPORT

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

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Image%20To%20Video%20SDK%20Question)

## ON-PREMISE OFFLINE SDK

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

## ON-DEMAND REST WEB API

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

## VIDEO REVIEW

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

<!-- code block begin -->

##### ****ConversionProgressGUI.VS2005.csproj:**

```
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{525EDC14-A580-4410-8A81-5ECB9B4B3F63}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ConversionProgressGUI</RootNamespace>
    <AssemblyName>ConversionProgressGUI</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <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|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Form1.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Form1.Designer.cs">
      <DependentUpon>Form1.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="Form1.resx">
      <SubType>Designer</SubType>
      <DependentUpon>Form1.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <COMReference Include="BytescoutImageToVideo">
      <Guid>{5212739C-A95B-4CDA-B116-F540A549B648}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference>
    <COMReference Include="stdole">
      <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
      <VersionMajor>2</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>primary</WrapperTool>
      <Isolated>False</Isolated>
    </COMReference>
  </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 -->

##### ****ConversionProgressGUI.VS2008.csproj:**

```
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{525EDC14-A580-4410-8A81-5ECB9B4B3F63}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ConversionProgressGUI</RootNamespace>
    <AssemblyName>ConversionProgressGUI</AssemblyName>
    <OldToolsVersion>2.0</OldToolsVersion>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <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|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Form1.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Form1.Designer.cs">
      <DependentUpon>Form1.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="Form1.resx">
      <SubType>Designer</SubType>
      <DependentUpon>Form1.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <COMReference Include="BytescoutImageToVideo">
      <Guid>{5212739C-A95B-4CDA-B116-F540A549B648}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference>
    <COMReference Include="stdole">
      <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
      <VersionMajor>2</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>primary</WrapperTool>
      <Isolated>False</Isolated>
    </COMReference>
  </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 -->

##### ****ConversionProgressGUI.VS2010.csproj:**

```
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>
    </ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{525EDC14-A580-4410-8A81-5ECB9B4B3F63}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ConversionProgressGUI</RootNamespace>
    <AssemblyName>ConversionProgressGUI</AssemblyName>
    <OldToolsVersion>3.5</OldToolsVersion>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <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|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Form1.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Form1.Designer.cs">
      <DependentUpon>Form1.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="Form1.resx">
      <SubType>Designer</SubType>
      <DependentUpon>Form1.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <COMReference Include="BytescoutImageToVideo">
      <Guid>{5212739C-A95B-4CDA-B116-F540A549B648}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference>
    <COMReference Include="stdole">
      <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
      <VersionMajor>2</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>primary</WrapperTool>
      <Isolated>False</Isolated>
    </COMReference>
  </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 -->

##### ****ConversionProgressGUI.csproj:**

```
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{525EDC14-A580-4410-8A81-5ECB9B4B3F63}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ConversionProgressGUI</RootNamespace>
    <AssemblyName>ConversionProgressGUI</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <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|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Form1.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Form1.Designer.cs">
      <DependentUpon>Form1.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="Form1.resx">
      <SubType>Designer</SubType>
      <DependentUpon>Form1.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <COMReference Include="BytescoutImageToVideo">
      <Guid>{5212739C-A95B-4CDA-B116-F540A549B648}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference>
    <COMReference Include="stdole">
      <Guid>{00020430-0000-0000-C000-000000000046}</Guid>
      <VersionMajor>2</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>primary</WrapperTool>
      <Isolated>False</Isolated>
    </COMReference>
  </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 -->

##### ****Form1.Designer.cs:**

```
namespace ConversionProgressGUI
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
			this.buttonConvert = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.progressBar1 = new System.Windows.Forms.ProgressBar();
			this.SuspendLayout();
			//
			// buttonConvert
			//
			this.buttonConvert.Location = new System.Drawing.Point(18, 57);
			this.buttonConvert.Name = "buttonConvert";
			this.buttonConvert.Size = new System.Drawing.Size(254, 33);
			this.buttonConvert.TabIndex = 0;
			this.buttonConvert.Text = "Convert slides with conversion preview";
			this.buttonConvert.UseVisualStyleBackColor = true;
			this.buttonConvert.Click += new System.EventHandler(this.buttonConvert_Click);
			//
			// label1
			//
			this.label1.AutoSize = true;
			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (204)));
			this.label1.Location = new System.Drawing.Point(15, 9);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(126, 13);
			this.label1.TabIndex = 2;
			this.label1.Text = "Conversion progress:";
			//
			// progressBar1
			//
			this.progressBar1.Location = new System.Drawing.Point(18, 28);
			this.progressBar1.Name = "progressBar1";
			this.progressBar1.Size = new System.Drawing.Size(254, 23);
			this.progressBar1.TabIndex = 3;
			//
			// Form1
			//
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(284, 102);
			this.Controls.Add(this.progressBar1);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.buttonConvert);
			this.Name = "Form1";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Form1";
			this.ResumeLayout(false);
			this.PerformLayout();

        }

        #endregion

		private System.Windows.Forms.Button buttonConvert;
        private System.Windows.Forms.Label label1;
		private System.Windows.Forms.ProgressBar progressBar1;
    }
}

```

<!-- code block end -->

<!-- code block begin -->

##### ****Form1.cs:**

```
using System;
using System.Windows.Forms;

using BytescoutImageToVideo;

namespace ConversionProgressGUI
{
    public partial class Form1 : Form
    {
		public const int WM_APP = 0x8000;
		public const int WM_CONVERSION_PROGRESS = WM_APP + 1;

		ImageToVideo converter = new ImageToVideo();

        public Form1()
        {
            InitializeComponent();

			converter.RegistrationName = "demo";
			converter.RegistrationKey = "demo";
        }

        private void buttonConvert_Click(object sender, EventArgs e)
        {
            if (!converter.IsRunning)
            {
                // Add images and set the duration for every slide
				Slide slide;
				slide = converter.AddImageFromFileName("..\\..\\..\\..\\slide1.jpg");
				slide.Duration = 3000; // 3000ms = 3s
				slide = converter.AddImageFromFileName("..\\..\\..\\..\\slide2.jpg");
				slide.Duration = 3000;
				slide = converter.AddImageFromFileName("..\\..\\..\\..\\slide3.jpg");
				slide.Duration = 3000;

				// Set output video size
				converter.OutputWidth = 400;
				converter.OutputHeight = 300;

				// Set output video file name
				converter.OutputVideoFileName = "result.wmv";

				// Set progress notification target window
				converter.SetProgressNotifyWindow(Handle.ToInt32(), WM_CONVERSION_PROGRESS, 0);

				// Run the conversion
				converter.Run();
            }
        }

		protected override void WndProc(ref Message m)
		{
			if (m.HWnd == Handle && m.Msg == WM_CONVERSION_PROGRESS)
			{
				progressBar1.Value = m.WParam.ToInt32();
			}

			base.WndProc(ref m);
		}
    }
}

```

<!-- code block end -->

<!-- code block begin -->

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

```
using System;
using System.Windows.Forms;

namespace ConversionProgressGUI
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

```

<!-- code block end -->


text:
from __future__ import absolute_import

import mock
import time

from collections import Iterable
from inspect import getargspec

from nydus.db.base import BaseCluster
from nydus.db.backends import BaseConnection
from nydus.db.routers import BaseRouter, RoundRobinRouter
from nydus.db.routers.keyvalue import ConsistentHashingRouter
from nydus.testutils import BaseTest

def _get_func(func):
    return getattr(func, '__wraps__', func)

class DummyConnection(BaseConnection):
    def __init__(self, i):
        self.host = 'dummyhost'
        self.i = i
        super(DummyConnection, self).__init__(i)

    @property
    def identifier(self):
        return "%s:%s" % (self.host, self.i)

class BaseRouterTest(BaseTest):
    Router = BaseRouter

    class TestException(Exception):
        pass

    def setUp(self):
        self.hosts = dict((i, {}) for i in xrange(5))
        self.cluster = BaseCluster(router=self.Router, hosts=self.hosts, backend=DummyConnection)
        self.router = self.cluster.router

    def get_dbs(self, *args, **kwargs):
        return self.router.get_dbs(*args, **kwargs)

    def test_not_ready(self):
        self.assertTrue(not self.router._ready)

    def test_get_dbs_iterable(self):
        db_nums = self.get_dbs(attr='test', args=('foo',))
        self.assertIsInstance(db_nums, Iterable)

    def test_get_dbs_unabletosetuproute(self):
        with mock.patch.object(self.router, '_setup_router', return_value=False):
            with self.assertRaises(BaseRouter.UnableToSetupRouter):
                self.get_dbs(attr='test', args=('foo',))

    def test_setup_router_returns_true(self):
        self.assertTrue(self.router.setup_router())

    def test_offers_router_interface(self):
        func = _get_func(self.router.get_dbs)
        self.assertTrue(callable(func))
        dbargs, _, _, dbdefaults = getargspec(func)
        self.assertTrue(set(dbargs) >= set(['self', 'attr', 'args', 'kwargs']))
        self.assertIsNone(dbdefaults)

        func = _get_func(self.router.setup_router)
        self.assertTrue(callable(func))
        setupargs, _, _, setupdefaults = getargspec(func)
        self.assertTrue(set(setupargs) >= set(['self', 'args', 'kwargs']))
        self.assertIsNone(setupdefaults)

    def test_returns_whole_cluster_without_key(self):
        self.assertEquals(self.hosts.keys(), self.get_dbs(attr='test'))

    def test_get_dbs_handles_exception(self):
        with mock.patch.object(self.router, '_route') as _route:
            with mock.patch.object(self.router, '_handle_exception') as _handle_exception:
                _route.side_effect = self.TestException()

                self.get_dbs(attr='test', args=('foo',))

                self.assertTrue(_handle_exception.called)

class BaseBaseRouterTest(BaseRouterTest):
    def test__setup_router_returns_true(self):
        self.assertTrue(self.router._setup_router())

    def test__pre_routing_returns_args_and_kwargs(self):
        self.assertEqual((('foo',), {}), self.router._pre_routing(attr='test', args=('foo',)))

    def test__route_returns_first_db_num(self):
        self.assertEqual(self.cluster.hosts.keys()[0], self.router._route(attr='test', args=('foo',))[0])

    def test__post_routing_returns_db_nums(self):
        db_nums = self.hosts.keys()

        self.assertEqual(db_nums, self.router._post_routing(attr='test', db_nums=db_nums, args=('foo',)))

    def test__handle_exception_raises_same_exception(self):
        e = self.TestException()

        with self.assertRaises(self.TestException):
            self.router._handle_exception(e)

    def test_returns_sequence_with_one_item_when_given_key(self):
        self.assertEqual(len(self.get_dbs(attr='test', args=('foo',))), len(self.hosts))

class BaseRoundRobinRouterTest(BaseRouterTest):
    Router = RoundRobinRouter

    def setUp(self):
        super(BaseRoundRobinRouterTest, self).setUp()
        assert self.router._setup_router()

    def test_ensure_db_num(self):
        db_num = 0
        s_db_num = str(db_num)

        self.assertEqual(self.router.ensure_db_num(db_num), db_num)
        self.assertEqual(self.router.ensure_db_num(s_db_num), db_num)

    def test_esnure_db_num_raises(self):
        with self.assertRaises(RoundRobinRouter.InvalidDBNum):
            self.router.ensure_db_num('a')

    def test_flush_down_connections(self):
        self.router._get_db_attempts = 9001
        self._down_connections = {0: time.time()}

        self.router.flush_down_connections()

        self.assertEqual(self.router._get_db_attempts, 0)
        self.assertEqual(self.router._down_connections, {})

    def test_mark_connection_down(self):
        db_num = 0

        self.router.mark_connection_down(db_num)

        self.assertAlmostEqual(self.router._down_connections[db_num], time.time(), delta=10)

    def test_mark_connection_up(self):
        db_num = 0

        self.router.mark_connection_down(db_num)

        self.assertIn(db_num, self.router._down_connections)

        self.router.mark_connection_up(db_num)

        self.assertNotIn(db_num, self.router._down_connections)

    def test__pre_routing_updates__get_db_attempts(self):
        self.router._pre_routing(attr='test', args=('foo',))

        self.assertEqual(self.router._get_db_attempts, 1)

    @mock.patch('nydus.db.routers.base.RoundRobinRouter.check_down_connections')
    def test__pre_routing_check_down_connections(self, _check_down_connections):
        self.router._get_db_attempts = RoundRobinRouter.attempt_reconnect_threshold + 1

        self.router._pre_routing(attr='test', args=('foo',))

        self.assertTrue(_check_down_connections.called)

    @mock.patch('nydus.db.routers.base.RoundRobinRouter.mark_connection_down')
    def test__pre_routing_retry_for(self, _mark_connection_down):
        db_num = 0

        self.router._pre_routing(attr='test', args=('foo',), retry_for=db_num)

        _mark_connection_down.assert_called_with(db_num)

    @mock.patch('nydus.db.routers.base.RoundRobinRouter.mark_connection_up')
    def test_online_connections_dont_get_marked_as_up(self, mark_connection_up):
        db_nums = [0]

        self.assertEqual(self.router._post_routing(attr='test', db_nums=db_nums, args=('foo',)), db_nums)
        self.assertFalse(mark_connection_up.called)

    @mock.patch('nydus.db.routers.base.RoundRobinRouter.mark_connection_up')
    def test_offline_connections_get_marked_as_up(self, mark_connection_up):
        self.router.mark_connection_down(0)
        db_nums = [0]

        self.assertEqual(self.router._post_routing(attr='test', db_nums=db_nums, args=('foo',)), db_nums)
        mark_connection_up.assert_called_with(db_nums[0])

class RoundRobinRouterTest(BaseRoundRobinRouterTest):
    def test__setup_router(self):
        self.assertTrue(self.router._setup_router())
        self.assertIsInstance(self.router._hosts_cycler, Iterable)

    def test__route_cycles_through_keys(self):
        db_nums = self.hosts.keys() * 2
        results = [self.router._route(attr='test', args=('foo',))[0] for _ in db_nums]

        self.assertEqual(results, db_nums)

    def test__route_retry(self):
        self.router.retry_timeout = 0

        db_num = 0

        self.router.mark_connection_down(db_num)

        db_nums = self.router._route(attr='test', args=('foo',))

        self.assertEqual(db_nums, [db_num])

    def test__route_skip_down(self):
        db_num = 0

        self.router.mark_connection_down(db_num)

        db_nums = self.router._route(attr='test', args=('foo',))

        self.assertNotEqual(db_nums, [db_num])
        self.assertEqual(db_nums, [db_num + 1])

    def test__route_hostlistexhausted(self):
        [self.router.mark_connection_down(db_num) for db_num in self.hosts.keys()]

        with self.assertRaises(RoundRobinRouter.HostListExhausted):
            self.router._route(attr='test', args=('foo',))

class ConsistentHashingRouterTest(BaseRoundRobinRouterTest):
    Router = ConsistentHashingRouter

    def get_dbs(self, *args, **kwargs):
        kwargs['attr'] = 'test'
        return super(ConsistentHashingRouterTest, self).get_dbs(*args, **kwargs)

    def test_retry_gives_next_host_if_primary_is_offline(self):
        self.assertEquals([2], self.get_dbs(args=('foo',)))
        self.assertEquals([4], self.get_dbs(args=('foo',), retry_for=2))

    def test_retry_host_change_is_sticky(self):
        self.assertEquals([2], self.get_dbs(args=('foo',)))
        self.assertEquals([4], self.get_dbs(args=('foo',), retry_for=2))

        self.assertEquals([4], self.get_dbs(args=('foo',)))

    def test_raises_host_list_exhaused_if_no_host_can_be_found(self):
        # Kill the first 4
        [self.get_dbs(retry_for=i) for i in range(4)]

        # And the 5th should raise an error
        self.assertRaises(
            ConsistentHashingRouter.HostListExhausted,
            self.get_dbs, **dict(args=('foo',), retry_for=4))

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
    <title>Demo C0 Coverage Information - SimpleCov - RCov style</title>
    <link href="./assets/0.2.3/screen.css" media="all" rel="stylesheet" type="text/css" />
    <link href="./assets/0.2.3/print.css" media="print" rel="stylesheet" type="text/css" />

Demo C0 Coverage Information - SimpleCov - RCov style

      <fieldset>
        File Filter:
        <select id="file_filter" class="filter">
          <option value="all_files">Show All</option>
          <option value="features">features/</option><option value="lib">lib/</option><option value="olds">olds/</option><option value="pages">pages/</option><option value="step_definitions">step_definitions/</option><option value="support">support/</option>
        </select>
      </fieldset>
      <fieldset>
        Code Coverage Threshold:
        <select id="coverage_filter" class="filter">
          <option value="all_coverage">Show All</option>
          <option value="10">< 10% Coverage</option><option value="20">< 20% Coverage</option><option value="30">< 30% Coverage</option><option value="40">< 40% Coverage</option><option value="50">< 50% Coverage</option><option value="60">< 60% Coverage</option><option value="70">< 70% Coverage</option><option value="80">< 80% Coverage</option><option value="90">< 90% Coverage</option><option value="100">< 100% Coverage</option>
          <option value="110">= 100% Coverage</option>
        </select>
      </fieldset>

            Name
            Total Lines
            Lines of Code
            Total Coverage
            Code Coverage

            TOTAL
            <tt>372</tt>
            <tt>159</tt>

<tt class=''>89.78%</tt>

<tt class='coverage_total'>76.10%</tt>

              features/step_definitions/shopping_cart.rb
              <tt>80</tt>
              <tt>9</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              features/support/hooks.rb
              <tt>45</tt>
              <tt>27</tt>

<tt class=''>71.11%</tt>

<tt class=''>51.85%</tt>

              lib/data_helper.rb
              <tt>58</tt>
              <tt>25</tt>

<tt class=''>79.31%</tt>

<tt class=''>52.00%</tt>

              lib/pages/generic_base_page.rb
              <tt>53</tt>
              <tt>26</tt>

<tt class=''>90.57%</tt>

<tt class=''>80.77%</tt>

              lib/pages/homepage.rb
              <tt>13</tt>
              <tt>6</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/automation_home_page.rb
              <tt>21</tt>
              <tt>11</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/checkout_page.rb
              <tt>8</tt>
              <tt>4</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/login_page.rb
              <tt>24</tt>
              <tt>15</tt>

<tt class=''>66.67%</tt>

<tt class=''>46.67%</tt>

              lib/pages/olds/order_confirmation_page.rb
              <tt>6</tt>
              <tt>3</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/order_summary_page.rb
              <tt>6</tt>
              <tt>3</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/payment_method_page.rb
              <tt>7</tt>
              <tt>4</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/shipping_address_page.rb
              <tt>7</tt>
              <tt>4</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/shopping_cart_summary_page.rb
              <tt>7</tt>
              <tt>4</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/olds/summer_dresses_catalog_page.rb
              <tt>25</tt>
              <tt>12</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

              lib/pages/welcome_page.rb
              <tt>12</tt>
              <tt>6</tt>

<tt class=''>100.00%</tt>

<tt class=''>100.00%</tt>

Generated on 2015-11-05 01:29:30 +0530 with SimpleCov-RCov 0.2.3


text:
/*
 *	lig-external.h
 *
 *	By David Meyer <dmm@1-4-5.net>
 *	Copyright 2009 David Meyer
 *
 *	Any externals that everyone needs go here.
 *
 *	David Meyer
 *	dmm@1-4-5.net
 *	Thu Apr  9 12:01:29 2009
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     o Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     o Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     o Neither the name of the University nor the names of its contributors
 *       may be used to endorse or promote products derived from this software
 *       without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
 *	$Header: /mnt/disk1/dmm/src/lig/RCS/lig-external.h,v 1.1 2010/11/14 20:47:00 dmm Exp $
 *
 */

extern  unsigned int	debug;
extern  unsigned int	disallow_eid;
extern  unsigned int	udp_checksum_disabled;
extern	ushort		emr_inner_src_port;

#ifdef BSD
#include <string.h>
#else
extern void		*memcpy();
extern void		*memset();
extern char		*strdup();
#endif

extern ushort		csum ();
extern long		tvdiff();


text:
'use strict';

let nativeRAF = global.requestAnimationFrame ||
    global.webkitRequestAnimationFrame ||
    global.mozRequestAnimationFrame;

let lastTime = 0;

let requestAnimationFrame = nativeRAF ||
    function (callback) {
        let currTime = Date.now();
        let timeDelay = Math.max(0, 16 - (currTime - lastTime));

        lastTime = currTime + timeDelay;
        return global.setTimeout(function () {
            callback(Date.now());
        }, timeDelay);
    };

// Works around a rare bug in Safari 6 where the first request is never invoked.
requestAnimationFrame(function () {
});

module.exports = requestAnimationFrame;


text:
{% extends "site_base.html" %}

{% load url from future %}
{% load i18n %}
{% load account_tags %}

{% block head_title %}{% trans "Password reset sent" %}{% endblock %}

{% block body %}

{% trans "Password reset sent" %}

    {% if not resend %}

{% blocktrans %}We have sent you an email. If you do not receive it within a few minutes, try resending or contact us at {{ THEME_CONTACT_EMAIL }}.{% endblocktrans %}

                <form method="POST" action="{% url "account_password_reset" %}">
                    {% csrf_token %}
                    {% for field in form %}
                        {{ field.as_hidden }}
                    {% endfor %}
                    <button type="submit" name="resend" class="btn btn-primary">{% trans "Resend" %}</button>
                </form>

    {% else %}

{% blocktrans %}We have resent the password email. If you do not receive it within a few minutes, contact us at {{ THEME_CONTACT_EMAIL }}.{% endblocktrans %}

    {% endif %}
{% endblock %}


text:
System.register(["test/lib/common", "app/core/table_model", "../renderer"], function (exports_1, context_1) {
    "use strict";
    var __moduleName = context_1 && context_1.id;
    var common_1, table_model_1, renderer_1;
    return {
        setters: [
            function (common_1_1) {
                common_1 = common_1_1;
            },
            function (table_model_1_1) {
                table_model_1 = table_model_1_1;
            },
            function (renderer_1_1) {
                renderer_1 = renderer_1_1;
            }
        ],
        execute: function () {
            common_1.describe('when rendering table', function () {
                common_1.describe('given 2 columns', function () {
                    var table = new table_model_1.default();
                    table.columns = [
                        { text: 'Time' },
                        { text: 'Value' },
                        { text: 'Colored' },
                        { text: 'Undefined' },
                        { text: 'String' },
                        { text: 'United', unit: 'bps' },
                        { text: 'Sanitized' },
                    ];
                    var panel = {
                        pageSize: 10,
                        styles: [
                            {
                                pattern: 'Time',
                                type: 'date',
                                format: 'LLL'
                            },
                            {
                                pattern: 'Value',
                                type: 'number',
                                unit: 'ms',
                                decimals: 3,
                            },
                            {
                                pattern: 'Colored',
                                type: 'number',
                                unit: 'none',
                                decimals: 1,
                                colorMode: 'value',
                                thresholds: [50, 80],
                                colors: ['green', 'orange', 'red']
                            },
                            {
                                pattern: 'String',
                                type: 'string',
                            },
                            {
                                pattern: 'United',
                                type: 'number',
                                unit: 'ms',
                                decimals: 2,
                            },
                            {
                                pattern: 'Sanitized',
                                type: 'string',
                                sanitize: true,
                            }
                        ]
                    };
                    var sanitize = function (value) {
                        return 'sanitized';
                    };
                    var renderer = new renderer_1.TableRenderer(panel, table, 'utc', sanitize);
                    common_1.it('time column should be formated', function () {
                        var html = renderer.renderCell(0, 1388556366666);
                        common_1.expect(html).to.be('2014-01-01T06:06:06Z	');
                    });
                    common_1.it('undefined time column should be rendered as -', function () {
                        var html = renderer.renderCell(0, undefined);
                        common_1.expect(html).to.be('-	');
                    });
                    common_1.it('null time column should be rendered as -', function () {
                        var html = renderer.renderCell(0, null);
                        common_1.expect(html).to.be('-	');
                    });
                    common_1.it('number column with unit specified should ignore style unit', function () {
                        var html = renderer.renderCell(5, 1230);
                        common_1.expect(html).to.be('1.23 kbps	');
                    });
                    common_1.it('number column should be formated', function () {
                        var html = renderer.renderCell(1, 1230);
                        common_1.expect(html).to.be('1.230 s	');
                    });
                    common_1.it('number style should ignore string values', function () {
                        var html = renderer.renderCell(1, 'asd');
                        common_1.expect(html).to.be('asd	');
                    });
                    common_1.it('colored cell should have style', function () {
                        var html = renderer.renderCell(2, 40);
                        common_1.expect(html).to.be('40.0	');
                    });
                    common_1.it('colored cell should have style', function () {
                        var html = renderer.renderCell(2, 55);
                        common_1.expect(html).to.be('55.0	');
                    });
                    common_1.it('colored cell should have style', function () {
                        var html = renderer.renderCell(2, 85);
                        common_1.expect(html).to.be('85.0	');
                    });
                    common_1.it('unformated undefined should be rendered as string', function () {
                        var html = renderer.renderCell(3, 'value');
                        common_1.expect(html).to.be('value	');
                    });
                    common_1.it('string style with escape html should return escaped html', function () {
                        var html = renderer.renderCell(4, "&breaking
 the
 row");
                        common_1.expect(html).to.be('&breaking <br /> the <br /> row	');
                    });
                    common_1.it('undefined formater should return escaped html', function () {
                        var html = renderer.renderCell(3, "&breaking
 the
 row");
                        common_1.expect(html).to.be('&breaking <br /> the <br /> row	');
                    });
                    common_1.it('undefined value should render as -', function () {
                        var html = renderer.renderCell(3, undefined);
                        common_1.expect(html).to.be('	');
                    });
                    common_1.it('sanitized value should render as', function () {
                        var html = renderer.renderCell(6, 'text link');
                        common_1.expect(html).to.be('sanitized	');
                    });
                });
            });
        }
    };
});
//# sourceMappingURL=renderer_specs.js.map


text:
<?php
/**
 * @author oshine <oyjqdlp@126.com>
 * @link https://github.com/cloudbar/cloud.yii
 * @see https://github.com/cloudbar/cloud.yii/wiki
 */
namespace cloud;

use CException;
use cloud\core\components\Engine;
use cloud\core\engines\Io;
use cloud\core\engines\Local;

class Cloud extends \Yii
{
    /**
     * 当前平台引擎
     * @var mixed
     */
    private static $_engine;

    /**
     * 默认加载的全局语言包
     * @var array
     */
    private static $globalLangSource = array( 'default', 'message', 'error' );

    /**
     * 翻译语言
     * @param string $message 翻译内容

     * 当eg:'test_language' 当前模块默认语言包找test_language翻译

     * 当eg:'error/test_language' 当前模块的error语言包中找test_language翻译

     * 当eg:'article/default/test_language' 在article模块的default语言包中找test_language翻译。
     * @param string $category 指定目录名,为空则遵循以上规则查找
     * @param array $params 语言变量替换数组
     * @param string $source 语言文件
     * @param string $language 目标语言
     * @return string
     * @author Ring
     */
    public static function lang( $message, $category = '', $params = array(), $source = null, $language = null ) {
        if ( empty( $category ) ) {
            $messagePart = explode( '/', $message );
            $currentModule = (string) self::getCurrentModuleName() . '.';
            switch ( count( $messagePart ) ) {
                case 1:
                    list($message) = $messagePart;
                    $category = $currentModule . 'default';
                    break;
                case 2:
                    list($file, $message) = $messagePart;
                    $category = $currentModule . $file;
                    break;
                case 3:
                    list($module, $file, $message) = $messagePart;
                    $category = $module . '.' . $file;
                    break;
                default:
                    $category = 'default';
                    break;
            }
        }
        $translation = self::t( trim( $category, '.' ), $message, $params, $source, $language );
        return $translation;
    }

    /**
     * 获取当前运行模块的名字
     * @return mixed
     * @author Ring
     */
    public static function getCurrentModuleName() {
        return self::app()->setting->get( 'module' );
    }

    /**
     * 加载多个语言文件,为空则加载全局$globalLangSource指定的语言文件,有多个则合并
     * @param array $langSource 要加载的语言包文件
     * @return array 合并后的语言数组
     */
    public static function getLangSources( $langSource = array() ) {
        if ( self::getCurrentModuleName() ) {
            $langSource[] = self::getCurrentModuleName() . '.' . 'default';
        }
        $lang = array();
        foreach ( array_unique( array_merge( self::$globalLangSource, $langSource ) ) as $source ) {
            $sourceLang = self::getLangSource( $source );
            $lang = array_merge( $lang, (array) $sourceLang );
        }
        return $lang;
    }

    /**
     * 加载当前模块下指定文件的语言包。返回语言包数组
     * @param string $file 语言包文件名
     * @return array 语言包数组
     */
    public static function getLangSource( $file ) {
        static $langs = array();
        if ( !isset( $langs[$file] ) ) {
            $langs[$file] = self::app()->getMessages()->loadMessages( $file, self::app()->getLanguage() );
        }
        return (array) $langs[$file];
    }

    /**
     * 返回当前平台引擎
     * @return Engine
     */
    public static function engine() {

        if(self::$_engine !== null && self::$_engine instanceof Engine)
            return self::$_engine;

        if(file_exists(PATH_DATA."/deploy")){
            defined( 'DEBUG' ) or define( 'DEBUG', false );

            $config = require_once PATH_DATA.DIRECTORY_SEPARATOR."production".DIRECTORY_SEPARATOR."config.php";
            self::$_engine = new Local($config);

        }else{
            defined( 'DEBUG' ) or define( 'DEBUG', true );
            error_reporting( E_ALL | E_STRICT );

            $config = require_once PATH_DATA.DIRECTORY_SEPARATOR."development".DIRECTORY_SEPARATOR."config.php";
            self::$_engine = new Local($config);
        }

        defined( 'YII_DEBUG' ) or define( 'YII_DEBUG', DEBUG );

        // 错误等级
        defined( 'YII_TRACE_LEVEL' ) or define( 'YII_TRACE_LEVEL', DEBUG ? 3 : 0  );

        return self::$_engine;
    }

    /**
     * @return Io
     */
    public static function io(){
        return self::engine()->io();
    }

    /**
     * @param null $config
     * @return \CApplication
     */
    public static function createWebApplication($config=null)
    {
        if($config == null){
            $config = PATH_ROOT . '/library/cloud/config/common.php';
        }
        return self::createApplication('cloud\core\components\Application',$config);
    }

    /**
     * @param null $config
     * @return \CApplication
     */
    public static function createConsoleApplication($config=null)
    {
        if($config == null){
            $config = PATH_ROOT . '/library/cloud/config/common.php';
        }
        return self::createApplication('cloud\core\cli\Application',$config);
    }
}


text:
@ngdoc content
@name checkbox
@description

  CSS Styles

The css decalaration of the `<md-checkbox>` component is:

<hljs lang="css">
 md-checkbox {
   margin: 8px;
   cursor: pointer;
   padding-left: 18px;
   padding-right: 0;
   line-height: 26px;
   min-width: 18px;
   min-height: 18px;
 }
</hljs>

 Ink color

In order to change the color when the checkbox is checked:

![greencheckbox](https://cloud.githubusercontent.com/assets/1292882/8035909/b2130da0-0dfc-11e5-932f-4424d3b46d5b.PNG)

<hljs lang="html">
<md-checkbox class="green">
   Green Checkbox
</md-checkbox>
</hljs>

 <hljs lang="css">
 md-checkbox.md-checked.green .md-icon {
  background-color: rgba(0, 255, 0, 0.87);
 }
 </hljs>

 Disabled

In order to change the color when a disabled checkbox is checked:

![checkboxdisabledred](https://cloud.githubusercontent.com/assets/1292882/8036177/dc941a86-0dfe-11e5-8892-ac19ec6926fe.PNG)

<hljs lang="html">
<md-checkbox ng-disabled="true" class="red" ng-model="data.cb4" ng-init="data.cb4=true">
  Checkbox: Disabled, Checked
</md-checkbox>
</hljs>

 <hljs lang="css">
md-checkbox.md-checked[disabled].red .md-icon {
  background-color: rgba(255, 0, 0, 0.26);
}
 </hljs>

  Borders

In order to add a custom border do the following:

![checkboxcustomborder](https://cloud.githubusercontent.com/assets/1292882/8037214/388dd40c-0e05-11e5-82a7-4bfa2541e968.PNG)

<hljs lang="html">

  <md-checkbox ng-model="data.cb2" aria-label="Checkbox 2" ng-true-value="'yup'" ng-false-value="'nope'">
   Default Border
  </md-checkbox>

  <md-checkbox ng-model="data.cb2" aria-label="Checkbox 2" ng-true-value="'yup'" class="dotted" ng-false-value="'nope'">
     Custom Border
  </md-checkbox>

</hljs>
<hljs lang="css">
md-checkbox.dotted .md-icon {
 border-width: 1px;
 border-style: dashed;
}
</hljs>

 Bi-Di

The mdCheckbox directive supports bi-directional specifiers in the `<html dir="rtl">` tag:

![checkboxrtl](https://cloud.githubusercontent.com/assets/1292882/8036091/fb40bcf6-0dfd-11e5-8319-25e68939d1a3.PNG)


text:
package com.balancedpayments;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.balancedpayments.core.Client;
import com.balancedpayments.core.Resource;
import com.balancedpayments.core.ResourceCollection;
import com.balancedpayments.errors.HTTPError;

public class Hold extends Resource {

    public Date created_at;
    public Map<String, String> meta;
    public Integer amount;
    public Date expires_at;
    public String description;
    public Debit debit;
    public String transaction_number;
    public Boolean is_void;
    public String account_uri;
    public Account account;
    public String card_uri;
    public Card card;

    public static class Collection extends ResourceCollection<Hold> {
        public Collection(String uri) {
            super(Hold.class, uri);
        }
    };

    public static Hold get(String uri) throws HTTPError {
        return new Hold((new Client()).get(uri));
    }

    public Hold() {
        super();
    }

    public Hold(String uri) throws HTTPError {
        super(uri);
    }

    public Hold(Map<String, Object> payload) {
        super(payload);
    }

    public Account getAccount() throws HTTPError {
        if (account == null)
            account = new Account(account_uri);
        return account;
    }

    public Card getCard() throws HTTPError {
        if (card == null)
            card = new Card(card_uri);
        return card;
    }

    public void void_() throws HTTPError {
        is_void = true;
        save();
    }

    public Debit capture(int amount) throws HTTPError {
        Map<String, Object> payload = new HashMap<String, Object>();
        payload.put("hold_uri", uri);
        payload.put("amount", amount);
        debit = account.debits.create(payload);
        return debit;
    }

    public Debit capture() throws HTTPError {
        Map<String, Object> payload = new HashMap<String, Object>();
        payload.put("hold_uri", uri);
        debit = account.debits.create(payload);
        return debit;
    }

    @Override
    public Map<String, Object> serialize() {
        Map<String, Object> payload = new HashMap<String, Object>();
        payload.put("amount", amount);
        payload.put("description", description);
        payload.put("is_void", is_void);
        payload.put("meta", meta);
        return payload;
    }

    @Override
    public void deserialize(Map<String, Object> payload) {
        super.deserialize(payload);
        created_at = deserializeDate((String) payload.get("created_at"));
        meta = (Map<String, String>) payload.get("meta");
        amount = ((Double) payload.get("amount")).intValue();
        expires_at = deserializeDate((String) payload.get("expires_at"));
        description = (String) payload.get("description");
        is_void  = (Boolean) payload.get("is_void");
        if (payload.containsKey("account_uri")) {
            account = null;
            account_uri = (String) payload.get("account_uri");
        }
        else {
            account = new Account((Map<String, Object>) payload.get("account"));
            account_uri = account.uri;
        }
        if (payload.get("debit") != null)
            debit = new Debit((Map<String, Object>) payload.get("debit"));
        else
            debit = null;
        if (payload.containsKey("source_uri")) {
            card = null;
            card_uri = (String) payload.get("source_uri");
        }
        else {
            card = new Card((Map<String, Object>) payload.get("source"));
            card_uri = card.uri;
        }
    }
}


text:
package org.uberfire.backend.plugin;

/**
 * A simple marker to keep track of all plugins processors.
 */
public interface PluginProcessor {

    /**
     * Checks if a plugin file has the valid extension
     * @param fileName the file name of the plugin
     */
    static boolean isAValidPluginFileExtension(String fileName) {

        for (PluginProcessorType type : PluginProcessorType.values()) {
            if (fileName.endsWith(type.getExtension())) {
                return true;
            }
        }
        return false;
    }

    /**
     * Checks if this processor should process a given plugin
     * @param pluginName the name of the plugin, must not be null.
     */
    boolean shouldProcess(String pluginName);

    /**
     * Removes all plugins from this processor.
     */
    void removeAll();

    /**
     * Processes a deployed plugin and optionally notifies clients
     * @param pluginName the name of the plugin, must not be null.
     * @param pluginDeploymentDir the directory to deploy plugin contents to, must not be null.
     * @param notifyClients trigger a event after plugin processing
     */
    void process(String pluginName,
                 String pluginDeploymentDir,
                 boolean notifyClients);

    /**
     * Checks if a plugin with the given name is registered.
     * @param pluginName the name of the plugin, must not be null.
     * @return true if registered, otherwise false.
     */
    boolean isRegistered(String pluginName);

    enum PluginProcessorType {
        GWT("nocache.js",
            false),
        PERSPECTIVE_EDITOR("layout.json",
                           true),
        HTML_TEMPLATE(".html",
                      true),
        JS(".js",
           true);

        private String extension;
        private boolean isRuntimePlugin;

        PluginProcessorType(String extension,
                            boolean isRuntimePlugin) {
            this.extension = extension;
            this.isRuntimePlugin = isRuntimePlugin;
        }

        public String getExtension() {
            return extension;
        }

        public boolean isRuntimePlugin() {
            return isRuntimePlugin;
        }
    }
}


text:
module SpecMixin
  include Snapcrawl::LogHelpers

  def fresh_logger
    spec_logger = StringIO.new
    $logger = Logger.new spec_logger
    $logger.formatter = log_formatter
    spec_logger
  end
end


text:
'use strict';

var _ = require('lodash'),
    bindAllTo = require('./utils').bindAllTo,
    async = require('async');

function ComponentCreator(component, dependencies) {
  _.extend(this, {
    component: component,
    dependencies: dependencies
  });
}

_.extend(ComponentCreator.prototype, {

  buildBase: function (base, cb) {
    var deps = this.dependencies;

    if (!base) return cb(null, null);

    if (_.isFunction(base)) {
      // async detection à la mocha
      // see - http://stackoverflow.com/questions/13570485/how-does-mocha-know-to-wait-and-timeout-only-with-my-asynchronous-tests
      if (base.length === 2) return base(deps, cb);

      try {
        cb(null, base(deps));
      } catch (e) {
        cb(e);
      }

      return;
    }

    cb(null, base);
  },

  initialize: function (base, asyncCb) {
    var c = this.component,
        izr = c.initializer,
        deps = this.dependencies;

    if (!izr) return asyncCb(null, base);

    // if initializer is specified as a string, it would be a method on
    // the base
    izr = (_.isString(izr)) ? base[izr] : izr;

    function safelyGetValue(err, r) {
      if (err) return asyncCb(err);

      asyncCb(null, (r || base));
    }

    // async initializer detection à la mocha
    if (izr.length === 2) return izr.call(base, deps, safelyGetValue);

    try {
      safelyGetValue(null, izr.call(base, deps));
    } catch (e) {
      asyncCb(e);
    }
  },

  creationSequence: function () {
    throw new Error('not implemented exception');
  },

  create: function (cb) {
    // build and run the assembly sequence in a waterfall
    async.waterfall(bindAllTo(this, this.creationSequence()), function (err, r) {
      cb(err, r);
    });
  }

});

module.exports = ComponentCreator;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using PointsTracker;

namespace PointsTrackerWindowsPhone
{
    public partial class HistoryPage : PhoneApplicationPage
    {
        public HistoryPage()
        {
            InitializeComponent();
            DataContext = new HistoryViewModel();
        }
    }
}


text:
#ifndef BOOST_CONVERT_PARAMETERS_HPP
#define BOOST_CONVERT_PARAMETERS_HPP

#include <boost/convert/detail/boost_parameter_ext.hpp>

namespace boost
{
    namespace cnv
    {
        struct adjust { enum type { left, right, center };};
        struct base { enum type { bin =2, dec =10, hex =16, oct =8 };};
        struct notation { enum type { fixed, scientific };};

        namespace parameter
        {
            BOOST_PARAMETER_KEYWORD(type,     adjust)
            BOOST_PARAMETER_KEYWORD(type,       base)
            BOOST_PARAMETER_KEYWORD(type,       fill)
            BOOST_PARAMETER_KEYWORD(type,     locale)
            BOOST_PARAMETER_KEYWORD(type,   notation)
            BOOST_PARAMETER_KEYWORD(type,  precision)
            BOOST_PARAMETER_KEYWORD(type,     skipws)
            BOOST_PARAMETER_KEYWORD(type,  uppercase)
            BOOST_PARAMETER_KEYWORD(type,      width)
        }
    }
}

#endif // BOOST_CONVERT_PARAMETERS_HPP


text:
from __future__ import absolute_import, division, print_function

import multiprocessing
import pickle
import sys

from .async import get_async  # TODO: get better get
from .context import _globals
from .optimize import fuse, cull

import cloudpickle

if sys.version_info.major < 3:
    import copy_reg as copyreg
else:
    import copyreg

def _reduce_method_descriptor(m):
    return getattr, (m.__objclass__, m.__name__)

# type(set.union) is used as a proxy to <class 'method_descriptor'>
copyreg.pickle(type(set.union), _reduce_method_descriptor)

def _dumps(x):
    return cloudpickle.dumps(x, protocol=pickle.HIGHEST_PROTOCOL)

_loads = pickle.loads

def _process_get_id():
    return multiprocessing.current_process().ident

def get(dsk, keys, num_workers=None, func_loads=None, func_dumps=None,
        optimize_graph=True, **kwargs):
    """ Multiprocessed get function appropriate for Bags

    Parameters
    ----------
    dsk : dict
        dask graph
    keys : object or list
        Desired results from graph
    num_workers : int
        Number of worker processes (defaults to number of cores)
    func_dumps : function
        Function to use for function serialization
        (defaults to cloudpickle.dumps)
    func_loads : function
        Function to use for function deserialization
        (defaults to cloudpickle.loads)
    optimize_graph : bool
        If True [default], `fuse` is applied to the graph before computation.
    """
    pool = _globals['pool']
    if pool is None:
        pool = multiprocessing.Pool(num_workers)
        cleanup = True
    else:
        cleanup = False

    # Optimize Dask
    dsk2, dependencies = cull(dsk, keys)
    if optimize_graph:
        dsk3, dependencies = fuse(dsk2, keys, dependencies)
    else:
        dsk3 = dsk2

    # We specify marshalling functions in order to catch serialization
    # errors and report them to the user.
    loads = func_loads or _globals.get('func_loads') or _loads
    dumps = func_dumps or _globals.get('func_dumps') or _dumps

    # Note former versions used a multiprocessing Manager to share
    # a Queue between parent and workers, but this is fragile on Windows
    # (issue #1652).
    try:
        # Run
        result = get_async(pool.apply_async, len(pool._pool), dsk3, keys,
                           get_id=_process_get_id,
                           dumps=dumps, loads=loads, **kwargs)
    finally:
        if cleanup:
            pool.close()
    return result


text:
package clonerefs

import (
	"bytes"
	"encoding/json"
	"errors"
	"flag"
	"fmt"
	"strings"
	"text/template"

	"k8s.io/apimachinery/pkg/util/sets"
	prowapi "k8s.io/test-infra/prow/apis/prowjobs/v1"
)

// Options configures the clonerefs tool
// completely and may be provided using JSON
// or user-specified flags, but not both.
type Options struct {
	// SrcRoot is the root directory under which
	// all source code is cloned
	SrcRoot string `json:"src_root"`
	// Log is the log file to which clone records are written
	Log string `json:"log"`

	// GitUserName is an optional field that is used with
	// `git config user.name`
	GitUserName string `json:"git_user_name,omitempty"`
	// GitUserEmail is an optional field that is used with
	// `git config user.email`
	GitUserEmail string `json:"git_user_email,omitempty"`

	// GitRefs are the refs to clone
	GitRefs []prowapi.Refs `json:"refs"`
	// KeyFiles are files containing SSH keys to be used
	// when cloning. Will be added to `ssh-agent`.
	KeyFiles []string `json:"key_files,omitempty"`

	// OauthTokenFile is the path of a file that contains an OAuth token.
	OauthTokenFile string `json:"oauth_token_file,omitempty"`

	// HostFingerPrints are ssh-keyscan host fingerprint lines to use
	// when cloning. Will be added to ~/.ssh/known_hosts
	HostFingerprints []string `json:"host_fingerprints,omitempty"`

	// MaxParallelWorkers determines how many repositories
	// can be cloned in parallel. If 0, interpreted as no
	// limit to parallelism
	MaxParallelWorkers int `json:"max_parallel_workers,omitempty"`

	Fail bool `json:"fail,omitempty"`

	// used to hold flag values
	refs       gitRefs
	clonePath  orgRepoFormat
	cloneURI   orgRepoFormat
	keys       stringSlice
	CookiePath string `json:"cookie_path,omitempty"`
}

// Validate ensures that the configuration options are valid
func (o *Options) Validate() error {
	if o.SrcRoot == "" {
		return errors.New("no source root specified")
	}

	if o.Log == "" {
		return errors.New("no log file specified")
	}

	if len(o.GitRefs) == 0 {
		return errors.New("no refs specified to clone")
	}

	seen := map[string]sets.String{}
	for _, ref := range o.GitRefs {
		if _, seenOrg := seen[ref.Org]; seenOrg {
			if seen[ref.Org].Has(ref.Repo) {
				return fmt.Errorf("sync config for %s/%s provided more than once", ref.Org, ref.Repo)
			}
			seen[ref.Org].Insert(ref.Repo)
		} else {
			seen[ref.Org] = sets.NewString(ref.Repo)
		}
	}

	return nil
}

const (
	// JSONConfigEnvVar is the environment variable that
	// clonerefs expects to find a full JSON configuration
	// in when run.
	JSONConfigEnvVar = "CLONEREFS_OPTIONS"
	// DefaultGitUserName is the default name used in git config
	DefaultGitUserName = "ci-robot"
	// DefaultGitUserEmail is the default email used in git config
	DefaultGitUserEmail = "ci-robot@k8s.io"
)

// ConfigVar exposes the environment variable used
// to store serialized configuration
func (o *Options) ConfigVar() string {
	return JSONConfigEnvVar
}

// LoadConfig loads options from serialized config
func (o *Options) LoadConfig(config string) error {
	return json.Unmarshal([]byte(config), o)
}

// Complete internalizes command line arguments
func (o *Options) Complete(args []string) {
	o.GitRefs = o.refs.gitRefs
	o.KeyFiles = o.keys.data

	for _, ref := range o.GitRefs {
		alias, err := o.clonePath.Execute(OrgRepo{Org: ref.Org, Repo: ref.Repo})
		if err != nil {
			panic(err)
		}
		ref.PathAlias = alias

		alias, err = o.cloneURI.Execute(OrgRepo{Org: ref.Org, Repo: ref.Repo})
		if err != nil {
			panic(err)
		}
		ref.CloneURI = alias
	}
}

// AddFlags adds flags to the FlagSet that populate
// the GCS upload options struct given.
func (o *Options) AddFlags(fs *flag.FlagSet) {
	fs.StringVar(&o.SrcRoot, "src-root", "", "Where to root source checkouts")
	fs.StringVar(&o.Log, "log", "", "Where to write logs")
	fs.StringVar(&o.GitUserName, "git-user-name", DefaultGitUserName, "Username to set in git config")
	fs.StringVar(&o.GitUserEmail, "git-user-email", DefaultGitUserEmail, "Email to set in git config")
	fs.Var(&o.refs, "repo", "Mapping of Git URI to refs to check out, can be provided more than once")
	fs.Var(&o.keys, "ssh-key", "Path to SSH key to enable during cloning, can be provided more than once")
	fs.Var(&o.clonePath, "clone-alias", "Format string for the path to clone to")
	fs.Var(&o.cloneURI, "uri-prefix", "Format string for the URI prefix to clone from")
	fs.IntVar(&o.MaxParallelWorkers, "max-workers", 0, "Maximum number of parallel workers, unset for unlimited.")
	fs.StringVar(&o.CookiePath, "cookiefile", "", "Path to git http.cookiefile")
	fs.BoolVar(&o.Fail, "fail", false, "Exit with failure if any of the refs can't be fetched.")
}

type gitRefs struct {
	gitRefs []prowapi.Refs
}

func (r *gitRefs) String() string {
	representation := bytes.Buffer{}
	for _, ref := range r.gitRefs {
		fmt.Fprintf(&representation, "%s,%s=%s", ref.Org, ref.Repo, ref.String())
	}
	return representation.String()
}

// Set parses out a prowapi.Refs from the user string.
// The following example shows all possible fields:
//   org,repo=base-ref:base-sha[,pull-number:pull-sha]...
// For the base ref and every pull number, the SHAs
// are optional and any number of them may be set or
// unset.
func (r *gitRefs) Set(value string) error {
	gitRef, err := ParseRefs(value)
	if err != nil {
		return err
	}
	r.gitRefs = append(r.gitRefs, *gitRef)
	return nil
}

type stringSlice struct {
	data []string
}

func (r *stringSlice) String() string {
	return strings.Join(r.data, ",")
}

// Set records the value passed
func (r *stringSlice) Set(value string) error {
	r.data = append(r.data, value)
	return nil
}

type orgRepoFormat struct {
	raw    string
	format *template.Template
}

func (a *orgRepoFormat) String() string {
	return a.raw
}

// Set parses out overrides from user input
func (a *orgRepoFormat) Set(value string) error {
	templ, err := template.New("format").Parse(value)
	if err != nil {
		return err
	}
	a.raw = value
	a.format = templ
	return nil
}

// OrgRepo hold both an org and repo name.
type OrgRepo struct {
	Org, Repo string
}

func (a *orgRepoFormat) Execute(data OrgRepo) (string, error) {
	if a.format != nil {
		output := bytes.Buffer{}
		err := a.format.Execute(&output, data)
		return output.String(), err
	}
	return "", nil
}

// Encode will encode the set of options in the format that
// is expected for the configuration environment variable
func Encode(options Options) (string, error) {
	encoded, err := json.Marshal(options)
	return string(encoded), err
}


text:
#include "asylo/platform/arch/sgx/untrusted/sgx_client.h"

#include "asylo/enclave.pb.h"
#include "asylo/platform/primitives/sgx/loader.pb.h"

namespace asylo {

EnclaveLoadConfig SgxLoader::GetEnclaveLoadConfig() const {
  EnclaveLoadConfig load_config;
  SgxLoadConfig sgx_config;
  SgxLoadConfig::FileEnclaveConfig file_enclave_config;
  file_enclave_config.set_enclave_path(enclave_path_);
  *sgx_config.mutable_file_enclave_config() = file_enclave_config;
  sgx_config.set_debug(debug_);
  *load_config.MutableExtension(sgx_load_config) = sgx_config;
  return load_config;
}

EnclaveLoadConfig SgxEmbeddedLoader::GetEnclaveLoadConfig() const {
  EnclaveLoadConfig load_config;
  SgxLoadConfig sgx_config;
  SgxLoadConfig::EmbeddedEnclaveConfig embedded_enclave_config;
  embedded_enclave_config.set_section_name(section_name_);
  *sgx_config.mutable_embedded_enclave_config() = embedded_enclave_config;
  sgx_config.set_debug(debug_);
  *load_config.MutableExtension(sgx_load_config) = sgx_config;
  return load_config;
}
}  //  namespace asylo


text:
@interface BOXWelcomeViewController : UIViewController <BOXItemPickerDelegate, BOXSignViewControllerDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>

@end


text:
pwd=`pwd`
cd "${0%/*}"
java -Xmx512M -cp libs/robocode.jar:libs/roborumble.jar:libs/codesize-1.1.jar roborumble.RoboRumbleAtHome ./roborumble/twinduul.txt
cd "${pwd}"


text:
module Qr
  class QrPresenter < Qdc::VersesPresenter
    AUTHOR_FIELDS = [
      'verified',
      'avatar_url',
      'bio',
      'user_type',
      'followers_count',
      'followings_count',
      'created_at',
      'updated_at',
      'posts_count',
      'comments_count'
    ].freeze

    COMMENTS_FIELDS = [
      'body',
      'html_body',
      'created_at',
      'updated_at',
      'replies_count'
    ].freeze

    def author_fields
      if (fields = params[:author_fields]).presence
        fields = sanitize_query_fields(fields.split(','))

        fields.select do |field|
          AUTHOR_FIELDS.include?(field)
        end
      else
        []
      end
    end

    def comment_fields
      if (fields = params[:comment_fields]).presence
        fields = sanitize_query_fields(fields.split(','))

        fields.select do |field|
          COMMENTS_FIELDS.include?(field)
        end
      else
        []
      end
    end

    def render_comments?
      lookahead.selects?(:comments)
    end

    def render_replies?
      lookahead.selects?(:replies)
    end

    def render_author?
      lookahead.selects?(:author)
    end
  end
end


text:
package org.nd4j.linalg.dimensionalityreduction;

import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.eigen.Eigen;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.indexing.NDArrayIndex;
import org.nd4j.linalg.ops.transforms.Transforms;

/**
 * PCA class for dimensionality reduction and general analysis
 *
 * @author Adam Gibson
 * @author Luke Czapla - added methods used in non-static usage of PCA
 */
public class PCA {

    private INDArray covarianceMatrix, mean, eigenvectors, eigenvalues;

    private PCA() {}

    /**
     * Create a PCA instance with calculated data: covariance, mean, eigenvectors, and eigenvalues.
     * @param dataset The set of data (records) of features, each row is a data record and each
     *                column is a feature, every data record has the same number of features.
     */
    public PCA(INDArray dataset) {
        INDArray[] covmean = covarianceMatrix(dataset);
        this.covarianceMatrix = covmean[0];
        this.mean = covmean[1];
        INDArray[] pce = principalComponents(covmean[0]);
        this.eigenvectors = pce[0];
        this.eigenvalues = pce[1];
    }

    /**
     * Return a reduced basis set that covers a certain fraction of the variance of the data
     * @param variance The desired fractional variance (0 to 1), it will always be greater than the value.
     * @return The basis vectors as columns, size N rows by ndims columns, where ndims is less than or equal to N
     */
    public INDArray reducedBasis(double variance) {
        INDArray vars = Transforms.pow(eigenvalues, -0.5, true);
        double res = vars.sumNumber().doubleValue();
        double total = 0.0;
        int ndims = 0;
        for (int i = 0; i < vars.columns(); i++) {
            ndims++;
            total += vars.getDouble(i);
            if (total/res > variance) break;
        }
        INDArray result = Nd4j.create(eigenvectors.rows(), ndims);
        for (int i = 0; i < ndims; i++) result.putColumn(i, eigenvectors.getColumn(i));
        return result;
    }

    /**
     * Takes a set of data on each row, with the same number of features as the constructing data
     * and returns the data in the coordinates of the basis set about the mean.
     * @param data Data of the same features used to construct the PCA object
     * @return The record in terms of the principal component vectors, you can set unused ones to zero.
     */
    public INDArray convertToComponents(INDArray data) {
        INDArray dx = data.subRowVector(mean);
        return Nd4j.tensorMmul(eigenvectors.transpose(), dx, new int[][] {{1},{1}}).transposei();
    }

    /**
     * Take the data that has been transformed to the principal components about the mean and
     * transform it back into the original feature set.  Make sure to fill in zeroes in columns
     * where components were dropped!
     * @param data Data of the same features used to construct the PCA object but as the components
     * @return The records in terms of the original features
     */
    public INDArray convertBackToFeatures(INDArray data) {
        return Nd4j.tensorMmul(eigenvectors, data, new int[][] {{1}, {1}}).transposei().addiRowVector(mean);
    }

    /**
     * Estimate the variance of a single record with reduced # of dimensions.
     * @param data A single record with the same N features as the constructing data set
     * @param ndims The number of dimensions to include in calculation
     * @return The fraction (0 to 1) of the total variance covered by the ndims basis set.
     */
    public double estimateVariance(INDArray data, int ndims) {
        INDArray dx = data.sub(mean);
        INDArray v = eigenvectors.transpose().mmul(dx.reshape(dx.columns(), 1));
        INDArray t2 = Transforms.pow(v, 2);
        double fraction = t2.get(NDArrayIndex.interval(0,ndims)).sumNumber().doubleValue();
        double total = t2.sumNumber().doubleValue();
        return fraction/total;
    }

    /**
     * Generates a set of count random samples with the same variance and mean and eigenvector/values
     * as the data set used to initialize the PCA object, with same number of features N.
     * @param count The number of samples to generate
     * @return A matrix of size count rows by N columns
     */
    public INDArray generateGaussianSamples(int count) {
        INDArray samples = Nd4j.randn(count, eigenvalues.columns());
        INDArray factors = Transforms.pow(eigenvalues, -0.5, true);
        samples.muliRowVector(factors);
        return Nd4j.tensorMmul(eigenvectors, samples, new int[][] {{1}, {1}}).transposei().addiRowVector(mean);
    }

    /**
     * Calculates pca vectors of a matrix, for a fixed number of reduced features
     * returns the reduced feature set
     * The return is a projection of A onto principal nDims components
     *
     * To use the PCA: assume A is the original feature set
     * then project A onto a reduced set of features. It is possible to
     * reconstruct the original data ( losing information, but having the same
     * dimensionality )
     *
     *

     * {@code
     *
     * INDArray Areduced = A.mmul( factor ) ;
     * INDArray Aoriginal = Areduced.mmul( factor.transpose() ) ;
     *
     * }
     *

     *
     * @param A the array of features, rows are results, columns are features - will be changed
     * @param nDims the number of components on which to project the features
     * @param normalize whether to normalize (adjust each feature to have zero mean)
     * @return the reduced parameters of A
     */
    public static INDArray pca(INDArray A, int nDims, boolean normalize) {
        INDArray factor = pca_factor(A, nDims, normalize);
        return A.mmul(factor);
    }

    /**
     * Calculates pca factors of a matrix, for a fixed number of reduced features
     * returns the factors to scale observations
     *
     * The return is a factor matrix to reduce (normalized) feature sets
     *
     * @see pca(INDArray, int, boolean)
     *
     * @param A the array of features, rows are results, columns are features - will be changed
     * @param nDims the number of components on which to project the features
     * @param normalize whether to normalize (adjust each feature to have zero mean)
     * @return the reduced feature set
     */
    public static INDArray pca_factor(INDArray A, int nDims, boolean normalize) {

        if (normalize) {
            // Normalize to mean 0 for each feature ( each column has 0 mean )
            INDArray mean = A.mean(0);
            A.subiRowVector(mean);
        }

        int m = A.rows();
        int n = A.columns();

        // The prepare SVD results, we'll decomp A to UxSxV'
        INDArray s = Nd4j.create(m < n ? m : n);
        INDArray VT = Nd4j.create(n, n, 'f');

        // Note - we don't care about U
        Nd4j.getBlasWrapper().lapack().gesvd(A, s, null, VT);

        // for comparison k & nDims are the equivalent values in both methods implementing PCA

        // So now let's rip out the appropriate number of left singular vectors from
        // the V output (note we pulls rows since VT is a transpose of V)
        INDArray V = VT.transpose();
        INDArray factor = Nd4j.create(n, nDims, 'f');
        for (int i = 0; i < nDims; i++) {
            factor.putColumn(i, V.getColumn(i));
        }

        return factor;
    }

    /**
     * Calculates pca reduced value of a matrix, for a given variance. A larger variance (99%)
     * will result in a higher order feature set.
     *
     * The returned matrix is a projection of A onto principal components
     *
     * @see pca(INDArray, int, boolean)
     *
     * @param A the array of features, rows are results, columns are features - will be changed
     * @param variance the amount of variance to preserve as a float 0 - 1
     * @param normalize whether to normalize (set features to have zero mean)
     * @return the matrix representing  a reduced feature set
     */
    public static INDArray pca(INDArray A, double variance, boolean normalize) {
        INDArray factor = pca_factor(A, variance, normalize);
        return A.mmul(factor);
    }

    /**
     * Calculates pca vectors of a matrix, for a given variance. A larger variance (99%)
     * will result in a higher order feature set.
     *
     * To use the returned factor: multiply feature(s) by the factor to get a reduced dimension
     *
     * INDArray Areduced = A.mmul( factor ) ;
     *
     * The array Areduced is a projection of A onto principal components
     *
     * @see pca(INDArray, double, boolean)
     *
     * @param A the array of features, rows are results, columns are features - will be changed
     * @param variance the amount of variance to preserve as a float 0 - 1
     * @param normalize whether to normalize (set features to have zero mean)
     * @return the matrix to mulitiply a feature by to get a reduced feature set
     */
    public static INDArray pca_factor(INDArray A, double variance, boolean normalize) {
        if (normalize) {
            // Normalize to mean 0 for each feature ( each column has 0 mean )
            INDArray mean = A.mean(0);
            A.subiRowVector(mean);
        }

        int m = A.rows();
        int n = A.columns();

        // The prepare SVD results, we'll decomp A to UxSxV'
        INDArray s = Nd4j.create(m < n ? m : n);
        INDArray VT = Nd4j.create(n, n, 'f');

        // Note - we don't care about U
        Nd4j.getBlasWrapper().lapack().gesvd(A, s, null, VT);

        // Now convert the eigs of X into the eigs of the covariance matrix
        for (int i = 0; i < s.length(); i++) {
            s.putScalar(i, Math.sqrt(s.getDouble(i)) / (m - 1));
        }

        // Now find how many features we need to preserve the required variance
        // Which is the same percentage as a cumulative sum of the eigenvalues' percentages
        double totalEigSum = s.sumNumber().doubleValue() * variance;
        int k = -1; // we will reduce to k dimensions
        double runningTotal = 0;
        for (int i = 0; i < s.length(); i++) {
            runningTotal += s.getDouble(i);
            if (runningTotal >= totalEigSum) { // OK I know it's a float, but what else can we do ?
                k = i + 1; // we will keep this many features to preserve the reqd. variance
                break;
            }
        }
        if (k == -1) { // if we need everything
            throw new RuntimeException("No reduction possible for reqd. variance - use smaller variance");
        }
        // So now let's rip out the appropriate number of left singular vectors from
        // the V output (note we pulls rows since VT is a transpose of V)
        INDArray V = VT.transpose();
        INDArray factor = Nd4j.create(n, k, 'f');
        for (int i = 0; i < k; i++) {
            factor.putColumn(i, V.getColumn(i));
        }

        return factor;
    }

    /**
     * This method performs a dimensionality reduction, including principal components
     * that cover a fraction of the total variance of the system.  It does all calculations
     * about the mean.
     * @param in A matrix of datapoints as rows, where column are features with fixed number N
     * @param variance The desired fraction of the total variance required
     * @return The reduced basis set
     */
    public static INDArray pca2(INDArray in, double variance) {
        // let's calculate the covariance and the mean
        INDArray[] covmean = covarianceMatrix(in);
        // use the covariance matrix (inverse) to find "force constants" and then break into orthonormal
        // unit vector components
        INDArray[] pce = principalComponents(covmean[0]);
        // calculate the variance of each component
        INDArray vars = Transforms.pow(pce[1], -0.5, true);
        double res = vars.sumNumber().doubleValue();
        double total = 0.0;
        int ndims = 0;
        for (int i = 0; i < vars.columns(); i++) {
            ndims++;
            total += vars.getDouble(i);
            if (total/res > variance) break;
        }
        INDArray result = Nd4j.create(in.columns(), ndims);
        for (int i = 0; i < ndims; i++) result.putColumn(i, pce[0].getColumn(i));
        return result;
    }

    /**
     * Returns the covariance matrix of a data set of many records, each with N features.
     * It also returns the average values, which are usually going to be important since in this
     * version, all modes are centered around the mean.  It's a matrix that has elements that are
     * expressed as average dx_i * dx_j (used in procedure) or average x_i * x_j - average x_i * average x_j
     *
     * @param in A matrix of vectors of fixed length N (N features) on each row
     * @return INDArray[2], an N x N covariance matrix is element 0, and the average values is element 1.
     */
    public static INDArray[] covarianceMatrix(INDArray in) {
        int dlength = in.rows();
        int vlength = in.columns();

        INDArray sum = Nd4j.create(vlength);
        INDArray product = Nd4j.create(vlength, vlength);

        for (int i = 0; i < vlength; i++)
            sum.getColumn(i).assign(in.getColumn(i).sumNumber().doubleValue()/dlength);

        for (int i = 0; i < dlength; i++) {
            INDArray dx1 = in.getRow(i).sub(sum);
            product.addi(dx1.reshape(vlength,1).mmul(dx1.reshape(1,vlength)));
        }
        product.divi(dlength);
        return new INDArray[] {product, sum};
    }

    /**
     * Calculates the principal component vectors and their eigenvalues (lambda) for the covariance matrix.
     * The result includes two things: the eigenvectors (modes) as result[0] and the eigenvalues (lambda)
     * as result[1].
     *
     * @param cov The covariance matrix (calculated with the covarianceMatrix(in) method)
     * @return Array INDArray[2] "result".  The principal component vectors in decreasing flexibility are
     *      the columns of element 0 and the eigenvalues are element 1.
     */
    public static INDArray[] principalComponents(INDArray cov) {
        assert cov.rows() == cov.columns();
        INDArray[] result = new INDArray[2];
        result[0] = Nd4j.eye(cov.rows());
        result[1] = Eigen.symmetricGeneralizedEigenvalues(result[0], cov, true);
        return result;
    }

    public INDArray getCovarianceMatrix() {
        return covarianceMatrix;
    }

    public INDArray getMean() {
        return mean;
    }

    public INDArray getEigenvectors() {
        return eigenvectors;
    }

    public INDArray getEigenvalues() {
        return eigenvalues;
    }

}


text:
using RemotePlusLibrary.Extension;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RSPM")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RSPM")]
[assembly: AssemblyCopyright("Copyright ©  2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ExtensionLibrary(null, "RSPM",
    FriendlyName = "RemotePlus Package Manager",
    LibraryType = RemotePlusLibrary.Core.NetworkSide.Server | RemotePlusLibrary.Core.NetworkSide.Proxy | RemotePlusLibrary.Core.NetworkSide.Client)]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d451d8d4-dc69-42a8-baac-97363c35f478")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


text:
import mimetypes

from django.conf import settings as django_settings
from django.http import HttpResponse, HttpResponseNotModified, Http404
from django.contrib.staticfiles.views import serve as staticfiles_serve
from django.views import static

from staticassets import finder, settings
from .exceptions import AssetNotFound

def serve(request, path, **kwargs):
    mimetype, encoding = mimetypes.guess_type(path)
    if not mimetype in settings.MIMETYPES.values():
        try:
            return staticfiles_serve(request, path, **kwargs)
        except Http404:
            return static.serve(request, path, document_root=django_settings.STATIC_ROOT)

    bundle = request.GET.get('bundle') in ('1', 't', 'true') or not settings.DEBUG
    try:
        asset = finder.find(path, bundle=bundle)
    except AssetNotFound:
        return static.serve(request, path, document_root=django_settings.STATIC_ROOT)

    # Respect the If-Modified-Since header.
    modified_since = request.META.get('HTTP_IF_MODIFIED_SINCE')
    if not static.was_modified_since(modified_since, asset.mtime, asset.size):
        return HttpResponseNotModified(content_type=asset.attributes.content_type)

    response = HttpResponse(asset.content, content_type=asset.attributes.content_type)
    response['Last-Modified'] = static.http_date(asset.mtime)
    response['Content-Length'] = asset.size

    return response


text:
package com.bupt.poirot.z3.main;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.microsoft.z3.ArithExpr;
import com.microsoft.z3.BoolExpr;
import com.microsoft.z3.Context;
import com.microsoft.z3.Expr;
import com.microsoft.z3.FuncDecl;
import com.microsoft.z3.IntExpr;
import com.microsoft.z3.Model;
import com.microsoft.z3.Solver;
import com.microsoft.z3.Sort;
import com.microsoft.z3.Status;
import com.microsoft.z3.Z3Exception;

public class SatisfiableWithString {
	private static HashMap<String, String> cfg ;
	private static Context ctx ;
	private static Solver solver;
	public SatisfiableWithString() {
		// TODO Auto-generated constructor stub
		 cfg = new HashMap<String, String>();
		 ctx = new Context(cfg);
		 solver = ctx.mkSolver();
	}
	public static String getSatifiable(String string) throws Z3Exception {

		String[] exprStrings = string.split("\\^");

		for (int i = 0; i < exprStrings.length; i++) {
			System.out.println(exprStrings[i]);
		}

		Pattern pattern = Pattern.compile("[0-9]*");
		Matcher isNum0,isNum1;
		String[] subStrings;
		List<BoolExpr> checkExprs = new ArrayList<BoolExpr>();
		for (int i = 0; i < exprStrings.length; i++) {
			//checkExprs[i] =
			String temp = exprStrings[i];//为每一个子表达式建立BoolExpr,如  x<y
			if (temp.indexOf(">=")!=-1) {
				subStrings = temp.split(">=");
				if (subStrings.length>2) { //如果不是x>=y的模式,
					System.out.println("incorrect formula");
					return "wrong expression";
				}
				isNum0 = pattern.matcher(subStrings[0]);
				isNum1 = pattern.matcher(subStrings[1]);
				if(!isNum0.matches() && !isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkIntConst(subStrings[1]);

					BoolExpr tempBoolExpr = ctx.mkGe(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}else if(!isNum0.matches() && isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkInt(subStrings[1]);
					//intExprSet.add(temp1);
					BoolExpr tempBoolExpr = ctx.mkGe(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}else {
					return "wrong expression";
				}
			}else if (temp.indexOf("<=")!=-1) {
				subStrings = temp.split("<=");
				if (subStrings.length>2) { //如果不是 x<=y 的模式,
					System.out.println("incorrect formula");
					return "wrong expression";
				}
				isNum0 = pattern.matcher(subStrings[0]);
				isNum1 = pattern.matcher(subStrings[1]);
				if(!isNum0.matches() && !isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkIntConst(subStrings[1]);

					BoolExpr tempBoolExpr = ctx.mkLe(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}
				else if(!isNum0.matches() && isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkInt(subStrings[1]);
					//intExprSet.add(temp1);
					BoolExpr tempBoolExpr = ctx.mkLe(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}else {
					return "wrong expression";
				}

			}else if (temp.indexOf("<")!=-1) {
				subStrings = temp.split("<");
				if (subStrings.length>2) { //如果不是 x<=y 的模式,
					System.out.println("incorrect formula");
					return "wrong expression";
				}
				isNum0 = pattern.matcher(subStrings[0]);
				isNum1 = pattern.matcher(subStrings[1]);
				if(!isNum0.matches() && !isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkIntConst(subStrings[1]);

					BoolExpr tempBoolExpr = ctx.mkLt(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}else if(!isNum0.matches() && isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkInt(subStrings[1]);

					BoolExpr tempBoolExpr = ctx.mkLt(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}else {
					return "wrong expression";
				}
			}else if (temp.indexOf(">")!=-1) {
				subStrings = temp.split(">");
				if (subStrings.length>2) { //如果不是 x<=y 的模式,
					System.out.println("incorrect formula");
					return "wrong expression";
				}
				isNum0 = pattern.matcher(subStrings[0]);
				isNum1 = pattern.matcher(subStrings[1]);
				if(!isNum0.matches() && !isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkIntConst(subStrings[1]);

					BoolExpr tempBoolExpr = ctx.mkGt(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}else if(!isNum0.matches() && isNum1.matches()){
					IntExpr temp0 = ctx.mkIntConst(subStrings[0]);

					IntExpr temp1 = ctx.mkInt(subStrings[1]);
					//intExprSet.add(temp1);
					BoolExpr tempBoolExpr = ctx.mkGt(temp0, temp1);
					checkExprs.add(tempBoolExpr);
				}else {
					return "wrong expression";
				}
			}else {
				return "wrong expression";
			}
		}
		solver.reset();
		solver.push();
		for (int i = 0; i < checkExprs.size(); i++) {
			solver.add(checkExprs.get(i));
		}
		if (solver.check() == Status.SATISFIABLE) {
			Model m = solver.getModel();
			System.out.println(m.toString());
			return "SATISFIABLE";
		}else {
			return "UNSATISFIABLE";
		}
	}

	public static void main(String[] args){
//		System.out.println(getSatifiable("x<=10^y>=10^x>=y"));
	}
}


text:
package io.github.lukehutch.fastclasspathscanner.matchprocessor;

/** The method to run when a subclass of a specific class is found on the classpath. */
//@FunctionalInterface
public interface SubclassMatchProcessor<T> {
    public void processMatch(Class<? extends T> matchingClass);
}