text:
package com.percipient24.cgc.entities;

import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.physics.box2d.Body;
import com.percipient24.helpers.LayerHandler;
import com.percipient24.cgc.CGCWorld;
import com.percipient24.cgc.entities.players.Player;
import com.percipient24.enums.EntityType;

/*
 * Handles the logic for a train car entity
 *
 * @version 0.2 14/2/4
 * @author Christopher Rider
 * @author Clayton Andrews
 */
public class TrainCar extends RotatableEntity
{
	private boolean horizontalMovement = true;		//otherwise vertical movement; assumes left to right and top to bottom
	private boolean reverse_direction = false;		//flag for flipping movement direction
	private boolean offCamera = false;

	/*
	 * Creates a new TrainCar object
	 *
	 * @param newLowAnimation		The Animation for the bottom of this object
	 * @param newMidAnimation		The Animation for the middle of this object
	 * @param newHighAnimation		The Animation for the top of this object
	 * @param pEntityType			The type of entity this object is
	 * @param attachedBody			The Body object that represents this GameEntity in the world
	 * @param left					Whether this is going left to right (true) or right to left (false)
	 */
	public TrainCar(Animation newLowAnimation, Animation newMidAnimation,
					Animation newHighAnimation, EntityType pEntityType,
					Body attachedBody, boolean left)
	{
		super(newLowAnimation, newMidAnimation, newHighAnimation, pEntityType, attachedBody);

		reverse_direction = left; //TODO: actually need to change how the constructor works for this value
		// These numbers are calculated based on the texture dimensions of the associated art asset.
		// The relationship is: 1.0f in world space is 96x96 in pixels (see art asset to get dimensions)
		// By default, half-width and half-height are calculated based on the base image's dimensions
		// when rotated/aligned horizontally.
		//halfWidth = -2.5f;
		//halfHeight = -0.75f;

		if(!horizontalMovement)
		{
			if(!reverse_direction)
			{
				this.rotation = 90;
			}
			else
			{
				this.rotation = 270;
			}
		}
		else
		{
			if (!reverse_direction)
			{
				this.rotation = 180;
			}
		}
	}

	/*
	 * Creates a new TrainCar object
	 *
	 * @param newLowAnimation		The Animation for the bottom of this object
	 * @param newMidAnimation		The Animation for the middle of this object
	 * @param newHighAnimation		The Animation for the top of this object
	 * @param pEntityType			The type of entity this object is
	 * @param attachedBody			The Body object that represents this GameEntity in the world
	 * @param left					Whether this is going left to right (true) or right to left (false)
	 * @param startAlpha			The starting alpha for this entity
	 */
	public TrainCar(Animation newLowAnimation, Animation newMidAnimation,
			Animation newHighAnimation, EntityType pEntityType,
			Body attachedBody, boolean left, float startAlpha)
	{
		this(newLowAnimation, newMidAnimation, newHighAnimation, pEntityType, attachedBody, left);
		alpha = startAlpha;
	}

	/*
	 * Timestep-based update method
	 *
	 * @param deltaTime				Seconds elapsed since the last frame
	 * @param layer					The BodyFactory layer to animate
	 */
	public void step(float deltaTime, int layer)
	{
		//update this Entity's animation state
		lowStateTime += deltaTime;
	}

	/*
	 * Determines the first class type in a collision
	 *
	 * @param g						The second entity colliding
	 */
	public void collide(GameEntity g)
	{
		g.collide(this);
	}

	/*
	 * Determines the second class type in a collision
	 *
	 * @param p						The first entity colliding
	 */
	public void collide(Player p)
	{
		CGCWorld.getCM().handlePlayerTrain(p);
	}

	/*
	 * @see com.percipient24.cgc.entities.GameEntity#addToWorldLayers(com.percipient24.helpers.BodyFactory)
	 */
	public void addToWorldLayers(LayerHandler lh)
	{
		lh.addEntityToLayer(this, LayerHandler.ground);
		lh.addEntityToLayer(this, LayerHandler.mid);
		lh.addEntityToLayer(this, LayerHandler.above);
	}

	/*
	 * @see com.percipient24.cgc.entities.GameEntity#removeFromWorldLayers(com.percipient24.helpers.BodyFactory)
	 */
	public void removeFromWorldLayers(LayerHandler lh)
	{
		lh.removeEntityFromLayer(this, LayerHandler.ground);
		lh.removeEntityFromLayer(this, LayerHandler.mid);
		lh.removeEntityFromLayer(this, LayerHandler.above);
	}

	/*
	 * Updates the train car
	 */
	public void updateTrain()
	{
		//TODO: Add checks against vertical bounds for train rush
		if (!offCamera)
		{
			if (reverse_direction)
			{
				if (body.getPosition().x < -5.0f)
				{
					offCamera = true;
				}
			}
			else
			{
				if (body.getPosition().x > 25.0f)
				{
					offCamera = true;
				}
			}
		}
	}

	/*
	 * Gets whether or not this TrainCars is moving from left to right
	 *
	 * @return						Whether the TrainCar goes left to right (true) or right to left (false)
	 */
	public boolean directionReversed()
	{
		return reverse_direction;
	}

	/*
	 * Get whether or not the train has passed by
	 *
	 * @return						Whether or not the train has gone off the map again
	 */
	public boolean isOffCamera()
	{
		return offCamera;
	}
} // End class


text:
const path = require('path')
const childProcess = require('child_process')
const copy = require('../../lib/copy')
const gyp = require('../../lib/gyp')
const solutions = require('../../lib/solutions')
const check = require('../../lib/check')
const compile = require('../../lib/compile')
const packagejson = require('../../lib/packagejson')
const execWith = require('../../lib/execWith')

const solutionFiles = ['myaddon.cc', 'index.js']
// a place to make a full copy to run a test compile
const copyTempDir = path.join(process.cwd(), '~test-addon.' + Math.floor(Math.random() * 10000))
// a place to make a full copy to replace myaddon.cc with a mock to do a mocked run to test JS
const copyFauxTempDir = path.join(process.cwd(), '~test-addon-faux.' + Math.floor(Math.random() * 10000))
// what we should get on stdout for this to pass
const expected = 'this is a test, I repeat, this is a test'

let exercise = require('workshopper-exercise')()

// add solutions file listing from solutions/ directory
exercise = solutions(exercise, solutionFiles)

// the steps towards verification
exercise.addProcessor(check.checkSubmissionDir)
exercise.addProcessor(copy.copyTemp([copyTempDir, copyFauxTempDir]))
exercise.addProcessor(copyFauxAddon)
exercise.addProcessor(packagejson.checkPackageJson)
exercise.addProcessor(gyp.checkBinding)
exercise.addProcessor(compile.checkCompile(copyTempDir))
exercise.addProcessor(checkJs)
exercise.addProcessor(checkExec)

// always clean up the temp directories
exercise.addCleanup(copy.cleanup([copyTempDir, copyFauxTempDir]))

function copyFauxAddon (mode, callback) {
  copy(path.join(__dirname, 'solution', 'myaddon.cc'), copyFauxTempDir, { overwrite: true }, function (err) {
    if (err) { return callback(err) }

    callback(null, true)
  })
}

// run `node-gyp rebuild` on a mocked version of the addon that prints what we want
// so we can test that their JS is doing what it is supposed to be doing and there
// is no cheating! (e.g. console.log(...))
function checkJs (mode, callback) {
  const exercise = this

  if (!exercise.passed) { return callback(null, true) } // shortcut if we've already had a failure

  gyp.rebuild(copyFauxTempDir, function (err) {
    if (err) {
      exercise.emit('fail', 'Compile mock C++ to test JavaScript: ' + err.message)
      return callback(null, false)
    }

    execWith(copyFauxTempDir, 'FAUX', 'FAUX\n', function (err, pass) {
      if (err) {
        return callback(err)
      }

      exercise.emit(pass ? 'pass' : 'fail', 'JavaScript code loads addon and invokes `print(str)` method')

      callback(null, pass)
    })
  })
}

// run a full execution of their code & addon, uses a `require()` in a child process
// and check the stdout for expected
function checkExec (mode, callback) {
  if (!exercise.passed) { return callback(null, true) } // shortcut if we've already had a failure

  childProcess.exec(
    '"' +
      process.execPath +
      '" "' +
      copyTempDir +
      '" "' +
      expected +
      '"'
    , function (err, stdout, stderr) {
      if (err) {
        process.stderr.write(stderr)
        process.stdout.write(stdout)
        return callback(err)
      }

      const pass = stdout.toString().replace('\r', '') === expected + '\n'
      const seminl = !pass && stdout.toString() === expected

      if (!seminl && !pass) {
        process.stderr.write(stderr)
        process.stdout.write(stdout)
      }

      if (seminl) {
        exercise.emit('fail', 'Addon prints out expected string (missing newline)')
      } else {
        exercise.emit(pass ? 'pass' : 'fail', 'Addon prints out expected string')
      }

      callback(null, pass)
    }
  )
}

