text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MemoryCacheController (Device Plug-in SDK for Android)</title>
<meta name="date" content="2020-07-06">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

ブラウザのJavaScriptが無効になっています。

ナビゲーション・リンクをスキップ

概要

パッケージ

クラス

階層ツリー

非推奨

索引

ヘルプ

前のクラス

次のクラス

フレーム

フレームなし

すべてのクラス

サマリー:

ネスト |

フィールド |

コンストラクタ |

メソッド

詳細:

フィールド |

コンストラクタ |

メソッド

org.deviceconnect.android.event.cache

クラス MemoryCacheController

java.lang.Object

org.deviceconnect.android.event.cache.BaseCacheController

org.deviceconnect.android.event.cache.MemoryCacheController

すべての実装されたインタフェース:

EventCacheController

直系の既知のサブクラス:

FileCacheController

public class MemoryCacheController
extends BaseCacheController

イベントデータをメモリにキャッシュし、キャッシュの操作機能を提供する.

コンストラクタのサマリー

コンストラクタ

コンストラクタと説明

MemoryCacheController()

メモリキャッシュコントローラーを生成する.

メソッドのサマリー

すべてのメソッド インスタンス・メソッド concreteメソッド

修飾子とタイプ
メソッドと説明

EventError
addEvent(Event event)

イベントデータをキャッシュに追加する.

void
flush()

キャッシュデータをフラッシュする.

protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<Event>>>
getCache()

イベントデータのキャッシュオブジェクトを取得する.

Event
getEvent(java.lang.String serviceId,
        java.lang.String profile,
        java.lang.String inter,
        java.lang.String attribute,
        java.lang.String origin,
        java.lang.String receiver)

キャッシュから指定された条件に合うイベントデータを取得する.

java.util.List<Event>
getEvents(java.lang.String origin)

java.util.List<Event>
getEvents(java.lang.String serviceId,
         java.lang.String profile,
         java.lang.String inter,
         java.lang.String attribute)

キャッシュから条件にあうイベントデータの一覧を取得する.

boolean
removeAll()

キャッシュからデータを全て削除する.

EventError
removeEvent(Event event)

イベントデータをキャッシュから削除する.

boolean
removeEvents(java.lang.String origin)

指定されたオリジンに紐づくイベント情報を全て削除する.

protected void
setCache(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<Event>>> cache)

キャッシュを設定する.

クラスから継承されたメソッド org.deviceconnect.android.event.cache.BaseCacheController

checkParameter

クラスから継承されたメソッド java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

コンストラクタの詳細

MemoryCacheController

public MemoryCacheController()

メモリキャッシュコントローラーを生成する.

メソッドの詳細

addEvent

public EventError addEvent(Event event)

インタフェースからコピーされた説明: EventCacheController

イベントデータをキャッシュに追加する.

パラメータ:

event - イベントデータ

戻り値:

処理結果

removeEvent

public EventError removeEvent(Event event)

インタフェースからコピーされた説明: EventCacheController

イベントデータをキャッシュから削除する.

パラメータ:

event - イベントデータ

戻り値:

処理結果

getEvent

public Event getEvent(java.lang.String serviceId,
                      java.lang.String profile,
                      java.lang.String inter,
                      java.lang.String attribute,
                      java.lang.String origin,
                      java.lang.String receiver)

インタフェースからコピーされた説明: EventCacheController

キャッシュから指定された条件に合うイベントデータを取得する.

パラメータ:

serviceId - サービスID

profile - プロファイル名

inter - インターフェース名

attribute - 属性名

origin - オリジン

receiver - レシーバー名

戻り値:

イベントデータ。条件に合うものが無い場合はnullを返す。

getEvents

public java.util.List<Event> getEvents(java.lang.String serviceId,
                                       java.lang.String profile,
                                       java.lang.String inter,
                                       java.lang.String attribute)

インタフェースからコピーされた説明: EventCacheController

キャッシュから条件にあうイベントデータの一覧を取得する.

パラメータ:

serviceId - サービスID

profile - プロファイル名

inter - インターフェース名

attribute - 属性名

戻り値:

イベントデータの一覧。無い場合は空のリストを返す。

getEvents

public java.util.List<Event> getEvents(java.lang.String origin)

flush

public void flush()

インタフェースからコピーされた説明: EventCacheController

キャッシュデータをフラッシュする.

removeAll

public boolean removeAll()

インタフェースからコピーされた説明: EventCacheController

キャッシュからデータを全て削除する.

戻り値:

成功の場合true、その他はfalseを返す

getCache

protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<Event>>> getCache()

イベントデータのキャッシュオブジェクトを取得する.
 Map<serviceId, Map<profile+interface+attribute, List<Event>>>。

戻り値:

キャッシュ

setCache

protected void setCache(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<Event>>> cache)

キャッシュを設定する.
 nullの場合設定されない。

パラメータ:

cache - キャッシュ

removeEvents

public boolean removeEvents(java.lang.String origin)

インタフェースからコピーされた説明: EventCacheController

指定されたオリジンに紐づくイベント情報を全て削除する.

パラメータ:

origin - オリジン

戻り値:

成功の場合true、その他はfalseを返す

ナビゲーション・リンクをスキップ

概要

パッケージ

クラス

階層ツリー

非推奨

索引

ヘルプ

前のクラス

次のクラス

フレーム

フレームなし

すべてのクラス

サマリー:

ネスト |

フィールド |

コンストラクタ |

メソッド

詳細:

フィールド |

コンストラクタ |

メソッド


text:
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, HDTextViewInputViewType) {
    HDTextViewNormalInputType = 0,
    HDTextViewTextInputType,
    HDTextViewFaceInputType,
    HDTextViewShareMenuInputType,
};

@interface HDTextView : UITextView

@property (nonatomic, copy) NSString *placeHolder;

@property (nonatomic, strong) UIColor *placeHolderTextColor;

- (NSUInteger)numberOfLinesOfText;

+ (NSUInteger)maxCharactersPerLine;

+ (NSUInteger)numberOfLinesForMessage:(NSString *)text;

@end

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="Apache Forrest" name="Generator">
<meta name="Forrest-version" content="0.10-dev">
<meta name="Forrest-skin-name" content="pelt">
<title>Apache™ FOP Version 1.1</title>
<link type="text/css" href="../skin/basic.css" rel="stylesheet">
<link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet">
<link media="print" type="text/css" href="../skin/print.css" rel="stylesheet">
<link type="text/css" href="../skin/profile.css" rel="stylesheet">

<link rel="shortcut icon" href="../favicon.ico">

<form action="http://www.google.com/search" method="get" class="roundtopsmall">
<input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">
                    <input name="Search" value="Search" type="submit">
</form>

Home

Version 1.0

Version 1.1

FOP Trunk

Development

The Apache Software Foundation > Apache XML Graphics Project

Apache™ FOP 1.1

About

Release Notes

Changes (1.1)

Known Issues

Upgrading

Using Apache™ FOP

Ant Task

Build

Configure

Embed

Run

Servlets

Features

Accessibility

Complex Scripts

Events

Extensions

Fonts

Graphics

Hyphenation

Intermediate Format

Metadata

Output Targets

PDF/A

PDF/X

PDF Encryption

        XML

        PDF

Font size:
	           <input value="Reset" class="resetfont" title="Reset text" onclick="ndeSetTextSize('reset'); return false;" type="button">
	           <input value="-a" class="smallerfont" title="Shrink text" onclick="ndeSetTextSize('decr'); return false;" type="button">
	           <input value="+a" class="biggerfont" title="Enlarge text" onclick="ndeSetTextSize('incr'); return false;" type="button">

Apache™ FOP Version 1.1

Introduction

Upgrading from an earlier version

Download

Introduction

        This is Version 1.1 of Apache FOP. FOP 1.1 contains many bug
        fixes and a number of improvements, including
        important features such as support for Complex Scripts
        (e.g., Arabic, Hebrew, Indic, and Southeast Asian scripts). To see what has changed since the last release,
        please visit Release Notes.

	This release implements a substantial subset of the W3C XSL-FO 1.1
	Recommendation. For a detailed overview of FOP's
	compliance with this recommendation, see Compliance.

Upgrading from an earlier version

        If you're upgrading to this version from an earlier version of FOP, please read the
        information on Upgrading!

Download

        To download this version, please visit Downloading.

$Revision$

        Copyright ©
         1999-2012 The Apache Software Foundation. Licensed under Apache License 2.0

    Apache, Apache FOP, the Apache feather logo, and the Apache FOP
    logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.


text:
<?php

declare(strict_types = 1);

namespace OctoLab\Common\Command\Doctrine;

use Doctrine\DBAL\Exception\ConnectionException;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Migrations\Tools\Console\Command\AbstractCommand;
use Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand;
use Doctrine\DBAL\Schema\Schema;
use OctoLab\Common\Doctrine\Migration\FileBasedMigration;
use OctoLab\Common\Doctrine\Util\Parser;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * @author Kamil Samigullin <kamil@samigullin.info>
 */
final class CheckMigrationCommand extends AbstractCommand
{
    /**
     * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
     */
    protected function configure()
    {
        parent::configure();
        $this
            ->setName('migrations:check')
            ->setDescription('Return list of sql queries in file or migration.')
            ->addArgument('migration', InputArgument::REQUIRED, 'Path to sql file or migration class.')
        ;
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     *
     * @return int
     *
     * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
     * @throws \InvalidArgumentException
     * @throws \Doctrine\DBAL\Migrations\MigrationException
     * @throws \TypeError
     * @throws \ReflectionException
     */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $migration = $input->getArgument('migration');
        if (is_file($migration)) {
            return $this->checkFileMigration($migration, $output);
        }
        $instance = $this->getMigrationInstance($migration, $input, $output);
        if ($instance instanceof FileBasedMigration) {
            return $this->checkFileBasedMigration($instance, $migration, $output);
        }
        throw new \InvalidArgumentException(sprintf(
            'Migration must be an instance of %s. Use "--dry-run" option of %s to see its\' content instead.',
            FileBasedMigration::class,
            MigrateCommand::class
        ));
    }

    /**
     * @param FileBasedMigration $migration
     * @param string $migrationName
     * @param OutputInterface $output
     *
     * @return int
     */
    private function checkFileBasedMigration(
        FileBasedMigration $migration,
        string $migrationName,
        OutputInterface $output
    ): int {
        $methods = ['upgrade' => 'preUp', 'downgrade' => 'preDown'];
        // the right way is to use the same schema that is passed to a real migration
        $schema = new Schema();
        foreach ($methods as $direction => $method) {
            $migration->{$method}($schema);
            if ($migration->getQueries()) {
                $output->writeln(
                    sprintf('<comment>%s by migration %s contains</comment>', ucfirst($direction), $migrationName)
                );
                $this->printQueries($migration->getQueries(), $output);
            } else {
                $output->writeln(
                    sprintf('<comment>%s by migration %s is empty</comment>', ucfirst($direction), $migrationName)
                );
            }
        }
        return 0;
    }

    /**
     * @param string $file
     * @param OutputInterface $output
     *
     * @return int
     */
    private function checkFileMigration(string $file, OutputInterface $output): int
    {
        $queries = Parser::extractSql(file_get_contents($file));
        if (!empty($queries)) {
            $output->writeln(sprintf('<comment>Migration %s contains</comment>', $file));
            $this->printQueries($queries, $output);
        } else {
            $output->writeln(sprintf('<comment>Migration %s is empty</comment>', $file));
        }
        return 0;
    }

    /**
     * @param string $migration
     * @param InputInterface $input
     * @param OutputInterface $output
     *
     * @return AbstractMigration
     *
     * @throws \Doctrine\DBAL\Migrations\MigrationException if could not find migration version
     * @throws \TypeError if it returns not instance of \Doctrine\DBAL\Migrations\AbstractMigration
     * @throws \ReflectionException
     */
    private function getMigrationInstance(
        string $migration,
        InputInterface $input,
        OutputInterface $output
    ): AbstractMigration {
        if (class_exists($migration)) {
            $instance = (new \ReflectionClass($migration))->newInstanceWithoutConstructor();
        } else {
            $configuration = $this->getMigrationConfiguration($input, $output);
            try {
                $instance = $configuration->getVersion($migration)->getMigration();
            } catch (ConnectionException $e) {
                $class = $configuration->getMigrationsNamespace() . '\\Version' . $migration;
                \assert('class_exists($class)');
                $instance = (new \ReflectionClass($class))->newInstanceWithoutConstructor();
            }
        }
        return $instance;
    }

    /**
     * @param string[] $queries
     * @param OutputInterface $output
     */
    private function printQueries(array $queries, OutputInterface $output)
    {
        $counter = \strlen((string)\count($queries));
        foreach ($queries as $i => $query) {
            $output->writeln(
                sprintf('<info>%s. %s</info>', str_pad((string)($i + 1), $counter, ' ', STR_PAD_LEFT), $query)
            );
        }
    }
}


text:
<?php

namespace tests\cases\core;

require_once dirname(__DIR__) . '/__init.php';


text:
SYNONYM

#### According to
GRIN Taxonomy for Plants

#### Published in
H. G. A. Engler, Pflanzenr. IV. 220B(Heft 41):22. 1910

#### Original name
null

### Remarks
null


text:
let mockPath = "/app/designer/zones/1";
jest.mock("../../history", () => ({
  getPathArray: jest.fn(() => mockPath.split("/")),
  push: jest.fn(),
}));

jest.mock("../../api/crud", () => ({
  edit: jest.fn(),
  save: jest.fn(),
}));

import * as React from "react";
import { mount, shallow } from "enzyme";
import {
  RawEditZone as EditZone, EditZoneProps, mapStateToProps,
} from "../edit_zone";
import { fakeState } from "../../__test_support__/fake_state";
import { fakePointGroup } from "../../__test_support__/fake_state/resources";
import {
  buildResourceIndex,
} from "../../__test_support__/resource_index_builder";
import { save, edit } from "../../api/crud";
import { push } from "../../history";

describe("<EditZone />", () => {
  const fakeProps = (): EditZoneProps => ({
    dispatch: jest.fn(),
    findZone: () => undefined,
    botSize: {
      x: { value: 3000, isDefault: true },
      y: { value: 1500, isDefault: true },
    },
  });

  it("redirects", () => {
    mockPath = "/app/designer/zones/nope";
    const wrapper = mount(<EditZone {...fakeProps()} />);
    expect(wrapper.text()).toContain("Redirecting...");
    expect(push).toHaveBeenCalledWith("/app/designer/zones");
  });

  it("doesn't redirect", () => {
    mockPath = "/app/logs";
    const wrapper = mount(<EditZone {...fakeProps()} />);
    expect(wrapper.text()).toContain("Redirecting...");
    expect(push).not.toHaveBeenCalled();
  });

  it("renders", () => {
    mockPath = "/app/designer/zones/1";
    const p = fakeProps();
    p.findZone = () => fakePointGroup();
    const wrapper = mount(<EditZone {...p} />);
    expect(wrapper.text().toLowerCase()).toContain("edit");
  });

  it("changes name", () => {
    mockPath = "/app/designer/zones/1";
    const p = fakeProps();
    const group = fakePointGroup();
    p.findZone = () => group;
    const wrapper = shallow(<EditZone {...p} />);
    wrapper.find("input").first().simulate("blur", {
      currentTarget: { value: "new name" }
    });
    expect(edit).toHaveBeenCalledWith(group, { name: "new name" });
    expect(save).toHaveBeenCalledWith(group.uuid);
  });
});

describe("mapStateToProps()", () => {
  it("returns props", () => {
    const state = fakeState();
    state.resources = buildResourceIndex([fakePointGroup()]);
    const props = mapStateToProps(state);
    expect(props.findZone(1)).toEqual(undefined);
  });
});


text:
class CostsController < ApplicationController
  make_resource_controller do
    belongs_to :product, :manufacturer

    response_for :create do |format|
      format.html { redirect_to objects_path }
      format.js
    end

    response_for :update do |format|
      format.html { redirect_to objects_path }
      format.js
    end
  end

  def resourceful_name
    t(:cost, :scope => [ :marketplace ])
  end

  before_filter :check_editor_of_indexed, :only => [ :index ]
  before_filter :check_editor_of_product, :only => [ :new, :create ]
  before_filter :check_editor_of_cost, :only => [ :edit, :update, :destroy ]

  def index
    respond_with_indexer do |options|
      options[:default_sort] = :product
      options[:headers] = [
        { :name => t(:product, :scope => [ :marketplace ]), :sort => :product, :include => :product, :order => "#{Product.table_name}.name" },
        { :name => t(:country, :scope => [ :contacts, :addresses ]), :sort => :country, :include => :country, :order => "#{Country.table_name}.name" },
        { :name => t(:amount, :scope => [ :marketplace ]), :sort => :amount }
      ]

      if @product
        add_breadcrumb h(@product.name), @product

        options[:conditions] = [ "product_id = ?", @product.id ]
      elsif @manufacturer
        add_breadcrumb h(@manufacturer.name), @manufacturer

        options[:include] = { :product => { :model => { :make => :manufacturer } } }
        options[:conditions] = [ "#{Manufacturer.table_name}.id = ?", @manufacturer.id ]
      end
    end
  end

  private

  def check_editor_of_indexed
    check_editor_of(@manufacturer || @product, true)
  end

  def check_editor_of_product
    check_editor_of(@product)
  end

  def check_editor_of_cost
    check_editor_of(@cost)
  end
end


text:
package uk.me.berndporr.iirj;

import org.apache.commons.math3.complex.Complex;

/**
 * User facing class which contains all the methods the user uses to create
 * ChebyshevI filters. This done in this way: ChebyshevII chebyshevII = new
 * ChebyshevII(); Then call one of the methods below to create low-,high-,band-,
 * or stopband filters. For example: chebyshevII.bandPass(2,250,50,5,0.5);
 */
public class ChebyshevII extends Cascade {

	class AnalogLowPass extends LayoutBase {

		private int nPoles;

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

		public AnalogLowPass(int _nPoles) {
			super(_nPoles);
			nPoles = _nPoles;
		}

		public void design(double stopBandDb) {
			reset();

			double eps = Math.sqrt(1. / (Math.exp(stopBandDb * 0.1 * MathSupplement.doubleLn10) - 1));
			double v0 = MathSupplement.asinh(1 / eps) / nPoles;
			double sinh_v0 = -Math.sinh(v0);
			double cosh_v0 = Math.cosh(v0);
			double fn = Math.PI / (2 * nPoles);

			int k = 1;
			for (int i = nPoles / 2; --i >= 0; k += 2) {
				double a = sinh_v0 * Math.cos((k - nPoles) * fn);
				double b = cosh_v0 * Math.sin((k - nPoles) * fn);
				double d2 = a * a + b * b;
				double im = 1 / Math.cos(k * fn);
				Complex pole = new Complex(a / d2, b / d2);
				Complex zero = new Complex(0.0, im);
				addPoleZeroConjugatePairs(pole,zero);
			}

			if ((nPoles & 1) == 1) {
				add(new Complex(1 / sinh_v0), new Complex(Double.POSITIVE_INFINITY));
			}
			setNormal(0,1);
		}
	}

	private void setupLowPass(int order, double sampleRate, double cutoffFrequency, double rippleDb,
			int directFormType) {

		AnalogLowPass m_analogProto = new AnalogLowPass(order);
		m_analogProto.design(rippleDb);

		LayoutBase m_digitalProto = new LayoutBase(order);

		new LowPassTransform(cutoffFrequency / sampleRate, m_digitalProto, m_analogProto);

		setLayout(m_digitalProto, directFormType);
	}

	/**
	 * ChebyshevI Lowpass filter with default toplogy
	 *
	 * @param order
	 *            The order of the filter
	 * @param sampleRate
	 *            The sampling rate of the system
	 * @param cutoffFrequency
	 *            the cutoff frequency
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 */
	public void lowPass(int order, double sampleRate, double cutoffFrequency, double rippleDb) {
		setupLowPass(order, sampleRate, cutoffFrequency, rippleDb, DirectFormAbstract.DIRECT_FORM_II);
	}

	/**
	 * ChebyshevI Lowpass filter with custom topology
	 *
	 * @param order
	 *            The order of the filter
	 * @param sampleRate
	 *            The sampling rate of the system
	 * @param cutoffFrequency
	 *            The cutoff frequency
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 * @param directFormType
	 *            The filter topology. This is either
	 *            DirectFormAbstract.DIRECT_FORM_I or DIRECT_FORM_II
	 */
	public void lowPass(int order, double sampleRate, double cutoffFrequency, double rippleDb, int directFormType) {
		setupLowPass(order, sampleRate, cutoffFrequency, rippleDb, directFormType);
	}

	private void setupHighPass(int order, double sampleRate, double cutoffFrequency, double rippleDb,
			int directFormType) {

		AnalogLowPass m_analogProto = new AnalogLowPass(order);
		m_analogProto.design(rippleDb);

		LayoutBase m_digitalProto = new LayoutBase(order);

		new HighPassTransform(cutoffFrequency / sampleRate, m_digitalProto, m_analogProto);

		setLayout(m_digitalProto, directFormType);
	}

	/**
	 * ChebyshevI Highpass filter with default topology
	 *
	 * @param order
	 *            The order of the filter
	 * @param sampleRate
	 *            The sampling rate of the system
	 * @param cutoffFrequency
	 *            the cutoff frequency
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 */
	public void highPass(int order, double sampleRate, double cutoffFrequency, double rippleDb) {
		setupHighPass(order, sampleRate, cutoffFrequency, rippleDb, DirectFormAbstract.DIRECT_FORM_II);
	}