module.exports = exercise

redpajama_set_name: RedPajamaGithub


text:
#ifndef SSDB_SLOWLOG_H
#define SSDB_SLOWLOG_H

#define SLOWLOG_ENTRY_MAX_ARGC 32
#define SLOWLOG_ENTRY_MAX_STRING 128

#include <cstdint>
#include <vector>
#include <ctime>
#include <util/bytes.h>

class SlowlogEntry {

public:
    SlowlogEntry(uint64_t id, const std::vector<Bytes> *req_b, int64_t duration) : id(id), duration(duration) {
        set_req(req_b);
        ts = time(NULL);

    }

    std::vector<std::string> req;
    uint64_t id;       /* Unique entry identifier. */
    int64_t duration; /* Time spent by the query, in nanoseconds. */
    time_t ts;        /* Unix time at which the query was executed. */

    bool operator<(const SlowlogEntry &m) const {
        return duration < m.duration;
    }

    bool operator>(const SlowlogEntry &m) const {
        return duration > m.duration;
    }

    std::string String() const {
        std::string res;

        res.append(std::to_string(id));
        res.append(" ");
        res.append(std::to_string(ts));
        res.append(" ");
        res.append(std::to_string(duration));
        res.append(" ");
        for (std::vector<std::string>::const_iterator it = req.begin(); it != req.end(); it++) {
            res.append(hexstr(*it));
            res.append(" ");
        }

        return res;
    }

    void set_req(const std::vector<Bytes> *req_b) {
        size_t argc = req_b->size();
        size_t slargc = (argc > SLOWLOG_ENTRY_MAX_ARGC) ? SLOWLOG_ENTRY_MAX_ARGC : argc;

        for (size_t j = 0; j < slargc; ++j) {
            if (slargc != argc && j == slargc - 1) {
                req.push_back("... (" + std::to_string(argc - slargc + 1) + " more arguments)");
            }

            const Bytes &r = req_b->at(j);
            if (r.size() > SLOWLOG_ENTRY_MAX_STRING) {
                std::string tmp = std::string(r.data(), SLOWLOG_ENTRY_MAX_STRING);
                req.push_back(tmp);
                req.push_back("... (" + std::to_string(r.size() - SLOWLOG_ENTRY_MAX_STRING) + " more bytes)");
            } else {
                req.push_back(r.String());
            }
        }

    }

};

class Slowlog {
public:

    std::vector<SlowlogEntry> history;

    uint64_t slowlog_entry_max_len = 50;
    uint64_t slowlog_log_slower_than = 10; //ms

    uint64_t slowlog_entry_id = 0;
    int64_t slowlog_min_duration = 0;

    void reset() {
        //clear
        slowlog_entry_id = 0;
        slowlog_min_duration = 0;
        history.clear();
    }

    uint64_t len() {
        //length
        return length;
    }

    void pushEntryIfNeeded(const std::vector<Bytes> *req, int64_t duration) {

        if (duration < slowlog_log_slower_than) {
            return;
        } else if (slowlog_entry_max_len == 0) {
            return;
        }

        bool full = (history.size() == slowlog_entry_max_len);
        if (full) {
            if (duration > slowlog_min_duration) {
                //remove first
                history.erase(history.begin());
            } else {
                return;
            }
        }

        history.emplace_back(SlowlogEntry(slowlog_entry_id++, req, duration));

        sort(history.begin(), history.end());
        slowlog_min_duration = history.front().duration;

    }

private:
    uint64_t length = 10;

};

#endif //SSDB_SLOWLOG_H


text:
// TypeScript Version: 2.0

/**
* Interface for a regular expression to match semantic version strings.
*/
interface ReSemVer {
	/**
	* Returns a regular expression to match a semantic version string.
	*
	* @returns regular expression
	*
	* @example
	* var RE_SEMVER = reSemVer();
	* // returns <RegExp>
	*
	* var bool = RE_SEMVER.test( '1.0.0' );
	* // returns true
	*
	* bool = RE_SEMVER.test( '1.0.0-alpha.1' );
	* // returns true
	*
	* bool = RE_SEMVER.test( 'abc' );
	* // returns false
	*
	* bool = RE_SEMVER.test( '1.0.0-alpha.1+build.1' );
	* // returns true
	*/
	(): RegExp;

	/**
	* Regular expression to match a semantic version string.
	*
	* @example
	* var bool = reSemVer.REGEXP.test( '1.0.0' );
	* // returns true
	*/
	REGEXP: RegExp;
}

/**
* Returns a regular expression to match a semantic version string.
*
* @returns regular expression
*
* @example
* var RE_SEMVER = reSemVer();
* // returns <RegExp>
*
* var bool = RE_SEMVER.test( '1.0.0' );
* // returns true
*
* bool = RE_SEMVER.test( '1.0.0-alpha.1' );
* // returns true
*
* bool = RE_SEMVER.test( 'abc' );
* // returns false
*
* bool = RE_SEMVER.test( '1.0.0-alpha.1+build.1' );
* // returns true
*/
declare var reSemVer: ReSemVer;

// EXPORTS //

export = reSemVer;


text:
layout: shared/narrow
title: "Stick to compositor-only properties and manage layer count"
description: "Compositing is where the painted parts of the page are put together for displaying on screen."
published_on: 2015-03-20
updated_on: 2015-03-20
order: 6
translation_priority: 0
authors:
  - paullewis
notes:
  flip:
    - "If you're concerned that you may not be able to limit your animations to just those properties, take a look at the FLIP principle, which may help you remap animations to changes in transforms and opacity from more expensive properties."
key-takeaways:
  - "Stick to transform and opacity changes for your animations."
  - "Promote moving elements with will-change or translateZ."
  - "Avoid overusing promotion rules; layers require memory and management."

---

  Compositing is where the painted parts of the page are put together for
  displaying on screen.

{% include shared/toc.liquid %}

{% include shared/takeaway.liquid list=page.key-takeaways %}

There are two key factors in this area that affect page performance: the number of compositor layers that need to be managed, and the properties that you use for animations.

## Use transform and opacity changes for animations

The best-performing version of the pixel pipeline avoids both layout and paint, and only requires compositing changes:

In order to achieve this you will need to stick to changing properties that can be handled by the compositor alone. Today there are only two properties for which that is true: **`transforms`** and **`opacity`**:

The caveat for the use of `transform`s and `opacity` is that the element on which you change these properties should be on _its own compositor layer_. In order to make a layer you must promote the element, which we will cover next.

{% include shared/remember.liquid title="Note" list=page.notes.flip %}

## Promote elements that you plan to animate