	/**
	 * ChebyshevI Lowpass filter and custom filter topology
	 *
	 * @param order
	 *            The order of the filter
	 * @param sampleRate
	 *            The sampling rate of the system
	 * @param cutoffFrequency
	 *            The cutoff frequency
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 * @param directFormType
	 *            The filter topology. This is either
	 *            DirectFormAbstract.DIRECT_FORM_I or DIRECT_FORM_II
	 */
	public void highPass(int order, double sampleRate, double cutoffFrequency, double rippleDb, int directFormType) {
		setupHighPass(order, sampleRate, cutoffFrequency, rippleDb, directFormType);
	}

	private void setupBandStop(int order, double sampleRate, double centerFrequency, double widthFrequency,
			double rippleDb, int directFormType) {

		AnalogLowPass m_analogProto = new AnalogLowPass(order);
		m_analogProto.design(rippleDb);

		LayoutBase m_digitalProto = new LayoutBase(order * 2);

		new BandStopTransform(centerFrequency / sampleRate, widthFrequency / sampleRate, m_digitalProto, m_analogProto);

		setLayout(m_digitalProto, directFormType);
	}

	/**
	 * Bandstop filter with default topology
	 *
	 * @param order
	 *            Filter order (actual order is twice)
	 * @param sampleRate
	 *            Samping rate of the system
	 * @param centerFrequency
	 *            Center frequency
	 * @param widthFrequency
	 *            Width of the notch
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 */
	public void bandStop(int order, double sampleRate, double centerFrequency, double widthFrequency, double rippleDb) {
		setupBandStop(order, sampleRate, centerFrequency, widthFrequency, rippleDb, DirectFormAbstract.DIRECT_FORM_II);
	}

	/**
	 * Bandstop filter with custom topology
	 *
	 * @param order
	 *            Filter order (actual order is twice)
	 * @param sampleRate
	 *            Samping rate of the system
	 * @param centerFrequency
	 *            Center frequency
	 * @param widthFrequency
	 *            Width of the notch
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 * @param directFormType
	 *            The filter topology
	 */
	public void bandStop(int order, double sampleRate, double centerFrequency, double widthFrequency, double rippleDb,
			int directFormType) {
		setupBandStop(order, sampleRate, centerFrequency, widthFrequency, rippleDb, directFormType);
	}

	private void setupBandPass(int order, double sampleRate, double centerFrequency, double widthFrequency,
			double rippleDb, int directFormType) {

		AnalogLowPass m_analogProto = new AnalogLowPass(order);
		m_analogProto.design(rippleDb);

		LayoutBase m_digitalProto = new LayoutBase(order * 2);

		new BandPassTransform(centerFrequency / sampleRate, widthFrequency / sampleRate, m_digitalProto, m_analogProto);

		setLayout(m_digitalProto, directFormType);

	}

	/**
	 * Bandpass filter with default topology
	 *
	 * @param order
	 *            Filter order
	 * @param sampleRate
	 *            Sampling rate
	 * @param centerFrequency
	 *            Center frequency
	 * @param widthFrequency
	 *            Width of the notch
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 */
	public void bandPass(int order, double sampleRate, double centerFrequency, double widthFrequency, double rippleDb) {
		setupBandPass(order, sampleRate, centerFrequency, widthFrequency, rippleDb, DirectFormAbstract.DIRECT_FORM_II);
	}

	/**
	 * Bandpass filter with custom topology
	 *
	 * @param order
	 *            Filter order
	 * @param sampleRate
	 *            Sampling rate
	 * @param centerFrequency
	 *            Center frequency
	 * @param widthFrequency
	 *            Width of the notch
	 * @param rippleDb
	 *            passband ripple in decibel sensible value: 1dB
	 * @param directFormType
	 *            The filter topology (see DirectFormAbstract)
	 */
	public void bandPass(int order, double sampleRate, double centerFrequency, double widthFrequency, double rippleDb,
			int directFormType) {
		setupBandPass(order, sampleRate, centerFrequency, widthFrequency, rippleDb, directFormType);
	}

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Hedwigia 40: 324 (1901)

#### Original name
Thelephora sparassoides Henn., 1901

### Remarks
null


text:
using System;
using Nimbus.MessageContracts;

namespace KillrVideo.SampleData.Dtos
{
    /// <summary>
    /// Command for adding sample YouTube videos to the site.
    /// </summary>
    [Serializable]
    public class AddSampleYouTubeVideos : IBusCommand
    {
        public int NumberOfVideos { get; set; }
    }
}


text:
package org.deftserver.io.timeout;

import java.nio.channels.SelectableChannel;

public interface TimeoutManager {

	void addTimeout(Timeout timeout);

	void addKeepAliveTimeout(SelectableChannel channel, Timeout timeout);

	boolean hasKeepAliveTimeout(SelectableChannel channel);

	/**
	 *
	 * @return the positive number (>0) in milliseconds until the deadline for the next scheduled timeout.
	 */
	long execute();

}


text:
@interface PodsDummy_QBImagePickerController : NSObject
@end
@implementation PodsDummy_QBImagePickerController
@end


text:
using System;
using Flame.Compiler;
using LLVMSharp;

namespace Flame.LLVM.Codegen
{
    /// <summary>
    /// A code block that performs a binary operation.
    /// </summary>
    public sealed class BinaryBlock : CodeBlock
    {
        public BinaryBlock(
            LLVMCodeGenerator CodeGenerator,
            CodeBlock Left,
            CodeBlock Right,
            IType Type,
            Func<LLVMBuilderRef, LLVMValueRef, LLVMValueRef, string, LLVMValueRef> BuildBinary)
        {
            this.codeGen = CodeGenerator;
            this.lhs = Left;
            this.rhs = Right;
            this.resultType = Type;
            this.build = BuildBinary;
        }

        private LLVMCodeGenerator codeGen;
        private CodeBlock lhs;
        private CodeBlock rhs;
        private IType resultType;
        private Func<LLVMBuilderRef, LLVMValueRef, LLVMValueRef, string, LLVMValueRef> build;

        /// <inheritdoc/>
        public override ICodeGenerator CodeGenerator => codeGen;

        /// <inheritdoc/>
        public override IType Type => resultType;

        /// <inheritdoc/>
        public override BlockCodegen Emit(BasicBlockBuilder BasicBlock)
        {
            var lhsCodegen = lhs.Emit(BasicBlock);
            var rhsCodegen = rhs.Emit(lhsCodegen.BasicBlock);
            return new BlockCodegen(
                rhsCodegen.BasicBlock,
                build(rhsCodegen.BasicBlock.Builder, lhsCodegen.Value, rhsCodegen.Value, "tmp"));
        }
    }
}


text:
<?php

namespace Sp\BowerBundle\Bower\Exception;

/**
 * @author Martin Parsiegla <martin.parsiegla@gmail.com>
 */
class InvalidMappingException extends MappingException
{
}


text:
<?php

namespace {

from('Hoa')

/**
 * \Hoa\Xyl\Interpreter\Html\Generic
 */
-> import('Xyl.Interpreter.Html.Generic')

/**
 * \Hoa\Test\Praspel\Compiler
 */
-> import('Test.Praspel.Compiler');

}

namespace Hoa\Xyl\Interpreter\Html {

/**
 * Class \Hoa\Xyl\Interpreter\Html\Input.
 *
 * The <input /> component.
 *
 * @author     Ivan Enderlin <ivan.enderlin@hoa-project.net>
 * @copyright  Copyright © 2007-2012 Ivan Enderlin.
 * @license    New BSD License
 */

class Input extends Generic {

    /**
     * Attributes description.
     *
     * @var \Hoa\Xyl\Interpreter\Html\Input array
     */
    protected static $_attributes        = array(
        'accept'         => parent::ATTRIBUTE_TYPE_NORMAL,
        'alt'            => parent::ATTRIBUTE_TYPE_NORMAL,
        'autocomplete'   => parent::ATTRIBUTE_TYPE_NORMAL,
        'checked'        => parent::ATTRIBUTE_TYPE_NORMAL,
        'dirname'        => parent::ATTRIBUTE_TYPE_NORMAL,
        'formaction'     => parent::ATTRIBUTE_TYPE_LINK,
        'formenctype'    => parent::ATTRIBUTE_TYPE_NORMAL,
        'formmethod'     => parent::ATTRIBUTE_TYPE_NORMAL,
        'formnovalidate' => parent::ATTRIBUTE_TYPE_NORMAL,
        'formtarget'     => parent::ATTRIBUTE_TYPE_NORMAL,
        'height'         => parent::ATTRIBUTE_TYPE_NORMAL,
        'list'           => parent::ATTRIBUTE_TYPE_NORMAL,
        'max'            => parent::ATTRIBUTE_TYPE_NORMAL,
        'maxlength'      => parent::ATTRIBUTE_TYPE_NORMAL,
        'min'            => parent::ATTRIBUTE_TYPE_NORMAL,
        'multiple'       => parent::ATTRIBUTE_TYPE_NORMAL,
        'name'           => parent::ATTRIBUTE_TYPE_NORMAL,
        'onerror'        => parent::ATTRIBUTE_TYPE_LIST,
        'pattern'        => parent::ATTRIBUTE_TYPE_NORMAL,
        'placeholder'    => parent::ATTRIBUTE_TYPE_NORMAL,
        'readonly'       => parent::ATTRIBUTE_TYPE_NORMAL,
        'required'       => parent::ATTRIBUTE_TYPE_NORMAL,
        'size'           => parent::ATTRIBUTE_TYPE_NORMAL,
        'src'            => parent::ATTRIBUTE_TYPE_LINK,
        'step'           => parent::ATTRIBUTE_TYPE_NORMAL,
        'type'           => parent::ATTRIBUTE_TYPE_NORMAL,
        'validate'       => parent::ATTRIBUTE_TYPE_CUSTOM,
        'value'          => parent::ATTRIBUTE_TYPE_NORMAL,
        'width'          => parent::ATTRIBUTE_TYPE_NORMAL
    );

    /**
     * Attributes mapping between XYL and HTML.
     *
     * @var \Hoa\Xyl\Interpreter\Html\Input array
     */
    protected static $_attributesMapping = array(
        'accept',
        'alt',
        'autocomplete',
        'checked',
        'dirname',
        'formaction',
        'formenctype',
        'formmethod',
        'formnovalidate',
        'formtarget',
        'height',
        'list',
        'max',
        'maxlength',
        'min',
        'multiple',
        'name',
        'pattern',
        'placeholder',
        'readonly',
        'required',
        'size',
        'src',
        'step',
        'type',
        'value',
        'width'
    );

    /**
     * Whether content could exist or not.
     * 0 to false, 1 to true, 2 to maybe.
     *
     * @var \Hoa\Xyl\Interpreter\Html\Input int
     */
    protected $_contentFlow              = 0;

    /**
     * Praspel compiler, to interprete the validate attribute.
     *
     * @var \Hoa\Test\Praspel\Compiler object
     */
    protected static $_compiler          = null;

    /**
     * Whether the input is valid or not.
     *
     * @var \Hoa\Xyl\Interpreter\Html\Input bool
     */
    protected $_validity                 = true;

    /**
     * Set (or restore) the input value.
     *
     * @access  public
     * @param   string  $value    Value.
     * @return  string
     */
    public function setValue ( $value ) {

        $old = $this->getValue();

        switch(strtolower($this->readAttribute('type'))) {

            case 'checkbox':
                $this->writeAttribute('checked', 'checked');
              break;

            case 'radio':
                if($value == $this->readAttribute('value'))
                    $this->writeAttribute('checked', 'checked');
                else
                    $this->removeAttribute('checked');
              break;

            default:
                $this->writeAttribute('value', $value);
        }

        return $old;
    }

    /**
     * Get the input value.
     *
     * @access  public
     * @return  string
     */
    public function getValue ( ) {

        $value = $this->readAttribute('value');

        if(ctype_digit($value))
            $value = (int) $value;
        elseif(is_numeric($value))
            $value = (float) $value;

        return $value;
    }

    /**
     * Unset the input value.
     *
     * @access  public
     * @return  void
     */
    public function unsetValue ( ) {

        switch(strtolower($this->readAttribute('type'))) {

            case 'checkbox':
            case 'radio':
                $this->removeAttribute('checked');
              break;

            default:
                $this->removeAttribute('value');
        }

        return;
    }

    /**
     * Check the input validity.
     *
     * @access  public
     * @param   mixed  $value    Value (if null, will find the value).
     * @return  bool
     */
    public function checkValidity ( $value = null ) {

        $type = strtolower($this->readAttribute('type'));

        if('submit' === $type || 'reset' === $type) {

            $this->_validity = false;

            if(   null   === $value
               || $value ==  $this->getValue())
                $this->_validity = true;

            return $this->_validity;
        }

        $validates = array();

        if(true === $this->abstract->attributeExists('validate'))
            $validates['@'] = $this->abstract->readAttribute('validate');
        else
            switch($type) {

                //@TODO
                // Write Praspel for each input type.
            }

        if(true === $this->attributeExists('pattern')) {

            $pattern = 'regex(\'' . str_replace(
                           '\'',
                           '\\\'',
                           $this->readAttribute('pattern')
                       ) .
                       '\', boundinteger(1, ' .
                       ($this->attributeExists('maxlength')
                           ? $this->readAttribute('maxlength')
                           : 7) .
                       '))';

            if(!isset($validates['@']))
                $validates['@']  = $pattern;
            else
                $validates['@'] .= ' or ' . $pattern;
        }

        $validates = array_merge(
            $validates,
            $this->abstract->readCustomAttributes('validate')
        );

        if(empty($validates))
            return true;

        $onerrors = array();

        if(true === $this->abstract->attributeExists('onerror'))
            $onerrors['@'] = $this->abstract->readAttributeAsList('onerror');

        $onerrors = array_merge(
            $onerrors,
            $this->abstract->readCustomAttributesAsList('onerror')
        );

        if(null === $value)
            $value = $this->getValue();
        else
            if(ctype_digit($value))
                $value = (int) $value;
            elseif(is_numeric($value))
                $value = (float) $value;

        if(null === self::$_compiler)
            self::$_compiler = new \Hoa\Test\Praspel\Compiler();

        $this->_validity = true;

        foreach($validates as $name => $realdom) {

            self::$_compiler->compile('@requires i: ' . $realdom . ';');
            $praspel         = self::$_compiler->getRoot();
            $variable        = $praspel->getClause('requires')->getVariable('i');
            $decision        = $variable->predicate($value);
            $this->_validity = $this->_validity && $decision;

            if(true === $decision)
                continue;

            if(!isset($onerrors[$name]))
                continue;

            $errors = $this->xpath(
                '//__current_ns:error[@id="' .
                implode('" or @id="', $onerrors[$name]) .
                '"]'
            );

            foreach($errors as $error)
                $this->getConcreteElement($error)->setVisibility(true);
        }

        return $this->_validity;
    }

    /**
     * Whether the input is valid or not.
     *
     * @access  public
     * @return  bool
     */
    public function isValid ( ) {

        return $this->_validity;
    }
}

}


text:
@interface OpenBaiduMapDemo : UITableViewController {
    NSArray *_titleArray;
}

@end

#endif


text:
package com.alibaba.json.bvt.bug;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;

public class Bug_for_array extends TestCase {
	public void test_array() throws Exception {
		A[] array = new A[] { new B(123, "xxx") };

		String text = JSON.toJSONString(array);
		System.out.println(text);
		Assert.assertEquals("[{\"id\":123,\"name\":\"xxx\"}]", text);
	}

	public static class A {
		private int id;

		public int getId() {
			return id;
		}

		public void setId(int id) {
			this.id = id;
		}

	}

	public static class B extends A {
		private String name;

		public B() {

		}

		public B  (int id, String name) {
			setId(id);
			setName(name);
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

	}
}


text: export * from './counter';


text:
package org.apache.olingo.server.sample.edmprovider;

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

import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;
import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer;
import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo;
import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;
import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding;
import org.apache.olingo.commons.api.edm.provider.CsdlProperty;
import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
import org.apache.olingo.commons.api.edm.provider.CsdlSchema;

public class CarsEdmProvider extends CsdlAbstractEdmProvider {

  // Service Namespace
  public static final String NAMESPACE = "olingo.odata.sample";

  // EDM Container
  public static final String CONTAINER_NAME = "Container";
  public static final FullQualifiedName CONTAINER_FQN = new FullQualifiedName(NAMESPACE, CONTAINER_NAME);

  // Entity Types Names
  public static final FullQualifiedName ET_CAR = new FullQualifiedName(NAMESPACE, "Car");
  public static final FullQualifiedName ET_MANUFACTURER = new FullQualifiedName(NAMESPACE, "Manufacturer");

  // Complex Type Names
  public static final FullQualifiedName CT_ADDRESS = new FullQualifiedName(NAMESPACE, "Address");

  // Entity Set Names
  public static final String ES_CARS_NAME = "Cars";
  public static final String ES_MANUFACTURER_NAME = "Manufacturers";

  @Override
  public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
    if (ET_CAR.equals(entityTypeName)) {
      return new CsdlEntityType()
          .setName(ET_CAR.getName())
          .setKey(Arrays.asList(
              new CsdlPropertyRef().setName("Id")))
          .setProperties(
              Arrays.asList(
                  new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()),
                  new CsdlProperty().setName("Model").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()),
                  new CsdlProperty().setName("ModelYear").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())
                      .setMaxLength(4),
                  new CsdlProperty().setName("Price").setType(EdmPrimitiveTypeKind.Decimal.getFullQualifiedName())
                      .setScale(2),
                  new CsdlProperty().setName("Currency").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())
                      .setMaxLength(3)
                  )
          ).setNavigationProperties(Arrays.asList(
              new CsdlNavigationProperty().setName("Manufacturer").setType(ET_MANUFACTURER)
              )
          );

    } else if (ET_MANUFACTURER.equals(entityTypeName)) {
      return new CsdlEntityType()
          .setName(ET_MANUFACTURER.getName())
          .setKey(Arrays.asList(
              new CsdlPropertyRef().setName("Id")))
          .setProperties(Arrays.asList(
              new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()),
              new CsdlProperty().setName("Name").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()),
              new CsdlProperty().setName("Address").setType(CT_ADDRESS))
          ).setNavigationProperties(Arrays.asList(
              new CsdlNavigationProperty().setName("Cars").setType(ET_CAR).setCollection(true)
              )
          );
    }

    return null;
  }

  public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
    if (CT_ADDRESS.equals(complexTypeName)) {
      return new CsdlComplexType().setName(CT_ADDRESS.getName()).setProperties(Arrays.asList(
          new CsdlProperty().setName("Street").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()),
          new CsdlProperty().setName("City").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()),
          new CsdlProperty().setName("ZipCode").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName()),
          new CsdlProperty().setName("Country").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())
          ));
    }
    return null;
  }

  @Override
  public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
      throws ODataException {
    if (CONTAINER_FQN.equals(entityContainer)) {
      if (ES_CARS_NAME.equals(entitySetName)) {
        return new CsdlEntitySet()
            .setName(ES_CARS_NAME)
            .setType(ET_CAR)
            .setNavigationPropertyBindings(
                Arrays.asList(
                    new CsdlNavigationPropertyBinding().setPath("Manufacturer").setTarget(
                        CONTAINER_FQN.getFullQualifiedNameAsString() + "/" + ES_MANUFACTURER_NAME)));
      } else if (ES_MANUFACTURER_NAME.equals(entitySetName)) {
        return new CsdlEntitySet()
            .setName(ES_MANUFACTURER_NAME)
            .setType(ET_MANUFACTURER).setNavigationPropertyBindings(
                Arrays.asList(
                    new CsdlNavigationPropertyBinding().setPath("Cars")
                        .setTarget(CONTAINER_FQN.getFullQualifiedNameAsString() + "/" + ES_CARS_NAME)));
      }
    }

    return null;
  }

  @Override
  public List<CsdlSchema> getSchemas() throws ODataException {
    List<CsdlSchema> schemas = new ArrayList<CsdlSchema>();
    CsdlSchema schema = new CsdlSchema();
    schema.setNamespace(NAMESPACE);
    // EntityTypes
    List<CsdlEntityType> entityTypes = new ArrayList<CsdlEntityType>();
    entityTypes.add(getEntityType(ET_CAR));
    entityTypes.add(getEntityType(ET_MANUFACTURER));
    schema.setEntityTypes(entityTypes);

    // ComplexTypes
    List<CsdlComplexType> complexTypes = new ArrayList<CsdlComplexType>();
    complexTypes.add(getComplexType(CT_ADDRESS));
    schema.setComplexTypes(complexTypes);

    // EntityContainer
    schema.setEntityContainer(getEntityContainer());
    schemas.add(schema);

    return schemas;
  }

  @Override
  public CsdlEntityContainer getEntityContainer() throws ODataException {
    CsdlEntityContainer container = new CsdlEntityContainer();
    container.setName(CONTAINER_FQN.getName());

    // EntitySets
    List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();
    container.setEntitySets(entitySets);
    entitySets.add(getEntitySet(CONTAINER_FQN, ES_CARS_NAME));
    entitySets.add(getEntitySet(CONTAINER_FQN, ES_MANUFACTURER_NAME));

    return container;
  }

  @Override
  public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
          throws ODataException {
    if (entityContainerName == null || CONTAINER_FQN.equals(entityContainerName)) {
      return new CsdlEntityContainerInfo().setContainerName(CONTAINER_FQN);
    }
    return null;
  }
}


text:
 .. Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

 ..   http://www.apache.org/licenses/LICENSE-2.0

 .. Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

DAG Serialization
=================

In order to make Airflow Webserver stateless (almost!), Airflow >=1.10.7 supports
DAG Serialization and DB Persistence.

.. image:: img/dag_serialization.png

Without DAG Serialization & persistence in DB, the Webserver and the Scheduler both
needs access to the DAG files. Both the scheduler and webserver parses the DAG files.

With **DAG Serialization** we aim to decouple the webserver from DAG parsing
which would make the Webserver very light-weight.

As shown in the image above, when using the this feature,
the Scheduler parses the DAG files, serializes them in JSON format and saves them in the Metadata DB.