As we mentioned in the "[Simplify paint complexity and reduce paint areas](simplify-paint-complexity-and-reduce-paint-areas)" section, you should promote elements that you plan to animate (within reason, don't overdo it!) to their own layer:

{% highlight css %}
.moving-element {
  will-change: transform;
}
{% endhighlight %}

Or, for older browsers, or those that don't support will-change:

{% highlight css %}
.moving-element {
  transform: translateZ(0);
}
{% endhighlight %}

This gives the browser the forewarning that changes are incoming and, depending on what you plan to change, the browser can potentially make provisions, such as creating compositor layers.

## Manage layers and avoid layer explosions

It's perhaps tempting, then, knowing that layers often help performance, to promote all the elements on your page with something like the following:

{% highlight css %}
* {
  will-change: transform;
  transform: translateZ(0);
}
{% endhighlight %}

Which is a roundabout way of saying that you'd like to promote every single element on the page. The problem here is that every layer you create requires memory and management, and that's not free. In fact, on devices with limited memory the impact on performance can far outweigh any benefit of creating a layer. Every layer's textures needs to be uploaded to the GPU, so there are further constraints in terms of bandwidth between CPU and GPU, and memory available for textures on the GPU.

In short, **do not promote elements unnecessarily**.

## Use Chrome DevTools to understand the layers in your app

To get an understanding of the layers in your application, and why an element has a layer you must enable the Paint profiler in Chrome DevTools' Timeline:

With this switched on you should take a recording. When the recording has finished you will be able to click on individual frames, which is found between the frames-per-second bars and the details:

Clicking on this will provide you with a new option in the details: a layer tab.

This option will bring up a new view that allows you to pan, scan and zoom in on all the layers during that frame, along with reasons that each layer was created.

Using this view you can track the number of layers you have. If you're spending a lot time in compositing during performance-critical actions like scrolling or transitions (you should aim for around **4-5ms**), you can use the information here to see how many layers you have, why they were created, and from there manage layer counts in your app.


text:
The documentation is designed for a specific purpose to help you to apply the features on your side. ByteScout Premium Suite: the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can create zugferd invoice with pdf sdk in VB.NET.

The SDK samples given below describe how to quickly make your application do create zugferd invoice with pdf sdk in VB.NET with the help of ByteScout Premium Suite. Just copy and paste the code into your VB.NET application's code and follow the instructions. Applying VB.NET application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

If you want to try other source code samples then the free trial version of ByteScout Premium Suite is available for download from our website. Just try other source code samples for VB.NET.

## REQUEST FREE TECH SUPPORT

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

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

## ON-PREMISE OFFLINE SDK

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

## ON-DEMAND REST WEB API

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

## VIDEO REVIEW

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

<!-- code block begin -->

##### ****FileAttachmentAnnotation.NETCore.vbproj:**

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

<!-- code block end -->

<!-- code block begin -->

##### ****FileAttachmentAnnotation.VS2005.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>FileAttachmentAnnotation</RootNamespace>
    <AssemblyName>FileAttachmentAnnotation</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <ProductVersion>8.0.50727</ProductVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
  </ItemGroup>
   <ItemGroup>
    <Content Include="ZUGFeRD-invoice.xml">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Invoice.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
 <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****FileAttachmentAnnotation.VS2008.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>FileAttachmentAnnotation</RootNamespace>
    <AssemblyName>FileAttachmentAnnotation</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <ProductVersion>9.0.30729</ProductVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="ZUGFeRD-invoice.xml">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Invoice.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****FileAttachmentAnnotation.VS2010.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>FileAttachmentAnnotation</RootNamespace>
    <AssemblyName>FileAttachmentAnnotation</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="ZUGFeRD-invoice.xml">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Invoice.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****FileAttachmentAnnotation.VS2012.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>FileAttachmentAnnotation</RootNamespace>
    <AssemblyName>FileAttachmentAnnotation</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="ZUGFeRD-invoice.xml">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Invoice.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****FileAttachmentAnnotation.VS2013.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>FileAttachmentAnnotation</RootNamespace>
    <AssemblyName>FileAttachmentAnnotation</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="ZUGFeRD-invoice.xml">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Invoice.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

##### ****FileAttachmentAnnotation.VS2015.vbproj:**

```
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{951C634C-4684-40A5-919C-741C5CA61EA4}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <StartupObject>Sub Main</StartupObject>
    <RootNamespace>FileAttachmentAnnotation</RootNamespace>
    <AssemblyName>FileAttachmentAnnotation</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Console</MyType>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>bin\Debug\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
  <PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
  </PropertyGroup>
  <PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
  </PropertyGroup>
  <PropertyGroup>
    <OptionStrict>Off</OptionStrict>
  </PropertyGroup>
  <PropertyGroup>
    <OptionInfer>On</OptionInfer>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Bytescout.PDF, Version=1.0.0.15, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Program.vb" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="ZUGFeRD-invoice.xml">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Invoice.pdf">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
```

<!-- code block end -->

<!-- code block begin -->

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

```
Imports Bytescout.PDF

''' <summary>
''' This example demonstrates how to attach a file to PDF document.
''' </summary>
Class Program

    Shared Sub Main()

        ' Create new PDF document
        Dim pdfDocument = New Document()
		pdfDocument.RegistrationName = "demo"
		pdfDocument.RegistrationKey = "demo"

        ' Load existing document
        pdfDocument.Load(".\Invoice.pdf")

        ' Attach ZUGFeRD XML file
        Dim fileAttachment As New Bytescout.PDF.FileAttachmentAnnotation(".\ZUGFeRD-invoice.xml", 0, 0, 0, 0)
        pdfDocument.Pages.Item(0).Annotations.Add(fileAttachment)

        ' Instruct PDF viewer applications to show attachment page on startup
        pdfDocument.PageMode = PageMode.Attachment

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

        ' Cleanup
        pdfDocument.Dispose()

        ' Open result document in default associated application (for demo puropse)
        Dim processStartInfo As New ProcessStartInfo("result.pdf")
        processStartInfo.UseShellExecute = True
        Process.Start(processStartInfo)

    End Sub

End Class

```

<!-- code block end -->


text:
<?php

/**
 * 客户端 论坛 生成类
 * @category iCMS
 * @package iCMS_FrameWork1_RuleClass_Gen_Forum
 * @author zhangchi
 */
class ForumClientGen extends BaseClientGen implements IBaseClientGen {

    /**
     * 引导方法
     * @return string 返回执行结果
     */
    public function GenClient()
    {
        $result = "";
        $function = Control::GetRequest("f", "");
        switch ($function) {

            case "list_by_rank":
                $result = self::GenListByRank();
                break;

        }
        $result = str_ireplace("{function}", $function, $result);
        return $result;
    }

    private function GenListByRank(){

        $result = "[{}]";

        $siteId = intval(Control::GetRequest("site_id", 0));
        $rank = intval(Control::GetRequest("rank", 0));

        if($siteId>0){

            $forumClientData = new ForumClientData();
            $arrList = $forumClientData->GetListByForumRank(
                $siteId,
                $rank
            );
            if (count($arrList) > 0) {
                $resultCode = 1;
                $result = Format::FixJsonEncode($arrList);
            }
            else{
                $resultCode = -2;
            }
        }
        else{
            $resultCode = -1;
        }

        return '{"result_code":"'.$resultCode.'","forum":{"forum_list":' . $result . '}}';

    }
}


text:
require 'thread'

module Adhearsion
  ##
  # This manages the list of calls the Adhearsion service receives
  class Calls
    def initialize
      @mutex = ::Monitor.new
      @calls = {}
      restart_supervisor
    end

    def <<(call)
      @supervisor.link call
      @mutex.synchronize do
        self[call.id] = call
        by_uri[call.uri] = call
      end
      self
    end

    def remove_inactive_call(call)
      if call_is_dead?(call)
        call_id = key call
        delete call_id if call_id

        remove_call_uri call
      elsif call.respond_to?(:id)
        delete call.id
        remove_call_uri call
      else
        call_actor = delete call
        remove_call_uri call_actor
      end
    end

    def with_tag(tag)
      values.find_all do |call|
        begin
          call.tagged_with? tag
        rescue Call::ExpiredError
          false
        end
      end
    end

    def with_uri(uri)
      by_uri[uri]
    end

    def restart_supervisor
      @supervisor.terminate if @supervisor
      @supervisor = Supervisor.new self
    end

    private

    def by_uri
      @by_uri ||= {}
    end

    def remove_call_uri(call)
      uri = by_uri.key call
      by_uri.delete uri if uri
    end

    def call_is_dead?(call)
      !call.alive?
    rescue ::NoMethodError
      false
    end

    def method_missing(method, *args, &block)
      @mutex.synchronize do
        @calls.send method, *args, &block
      end
    end

    class Supervisor
      include Celluloid

      trap_exit :call_died

      def initialize(collection)
        @collection = collection
      end

      def call_died(call, reason)
        catching_standard_errors do
          call_id = @collection.key call
          @collection.remove_inactive_call call
          return unless reason
          Adhearsion::Events.trigger :exception, reason
          logger.error "Call #{call_id} terminated abnormally due to #{reason}. Forcing hangup."
          PunchblockPlugin.client.execute_command Punchblock::Command::Hangup.new, :async => true, :call_id => call_id
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">

    <kbase name="sampleKBase" packages="org.drools.example.drink" default="true">
        <ksession name="sampleKSession" default="true" />
    </kbase>

</kmodule>


text:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

        <variable
            name="user"
            type="com.wecan.xhin.studio.bean.common.User" />
    </data>

    <com.balysv.materialripple.MaterialRippleLayout
        android:id="@+id/mrl_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:mrl_rippleColor="?attr/colorPrimary"
        app:mrl_rippleOverlay="true">

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="?android:attr/listPreferredItemHeight"
            android:padding="6dp">

            <ImageView
                android:id="@+id/ivAvatar"
                android:layout_width="70dp"
                android:layout_height="fill_parent"
                android:scaleType="fitXY"
                android:layout_alignParentBottom="true"
                android:layout_alignParentTop="true"
                android:layout_marginEnd="6dip"
                android:layout_marginRight="6dip"
                android:contentDescription="@string/nothing"
                android:src="@drawable/header" />

            <TextView
                android:id="@+id/subtitle"
                android:layout_width="fill_parent"
                android:layout_height="26dip"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_toEndOf="@id/ivAvatar"
                android:layout_toRightOf="@id/ivAvatar"
                android:ellipsize="marquee"
                android:singleLine="true"
                android:text="@{user.description}"
                android:textSize="12sp" />

            <TextView
                android:id="@+id/title"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_above="@id/subtitle"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:layout_alignWithParentIfMissing="true"
                android:layout_toEndOf="@id/ivAvatar"
                android:layout_toRightOf="@id/ivAvatar"
                android:gravity="center_vertical"
                android:text="@{user.name}"

                android:textSize="16sp" />
        </RelativeLayout>
    </com.balysv.materialripple.MaterialRippleLayout>
</layout>


text:
import pytest

from frigg.projects.models import EnvironmentVariable, Project

@pytest.fixture
def project():
    return Project(owner='frigg', name='frigg-hq')

def test_environment_variable__str__(project):
    variable = EnvironmentVariable(project=project, key='PYPI_PASSWORD')
    assert str(variable) == 'frigg / frigg-hq - PYPI_PASSWORD'


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
  <gradient
      android:startColor="#FFFF0000"
      android:endColor="#80FF00FF"
      android:angle="45"/>
  <padding android:left="7dp"
           android:top="7dp"
           android:right="7dp"
           android:bottom="7dp"/>
  <corners android:radius="8dp"/>
  <size android:width="2dp" android:dashWidth=<error>""</error>/>
  <solid/>
  <stroke android:width="4dp"
          android:color="color"
          android:dashWidth="<error>integer</error>"
          android:dashGap="<error>4</error>"
          <warning>android:aba</warning>=""/>
  <<warning>aba</warning>/>
</shape>


text:
/*
* File: app/js/routes.js
*
* Defines the main routes in the application.
* The routes you see here will be anchors '#/' unless specifically configured otherwise.
*
* */

(function () {
    'use strict';
    ///////////////////////
    // Angular Config
    ///////////////////////
    angular.module('app').config(['$routeProvider','$urlRouterProvider','$stateProvider','ACCESS_LEVELS','URLS',
        function ($routeProvider, $urlRouterProvider, $stateProvider, ACCESS_LEVELS, URLS) {

            ///* Authentication */
            //$routeProvider.when(URLS.path._LOGIN_, {
            //    templateUrl: 'static/partial/authentication/login.html',
            //    access_level: ACCESS_LEVELS.pub,
            //    controller: 'LoginController',
            //    controllerAs: 'ctrl'
            //});
            //
            //$routeProvider.when(URLS.path._SIGNUP_, {
            //    templateUrl: 'static/partial/authentication/signup.html',
            //    access_level: ACCESS_LEVELS.pub,
            //    controller: 'SignupController',
            //    controllerAs: 'ctrl'
            //});

            //$routeProvider.when(URLS.path._RESET_PASSWORD_, {
            //    templateUrl: 'static/partial/authentication/reset_password.html',
            //    access_level: ACCESS_LEVELS.pub,
            //    controller: 'ResetPasswordController',
            //    controllerAs: 'ctrl'
            //});
            //
            //$routeProvider.when(URLS.path._RESET_PASSWORD_CONFIRMATION_, {
            //    templateUrl: 'static/partial/authentication/reset_password_confirmation.html',
            //    access_level: ACCESS_LEVELS.pub,
            //    controller: 'ResetPasswordConfirmationController',
            //    controllerAs: 'ctrl'
            //});
            //
            //// Home
            //$routeProvider.when(URLS.path._HOME_, {
            //    templateUrl: 'static/partial/core/layout.html',
            //    access_level: ACCESS_LEVELS.pub,
            //    controller: 'MainController',
            //    controllerAs: 'ctrl'
            //});
            //
            //$routeProvider.otherwise({
            //    redirectTo: URLS.path._HOME_,
            //    access_level: ACCESS_LEVELS.pub,
            //    controller: 'HeaderController',
            //    controllerAs: 'ctrl'
            //});

            // *****************
            // using angularUiRoute
            // *****************

            // Public Views
            //$stateProvider.state('search', {
            //    //abstract: true,
            //    url: "/search",
            //    templateUrl: "static/partial/core/layout_public.html",
            //    access_level: ACCESS_LEVELS.pub,
            //    controller: 'MainController',
            //    controllerAs: 'ctrl'
            //});

            //$stateProvider.state('index.search', {
            //    url: "/index/search",
            //    templateUrl: "static/partial/core/search.html",
            //    access_level: ACCESS_LEVELS.pub,
            //    //controller: 'LoginController',
            //    //controllerAs: 'ctrl',
            //    data: { pageTitle: '' }
            //});

            $stateProvider.state('login', {
                url: URLS.path._LOGIN_+'?redirectTo',
                templateUrl: "static/partial/authentication/login.html",
                access_level: ACCESS_LEVELS.pub,
                controller: 'LoginController',
                controllerAs: 'ctrl',
                data: { pageTitle: 'Login' }
            });

            $stateProvider.state('signup', {
                url: URLS.path._SIGNUP_,
                templateUrl: "static/partial/authentication/signup.html",
                access_level: ACCESS_LEVELS.pub,
                controller: 'SignupController',
                controllerAs: 'ctrl',
                data: { pageTitle: 'Signup' }
            });
            $stateProvider.state('reset-password', {
                url: URLS.path._RESET_PASSWORD_,
                templateUrl: "static/partial/authentication/reset_password.html",
                access_level: ACCESS_LEVELS.pub,
                controller: 'ResetPasswordController',
                controllerAs: 'ctrl',
                data: { pageTitle: 'Reset password' }
            });
            $stateProvider.state('reset-password-confirmation', {
                url: URLS.path._RESET_PASSWORD_CONFIRMATION_,
                templateUrl: "static/partial/authentication/reset_password_confirmation.html",
                access_level: ACCESS_LEVELS.pub,
                controller: 'ResetPasswordConfirmationController',
                controllerAs: 'ctrl',
                data: { pageTitle: 'Confirm password' }
            });

            // Private Views
            $stateProvider.state('main', {
                // Note: With abstract set to true, that means this state can not be explicitly activated.
                // It can only be implicitly activated by activating one of its children.
                abstract: true,
                url: "/main",
                templateUrl: "static/partial/core/layout.html",
                access_level: ACCESS_LEVELS.user,
                controller: 'MainController',
                controllerAs: 'ctrl'
            });

            $stateProvider.state('main.hello', {
                url: "/hello",
                templateUrl: "static/partial/core/hello.html",
                access_level: ACCESS_LEVELS.pub,
                controller: 'HelloController as ctrl',
                data: { pageTitle: 'Hello' }
            });

            $urlRouterProvider.otherwise("/main/hello");

        }
    ]);

})();


text:
BEGIN TRANSACTION

CREATE TABLE [dbo].[regions](
 [regionHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionName] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [uuid] [varchar](255) COLLATE Latin1_General_CI_AS NOT NULL,
 [regionRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionSecret] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionDataURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [serverIP] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [serverPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [serverURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [locX] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [locY] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [locZ] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [eastOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [westOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [southOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [northOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionAssetURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionAssetRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionAssetSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionUserURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionUserRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionUserSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [regionMapTexture] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [serverHttpPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [serverRemotingPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
 [owner_uuid] [varchar](36) COLLATE Latin1_General_CI_AS NULL,
PRIMARY KEY CLUSTERED
(
 [uuid] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

COMMIT


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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Boxer: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Boxer
    1.0.1

Simple quick Clean ECS

Main Page

Packages

Classes

Class List

Class Index

Class Members

Boxer.Group Member List

This is the complete list of members for Boxer.Group, including all inherited members.

AttachLogistics(LogisticSystem system)	Boxer.Group

Group() (defined in Boxer.Group)	Boxer.Group

Handle(Box box)	Boxer.Group

Length()	Boxer.Group

NeedRestraints	Boxer.Group	protected

Needs(System.Type newtype)	Boxer.Group

Storage	Boxer.Group

Systems	Boxer.Group	protected

Update()	Boxer.Group

Without(System.Type newtype)	Boxer.Group

WithoutRestraints	Boxer.Group	protected

Generated by

     1.8.11


text:
PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin

echo "********************************************************************************"
echo "*** $(basename "$0")"
echo "********************************************************************************"
echo "Enabling Bash History Timestamps..."
cat <<EOF >/etc/profile.d/shell_history.sh
# Enable shell command history timestamps.
# CLAIRVOYANT
export HISTTIMEFORMAT="%F %T "
EOF
chown root:root /etc/profile.d/shell_history.sh
chmod 0644 /etc/profile.d/shell_history.sh


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>collection/js/arraylist.js - YUI 3</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

            API Docs for: 3.18.1

APIs

Classes

Modules

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

Anim

App

App.Base

App.Content

App.Transitions

App.TransitionsNative

AreaSeries

AreaSplineSeries

Array

ArrayList

ArraySort

AsyncQueue

Attribute

AttributeCore

AttributeEvents

AttributeExtras

AttributeLite

AttributeObservable

AutoComplete

AutoCompleteBase

AutoCompleteFilters

AutoCompleteHighlighters

AutoCompleteList

Axis

AxisBase

BarSeries

Base

BaseCore

BaseObservable

BottomAxisLayout

Button

ButtonCore

ButtonGroup

Cache

CacheOffline

Calendar

CalendarBase

CandlestickSeries

CanvasCircle

CanvasDrawing

CanvasEllipse

CanvasGraphic

CanvasPath

CanvasPieSlice

CanvasRect

CanvasShape

CartesianChart

CartesianSeries

CategoryAxis

CategoryAxisBase

CategoryImpl

Chart

ChartBase

ChartLegend

Circle

CircleGroup

ClassNameManager

ClickableRail

Color

Color.Harmony

Color.HSL

Color.HSV

ColumnSeries

ComboSeries

ComboSplineSeries

config

Console

ContentEditable

Controller

Cookie

CurveUtil

CustomEvent

DataSchema.Array

DataSchema.Base

DataSchema.JSON

DataSchema.Text

DataSchema.XML

DataSource.Function

DataSource.Get

DataSource.IO

DataSource.Local

DataSourceArraySchema

DataSourceCache

DataSourceCacheExtension

DataSourceJSONSchema

DataSourceTextSchema

DataSourceXMLSchema

DataTable

DataTable.Base

DataTable.BodyView

DataTable.BodyView.Formatters

DataTable.Column

DataTable.ColumnWidths

DataTable.Core

DataTable.HeaderView

DataTable.Highlight

DataTable.KeyNav

DataTable.Message

DataTable.Mutable

DataTable.Paginator

DataTable.Paginator.Model

DataTable.Paginator.View

DataTable.Scrollable

DataTable.Sortable

DataTable.TableView

Date

DD.DDM

DD.Delegate

DD.Drag

DD.Drop

DD.Scroll

Dial

Do

Do.AlterArgs

Do.AlterReturn

Do.Error

Do.Halt

Do.Method

Do.Prevent

DOM

DOMEventFacade

Drawing

Easing

EditorBase

EditorSelection

Ellipse

EllipseGroup

Escape

Event

EventFacade

EventHandle

EventTarget

Features

File

FileFlash

FileHTML5

Fills

Frame

Get

Get.Transaction

GetNodeJS

Graph

Graphic

GraphicBase

Gridlines

GroupDiamond

GroupRect

Handlebars

Highlight

Histogram

HistoryBase

HistoryHash

HistoryHTML5

HorizontalLegendLayout

ImgLoadGroup

ImgLoadImgObj

InlineEditor

Intl

IO

JSON

JSONPRequest

Lang

LazyModelList

LeftAxisLayout

Lines

LineSeries

Loader

MarkerSeries

Matrix

MatrixUtil

Model

ModelList

ModelSync.Local

ModelSync.REST

Node

NodeList

Number

NumericAxis

NumericAxisBase

NumericImpl

Object

OHLCSeries

Overlay

Paginator

Paginator.Core

Paginator.Url

Panel

Parallel

Path

PieChart

PieSeries

Pjax

PjaxBase

PjaxContent

Plots

Plugin.Align

Plugin.AutoComplete

Plugin.Base

Plugin.Button

Plugin.Cache

Plugin.CalendarNavigator

Plugin.ConsoleFilters

Plugin.CreateLinkBase

Plugin.DataTableDataSource

Plugin.DDConstrained

Plugin.DDNodeScroll

Plugin.DDProxy

Plugin.DDWindowScroll

Plugin.Drag

Plugin.Drop

Plugin.EditorBidi

Plugin.EditorBR

Plugin.EditorLists

Plugin.EditorPara

Plugin.EditorParaBase

Plugin.EditorParaIE

Plugin.EditorTab

Plugin.ExecCommand

Plugin.ExecCommand.COMMANDS

Plugin.Flick

Plugin.Host

plugin.NodeFocusManager

Plugin.NodeFX

plugin.NodeMenuNav

Plugin.Pjax

Plugin.Resize

Plugin.ResizeConstrained

Plugin.ResizeProxy

Plugin.ScrollInfo

Plugin.ScrollViewList

Plugin.ScrollViewPaginator

Plugin.ScrollViewScrollbars

Plugin.Shim

Plugin.SortScroll

Plugin.Tree.Lazy

Plugin.WidgetAnim

Pollable

Promise

Promise.Resolver

QueryString

Queue

RangeSeries

Record

Recordset

RecordsetFilter

RecordsetIndexer

RecordsetSort

Rect

Renderer

Resize

RightAxisLayout

Router

ScrollView

Selector

SeriesBase

Shape

ShapeGroup

Slider

SliderBase

SliderValueRange

Sortable

SplineSeries

StackedAreaSeries

StackedAreaSplineSeries

StackedAxis

StackedAxisBase

StackedBarSeries

StackedColumnSeries

StackedComboSeries

StackedComboSplineSeries

StackedImpl

StackedLineSeries

StackedMarkerSeries

StackedSplineSeries

StackingUtil

State

StyleSheet

Subscriber

SVGCircle

SVGDrawing

SVGEllipse

SVGGraphic

SVGPath

SVGPieSlice

SVGRect

SVGShape

SWF

SWFDetect

SyntheticEvent

SyntheticEvent.Notifier

SynthRegistry

Tab

TabView

Template

Template.Micro

Test.ArrayAssert

Test.Assert

Test.AssertionError

Test.ComparisonFailure

Test.Console

Test.CoverageFormat

Test.DateAssert

Test.EventTarget

Test.Mock

Test.Mock.Value

Test.ObjectAssert

Test.Reporter

Test.Results

Test.Runner

Test.ShouldError

Test.ShouldFail

Test.TestCase

Test.TestFormat

Test.TestNode

Test.TestRunner

Test.TestSuite

Test.UnexpectedError

Test.UnexpectedValue

Test.Wait

Text.AccentFold

Text.WordBreak

TimeAxis

TimeAxisBase

TimeImpl

ToggleButton

TopAxisLayout

Transition

Tree

Tree.Labelable

Tree.Node

Tree.Node.Labelable

Tree.Node.Openable

Tree.Node.Selectable

Tree.Node.Sortable

Tree.Openable

Tree.Selectable

Tree.Sortable

UA

Uploader

Uploader.Queue

UploaderFlash

UploaderHTML5

ValueChange

VerticalLegendLayout

View

View.NodeMap

VMLCircle

VMLDrawing

VMLEllipse

VMLGraphic

VMLPath

VMLPieSlice

VMLRect

VMLShape

Widget

WidgetAutohide

WidgetButtons

WidgetChild

WidgetModality

WidgetParent

WidgetPosition

WidgetPositionAlign

WidgetPositionConstrain

WidgetStack

WidgetStdMod

XML

YQL

YQLRequest

YUI

YUI~substitute

align-plugin

anim

anim-base

anim-color

anim-curve

anim-easing

anim-node-plugin

anim-scroll

anim-shape

anim-shape-transform

anim-xy

app

app-base

app-content

app-transitions

app-transitions-native

array-extras

array-invoke

arraylist

arraylist-add

arraylist-filter

arraysort

async-queue

attribute

attribute-base

attribute-complex

attribute-core

attribute-extras

attribute-observable

autocomplete

autocomplete-base

autocomplete-filters

autocomplete-filters-accentfold

autocomplete-highlighters

autocomplete-highlighters-accentfold

autocomplete-list

autocomplete-list-keys

autocomplete-plugin

autocomplete-sources

axis

axis-base

axis-category

axis-category-base

axis-numeric

axis-numeric-base

axis-stacked

axis-stacked-base

axis-time

axis-time-base

base

base-base

base-build

base-core

base-observable

base-pluginhost

button

button-core

button-group

button-plugin

cache

cache-base

cache-offline

cache-plugin

calendar

calendar-base

calendarnavigator

charts

charts-base

charts-legend

classnamemanager

clickable-rail

collection

color

color-base

color-harmony

color-hsl

color-hsv

console

console-filters

content-editable

cookie

createlink-base

dataschema

dataschema-array

dataschema-base

dataschema-json

dataschema-text

dataschema-xml

datasource

datasource-arrayschema

datasource-cache

datasource-function

datasource-get

datasource-io

datasource-jsonschema

datasource-local

datasource-polling

datasource-textschema

datasource-xmlschema

datatable

datatable-base

datatable-body

datatable-column-widths

datatable-core

datatable-datasource

datatable-foot

datatable-formatters

datatable-head

datatable-highlight

datatable-keynav

datatable-message

datatable-mutable

datatable-paginator

datatable-scroll

datatable-sort

datatable-table

datatype

datatype-date

datatype-date-format

datatype-date-math

datatype-date-parse

datatype-number

datatype-number-format

datatype-number-parse

datatype-xml

datatype-xml-format

datatype-xml-parse

dd

dd-constrain

dd-ddm

dd-ddm-base

dd-ddm-drop

dd-delegate

dd-drag

dd-drop

dd-drop-plugin

dd-gestures

dd-plugin

dd-proxy

dd-scroll

dial

dom

dom-base

dom-screen

dom-style

dump

editor

editor-base

editor-bidi

editor-br

editor-inline

editor-lists

editor-para

editor-para-base

editor-para-ie

editor-tab

escape

event

event-base

event-contextmenu

event-custom

event-custom-base

event-custom-complex

event-delegate

event-flick

event-focus

event-gestures

event-hover

event-key

event-mouseenter

event-mousewheel

event-move

event-outside

event-resize

event-simulate

event-synthetic

event-tap

event-touch

event-valuechange

exec-command

features

file

file-flash

file-html5

frame

gesture-simulate

get

get-nodejs

graphics

graphics-group

handlebars

handlebars-base

handlebars-compiler

highlight

highlight-accentfold

highlight-base

history

history-base

history-hash

history-hash-ie

history-html5

imageloader

intl

io

io-base

io-form

io-nodejs

io-queue

io-upload-iframe

io-xdr

json

json-parse

json-stringify

jsonp

jsonp-url

lazy-model-list

loader

loader-base

loader-yui3

matrix

model

model-list

model-sync-rest

node

node-base

node-core

node-data

node-event-delegate

node-event-html5

node-event-simulate

node-flick

node-focusmanager

node-load

node-menunav

node-pluginhost

node-screen

node-scroll-info

node-style

oop

overlay

paginator

paginator-core

paginator-url

panel

parallel

pjax

pjax-base

pjax-content

pjax-plugin

plugin

pluginhost

pluginhost-base

pluginhost-config

promise

querystring

querystring-parse

querystring-parse-simple

querystring-stringify

querystring-stringify-simple

queue-promote

range-slider

recordset

recordset-base

recordset-filter

recordset-indexer

recordset-sort

resize

resize-contrain

resize-plugin

resize-proxy

rollup

router

scrollview

scrollview-base

scrollview-base-ie

scrollview-list

scrollview-paginator

scrollview-scrollbars

selection

selector-css2

selector-css3

selector-native

series-area

series-area-stacked

series-areaspline

series-areaspline-stacked

series-bar

series-bar-stacked

series-base

series-candlestick

series-cartesian

series-column

series-column-stacked

series-combo

series-combo-stacked

series-combospline

series-combospline-stacked

series-curve-util

series-fill-util

series-histogram

series-line

series-line-stacked

series-line-util

series-marker

series-marker-stacked

series-ohlc

series-pie

series-plot-util

series-range

series-spline

series-spline-stacked

series-stacked

shim-plugin

slider

slider-base

slider-value-range

sortable

sortable-scroll

stylesheet

substitute

swf

swfdetect

tabview

template

template-base

template-micro

test

test-console

text

text-accentfold

text-wordbreak

timers

transition

transition-timer

tree

tree-labelable

tree-lazy

tree-node

tree-openable

tree-selectable

tree-sortable

uploader

uploader-flash

uploader-html5

uploader-queue

view

view-node-map

widget

widget-anim

widget-autohide

widget-base

widget-base-ie

widget-buttons

widget-child

widget-htmlparser

widget-modality

widget-parent

widget-position

widget-position-align

widget-position-constrain

widget-skin

widget-stack

widget-stdmod

widget-uievents

yql

yql-jsonp

yql-nodejs

yql-winjs

yui

yui-base

yui-later

yui-log

yui-throttle

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

            <input type="checkbox" id="api-show-deprecated">
            Deprecated

File: collection/js/arraylist.js

/**
 * Collection utilities beyond what is provided in the YUI core
 * @module collection
 * @submodule arraylist
 */

var YArray      = Y.Array,
    YArray_each = YArray.each,
    ArrayListProto;

/**
 * Generic ArrayList class for managing lists of items and iterating operations
 * over them.  The targeted use for this class is for augmentation onto a
 * class that is responsible for managing multiple instances of another class
 * (e.g. NodeList for Nodes).  The recommended use is to augment your class with
 * ArrayList, then use ArrayList.addMethod to mirror the API of the constituent
 * items on the list's API.
 *
 * The default implementation creates immutable lists, but mutability can be
 * provided via the arraylist-add submodule or by implementing mutation methods
 * directly on the augmented class's prototype.
 *
 * @class ArrayList
 * @constructor
 * @param items { Array } array of items this list will be responsible for
 */
function ArrayList( items ) {
    if ( items !== undefined ) {
        this._items = Y.Lang.isArray( items ) ? items : YArray( items );
    } else {
        // ||= to support lazy initialization from augment
        this._items = this._items || [];
    }
}

ArrayListProto = {
    /**
     * Get an item by index from the list.  Override this method if managing a
     * list of objects that have a different public representation (e.g. Node
     * instances vs DOM nodes).  The iteration methods that accept a user
     * function will use this method for access list items for operation.
     *
     * @method item
     * @param i { Integer } index to fetch
     * @return { mixed } the item at the requested index
     */
    item: function ( i ) {
        return this._items[i];
    },

    /**
     * <p>Execute a function on each item of the list, optionally providing a
     * custom execution context.  Default context is the item.</p>
     *
     * <p>The callback signature is <code>callback( item, index )</code>.</p>
     *
     * @method each
     * @param fn { Function } the function to execute
     * @param context { mixed } optional override 'this' in the function
     * @return { ArrayList } this instance
     * @chainable
     */
    each: function ( fn, context ) {
        YArray_each( this._items, function ( item, i ) {
            item = this.item( i );

            fn.call( context || item, item, i, this );
        }, this);

        return this;
    },

    /**
     * <p>Execute a function on each item of the list, optionally providing a
     * custom execution context.  Default context is the item.</p>
     *
     * <p>The callback signature is <code>callback( item, index )</code>.</p>
     *
     * <p>Unlike <code>each</code>, if the callback returns true, the
     * iteration will stop.</p>
     *
     * @method some
     * @param fn { Function } the function to execute
     * @param context { mixed } optional override 'this' in the function
     * @return { Boolean } True if the function returned true on an item
     */
    some: function ( fn, context ) {
        return YArray.some( this._items, function ( item, i ) {
            item = this.item( i );

            return fn.call( context || item, item, i, this );
        }, this);
    },

    /**
     * Finds the first index of the needle in the managed array of items.
     *
     * @method indexOf
     * @param needle { mixed } The item to search for
     * @return { Integer } Array index if found.  Otherwise -1
     */
    indexOf: function ( needle ) {
        return YArray.indexOf( this._items, needle );
    },

    /**
     * How many items are in this list?
     *
     * @method size
     * @return { Integer } Number of items in the list
     */
    size: function () {
        return this._items.length;
    },

    /**
     * Is this instance managing any items?
     *
     * @method isEmpty
     * @return { Boolean } true if 1 or more items are being managed
     */
    isEmpty: function () {
        return !this.size();
    },

    /**
     * Provides an array-like representation for JSON.stringify.
     *
     * @method toJSON
     * @return { Array } an array representation of the ArrayList
     */
    toJSON: function () {
        return this._items;
    }
};
// Default implementation does not distinguish between public and private
// item getter
/**
 * Protected method for optimizations that may be appropriate for API
 * mirroring. Similar in functionality to <code>item</code>, but is used by
 * methods added with <code>ArrayList.addMethod()</code>.
 *
 * @method _item
 * @protected
 * @param i { Integer } Index of item to fetch
 * @return { mixed } The item appropriate for pass through API methods
 */
ArrayListProto._item = ArrayListProto.item;

// Mixed onto existing proto to preserve constructor NOT being an own property.
// This has bitten me when composing classes by enumerating, copying prototypes.
Y.mix(ArrayList.prototype, ArrayListProto);

Y.mix( ArrayList, {

    /**
     * <p>Adds a pass through method to dest (typically the prototype of a list
     * class) that calls the named method on each item in the list with
     * whatever parameters are passed in.  Allows for API indirection via list
     * instances.</p>
     *
     * <p>Accepts a single string name or an array of string names.</p>
     *
     * <pre><code>list.each( function ( item ) {
     *     item.methodName( 1, 2, 3 );
     * } );
     * // becomes
     * list.methodName( 1, 2, 3 );</code></pre>
     *
     * <p>Additionally, the pass through methods use the item retrieved by the
     * <code>_item</code> method in case there is any special behavior that is
     * appropriate for API mirroring.</p>
     *
     * <p>If the iterated method returns a value, the return value from the
     * added method will be an array of values with each value being at the
     * corresponding index for that item.  If the iterated method does not
     * return a value, the added method will be chainable.
     *
     * @method addMethod
     * @static
     * @param dest {Object} Object or prototype to receive the iterator method
     * @param name {String|String[]} Name of method of methods to create
     */
    addMethod: function ( dest, names ) {

        names = YArray( names );

        YArray_each( names, function ( name ) {
            dest[ name ] = function () {
                var args = YArray( arguments, 0, true ),
                    ret  = [];

                YArray_each( this._items, function ( item, i ) {
                    item = this._item( i );

                    var result = item[ name ].apply( item, args );

                    if ( result !== undefined && result !== item ) {
                        ret[i] = result;
                    }
                }, this);

                return ret.length ? ret : this;
            };
        } );
    }
} );

Y.ArrayList = ArrayList;


text:
require "national_ids/version"
require "national_ids/number"

#
# Main namespace definition
#
module NationalIds
end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingRight="@dimen/activity_vertical_margin"
    android:paddingEnd="@dimen/activity_vertical_margin"
    android:background="@android:color/white">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:minHeight="?android:attr/listPreferredItemHeightSmall">
        <ImageView
            android:layout_width="@dimen/lock_screen_user_picture_size"
            android:layout_height="@dimen/lock_screen_user_picture_size"
            android:layout_margin="@dimen/activity_vertical_margin"
            android:id="@+id/image_view_environment_picture"
            android:layout_gravity="center_vertical"
            />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:id="@+id/text_view_current_environment"
            android:textColor="@android:color/black"
            android:textStyle="bold"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:minHeight="?android:attr/listPreferredItemHeightSmall"
        android:id="@+id/button_master_passphrase_unlock">
        <ImageView
            android:layout_width="@dimen/lock_screen_user_picture_size"
            android:layout_height="@dimen/lock_screen_user_picture_size"
            android:id="@+id/image_view_master_passphrase_icon"
            android:src="@drawable/ic_master_password"
            android:layout_gravity="center_vertical"
            android:layout_margin="@dimen/activity_vertical_margin"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="@string/use_master_password"
            android:textColor="@android:color/black"
            android:textStyle="bold"/>
    </LinearLayout>
</LinearLayout>


text:
import Vue from 'vue'

import App from './App'
import router from './router'

import Analytics from '@/services/analytics'
import Helpers from '@/services/helpers'

Vue.config.productionTip = false

Analytics.init()

new Vue({
  components: { App },
  router,
  template: '<App/>'
}).$mount('#app')

Helpers.setupExternalLinks()
Helpers.listenToPing()


text:
package jat.jat3D;

import jat.core.util.jatMessages;
import jat.coreNOSA.math.MatrixVector.data.VectorN;

import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.vecmath.Point3d;
import javax.vecmath.Vector3d;
import javax.vecmath.Vector3f;

/**
 * Base class for 3D objects. Planet, moons, and spacecraft extend this class.
 * To be extended by specific object
 *
 * @author Tobias Berthold
 */

// abstract public class body3D extends TransformGroup
public class Body3D extends TransformGroup {
	Vector3f Vf = new Vector3f();
	Vector3d Vd = new Vector3d();
	Vector3d VRot = new Vector3d();
	Transform3D Trans = new Transform3D();
	protected double scale = 1.0; // scale factor for 3D objects
	protected static String Lightwave_path;
	protected static String Wavefront_path;
	protected static String ThreeDStudio_path;
	jatMessages messages;

	public Body3D() {
//		PathUtil p = new PathUtil();
		// String fs = f.fs;
		// images_path = p.root_path + "data/jat3D/images_hires/";
		// images_path = f.root_path + "data" + fs + "jat3D" + fs +
		// "images_hires" + fs;
		// Wavefront_path = f.root_path + "data" + fs + "jat3D" + fs +
		// "Wavefront" + fs;
		// Lightwave_path = f.root_path + "data" + fs + "jat3D" + fs +
		// "Lightwave" + fs;
		// ThreeDStudio_path = f.root_path + "data" + fs + "jat3D" + fs +
		// "3DStudio" + fs;
		// System.out.println(images_path);
		setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
	}

	// Methods to be implemented in subclasses
	// abstract public void add();

	public void set_scale(double scale) {
		getTransform(Trans);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	/**
	 * Set the position of the body in km
	 *
	 * @param x
	 *            x position
	 * @param y
	 *            y position
	 * @param z
	 *            z position
	 */
	public void set_position(double x, double y, double z) {
		getTransform(Trans);
		Vd.x = x;
		Vd.y = y;
		Vd.z = z;
		Trans.setTranslation(Vd);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	/**
	 * Set new body position.
	 *
	 * @param rv
	 *            new position
	 */
	public void set_position(double[] rv) {
		getTransform(Trans);
		Vd.x = rv[0];
		Vd.y = rv[1];
		Vd.z = rv[2];
		Trans.setTranslation(Vd);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	/**
	 * Set new body position.
	 *
	 * @param r
	 *            new position
	 */
	public void set_position(VectorN r) {
		getTransform(Trans);
		Vd.x = r.x[0];
		Vd.y = r.x[1];
		Vd.z = r.x[2];
		Trans.setTranslation(Vd);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	public void set_position(Point3d r) {
		getTransform(Trans);
		Vd.x = r.x;
		Vd.y = r.y;
		Vd.z = r.z;
		Trans.setTranslation(Vd);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	public void set_position(Vector3f r) {
		getTransform(Trans);
		Vd.x = r.x;
		Vd.y = r.y;
		Vd.z = r.z;
		Trans.setTranslation(Vd);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	public void set_position(Vector3d r) {
		getTransform(Trans);
		Vd.x = r.x;
		Vd.y = r.y;
		Vd.z = r.z;
		Trans.setTranslation(Vd);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	/**
	 * Set_body attitude.using quaternion
	 *
	 * @param quatObject
	 *            quaternion
	 */
	public void set_attitude(Transform3D quatObject) {
		setTransform(quatObject);
	}

	/**
	 * Set body attitude without changing position or scale using Euler angles
	 *
	 * @param alpha
	 *            x angle
	 * @param beta
	 *            y angle
	 * @param gamma
	 *            z angle
	 */
	public void set_attitude(double alpha, double beta, double gamma) {
		getTransform(Trans);
		Trans.get(Vf);
		VRot.x = alpha;
		VRot.y = beta;
		VRot.z = gamma;
		Trans.setEuler(VRot);
		Trans.setTranslation(Vf);
		Trans.setScale(scale);
		setTransform(Trans);
	}

	/**
	 * Set body position and attitude
	 *
	 * @param x
	 * @param y
	 * @param z
	 * @param alpha
	 * @param beta
	 * @param gamma
	 */
	public void set_pos_attitude(double x, double y, double z, double alpha, double beta, double gamma) {
		getTransform(Trans);
		Trans.get(Vf);
		VRot.x = alpha;
		VRot.y = beta;
		VRot.z = gamma;
		Trans.setEuler(VRot);
		Vd.x = x;
		Vd.y = y;
		Vd.z = z;
		Trans.setTranslation(Vd);
		Trans.setScale(scale);
		setTransform(Trans);
	}

}


text:
{{title}}

{{description}}

{{version}}

{{installation}}

{{auth}}

## Getting started

{{client-classes}}

{{client-construction}}

## Sample code

## Creating a job

{{sample:CloudSchedulerClient.CreateJob}}

## Listing all jobs

{{sample:CloudSchedulerClient.ListJobs}}


text:
@interface EasyDiscountViewController () <UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *priceTextField;
@property (weak, nonatomic) IBOutlet UITextField *discountTextField;
@property (weak, nonatomic) IBOutlet UITextField *totalTextField;
-(void)calculate;
-(void)iPhoneShaked:(NSNotification *)notification;
@end

@implementation EasyDiscountViewController
@synthesize priceTextField;
@synthesize discountTextField;
@synthesize totalTextField;
//@synthesize discount = _discount;

//-(void)setDiscount:(double)discount{
//    _discount = discount;
//    discountLabel.text = [NSString stringWithFormat:@"Discount (%.2f)",_discount];
//}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.

    CAGradientLayer *gradient = [CAGradientLayer layer];
    gradient.frame = self.view.bounds;
    gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor colorWithHexString:@"0xE50000"] CGColor], (id)[[UIColor colorWithHexString:@"0x2C0000"] CGColor], nil];

    [self.view.layer insertSublayer:gradient atIndex:0];

    self.discountTextField.delegate = self;
    self.priceTextField.delegate = self;

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(iPhoneShaked:) name:@"iPhoneShaked" object:nil];
}

-(void)iPhoneShaked:(NSNotification *)notification{
#if vPRO
    self.priceTextField.text = @"";
    self.discountTextField.text = @"";
    self.totalTextField.text = @"";
#endif
}

- (void)viewDidUnload
{
    [self setPriceTextField:nil];
    [self setDiscountTextField:nil];
    [self setTotalTextField:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
//    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
//        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
//    } else {
//        return YES;
//    }
    return NO;
}

//-(double)getNumberFromString:(NSString*)number{
////    NSString *regex = @"";
//
//    NSError *error = NULL;
//    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\b[0-9]+(\\.[0-9]+)?\\b"
//                                                                           options:NSRegularExpressionCaseInsensitive
//                                                                             error:&error];
//    NSTextCheckingResult *match = [regex firstMatchInString:number
//                                                    options:0
//                                                      range:NSMakeRange(0, number.length)];
//
//    if (match) {
//        NSRange matchRange = [match range];
//        NSLog(@"Range location: %d lenght: %d",matchRange.location, matchRange.length);
//    }
//
//
//
//
//    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc]init];
//    [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
//
//    NSNumber *nsnumber = [numberFormatter numberFromString:number];
//
//    NSLog(@"number: %@",nsnumber.description);
//
//    return [numberFormatter numberFromString:number].doubleValue;
//}

- (IBAction)buttonAction:(id)sender {
    if([sender isKindOfClass:UIButton.class]){
        UIButton *button = (UIButton*)sender;
        NSString *title = button.titleLabel.text;
        double discount = discountTextField.text.doubleValue;
        if([title isEqualToString:@"+"]){
            discount++;
        } else if([title isEqualToString:@"-"]){
            discount--;
        } else {
            double predefinedPercent = [title substringToIndex:title.length-1].doubleValue;
            discount = predefinedPercent;
        }

        if([MathHelper isDecimal:discount]){
            self.discountTextField.text = [NSString stringWithFormat:@"%.2f", discount];
        } else {
            self.discountTextField.text = [NSString stringWithFormat:@"%d", (int)discount];
        }
        [self calculate];
    }
}

-(void)calculate{
    double price = self.priceTextField.text.doubleValue;
    double discount = self.discountTextField.text.doubleValue;
    double decimalDiscount = discount/100.0;
    double toSubstract = price * decimalDiscount;
    double total = price - toSubstract;
    if([MathHelper isDecimal:total]){
        self.totalTextField.text = [NSString stringWithFormat:@"%.2f",total];
    } else {
        self.totalTextField.text = [NSString stringWithFormat:@"%d",(int)total];
    }
}

#pragma mark -
#pragma mark UITextFieldDelegate

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    return textField.resignFirstResponder;
}

- (void)textFieldDidEndEditing:(UITextField *)textField{
    [self calculate];
}

//- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
//
//    NSLog(@"Old String: %@",textField.text);
//    NSLog(@"New String: %@",string);
//
//    return YES;
//}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="Cheque" table="cheque">
    <indexes>
      <index name="FK_CONTRE_CHEQUE" columns="EXEPT"/>
    </indexes>
    <id name="id" type="bigint" column="ID">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="numCheque" type="string" column="NUM_CHEQUE" length="56" nullable="true"/>
    <field name="titreCheque" type="string" column="TITRE_CHEQUE" length="30" nullable="true"/>
    <field name="montantChq" type="float" column="MONTANT_CHQ" precision="10" scale="0" nullable="true"/>
    <field name="dateEcheance" type="datetime" column="DATE_ECHEANCE" nullable="true"/>
    <field name="natureCheque" type="string" column="NATURE_CHEQUE" length="30" nullable="true"/>
    <field name="etatCheque" type="string" column="ETAT_CHEQUE" length="30" nullable="true"/>
    <field name="datevalid" type="datetime" column="dateValid" nullable="true"/>
    <field name="etatvalid" type="string" column="etatValid" length="20" nullable="true"/>
    <many-to-one field="exept" target-entity="Expedition">
      <join-columns>
        <join-column name="EXEPT" referenced-column-name="ID"/>
      </join-columns>
    </many-to-one>
    <many-to-many field="facture" target-entity="Facture" inversed-by="cheque">
      <join-table name="regler_par">
        <join-columns>
          <join-column name="CHEQUE" referenced-column-name="ID"/>
        </join-columns>
        <inverse-join-columns>
          <join-column name="FACTURE" referenced-column-name="ID"/>
        </inverse-join-columns>
      </join-table>
    </many-to-many>
  </entity>
</doctrine-mapping>


text:
using System;

namespace WheburfearnofeKellehere.Core.Models
{
    // Remove this class once your pages/features are using your data.
    // This is used by the SampleDataService.
    // It is the model class we use to display data on pages like Grid, Chart, and List Details.
    public class SampleOrderDetail
    {
        public long ProductID { get; set; }

        public string ProductName { get; set; }

        public int Quantity { get; set; }

        public double Discount { get; set; }

        public string QuantityPerUnit { get; set; }

        public double UnitPrice { get; set; }

        public string CategoryName { get; set; }

        public string CategoryDescription { get; set; }

        public double Total { get; set; }

        public string ShortDescription => $"Product ID: {ProductID} - {ProductName}";
    }
}


text:
from flask import Flask
from seldon.microservice.predict import predict_blueprint
from seldon.microservice.recommend import recommend_blueprint
from seldon.microservice.extension import extension_blueprint
import seldon
from sklearn.pipeline import Pipeline
import seldon.pipeline.util as sutl
import random
import pylibmc

class Microservices(object):
    """
    Allow creation of predict and recommender microservices

    aws_key : str, optional
       aws key
    aws_secret : str, optional
       aws secret
    """
    def __init__(self,aws_key=None,aws_secret=None):
        self.aws_key = aws_key
        self.aws_secret = aws_secret

    def create_prediction_microservice(self,pipeline_folder,model_name):
        """
        Create a prediction Flask microservice app

        Parameters
        ----------

        pipeline_folder : str
           location of pipeline
        model_name : str
           model name to use for this pipeline
        """
        app = Flask(__name__)

        rint = random.randint(1,999999)
        pw = sutl.Pipeline_wrapper(work_folder='/tmp/pl_'+str(rint),aws_key=self.aws_key,aws_secret=self.aws_secret)
        pipeline = pw.load_pipeline(pipeline_folder)

        app.config["seldon_pipeline_wrapper"] = pw
        app.config["seldon_pipeline"] = pipeline
        app.config["seldon_model_name"] = model_name

        app.register_blueprint(predict_blueprint)

        # other setup tasks
        return app

    def create_recommendation_microservice(self,recommender_folder,memcache_servers=None,memcache_pool_size=2):
        """
        create recommedation Flask microservice app

        Parameters
        ----------

        recommender_folder : str
           location of recommender model files
        memcache_servers : comma separated string, optional
           memcache server locations, e.g., 127.0.0.1:11211
        memcache_pool_size : int, optional
           size of memcache pool
        """
        app = Flask(__name__)

        if not memcache_servers is None:
            mc = pylibmc.Client(memcache_servers)
            _mc_pool = pylibmc.ClientPool(mc, memcache_pool_size)
            app.config["seldon_memcache"] = _mc_pool

        if self.aws_key:
            rw = seldon.Recommender_wrapper(aws_key=self.aws_key,aws_secret=self.aws_secret)
        else:
            rw = seldon.Recommender_wrapper()
        recommender = rw.load_recommender(recommender_folder)
        app.config["seldon_recommender"] = recommender

        app.register_blueprint(recommend_blueprint)

        # other setup tasks
        return app

    def create_extension_microservice(self,extension_folder):
        """
        Create a prediction Flask microservice app

        Parameters
        ----------

        extension_folder : str
           location of extension
        """
        app = Flask(__name__)

        rint = random.randint(1,999999)
        ew = seldon.Extension_wrapper(work_folder='/tmp/pl_'+str(rint),aws_key=self.aws_key,aws_secret=self.aws_secret)
        extension = ew.load_extension(extension_folder)

        app.config["seldon_extension_wrapper"] = ew
        app.config["seldon_extension"] = extension

        app.register_blueprint(extension_blueprint)

        # other setup tasks
        return app


text:
package org.apache.ignite.examples.servicegrid;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.services.Service;
import org.apache.ignite.services.ServiceContext;

/**
 * Simple service which utilizes Ignite cache as a mechanism to provide
 * distributed {@link SimpleMapService} functionality.
 */
public class SimpleMapServiceImpl<K, V> implements Service, SimpleMapService<K, V> {
    /** Serial version UID. */
    private static final long serialVersionUID = 0L;

    /** Ignite instance. */
    @IgniteInstanceResource
    private Ignite ignite;

    /** Underlying cache map. */
    private IgniteCache<K, V> cache;

    /** {@inheritDoc} */
    @Override public void put(K key, V val) {
        cache.put(key, val);
    }

    /** {@inheritDoc} */
    @Override public V get(K key) {
        return cache.get(key);
    }

    /** {@inheritDoc} */
    @Override public void clear() {
        cache.clear();
    }

    /** {@inheritDoc} */
    @Override public int size() {
        return cache.size();
    }

    /** {@inheritDoc} */
    @Override public void cancel(ServiceContext ctx) {
        ignite.destroyCache(ctx.name());

        System.out.println("Service was cancelled: " + ctx.name());
    }

    /** {@inheritDoc} */
    @Override public void init(ServiceContext ctx) throws Exception {
        // Create a new cache for every service deployment.
        // Note that we use service name as cache name, which allows
        // for each service deployment to use its own isolated cache.
        cache = ignite.getOrCreateCache(new CacheConfiguration<K, V>(ctx.name()));

        System.out.println("Service was initialized: " + ctx.name());
    }

    /** {@inheritDoc} */
    @Override public void execute(ServiceContext ctx) throws Exception {
        System.out.println("Executing distributed service: " + ctx.name());
    }
}