The Webserver now instead of having to parse the DAG file again, reads the
serialized DAGs in JSON, de-serializes them and create the DagBag and uses it
to show in the UI.

One of the key features that is implemented as the part of DAG Serialization is that
instead of loading an entire DagBag when the WebServer starts we only load each DAG on demand from the
Serialized Dag table. This helps reduce Webserver startup time and memory. The reduction is notable
when you have large number of DAGs.

Below is the screenshot of the ``serialized_dag`` table in Metadata DB:

.. image:: img/serialized_dag_table.png

Enable Dag Serialization
------------------------

Add the following settings in ``airflow.cfg``:

.. code-block:: ini

    [core]
    store_serialized_dags = True
    min_serialized_dag_update_interval = 30

*   ``store_serialized_dags``: This flag decides whether to serialises DAGs and persist them in DB.
    If set to True, Webserver reads from DB instead of parsing DAG files
*   ``min_serialized_dag_update_interval``: This flag sets the minimum interval (in seconds) after which
    the serialized DAG in DB should be updated. This helps in reducing database write rate.

If you are updating Airflow from <1.10.7, please do not forget to run ``airflow db upgrade``.

Limitations
-----------
The Webserver will still need access to DAG files in the following cases,
which is why we said "almost" stateless.

*   **Rendered Template** tab will still have to parse Python file as it needs all the details like
    the execution date and even the data passed by the upstream task using Xcom.
*   **Code View** will read the DAG File & show it using Pygments.
    However, it does not need to Parse the Python file so it is still a small operation.

Using a different JSON Library
------------------------------

To use a different JSON library instead of the standard ``json`` library like ``ujson``, you need to
define a ``json`` variable in local Airflow settings (``airflow_local_settings.py``) file as follows:

.. code:: python

    import ujson
    json = ujson


text:
<!DOCTYPE HTML>

  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Test for bug 460532</title>

  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">

Mozilla Bug 460532

lorem ipsum.


text:
class RenameRolesToPerms < ActiveRecord::Migration
  def self.up
    rename_table :roles, :perms
    rename_table :users_roles, :users_perms
    rename_column :users_perms, :role_id, :perm_id
    #remove_index :users_perms,
  end

  def self.down
    #rename_index :users_perms,  :index_users_perms_on_user_id_and_perms_id, :index_users_roles_on_user_id_and_role_id
    rename_column :users_perms, :perm_id, :role_id
    rename_table :users_perms, :users_roles
    rename_table :perms, :roles
  end
end


text:
id: 5900f5001000cf542c510013
challengeType: 5
title: 'Problem 403: Lattice points enclosed by parabola and line'
videoUrl: ''
localeTitle: 'Problema 403: Pontos de treliça fechados por parábola e linha'
---

## Description

 Para os inteiros a e b, definimos D (a, b) como o domínio delimitado pela parábola y = x2 e a reta y = a · x + b: D (a, b) = {(x, y) | x2 ≤ y ≤ a · x + b}.
 L (a, b) é definido como o número de pontos de rede contidos em D (a, b). Por exemplo, L (1, 2) = 8 e L (2, -1) = 1.

 Também definimos S (N) como a soma de L (a, b) para todos os pares (a, b) de forma que a área de D (a, b) seja um número racional e | a |, | b | ≤ N. Podemos verificar que S (5) = 344 e S (100) = 26709528.

 Encontre S (1012). Dê sua resposta mod 108.

## Instructions

## Tests

```yml
tests:
  - text: <code>euler403()</code> deve retornar 18224771.
    testString: 'assert.strictEqual(euler403(), 18224771, "<code>euler403()</code> should return 18224771.");'

```

## Challenge Seed

```js
function euler403() {
  // Good luck!
  return true;
}

euler403();

```

## Solution

```js
// solution required
```


text:
using System;
using System.Collections.Generic;
using System.Text;
using CSC.CSClassroom.Model.Assignments;
using CSC.CSClassroom.Model.Assignments.ServiceResults;

namespace CSC.CSClassroom.Service.Assignments.AssignmentScoring
{
	/// <summary>
	/// Calculates the score and status of an assignment group.
	/// </summary>
	public interface IAssignmentGroupScoreCalculator
	{
		/// <summary>
		/// Returns the score for an assignment.
		/// </summary>
		double GetAssignmentGroupScore(
			IList<AssignmentResult> assignmentResults,
			int roundDigits);

		/// <summary>
		/// Returns the total points available for an assignment.
		/// </summary>
		double GetAssignmentGroupTotalPoints(
			IList<Assignment> assignments,
			int roundDigits);

		/// <summary>
		/// Returns the status for an assignment group.
		/// </summary>
		SubmissionStatus GetAssignmentGroupStatus(
			IList<AssignmentResult> assignmentResults);
	}
}


text:
#ifndef LEDGER_CORE_HORIZONACCOUNTPARSER_HPP
#define LEDGER_CORE_HORIZONACCOUNTPARSER_HPP

#include "HorizonBalanceParser.hpp"
#include "HorizonFlagsParser.hpp"

#include <rapidjson/reader.h>
#include <utils/JsonParserPath.hpp>
#include <wallet/stellar/stellar.hpp>

namespace ledger {
    namespace core {
        class HorizonAccountParser {
          public:
            bool Null();
            bool Bool(bool b);
            bool Int(int i);
            bool Uint(unsigned i);
            bool Int64(int64_t i);
            bool Uint64(uint64_t i);
            bool Double(double d);
            bool RawNumber(const rapidjson::Reader::Ch *str, rapidjson::SizeType length, bool copy);
            bool String(const rapidjson::Reader::Ch *str, rapidjson::SizeType length, bool copy);
            bool StartObject();
            bool Key(const rapidjson::Reader::Ch *str, rapidjson::SizeType length, bool copy);
            bool EndObject(rapidjson::SizeType memberCount);
            bool StartArray();
            bool EndArray(rapidjson::SizeType elementCount);
            void init(stellar::Account *account);
            void setPathView(const JsonParserPathView &path);

          private:
            JsonParserPathView _path;
            stellar::Account *_account;
            HorizonFlagsParser _flagsParser;
            HorizonBalanceParser _balancesParser;
        };
    } // namespace core
} // namespace ledger

#endif // LEDGER_CORE_HORIZONACCOUNTPARSER_HPP


text:
#pragma once
#include <aws/appflow/Appflow_EXPORTS.h>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace Appflow
{
namespace Model
{

  /**
   *
 The connector metadata specific to Datadog.

See Also:
   AWS
   * API Reference

   */
  class AWS_APPFLOW_API DatadogMetadata
  {
  public:
    DatadogMetadata();
    DatadogMetadata(Aws::Utils::Json::JsonView jsonValue);
    DatadogMetadata& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

  };

} // namespace Model
} // namespace Appflow
} // namespace Aws


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using BTDB.KVDBLayer;
using BTDB.ODBLayer;
using BTDBTest;

namespace SimpleTester;

public class RelationSpeedTest
{
    public class Person
    {
        [PrimaryKey(1)]
        public ulong Id { get; set; }
        [SecondaryKey("Email")]
        public string? Email { get; set; }
    }

    static ObjectDB CreateInMemoryDb()
    {
        var lowDb = new InMemoryKeyValueDB();
        var db = new ObjectDB();
        db.Open(lowDb, true);
        return db;
    }

    static ObjectDB CreateDb(IFileCollection fc)
    {
        var lowDb = new KeyValueDB(fc);
        var db = new ObjectDB();
        db.Open(lowDb, true);
        return db;
    }

    static ObjectDB CreateBTreeDb(IFileCollection fc)
    {
        var lowDb = new BTreeKeyValueDB(fc);
        var db = new ObjectDB();
        db.Open(lowDb, true);
        return db;
    }

    static IEnumerable<string> GenerateEmails(int count)
    {
        var rnd = new Random();
        while (count-- > 0)
            yield return $"a{rnd.Next(999)}@b{count}.com";
    }

    interface IMeasureOperations
    {
        void Insert();
        void List();
        void Update();
        void Remove();
    }

    //definitions for relations
    public interface IPersonTable : IRelation<Person>
    {
        void Insert(Person person);
        void Update(Person person);
        Person FindById(ulong id);
        void RemoveById(ulong id);
        IEnumerator<Person> ListByEmail(AdvancedEnumeratorParam<string> param);
    }
    //

    class RelationPersonTest : IMeasureOperations
    {
        readonly int _count;
        readonly ObjectDB _db;
        readonly Func<IObjectDBTransaction, IPersonTable> _creator;

        public RelationPersonTest(ObjectDB db, int count)
        {
            _count = count;
            _db = db;
            using var tr = _db.StartTransaction();
            _creator = tr.InitRelation<IPersonTable>("Job");
            tr.Commit();
        }

        public void Insert()
        {
            ulong idx = 0;
            foreach (var email in GenerateEmails(_count))
            {
                using var tr = _db.StartTransaction();
                var personTable = _creator(tr);
                personTable.Insert(new Person { Email = email, Id = idx++ });
                tr.Commit();
            }
        }

        public void List()
        {
            ulong sum = 0;
            using var tr = _db.StartTransaction();
            var personTable = _creator(tr);
            var en = personTable.ListByEmail(AdvancedEnumeratorParam<string>.Instance);
            while (en.MoveNext())
            {
                sum += en.Current.Id;
            }
        }

        public void Update()
        {
            for (var id = 0ul; id < (ulong)_count; id++)
            {
                using var tr = _db.StartTransaction();
                var personTable = _creator(tr);
                var p = personTable.FindById(id);
                p.Email += "a";
                personTable.Update(p);
                tr.Commit();
            }
        }

        public void Remove()
        {
            for (var id = 0ul; id < (ulong)_count; id++)
            {
                using var tr = _db.StartTransaction();
                var personTable = _creator(tr);
                personTable.RemoveById(id);
                tr.Commit();
            }
        }
    }

    //definitions for singletons
    public class PersonMap
    {
        public IDictionary<ulong, Person>? Items { get; set; }
    }

    public class PersonNameIndex
    {
        public IOrderedDictionary<string, ulong>? Items { get; set; }
    }
    //

    class SingletonPersonTest : IMeasureOperations
    {
        readonly int _count;
        readonly ObjectDB _db;

        public SingletonPersonTest(ObjectDB db, int count)
        {
            _db = db;
            _count = count;
        }

        public void Insert()
        {
            ulong idx = 0;
            foreach (var email in GenerateEmails(_count))
            {
                using var tr = _db.StartTransaction();
                var persons = tr.Singleton<PersonMap>();
                var emails = tr.Singleton<PersonNameIndex>();

                persons.Items![idx] = new Person { Email = email, Id = idx };
                emails.Items![email] = idx;
                idx++;
                tr.Commit();
            }
        }

        public void List()
        {
            using var tr = _db.StartReadOnlyTransaction();
            var persons = tr.Singleton<PersonMap>();
            var emails = tr.Singleton<PersonNameIndex>();
            ulong sum = 0;
            foreach (var e in emails.Items!)
            {
                var p = persons.Items![e.Value];
                sum += p.Id;
            }
        }

        public void Update()
        {
            for (var id = 0ul; id < (ulong)_count; id++)
            {
                using var tr = _db.StartTransaction();
                var persons = tr.Singleton<PersonMap>();
                var emails = tr.Singleton<PersonNameIndex>();

                var p = persons.Items![id];
                emails.Items!.Remove(p.Email!);
                p.Email += "a";
                emails.Items[p.Email] = id;
                persons.Items[id] = p;
                tr.Commit();
            }
        }

        public void Remove()
        {
            for (var id = 0ul; id < (ulong)_count; id++)
            {
                using var tr = _db.StartTransaction();
                var persons = tr.Singleton<PersonMap>();
                var emails = tr.Singleton<PersonNameIndex>();

                var p = persons.Items![id];
                emails.Items!.Remove(p.Email!);
                persons.Items.Remove(id);
                tr.Commit();
            }
        }

        public void Dispose()
        {
            _db.Dispose();
        }
    }

    void Measure(string name, IMeasureOperations testImpl)
    {
        GC.Collect();
        GC.WaitForPendingFinalizers();

        Console.WriteLine($"Measure {name}");
        var sw = new Stopwatch();
        sw.Start();

        Do("Insert", testImpl.Insert);
        Do("Update", testImpl.Update);
        Do("List  ", testImpl.List);
        Do("Remove", testImpl.Remove);

        sw.Stop();

        Console.WriteLine($"Total : {TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds)}");
        Console.WriteLine();
    }

    void Do(string operationName, Action action)
    {
        var sw = new Stopwatch();
        sw.Start();
        action();
        sw.Stop();
        Console.WriteLine($"{operationName}: {TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds)}");
    }

    public void Run()
    {
        var cnt = 5000000;
        using (var fc = new InMemoryFileCollection())
        using (var db = CreateDb(fc))
        {
            Measure("Relation: ", new RelationPersonTest(db, cnt));
        }
        using (var fc = new InMemoryFileCollection())
        using (var db = CreateDb(fc))
        {
            Measure("2 Maps: ", new SingletonPersonTest(db, cnt));
        }
        using (var fc = new InMemoryFileCollection())
        using (var db = CreateBTreeDb(fc))
        {
            Measure("Relation (BTree): ", new RelationPersonTest(db, cnt));
        }
        using (var fc = new InMemoryFileCollection())
        using (var db = CreateBTreeDb(fc))
        {
            Measure("2 Maps (BTree): ", new SingletonPersonTest(db, cnt));
        }
        using (var db = CreateInMemoryDb())
        {
            Measure("Relation (mem): ", new RelationPersonTest(db, cnt));
        }
        using (var db = CreateInMemoryDb())
        {
            Measure("2 Maps (mem): ", new SingletonPersonTest(db, cnt));
        }
    }
}


text:
-My build DIGITAL Command Language:
-Muhammad Adi Nugroho,S.Adm.Neg.:
-Via My Notepad (HTML Editor):

Built-In VBA Functions

-HAR:

-To be evaluated in console:


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace _03.ValidUsernames
{
    public class ValidUsernames
    {
        public static void Main()
        {
            var data = Console.ReadLine().Split(new char[] { ' ', '\\', '/', '(', ')' }, StringSplitOptions.RemoveEmptyEntries);

            var regex = new Regex(@"\b[a-zA-Z](\w){2,24}\b");
            var valid = new List<string>();
            foreach (var item in data)
            {
                if (regex.IsMatch(item))
                {
                    valid.Add(item.ToString());
                }
            }
            var maxSum = 0;
            string first = "";
            string second = "";

            for (int i = 0; i < valid.Count - 1; i++)
            {
                var sum = 0;
                sum = valid[i].Length + valid[i + 1].Length;

                if (maxSum < sum)
                {
                    maxSum = sum;
                    first = valid[i];
                    second = valid[i + 1];
                }

            }

            Console.WriteLine(first);
            Console.WriteLine(second);
        }
    }
}


text:
package main

import (
	"fmt"
	"os"
)

func GetFileSize(f *os.File) (int64, error) {
	/* first try stat */
	off, err := fsizeStat(f)
	if err != nil {
		/* if that fails, try seek */
		return fsizeSeek(f)
	}

	return off, nil
}

func fsizeStat(f *os.File) (int64, error) {
	fi, err := f.Stat()

	if err != nil {
		return 0, err
	}

	return fi.Size(), nil
}

func fsizeSeek(f *os.File) (int64, error) {
	off, err := f.Seek(0, 2)
	if err != nil {
		return 0, fmt.Errorf("seeking did not work, stdin is not" +
			"supported yet because github doesn't support chunking" +
			"requests (and I haven't implemented detecting stdin and" +
			"buffering yet")
	}

	_, err = f.Seek(0, 0)
	if err != nil {
		return 0, fmt.Errorf("could not seek back in the file")
	}
	return off, nil
}


text:
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ProductManager.ViewData.Entity
{
    public class UserProjectEntity : NotifyPropertyChanged
    {
        private int userProjectID;
        private int UserProjectID
        {
            get
            {
                return userProjectID;
            }
            set
            {
                if (userProjectID != value)
                {
                    userProjectID = value;
                    UpdateChanged("UserProjectEntity");
                }
            }
        }

        private int userID;
        public int UserID
        {
            get
            {
                return userID;
            }
            set
            {
                if (userID != value)
                {
                    userID = value;
                    UpdateChanged("UserID");
                }
            }
        }

        private String manufactureNumber;
        public String ManufactureNumber
        {
            get
            {
                return manufactureNumber;
            }
            set
            {
                if (manufactureNumber != value)
                {
                    manufactureNumber = value;
                    UpdateChanged("ManufactureNumber");
                }
            }
        }

        public void Update()
        {
            this.userProjectID = UserProject.user_project_id;
            this.manufactureNumber = UserProject.manufacture_number;
            this.userID = UserProject.user_id.GetValueOrDefault(-1);
        }

        public void DUpdate()
        {
            UserProject.user_project_id = this.userProjectID;
            UserProject.manufacture_number = this.manufactureNumber;
            UserProject.user_id = this.userID;
        }

        public void RaisALL()
        {
            UpdateChanged("UserProjectID");
            UpdateChanged("UserID");
            UpdateChanged("ManufactureNumber");
        }

        public ProductManager.Web.Model.user_project UserProject { get; set; }

    }
}


text:
import { ClientTimeSheetController } from './client_timesheet.controller.js';
import calculatorModule from './calculator.module.js';
import rangeSelectorModule from './range_selector.module.js';

export default angular.module('airy.clientTimeSheet', [
    calculatorModule.name,
    rangeSelectorModule.name,
]).component('clientTimeSheet', {
    templateUrl: 'partials/client_timesheet.html',
    controller: ClientTimeSheetController,
});


text:
"""
    MINDBODY Public API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: v6

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import unittest

import swagger_client
from swagger_client.models.staff_permission_group import StaffPermissionGroup  # noqa: E501
from swagger_client.rest import ApiException

class TestStaffPermissionGroup(unittest.TestCase):
    """StaffPermissionGroup unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def testStaffPermissionGroup(self):
        """Test StaffPermissionGroup"""
        # FIXME: construct object with mandatory attributes with example values
        # model = swagger_client.models.staff_permission_group.StaffPermissionGroup()  # noqa: E501
        pass

if __name__ == '__main__':
    unittest.main()


text:
// Copyright 2014-present Facebook. All Rights Reserved.
#pragma once
#include <folly/io/async/AsyncTimeout.h>
#include <chrono>
#include <folly/io/async/EventBase.h>

namespace facebook { namespace fboss {

class ThreadHeartbeat : private folly::AsyncTimeout {
  /*
   * Send heartbeat at regular interval to thread.  Measure delay between
   * time we expect heartbeat to be processed vs. time actually processed,
   * and record it to ods.
   */
 public:
  ThreadHeartbeat(folly::EventBase* evb, std::string threadName,
                  int intervalMsecs,
                  std::function<void(int, int)> heartbeatStatsFunc) :
      AsyncTimeout(evb),
      evb_(evb),
      threadName_(threadName),
      intervalMsecs_(intervalMsecs),
      heartbeatStatsFunc_(heartbeatStatsFunc) {
    VLOG(2) << "ThreadHeartbeat intervalMsecs:" << intervalMsecs_.count();
    evb_->runInEventBaseThread([this]() {
        scheduleFirstHeartbeat();
      });
  }

  ~ThreadHeartbeat() override {
    evb_->runImmediatelyOrRunInEventBaseThreadAndWait(
      [this]() {
        cancelTimeout();
      });
  }

 private:
  void timeoutExpired() noexcept override;

  void scheduleFirstHeartbeat() {
    CHECK(evb_->inRunningEventBaseThread());
    lastTime_ = std::chrono::system_clock::now();
    scheduleTimeout(intervalMsecs_);
  }

  folly::EventBase* evb_;
  std::string threadName_;
  std::chrono::milliseconds intervalMsecs_;
  std::function<void(int, int)> heartbeatStatsFunc_;
  std::chrono::time_point<std::chrono::system_clock> lastTime_;
  //XXX: these thresholds could be made configurable if needed
  int delayThresholdMsecs_ = 1000;
  int backlogThreshold_ = 10;
};

}} // facebook::fboss


text:
<!DOCTYPE html>

    <title>AuthenticationChallengeResponsable Protocol Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

Kingfisher Docs (78% documented)

View on GitHub

Install in Dash

        Kingfisher Reference

        AuthenticationChallengeResponsable Protocol Reference

            Classes

                AnimatedImageView

                ImageCache

                – CacheCheckResult

                ImageDownloader

                ImagePrefetcher

                Kingfisher

                KingfisherManager

                RetrieveImageTask

            Global Variables

                KingfisherDiskCacheCleanedHashKey

                KingfisherErrorDomain

                KingfisherErrorStatusCodeKey

            Enums

                CacheType

                ContentMode

                ImageProcessItem

                ImageTransition

                ImageTransition

                IndicatorType

                KingfisherError

                KingfisherOptionsInfoItem

            Extensions

                CGSize

                Collection

                Data

                Image

                ImageView

                Notification

                String

                UIButton

                URL

            Functions

                >>(_:_:)

            Protocols

                AuthenticationChallengeResponsable

                CIImageProcessor

                CacheSerializer

                ImageDownloadRequestModifier

                ImageDownloaderDelegate

                ImageProcessor

                Indicator

                KingfisherCompatible

                Resource

            Structs

                AnyModifier

                BlackWhiteProcessor

                BlurImageProcessor

                CGSizeProxy

                ColorControlsProcessor

                CroppingImageProcessor

                DataProxy

                DefaultCacheSerializer

                DefaultImageProcessor

                Filter

                FormatIndicatedCacheSerializer

                ImageResource

                OverlayImageProcessor

                RectCorner

                ResizingImageProcessor

                RetrieveImageDownloadTask

                RoundCornerImageProcessor

                StringProxy

                TintImageProcessor

            Typealiases

                ImageDownloaderCompletionHandler

                ImageDownloaderProgressBlock

                KingfisherOptionsInfo

                PrefetcherCompletionHandler

                PrefetcherProgressBlock

                RetrieveImageDiskTask

                Transformer

AuthenticationChallengeResponsable

public protocol AuthenticationChallengeResponsable: class

Protocol indicates that an authentication challenge could be handled.

                    downloader(_:didReceive:completionHandler:)

Called when an session level authentication challenge is received.
This method provide a chance to handle and response to the authentication challenge before downloading could start.

Note

This method is a forward from URLSession(:didReceiveChallenge:completionHandler:). Please refer to the document of it in NSURLSessionDelegate.

Declaration

Swift

func downloader(_ downloader: ImageDownloader, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)

Parameters

                                downloader

The downloader which receives this challenge.

                                challenge

An object that contains the request for authentication.

                                completionHandler

A handler that your delegate method must call.

                        Show on GitHub

© 2017 Wei Wang. All rights reserved. (Last updated: 2017-06-16)

Generated by jazzy ♪♫ v0.8.2, a Realm project.


text:
#include <Windows.h>
#include <stdio.h>
#include <string.h>
#include <SetupAPI.h>

#define DEBUG

#ifdef  DEBUG
#define Log FLog
#else
#define Log(fmt, ...) do {} while(0)
#endif

#define BUFFERSIZE 500
extern TCHAR pLogFile[BUFFERSIZE + 1];
extern CRITICAL_SECTION		myCS;
void FLog(TCHAR* pMsg,...);
void Logw(WCHAR *pMsg,...);
void usbipGetCurDir(TCHAR *curPath);
wchar_t* CharToWchar(const char* c);
char* WcharToChar(const wchar_t* wp) ;

enum {
	ISStorage = 0,
	ISCamera,
	ISPRINTER,
	OTHER
};

typedef struct _DevAttr {
	HDEVINFO DevInfo;
	SP_DEVINFO_DATA DevInfoData;
	TCHAR devPath[MAX_PATH];
} DevAttr;

typedef BOOL (*ClsCmp)(DevAttr *devAttr, TCHAR *cmpStr);
BOOL FindDeviceObject(IN TCHAR *devCls, IN const GUID *clsGuid, IN TCHAR *cmpStr, IN ClsCmp cmp,
					  OUT DevAttr *devAttr);

/*
 * >>>> represent "task begining"
 * **** represent "some error"
 * ==== represent "success"
 */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;

namespace XamarinFormsCarCatalog.Views
{
    public partial class SuvPage : ContentPage
    {
        public SuvPage()
        {
            InitializeComponent();
        }
    }
}


text:
package javax.lang.model.element;

import javax.lang.model.util.*;

/**
 * A visitor of program elements, in the style of the visitor design
 * pattern.  Classes implementing this interface are used to operate
 * on an element when the kind of element is unknown at compile time.
 * When a visitor is passed to an element's {@link Element#accept
 * accept} method, the <tt>visitXYZ</tt> method most applicable
 * to that element is invoked.
 *
 *
 Classes implementing this interface may or may not throw a
 * {@code NullPointerException} if the additional parameter {@code p}
 * is {@code null}; see documentation of the implementing class for
 * details.
 *
 *
 WARNING: It is possible that methods will be added to
 * this interface to accommodate new, currently unknown, language
 * structures added to future versions of the Java™ programming
 * language.  Therefore, visitor classes directly implementing this
 * interface may be source incompatible with future versions of the
 * platform.  To avoid this source incompatibility, visitor
 * implementations are encouraged to instead extend the appropriate
 * abstract visitor class that implements this interface.  However, an
 * API should generally use this visitor interface as the type for
 * parameters, return type, etc. rather than one of the abstract
 * classes.
 *
 * @param <R> the return type of this visitor's methods.  Use {@link
 *            Void} for visitors that do not need to return results.
 * @param
 the type of the additional parameter to this visitor's
 *            methods.  Use {@code Void} for visitors that do not need an
 *            additional parameter.
 *
 * @author Joseph D. Darcy
 * @author Scott Seligman
 * @author Peter von der Ahé
 * @see AbstractElementVisitor6
 * @since 1.6
 */
public interface ElementVisitor<R, P> {
    /**
     * Visits an element.
     * @param e  the element to visit
     * @param p  a visitor-specified parameter
     * @return a visitor-specified result
     */
    R visit(Element e, P p);

    /**
     * A convenience method equivalent to {@code v.visit(e, null)}.
     * @param e  the element to visit
     * @return a visitor-specified result
     */
    R visit(Element e);

    /**
     * Visits a package element.
     * @param e  the element to visit
     * @param p  a visitor-specified parameter
     * @return a visitor-specified result
     */
    R visitPackage(PackageElement e, P p);

    /**
     * Visits a type element.
     * @param e  the element to visit
     * @param p  a visitor-specified parameter
     * @return a visitor-specified result
     */
    R visitType(TypeElement e, P p);

    /**
     * Visits a variable element.
     * @param e  the element to visit
     * @param p  a visitor-specified parameter
     * @return a visitor-specified result
     */
    R visitVariable(VariableElement e, P p);

    /**
     * Visits an executable element.
     * @param e  the element to visit
     * @param p  a visitor-specified parameter
     * @return a visitor-specified result
     */
    R visitExecutable(ExecutableElement e, P p);

    /**
     * Visits a type parameter element.
     * @param e  the element to visit
     * @param p  a visitor-specified parameter
     * @return a visitor-specified result
     */
    R visitTypeParameter(TypeParameterElement e, P p);

    /**
     * Visits an unknown kind of element.
     * This can occur if the language evolves and new kinds
     * of elements are added to the {@code Element} hierarchy.
     *
     * @param e  the element to visit
     * @param p  a visitor-specified parameter
     * @return a visitor-specified result
     * @throws UnknownElementException
     *  a visitor implementation may optionally throw this exception
     */
    R visitUnknown(Element e, P p);
}


text:
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;

using LinqToDB;
using LinqToDB.Common;
using LinqToDB.Data;
using LinqToDB.Mapping;

using Microsoft.SqlServer.Types;

using NUnit.Framework;

namespace Tests.DataProvider
{
	[TestFixture]
	public class SqlServerTypesTests : DataProviderTestBase
	{
		[SetUp]
		public void SetUp()
		{
			Configuration.LinqService.SerializeAssemblyQualifiedName = true;
		}

		[TearDown]
		public void TearDown()
		{
			Configuration.LinqService.SerializeAssemblyQualifiedName = false;
		}

		[Table(Name="AllTypes2")]
		class AllTypes2
		{
			[Column(DbType="int"),   PrimaryKey, Identity] public int             ID                     { get; set; } // int
			[Column(DbType="date"),              Nullable] public DateTime?       dateDataType           { get; set; } // date
			[Column(DbType="datetimeoffset(7)"), Nullable] public DateTimeOffset? datetimeoffsetDataType { get; set; } // datetimeoffset(7)
			[Column(DbType="datetime2(7)"),      Nullable] public DateTime?       datetime2DataType      { get; set; } // datetime2(7)
			[Column(DbType="time(7)"),           Nullable] public TimeSpan?       timeDataType           { get; set; } // time(7)
#if !NETSTANDARD1_6
			[Column(DbType="hierarchyid"),       Nullable] public SqlHierarchyId  hierarchyidDataType    { get; set; } // hierarchyid
			[Column(DbType="geography"),         Nullable] public SqlGeography    geographyDataType      { get; set; } // geography
			[Column(DbType="geometry"),          Nullable] public SqlGeometry     geometryDataType       { get; set; } // geometry
#endif
		}

		[AttributeUsage(AttributeTargets.Method)]
		class SqlServerDataContextAttribute : IncludeDataContextSourceAttribute
		{
			public SqlServerDataContextAttribute(bool includeLinqService = true)
				: base(includeLinqService, ProviderName.SqlServer2008, ProviderName.SqlServer2012, ProviderName.SqlServer2014, TestProvName.SqlAzure)
			{
			}
		}

		[Test, SqlServerDataContext]
		public void TestHierarchyId(string context)
		{
			using (var conn = GetDataContext(context))
			{
				conn.GetTable<AllTypes2>()
					.Where (t => (bool)(t.hierarchyidDataType.GetLevel() > 0))
					.Select(t => new
					{
						v1 = SqlHierarchyId.GetRoot(),
						v2 = Sql.ToSql(t.hierarchyidDataType.GetDescendant(SqlHierarchyId.Parse("/1/3/4/"), SqlHierarchyId.Parse("/1/3/5/"))),
						v3 = t.hierarchyidDataType.IsDescendantOf(SqlHierarchyId.Parse("/1/")),
						v4 = t.hierarchyidDataType.GetLevel(),
						v5 = t.hierarchyidDataType.GetAncestor(0),
						v6 = t.hierarchyidDataType.GetReparentedValue(SqlHierarchyId.Parse("/1/"), SqlHierarchyId.Parse("/2/")),
						v7 = SqlHierarchyId.Parse("/1/2/3/4/5/"),
						v8 = t.hierarchyidDataType.ToString(),
					})
					.ToList();
			}
		}

		[Table("#tmp")]
		class MyTable
		{
			[Column] public SqlHierarchyId ID;
		}

		[Test, SqlServerDataContext]
		public void CreateTest(string context)
		{
			using (var conn = GetDataContext(context))
			{
				conn.CreateTable<MyTable>();
			}
		}

		//[Test, SqlServerDataContext]
		[Test, SqlServerDataContext(false)]
		public void TestGeography(string context)
		{
			using (var conn = GetDataContext(context))
			{
				conn.InlineParameters = true;

				conn.GetTable<AllTypes2>()
					.Select(t => new
					{
						v1  = t.geographyDataType.STSrid,
						v2  = t.geographyDataType.Lat,
						v3  = t.geographyDataType.Long,
						v4  = t.geographyDataType.Z,
						v5  = t.geographyDataType.M,
						//v6  = t.geographyDataType.HasZ,
						//v7  = t.geographyDataType.HasM,
						v8  = SqlGeography.GeomFromGml(t.geographyDataType.AsGml(), 4326),
						v9  = t.geographyDataType.AsGml(),
						v10 = t.geographyDataType.ToString(),
						v11 = SqlGeography.Parse("LINESTRING(-122.360 47.656, -122.343 47.656)"),
						v12 = SqlGeography.Point(1, 1, 4326),
						v13 = SqlGeography.STGeomFromText(new SqlChars("LINESTRING(-122.360 47.656, -122.343 47.656)"), 4326),
					})
					.ToList();
			}
		}

		[Table]
		public class SqlTypes
		{
			[Column] public int            ID;
			[Column] public SqlHierarchyId HID;

			static List<SqlTypes> _data;
			public  static IEnumerable<SqlTypes> Data(string context)
			{
				if (_data == null)
					using (var db = new DataConnection(context.Replace(".LinqService", "")))
						_data = db.GetTable<SqlTypes>().ToList();

				foreach (var item in _data)
					yield return item;
			}

			public override bool Equals(object obj)
			{
				return obj is SqlTypes && ((SqlTypes)obj).ID == ID;
			}

			public override int GetHashCode()
			{
				return ID.GetHashCode();
			}
		}

		[Test, SqlServerDataContext]
		public void Where1(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => (bool)(hid.IsDescendantOf(t.HID) == SqlBoolean.True)),
					db.GetTable<SqlTypes>()
						.Where(t => (bool)(hid.IsDescendantOf(t.HID) == SqlBoolean.True)));
			}
		}

		[Test, SqlServerDataContext]
		public void Where2(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => (bool)hid.IsDescendantOf(t.HID) == true),
					db.GetTable<SqlTypes>()
						.Where(t => (bool)hid.IsDescendantOf(t.HID) == true));
			}
		}

		[Test, SqlServerDataContext]
		public void Where3(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => (bool)hid.IsDescendantOf(t.HID)),
					db.GetTable<SqlTypes>()
						.Where(t => (bool)hid.IsDescendantOf(t.HID)));
			}
		}

		[Test, SqlServerDataContext]
		public void Where4(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => hid.IsDescendantOf(t.HID).Value),
					db.GetTable<SqlTypes>()
						.Where(t => hid.IsDescendantOf(t.HID).Value));
			}
		}

		[Test, SqlServerDataContext]
		public void Where5(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => hid.IsDescendantOf(t.HID).IsTrue),
					db.GetTable<SqlTypes>()
						.Where(t => hid.IsDescendantOf(t.HID).IsTrue));
			}
		}

		[Test, SqlServerDataContext]
		public void Where6(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => (bool)(hid.IsDescendantOf(t.HID) == SqlBoolean.True) && t.ID != 1)
						.OrderBy(c => c.HID),
					db.GetTable<SqlTypes>()
						.Where(t => (bool)(hid.IsDescendantOf(t.HID) == SqlBoolean.True) && t.ID != 1)
						.OrderBy(c => c.HID));
			}
		}

		[Sql.Expression("{0}.IsDescendantOf({1})", ServerSideOnly = true)]
		static bool IsDescendantOf(SqlHierarchyId child, SqlHierarchyId parent)
		{
			return child.IsDescendantOf(parent).Value;
		}

		[Test, SqlServerDataContext]
		public void Where7(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => IsDescendantOf(hid, t.HID)),
					db.GetTable<SqlTypes>()
						.Where(t => IsDescendantOf(hid, t.HID)));
			}
		}

		[Test, SqlServerDataContext]
		public void Where8(string context)
		{
			using (var db = GetDataContext(context))
			{
				var hid = SqlHierarchyId.Parse("/1/");

				AreEqual(
					SqlTypes.Data(context)
						.Where(t => IsDescendantOf(hid, t.HID)),
					db.GetTable<SqlTypes>()
						.Where(t => IsDescendantOf(hid, t.HID) == true));
			}
		}
	}
}


text:
<?php

namespace App\Http\Requests\User;

use App\Http\Requests\Request;
use Illuminate\Contracts\Validation\Validator;
/**
 * Class UserCreateRequest
 *
 * @package App\Http\Requests\User
 */
class UserEditRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Declaration an attributes
     *
     * @var array
     */
    protected $attrs = [
        'name'    => 'Name',
        // 'email'   => 'Email',
        'phone'   => 'Phone'
    ];

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name'    => 'required|max:225',
            // 'email'   => 'required|email|unique:users,email|max:225',
            'phone'   => 'required|max:30'
        ];
    }

    /**
     * @param $validator
     *
     * @return mixed
     */
   /* Menampilkan error */
public function validator($validator)
    {
        return $validator->make($this->all(), $this->container->call([$this, 'rules']), $this->messages(), $this->attrs);
    }

    /**
     * @param Validator $validator
     *
     * @return array
     *
     */
    protected function formatErrors(Validator $validator)
    {
        $message = $validator->errors();

        return [
            'success' => false,
            'validation' => [
                'name'      => $message->first('name'),
                'class'     => $message->first('class'),
                'level'     => $message->first('level'),
                'phone'     => $message->first('phone'),
                'password'  => $message->first('password')
            ]
        ];
    }
}


text:
package guizmo.tiles.utilM;

import java.awt.Rectangle;

import guizmo.tiles.HAlignmentType;
import guizmo.tiles.VAlignmentType;

public class RectangleUtil {

	/**
	 * Indicates the absolute horizontal alignment of an element inside a container.
	 *
	 * In order to decide the alignment, the difference between the margins of both extremes must be assessed.
	 * Therefore, we compare the relative difference between the horizontal or vertical extremes
	 * to decide if they must have the same alignment or not, no matter the alignment of the children.
	 *
	 * Be aware that this method does not consider that some elements form a group and must be aligned in the same way.
	 * For example, if there are five elements in a row and the group is aligned to the left, but the rectangle which is
	 * being analysed is the rightmost, then it will be set to "CENTER" not to "LEFT".
	 *
	 * @param rect Rectangle to consider. The coordinates are relative to the container.
	 * @param container Container rectangle
	 * @param margin The percentage margin with regard to the container bounds which are used in the alignment comparisons
	 * @param marginDiff The percentage of the difference between margins so if the difference is less than this parameter
	 * then the element has to be aligned as CENTER or BOTH
	 */
	public static HAlignmentType getAbsHAlignment(Rectangle rect, Rectangle container, float margin, float marginDiff){
		float leftMargin = (float)(rect.getMinX() - container.getMinX()) / (float)container.getWidth();
		float rightMargin = (float)(container.getMaxX() - rect.getMaxX()) / (float)container.getWidth();
		float hdiff = Math.abs(leftMargin - rightMargin);
		int containerCenter = (int)container.getMinX() + Math.round((float)container.getWidth() / 2);
		int rectCenter = (int)rect.getMinX() + Math.round((float)rect.getWidth() / 2);
		float centerMargin = Math.abs(containerCenter - rectCenter) / (float)container.getWidth();

		if (leftMargin <= margin && rightMargin <= margin)
			return HAlignmentType.BOTH;
		else if (leftMargin <= margin && hdiff > marginDiff)
			return HAlignmentType.LEFT;
		else if (rightMargin <= margin && hdiff > marginDiff)
			return HAlignmentType.RIGHT;
		else if ((leftMargin <= margin && hdiff <= marginDiff) || (rightMargin <= margin && hdiff <= marginDiff))
			return HAlignmentType.BOTH;
		else if (centerMargin <= margin)
			return HAlignmentType.CENTER;
		else
			return HAlignmentType.NONE;
	}

	/**
	 * Indicates the absolute vertical alignment of an element inside a container.
	 *
	 * In order to decide the alignment, the difference between the margins of both extremes must be assessed.
	 * Therefore, we compare the relative difference between the horizontal or vertical extremes
	 * to decide if they must have the same alignment or not, no matter the alignment of the children.
	 *
	 * Be aware that this method does not consider that some elements form a group and must be aligned in the same way.
	 * For example, if there are five elements in a row and the group is aligned to the left, but the rectangle which is
	 * being analysed is the rightmost, then it will be set to "CENTER" not to "LEFT".
	 *
	 * @param rect Rectangle to consider. The coordinates are relative to the container.
	 * @param container Container rectangle
	 * @param margin The percentage margin with regard to the container bounds which are used in the alignment comparisons
	 * @param marginDiff The percentage of the difference between margins so if the difference is less than this parameter
	 * then the element has to be aligned as CENTER or BOTH
	 */
	public static VAlignmentType getAbsVAlignment(Rectangle rect, Rectangle container, float margin, float marginDiff){
		float topMargin = (float)(rect.getMinY() - container.getMinY()) / (float)container.getHeight();
		float bottomMargin = (float)(container.getMaxY() - rect.getMaxY()) / (float)container.getHeight();
		float vdiff = Math.abs(topMargin - bottomMargin);
		int containerMiddle = (int)container.getMinX() + Math.round((float)container.getHeight() / 2);
		int rectMiddle = (int)container.getMinX() + Math.round((float)rect.getHeight() / 2);
		float middleMargin = Math.abs(containerMiddle - rectMiddle) / (float)container.getHeight();

		if (topMargin <= margin && bottomMargin <= margin)
			return VAlignmentType.BOTH;
		else if (topMargin <= margin && vdiff > marginDiff)
			return VAlignmentType.TOP;
		else if (bottomMargin <= margin && vdiff > marginDiff)
			return VAlignmentType.BOTTOM;
		else if ((topMargin <= margin && vdiff <= marginDiff) || (bottomMargin <= margin && vdiff <= marginDiff))
			return VAlignmentType.BOTH;
		else if (middleMargin <= margin)
			return VAlignmentType.MIDDLE;
		else
			return VAlignmentType.NONE;
	}
}


text:
package com.wide.ice.auth.controller;

import java.security.Principal;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.wide.ice.auth.domain.User;
import com.wide.ice.auth.service.UserService;

/**
 * Created by OELABED on 13/11/2016.
 */

@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/current", method = RequestMethod.GET)
    public Principal getUser(Principal principal) {
        return principal;
    }

    @PreAuthorize("#oauth2.hasScope('server')")
    @RequestMapping(method = RequestMethod.POST)
    public void createUser(@Valid @RequestBody User user) {
        userService.create(user);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
   Copyright 2015 Jason J. (iamovrhere)

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<resources>
    <!-- A list of non-translatable string for use in configuration -->

    <!-- Content provider authority used in the manifest -->
    <string name="content_provider_authority">com.ovrhere.android.currencyconverter</string>

    <!--  The values for the spinner of update times (in milliseconds!)
    Parallel to currConv_spinner_updatePeriod_labels.
    These will be parsed to longs at run time. -->
    <string-array name="currConv_spinner_updatePeriod_values">
        <item>300000</item><!-- 5 minutes -->
		<item>900000</item><!-- 15 minutes -->
		<item>1800000</item><!-- 30 minutes -->
		<item>3600000</item><!-- 1 hour -->
		<item>7200000</item><!-- 2 hours -->
		<item>21600000</item><!-- 6 hours -->
		<item>43200000</item><!-- 12 hours -->
		<item>86400000</item><!-- 24 hours -->
		<item>172800000</item><!--2 days  -->
		<item>604800000</item><!-- 1 week -->
    </string-array>

    <!-- Keys that are not settings actually but it's just easier to use them -->
    <eat-comment />
    <!-- Key for update interval handle -->
    <string name="currConv_settings_KEY_UPDATE_INTERVAL"
        >currConv_settings_KEY_UPDATE_INTERVAL</string>

    <!-- Key for more apps -->
    <string name="currConv_settings_KEY_MORE_APPS"
        >currConv_settings_KEY_MORE_APPS</string>

    <!-- Key for clear settings -->
    <string name="currConv_settings_KEY_CLEAR_SETTINGS"
        >currConv_settings_KEY_CLEAR_SETTINGS</string>
    <!-- Key for app version -->
    <string name="currConv_settings_KEY_SOFTWARE_VERSION"
        >currConv_settings_KEY_SOFTWARE_VERSION</string>
</resources>