text:
title: Form General Elements
---

{{#extend "layout-default"}}

  {{#content "js_vendor" mode="append"}}

  {{/content}}

  {{#content "js" mode="append"}}

  {{/content}}

  {{#content "body"}}

Form General Elements

Home

Forms

General

          <button type="button" class="btn btn-sm btn-icon btn-primary btn-round" data-toggle="tooltip"
          data-original-title="Edit">

          </button>
          <button type="button" class="btn btn-sm btn-icon btn-primary btn-round" data-toggle="tooltip"
          data-original-title="Refresh">

          </button>
          <button type="button" class="btn btn-sm btn-icon btn-primary btn-round" data-toggle="tooltip"
          data-original-title="Setting">

          </button>

Form Elements

Rounded Input

                  <input type="text" class="form-control round" id="inputRounded">

Disable

                  <input type="text" class="form-control" id="inputDisabled" placeholder="Disabled input here..."
                  disabled>

Input Focus

                  <input type="text" class="form-control focus" id="inputFocus" value="This is focused...">

Placeholder

                  <input type="text" class="form-control" id="inputPlaceholder" placeholder="placeholder">

Static Control

email@example.com

File Upload

                      <input type="text" class="form-control" readonly="">

                          <input type="file" name="" multiple="">

                      <input type="text" class="form-control" readonly="">

                          <input type="file" name="" multiple="">

With Help

                  <input type="text" class="form-control" id="inputHelpText">
                  A block of help text that breaks onto a new line and may extend
                    beyond one line.

Search

                      <input type="text" class="form-control" name="" placeholder="Search...">

                        <button type="submit" class="btn btn-primary"></button>

                      <button type="submit" class="input-search-btn"></button>
                      <input type="text" class="form-control" name="" placeholder="Search...">

                      <input type="text" class="form-control" name="" placeholder="Search...">
                      <button type="button" class="input-search-close icon md-close" aria-label="Close"></button>

                      <input type="text" class="form-control" name="" placeholder="Search...">
                      <button type="button" class="input-search-close icon md-close" aria-label="Close"></button>

Size

                    <input type="text" class="form-control input-sm" placeholder="Small">

                    <input type="text" class="form-control" placeholder="Normal">

                    <input type="text" class="form-control input-lg" placeholder="Big">

Select

                    <select class="form-control">
                      <option>1</option>
                      <option>2</option>
                      <option>3</option>
                      <option>4</option>
                      <option>5</option>
                    </select>

                    <select class="form-control" multiple="">
                      <option>1</option>
                      <option>2</option>
                      <option>3</option>
                      <option>4</option>
                      <option>5</option>
                    </select>

Textarea

                  <textarea class="form-control" id="textareaDefault" rows="3"></textarea>

Input Groups

Checkbox And Radio

Place any checkbox or radio option within an input group's addon
                    instead of text.

                          <input type="checkbox" id="inputCheckbox" name="inputCheckbox" checked>

                      <input type="text" class="form-control">

                          <input type="radio" id="inputRadio" name="inputRadio" checked>

                      <input type="text" class="form-control">

Text Addon

Place one add-on or button on either side of an input. You may
                    also place one on both sides of an input.

                      <input type="email" class="form-control" placeholder="email">
                      @example.com

                      $
                      <input type="text" class="form-control" placeholder="">

                      $
                      <input type="text" class="form-control" placeholder="">
                      .00

Icon Addon

Place icon instead of text in add-on on either side of an input.
                    You may also place one on both sides of an input.

                      <input type="text" class="form-control" placeholder="Username">

                      <input type="text" class="form-control" placeholder="Email">

                      <input type="email" class="form-control" placeholder="Email">

Button Addon

Buttons in input groups are a bit different and require one extra
                    level of nesting. Instead of .input-group-addon,
                    you'll need to use .input-group-btn to wrap the
                    buttons. This is required due to default browser styles that
                    cannot be overridden.

                        <button type="button" class="btn btn-primary">Go!</button>

                      <input type="text" class="form-control" placeholder="Search for...">

                      <input type="text" class="form-control" placeholder="Search for...">

                        <button type="button" class="btn btn-primary">Go!</button>

Buttons With Dropdowns

Place any button or drodowns within an input group's addon instead
                    of text.

                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"
                        aria-expanded="false">Action

                        </button>

Action

Another action

Something else here

Separated link

                      <input type="text" class="form-control">

                      <input type="text" class="form-control">

                        <button type="button" class="btn btn-primary" tabindex="-1">Action</button>
                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"
                        aria-expanded="false" tabindex="-1">

                        </button>

Action

Another action

Something else here

Separated link

Size

Add the relative form sizing classes to the .input-group                    itself and contents within will automatically resize—no need
                    for repeating the form control size classes on each element.

                      @
                      <input type="text" class="form-control input-lg" placeholder="Username">

                      @
                      <input type="text" class="form-control" placeholder="Username">

                      @
                      <input type="text" class="form-control" placeholder="Username">

Checkbox & Radio
              official website

Checkboxes

Add class .checkbox-customto make it.

                    <input type="checkbox" id="inputUnchecked" />
                    Unchecked

                    <input type="checkbox" id="inputChecked" checked />
                    Checked

                    <input type="checkbox" disabled />
                    Disabled Unchecked

                    <input type="checkbox" disabled checked />
                    Checked Disabled

Radios

Add class .radio-customto make it.

                    <input type="radio" id="inputRadiosUnchecked" name="inputRadios" />
                    Unchecked

                    <input type="radio" id="inputRadiosChecked" name="inputRadios" checked />
                    Checked

                    <input type="radio" id="inputRadiosDisabled" name="inputRadiosDisabled" disabled
                    />
                    Disabled Unchecked

                    <input type="radio" id="inputRadiosDisabledChecked" name="inputRadiosDisabledChecked"
                    disabled checked />
                    Checked Disabled

Color Options

Add class .checkbox-default, .checkbox-primary,
                    .checkbox-success, .checkbox-info,
                    .checkbox-warning, .checkbox-danger,
                    to change styles.

                        <input type="checkbox" name="inputCheckboxes" checked />

                        <input type="checkbox" name="inputCheckboxes" checked />

                        <input type="checkbox" name="inputCheckboxes" checked />

                        <input type="checkbox" name="inputCheckboxes" checked />

                        <input type="checkbox" name="inputCheckboxes" checked />

                        <input type="checkbox" name="inputCheckboxes" checked />

                        <input type="checkbox" name="inputCheckboxes" checked />

                        <input type="radio" id="inputRadioNormal" name="inputRadiosNormal" checked />

                        <input type="radio" name="inputRadioDefault" checked />

                        <input type="radio" name="inputRadioPrimary" checked />

                        <input type="radio" name="inputRadioSuccess" checked />

                        <input type="radio" name="inputRadioInfo" checked />

                        <input type="radio" name="inputRadioWarning" checked />

                        <input type="radio" name="inputRadioDanger" checked />

  {{/content}}
{{/extend}}


text:
package org.dmfs.httpessentials.executors.authorizing;

import org.dmfs.httpessentials.types.CharToken;
import org.dmfs.httpessentials.types.Token;

/**
 * Container class for frequently used Tokens.
 *
 * @author Marten Gajda
 */
public final class Tokens
{
    public final static Token ALGORITHM = new CharToken("algorithm");

    public final static Token BASIC = new CharToken("Basic");

    public final static Token CNONCE = new CharToken("cnonce");

    public final static Token DIGEST = new CharToken("Digest");

    public final static Token NC = new CharToken("nc");

    public final static Token NONCE = new CharToken("nonce");

    public final static Token OPAQUE = new CharToken("opaque");

    public final static Token QOP = new CharToken("qop");

    public final static Token REALM = new CharToken("realm");

    public final static Token RESPONSE = new CharToken("response");

    public final static Token URI = new CharToken("uri");

    public final static Token USERHASH = new CharToken("userhash");

    public final static Token USERNAME = new CharToken("username");

    private Tokens()
    {
        // no instances allowed
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
		</layout>
	</appender>

	<!--appender name="FILE" class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="${user.home}/logs/ebms-adapter.log"/>
		<param name="Threshold" value="INFO"/>
		<param name="MaxFileSize" value="5MB"/>
		<param name="MaxBackupIndex" value="20"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
		</layout>
	</appender-->

	<!--appender  name="FILE"  class="org.apache.log4j.DailyFileAppender">
		<param name="File" value="'${user.home}/logs/ebms-adapter-'yyyyMMdd'.log'"/>
		<param name="Threshold" value="INFO"/>
		<param name="Append" value="true"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
		</layout>
	</appender-->

	<appender  name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
		<param name="File" value="${user.home}/logs/ebms-adapter.log"/>
		<param name="DatePattern" value="yyyyMMdd'.log'"/>
		<param name="Threshold" value="debug"/>
		<param name="Append" value="true"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
		</layout>
	</appender>

	<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
		<appender-ref ref="CONSOLE"/>
		<!--appender-ref ref="FILE"/-->
	</appender>

	<logger name="nl.clockwork" additivity="false">
		<level value="info"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="nl.clockwork.mule.ebms" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.apache" additivity="false">
		<level value="warn"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="com.sun.org" additivity="false">
		<level value="warn"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="javax.xml" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.xml.sax" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="net.sf.saxon" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog" additivity="false">
		<level value="error"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.springframework.beans.factory" additivity="false">
		<level value="warn"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.springframework.jdbc" additivity="false">
		<level value="warn"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="com.mchange.v2" additivity="false">
		<level value="warn"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="com.mulesource" additivity="false">
		<level value="info"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule" additivity="false">
		<level value="info"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule.expression" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule.module.xml.expression" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule.routing" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule.routing.filters.ExpressionFilter" additivity="false">
		<level value="debug" />
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule.routing.filters" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule.module.xml.transformer.AbstractXmlTransformer" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<logger name="org.mule.routing.outbound" additivity="false">
		<level value="debug"/>
		<appender-ref ref="ASYNC"/>
	</logger>

	<root>
		<priority value="error"/>
		<appender-ref ref="ASYNC"/>
	</root>

</log4j:configuration>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

Bad Request!

           Bad request!


text:
[Packer](https://packer.io) templates, mainly for use building boxes for [Atlas](https://atlas.hashicorp.com/maier/).

### Current boxes

* [Alpine Linux](http://alpinelinux.org/) v3.1.3 x86_64 [Atlas boxes](https://atlas.hashicorp.com/maier/boxes/alpine-3.1.3-x86_64)
* [CentOS](http://centos.org/) v6.6 x86_64 [Atlas boxes](https://atlas.hashicorp.com/maier/boxes/centos-6.6-x86_64)
* [CentOS](http://centos.org/) v7.1.1503 x86_64 [Atlas boxes](https://atlas.hashicorp.com/maier/boxes/centos-7.1.1503-x86_64)

## Use existing template

Using `alpine3` as an example:

1. `cd alpine3`
2. Edit `alpine-3.1.3-x86_64.json`
	3. Update `push.name` to use the correct Atlas account name.
	4. And anything else that interests you
5. Edit `sh_vars`
	6. Set `ATLAS_USER_NAME` to the correct Atlas account name.

To perform a local build simply run, `packer build alpine-3.1.3-x86_64.json`

To perform the build integrated with Atlas run, `../atlas.sh`

#### Check syntax

```
$ packer validate alpine-3.1.3-x86_64.json
```

#### Test build

Note, this is a **local** build and will **intentionally** fail on the *atlas post-processor*. If it didn't it would push every build up to Atlas, probably not what is desired when the template is being developed, updated, and/or tested.

```
$ packer build alpine-3.1.3-x86_64.json
```

> Note, to debug the VM boot process change *headless* to *false* in the template. Optionally, run `PACKER_LOG=1 packer build alpine-3.1.3-x86_64.json` to see output from Packer.

#### Deploy to Atlas

This will act accordingly to how the variables were set in `sh_vars`.

```
$ ../atlas.sh
```

> **NOTES**
>
> * When the build is created on Atlas some variables need to be set before it will work. Namely, the two `ATLAS_*` variables from `sh_vars` & `../atlas.sh`. The template is expecting these to be in the environment when Atlas performs the build. But, there is a chicken-and-egg issue with regards to, the template needs to be pushed to Atlas before the build variables can be edited... There does not currently appear to be a way to **create** a build without pushing a template first, which then triggers a build, which then fails... As such, the first build will probably fail until the `ATLAS_USER_NAME` and `ATLAS_BOX_NAME` variables are added in the Atlas Build Configuration Variables section.
> * CentOS 7 uses `build_type="local"`, builds the box locally then pushes the built box up to Atlas. (versus *alpine3* and *centos6* which leverage remote Atlas builds.) The reason for this is, the version of virtualbox used by Atlas is older and the vbga repeatedly failed to build/install on CentOS 7...YMMV. Building the box locally with virtualbox v4.3.26 works correctly [for me].

## Creating a new distribution/release template

1. Create distribution specific directory structure. e.g. `$ cp -r skel <New_Distro_or_Ver>`
1. Change to the directory
1. Edit `sh_vars` and set the required variables.
1. Run `../atlas.sh` once to generate a skeleton Packer template.
1. Edit the resulting template. Specific items which need to change are in `<<>>` (the `description` and `push.name` primarily.) Update the rest based on the needs of the distribution and the [Packer template documentation](https://www.packer.io/docs/templates/introduction.html). The `iso_url`, `iso_checksum`, and `boot_comand` would have to be set at the barest minimum. Add any additional builders or provisioners, etc.
1. Create any applicable artifacts in `http` and `scripts` to be used by the template.

#### Check syntax

```
$ packer validate <template>
```

#### Test build

Note, this is a **local** build and will **intentionally** fail on the *atlas post-processor*. If it didn't it would push every build up to Atlas, probably not what is desired when the template is being developed, updated, and/or tested.

```
$ packer build <template>
```

#### Deploy to Atlas

This will act accordingly to how the variables wer set in `sh_vars`.

```
$ ../atlas.sh
```


text:
package org.slf4j.helpers;

import java.text.MessageFormat;

import org.junit.Ignore;
import org.junit.Test;

@Ignore
public class MessageFormatterPerfTest{ //extends TestCase {

    Integer i1 = new Integer(1);
    Integer i2 = new Integer(2);
    static long RUN_LENGTH = 100 * 1000;
    //
    static long REFERENCE_BIPS = 48416;

    public void XtestJDKFormatterPerf() {
        jdkMessageFormatter(RUN_LENGTH);
        double duration = jdkMessageFormatter(RUN_LENGTH);
        System.out.println("jdk duration = " + duration + " nanos");
    }

    @Test
    public void testSLF4JPerf_OneArg() {
        slf4jMessageFormatter_OneArg(RUN_LENGTH);
        double duration = slf4jMessageFormatter_OneArg(RUN_LENGTH);
        System.out.println("duration=" + duration);
        long referencePerf = 36;
        BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
    }

    @Test
    public void testSLF4JPerf_TwoArg() {
        slf4jMessageFormatter_TwoArg(RUN_LENGTH);
        double duration = slf4jMessageFormatter_TwoArg(RUN_LENGTH);
        long referencePerf = 60;
        BogoPerf.assertDuration(duration, referencePerf, REFERENCE_BIPS);
    }

    public double slf4jMessageFormatter_OneArg(long len) {
        long start = System.nanoTime();
        for (int i = 0; i < len; i++) {
            final FormattingTuple tp = MessageFormatter.format("This is some rather short message {} ", i1);
            tp.getMessage();
            tp.getArgArray();
            tp.getThrowable();

            MessageFormatter.format("This is some rather short message {} ", i1);
        }
        long end = System.nanoTime();
        return (end - start) / (1000 * 1000.0);
    }

    public double slf4jMessageFormatter_TwoArg(long len) {
        long start = System.nanoTime();
        for (int i = 0; i < len; i++) {
            final FormattingTuple tp = MessageFormatter.format("This is some {} short message {} ", i1, i2);
            tp.getMessage();
            tp.getArgArray();
            tp.getThrowable();
        }
        long end = System.nanoTime();
        return (end - start) / (1000 * 1000.0);
    }

    public double jdkMessageFormatter(long len) {
        @SuppressWarnings("unused")
        String s = "";
        s += ""; // keep compiler happy
        long start = System.currentTimeMillis();
        Object[] oa = new Object[] { i1 };
        for (int i = 0; i < len; i++) {
            s = MessageFormat.format("This is some rather short message {0}", oa);
        }
        long end = System.currentTimeMillis();
        return (1.0 * end - start);
    }

}


text:
package com.facebook.buck.android;

import com.facebook.buck.io.ProjectFilesystem;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.CellPathResolver;
import com.facebook.buck.rules.CommonDescriptionArg;
import com.facebook.buck.rules.Description;
import com.facebook.buck.rules.HasDeclaredDeps;
import com.facebook.buck.rules.Hint;
import com.facebook.buck.rules.TargetGraph;
import com.facebook.buck.util.immutables.BuckStyleImmutable;
import com.google.common.collect.ImmutableSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.immutables.value.Value;

public class AndroidAppModularityDescription
    implements Description<AndroidAppModularityDescriptionArg> {

  @Override
  public Class<AndroidAppModularityDescriptionArg> getConstructorArgType() {
    return AndroidAppModularityDescriptionArg.class;
  }

  @Override
  public BuildRule createBuildRule(
      TargetGraph targetGraph,
      BuildTarget buildTarget,
      ProjectFilesystem projectFilesystem,
      BuildRuleParams params,
      BuildRuleResolver resolver,
      CellPathResolver cellRoots,
      AndroidAppModularityDescriptionArg args) {
    APKModuleGraph apkModuleGraph =
        new APKModuleGraph(
            Optional.of(args.getApplicationModuleConfigs()), targetGraph, buildTarget);

    AndroidAppModularityGraphEnhancer graphEnhancer =
        new AndroidAppModularityGraphEnhancer(
            buildTarget, params, resolver, args.getNoDx(), apkModuleGraph);

    AndroidAppModularityGraphEnhancementResult result = graphEnhancer.createAdditionalBuildables();

    return new AndroidAppModularity(
        buildTarget, projectFilesystem, params.withExtraDeps(result.getFinalDeps()), result);
  }

  @BuckStyleImmutable
  @Value.Immutable
  interface AbstractAndroidAppModularityDescriptionArg
      extends CommonDescriptionArg, HasDeclaredDeps {

    Map<String, List<BuildTarget>> getApplicationModuleConfigs();

    @Hint(isDep = false)
    ImmutableSet<BuildTarget> getNoDx();
  }
}


text:
<?php
    /**
     * XPHP - PHP Framework
     *
     * This project is licensed
     * under MIT. Please use it
     * under the license and law.
     *
     * @category Framework
     * @package  XPHP
     * @author   Tianle Xu <xtl@xtlsoft.top>
     * @license  MIT
     * @link     https://github.com/xtlsoft/XPHP
     *
     */

    namespace X\Temp\Instance;

    use \X\Core;

    ini_set("display_errors", 1);
    error_reporting(E_ALL);

    /**
     * Composer Vendor Directory
     */
    defined("COMPOSER_DIR") or define("COMPOSER_DIR", dirname(__DIR__) . '/vendor/');

    // Require the composer
    require_once COMPOSER_DIR . 'autoload.php';

    $configure = require SysDir. 'Configure.php';

    $App = new \X\Application($configure);

    $App->runScript("Register.php");

    $App->container->add('Request.Handler', '\X\Handler\Http');

    $App->runScript("Config.php");

    $App->init();

    $App->run();


text:
package com.wthfeng.learn.pattern.singleton;

import java.io.Serializable;

/**
 * 双重检锁模式
 *
 * @author wangtonghe
 * @since 2018/9/18 09:57
 */
public class Singleton implements Serializable {

    /**
     * 实例变量一定要有volatile修饰
     */
    private volatile static Singleton singleton;

    private Singleton() {
        if (null != singleton) {
            throw new RuntimeException();
        }
    }

    public static Singleton getInstance() {
        if (singleton == null) {
            synchronized (Singleton.class) {
                if (singleton == null) {
                    singleton = new Singleton();
                }
            }
        }
        return singleton;
    }

    public void dispaly() {
        System.out.println("hello,this is singleton.");
    }

    private Object readResolve() {
        return singleton;
    }

}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>GEPOL</title>
	<link rel="stylesheet" href="../resources/styles/organique.css">

<?php include '../includes/menuIn.html';?>

Gabinete de Estudos e Políticas Legislativas

Quem somos

O Gabinete de Estudos e Politica Legislativa é um serviço que funciona junto do Gabinete da Ministra da Justiça e insere-se na Orgânica do Ministério da Justiça e rege-se quanto a sua organização e funcionamento pelas regras estabelecidas pela Lei nº 5/97, Estatuto da Funcionalidade Pública, pela Lei Orgânica do Governo e do Ministério da Justiça.

Função

O Gabinete de Estudos e Política Legislativa abreviadamente designado de (GEPL), é o órgão de concepção e apoio técnico do Ministério responsável pela preparação legislativa, elaboração de estudos, planos anuais e plurianuais, informações e pareceres e apoio técnico jurídico nas áreas de actividades do Ministério

O que Fazemos

Enquanto competência, incumbe ao GEPL, dentre outras funções:

Dar assessoria aos órgãos do Estado na elaboração de leis, decretos-lei, decretos e outras disposições normativas;

Dar assessoria aos organismos da Administração Central do Estado em matéria jurídica;

Participar nos trabalhos preparatórios de acordos, convenções ou tratados quando caibam no âmbito do Ministério ou haja solicitação neste sentido por parte de outros organismos, e recomendar a sua aprovação ou não, sempre que se mostre conveniente e oportuno;

Manter e desenvolver relações com organismos homólogos e instituições de carácter regional e internacional, no campo do Direito, promovendo a permuta de informação e documentação jurídica;

Promover o contínuo aperfeiçoamento do sistema jurídico nacional;

Proceder ao levantamento da legislação em vigor com vista à sua sistematização e codificação;

Proceder ao levantamento e recolha de documentação internacional que permita o estudo comparativo dos vários sistemas jurídicos;

Representar o Ministério no secretariado técnico do Conselho de Ministros.

Caso deseje saber mais informações pode baixar o nosso Estatuto Orgânico.

		<button>Baixar Estatuto </button>

Direção

Uma Equipa Forte e Dinámica

Director do GEPL

Dr. Mondlane Lopes Tomé, Jurista

O GEPOL é dirigido por um Director nomeado pelo Ministro de tutela nos termos do diploma e da lei geral.

Contacte-nos

Precisa de ajuda?

Envia uma mensagem pra nós pelo formulário abaixo

			<form>
				*Nome
				<input type="text" class="form-control">
				*Email
				<input type="text" class="form-control">
				Telefone

			        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">+239 </button>

+351

+244

+55

+238

			      <input type="text" class="form-control" aria-label="...">

				Mensagem
				<textarea name="" id="" cols="30" rows="10" class="form-control"></textarea>

					<button class="btn btn-default">Enviar</button>
					<button class="btn btn-default">Apagar</button>

			</form>

Siga-nos

Avenida Marginal 12 de Julho, Caixa Postal – 901 Cidade de S. Tomé

email: Gepolmj@gmail.com

Telefone: +239 2227256

Atendimento: Quinta- feiras das 9 horas ás 12 horas

<?php include '../includes/footer.html';?>


text:
package org.rcgonzalezf.weather.common;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import static org.junit.Assert.assertNotNull;

@RunWith(JUnit4.class) public class ServiceConfigTest {

  private ServiceConfig uut;
  private WeatherRepository mWeatherRepository;
  private ServiceConfig mRealServiceConfig;
  private WeatherProvider mDefaultProvider;

  @After public void rollbackServiceConfig() {
    ServiceConfig.setInstance(mRealServiceConfig);
  }

  @Before public void createRepository() {
    mRealServiceConfig = ServiceConfig.getInstance();
    uut = new ServiceConfig();
    ServiceConfig.setInstance(uut);
    uut.setApiKey("someKey");
    mDefaultProvider = WeatherProvider.OpenWeather;
  }

  @Test(expected = IllegalStateException.class) public void shouldThrowExceptionIfNoApiKeyIsSet() {
    givenNullApiKey();

    givenSomeKnownProvider();

    whenRetrievingRepository();
  }

  @Test(expected = IllegalStateException.class)
  public void shouldThrowExceptionIfNoProviderIsSet() {
    whenRetrievingRepository();
  }

  @Test public void shouldGetRepositoryInstanceForValidConfig() {
    givenSomeKnownProvider();

    whenRetrievingRepository();

    thenShouldHaveRepositoryInstance();
  }

  private void thenShouldHaveRepositoryInstance() {
    assertNotNull(mWeatherRepository);
  }

  private void whenRetrievingRepository() {
    mWeatherRepository = uut.getWeatherRepository();
  }

  private void givenSomeKnownProvider() {
    uut.setWeatherProvider(mDefaultProvider);
  }

  private void givenNullApiKey() {
    uut.setApiKey(null);
  }
}


text:
See [here](https://angular.io/docs/ts/latest/tutorial/toh-pt1.html) to learn about Angular 2 and TypeScript.

Checkout [typescriptlang.org](https://www.typescriptlang.org/) to learn more about TypeScript.


text:
from Action import Action
from TopMenu import TopMenu

class BootMenuAction (Action):

    def __init__ (self,label):
        self.label = label

    def do (self):
        self.menu = TopMenu()


text:
package com.mygdx.spriter.game.client;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.gwt.GwtApplication;
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
import com.mygdx.spriter.game.MyGdxSpriterGame;

public class HtmlLauncher extends GwtApplication {

        @Override
        public GwtApplicationConfiguration getConfig () {
                return new GwtApplicationConfiguration(480, 320);
        }

        @Override
        public ApplicationListener createApplicationListener () {
                return new MyGdxSpriterGame();
        }
}


text:
using System;
using System.Globalization;
using Sitecore.Data.Fields;
using Synthesis.FieldTypes.Interfaces;

namespace Synthesis.Testing
{
	public class TestDateTimeField : TestFieldType, IDateTimeField
	{
		public TestDateTimeField(DateTime dateTime)
		{
			Value = dateTime;
		}

		/// <summary>
		///     Gets the value of the field. If no value exists, returns DateTime.MinValue
		/// </summary>
		public DateTime Value { get; set; }

		/// <summary>
		///     Checks if the field has a value. For a DateTime, this checks if it equals default(DateTime).
		/// </summary>
		public override bool HasValue
		{
			get { return Value != DateTime.MinValue; }
		}

		/// <summary>
		///     Renders the field using a Sitecore FieldRenderer and returns the result
		/// </summary>
		public virtual string RenderedValue
		{
			get { return Value.ToString(CultureInfo.InvariantCulture); }
		}

		public DateField ToDateField()
		{
			throw new NotImplementedException("Test date fields cannot return Sitecore item objects");
		}
	}
}


text:
ACCEPTED

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

#### Published in
in Hooker, Fl. nov. -zel. 2: 202 (1855)

#### Original name
Sphaeria robertsii Hook., 1837

### Remarks
null


text:
<?php declare(strict_types = 1);

namespace Adeira\Connector\PhysicalUnits\DomainModel\Temperature\Units;

final class Fahrenheit implements ITemperatureUnit
{

	private $value;

	public function __construct($value)
	{
		$this->value = $value;
	}

	public function value(): float
	{
		return (float)$this->value;
	}

	public function getConversionTable(): array
	{
		return [
			Celsius::class => function (self $fahrenheit) {
				return new Celsius(($fahrenheit->value - 32) * 5 / 9); //exact
			},
			Kelvin::class => function (self $fahrenheit) {
				$celsius = ($fahrenheit->value - 32) * 5 / 9;
				return new Kelvin($celsius + 273.15); //exact
			},
		];
	}

}


text:
var IPv4Addr = require("./ipv4_addr");

function IGMP(emitter) {
    this.emitter = emitter;
    this.type = undefined;
    this.version = undefined;
    this.maxResponseTime = undefined;
    this.checksum = undefined;
    this.groupAddress = undefined;
}

// http://en.wikipedia.org/wiki/Internet_Group_Management_Protocol
// This is an implementation of V3
// https://tools.ietf.org/html/rfc3376
IGMP.prototype.decode = function (raw_packet, offset) {
    this.type = raw_packet[offset];

    // units are 1/10s
    // if value < 128 this is an int, else it is a float
    // right now we don't handle the float version
    this.maxResponseTime =raw_packet[offset + 1];

    this.checksum = raw_packet.readUInt16BE(offset + 2); // 2, 3
    this.groupAddress = new IPv4Addr().decode(raw_packet, offset + 4); // 4, 5, 6, 7

    //Membership Query (0x11)
    //Membership Report (IGMPv1: 0x12, IGMPv2: 0x16, IGMPv3: 0x22)
    //Leave Group (0x17)
    switch (this.type) {
    case 0x11:
        this.version = 3;
        break;
    case 0x12:
        this.version = 1;
        break;
    case 0x16:
    case 0x17:
        this.version = 2;
        break;
    case 0x22:
        this.version = 3;
        break;
    }

    if(this.emitter) { this.emitter.emit("igmp", this); }
    return this;
};

IGMP.prototype.decoderName = "igmp";
IGMP.prototype.eventsOnDecode = true;

IGMP.prototype.toString = function () {
    var ret;

    switch (this.type) {
    case 0x11:
        ret = "Membership Query";
        break;
    case 0x12:
        ret = "Membership Report";
        break;
    case 0x16:
        ret = "Membership Report";
        break;
    case 0x17:
        ret = "Leave Group";
        break;
    case 0x22:
        ret = "Membership Report";
        // TODO: Decode v3 message
        break;
    default:
        ret = "type " + this.type;
        break;
    }

    return ret;
};

module.exports = IGMP;


text:
package javasmmr.zoosome.models.animals;

public class Seal extends Aquatic {
	public Seal(int nrOfLegs, String name, int avgSwimDepth, WaterType waterType) {
		super(nrOfLegs, name, avgSwimDepth, waterType);
	}

	public Seal() {
		super(0, "Seal", 1500, WaterType.SALTWATER);
	}
}


text:
"""Tests for the FilterDataset serialization."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from absl.testing import parameterized

from tensorflow.python.data.experimental.kernel_tests.serialization import dataset_serialization_test_base
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.framework import combinations
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.ops import math_ops
from tensorflow.python.platform import test

class FilterDatasetSerializationTest(
    dataset_serialization_test_base.DatasetSerializationTestBase,
    parameterized.TestCase):

  def _build_filter_range_graph(self, div):
    return dataset_ops.Dataset.range(100).filter(
        lambda x: math_ops.not_equal(math_ops.mod(x, div), 2))

  @combinations.generate(test_base.default_test_combinations())
  def testFilterCore(self):
    div = 3
    num_outputs = sum(x % 3 != 2 for x in range(100))
    self.run_core_tests(lambda: self._build_filter_range_graph(div),
                        num_outputs)

  def _build_filter_dict_graph(self):
    return dataset_ops.Dataset.range(10).map(
        lambda x: {"foo": x * 2, "bar": x ** 2}).filter(
            lambda d: math_ops.equal(d["bar"] % 2, 0)).map(
                lambda d: d["foo"] + d["bar"])

  @combinations.generate(test_base.default_test_combinations())
  def testFilterDictCore(self):
    num_outputs = sum((x**2) % 2 == 0 for x in range(10))
    self.run_core_tests(self._build_filter_dict_graph, num_outputs)

  def _build_sparse_filter(self):

    def _map_fn(i):
      return sparse_tensor.SparseTensor(
          indices=[[0, 0]], values=(i * [1]), dense_shape=[1, 1]), i

    def _filter_fn(_, i):
      return math_ops.equal(i % 2, 0)

    return dataset_ops.Dataset.range(10).map(_map_fn).filter(_filter_fn).map(
        lambda x, i: x)

  @combinations.generate(test_base.default_test_combinations())
  def testSparseCore(self):
    num_outputs = 5
    self.run_core_tests(self._build_sparse_filter, num_outputs)

if __name__ == "__main__":
  test.main()


text:
package me.pjq.musicplayer;

import android.annotation.SuppressLint;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;

@SuppressLint("NewApi")
public class StepCountEventManager implements SensorEventListener {

    private SensorManager sManager;
    Sensor countSensor;

    private StepCountListener listener;

    public StepCountEventManager() {
    }

    public void setListener(StepCountListener listener) {
        this.listener = listener;
    }

    @SuppressLint("NewApi")
    public void init(Context ctx) {
        sManager = (SensorManager) ctx.getSystemService(Context.SENSOR_SERVICE);
        countSensor = sManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER);

        register();
    }

    @SuppressLint("NewApi")
    public void register() {
        if (countSensor != null) {
            sManager.registerListener(this, countSensor, SensorManager.SENSOR_DELAY_UI);
        } else {
            listener.onNotSupportStepSensor();
        }
    }

    @Override
    @SuppressLint("NewApi")
    public void onSensorChanged(SensorEvent sensorEvent) {
        int count = (int) sensorEvent.values[0];

        listener.onStepCount(count);
    }

    @Override
    public void onAccuracyChanged(Sensor sensor, int i) {
    }

    @SuppressLint("NewApi")
    public void deregister() {
        if (null != countSensor) {
            sManager.unregisterListener(this, countSensor);
        }
    }

    public static interface StepCountListener {
        public void onStepCount(int count);

        public void onNotSupportStepSensor();
    }
}


text:
<?php

namespace Application\Model;

class CatServEstudiosEntity
{
	protected $id;
	protected $clave;
	protected $detalle;
	protected $cat_conceptos_id;
	protected $unidad;
	protected $distancias_muestreo_id;
	protected $servicio_tipo;
	protected $tiempo_servicio;
	protected $pu;
	/*protected $mensual;
	protected $semanal;*/

	public function getId()
	{
		return $this->id;
	}

	public function setId($Value)
	{
		$this->id = $Value;
	}

  	public function getClave()
	{
		return $this->clave;
	}

    public function setClave($Value)
    {
        $this->clave = $Value;
    }

    public function getDetalle()
	{
		return $this->detalle;
	}

    public function setDetalle($Value)
    {
        $this->detalle = $Value;
    }

    public function getCatConceptosId()
	{
		return $this->cat_conceptos_id;
	}

    public function setCatConceptosId($Value)
    {
        $this->cat_conceptos_id = $Value;
    }

    public function getUnidad()
	{
		return $this->unidad;
	}

    public function setUnidad($Value)
    {
        $this->unidad = $Value;
    }

    public function getDistanciasMuestreoId()
	{
		return $this->distancias_muestreo_id;
	}

    public function setDistanciasMuestreoId($Value)
    {
        $this->distancias_muestreo_id = $Value;
    }

    public function getPu()
	{
		return $this->pu;
	}

    public function setPu($Value)
    {
        $this->pu = $Value;
    }

    public function getServicioTipo()
	{
		return $this->servicio_tipo;
	}

    public function setServicioTipo($Value)
    {
        $this->servicio_tipo = $Value;
    }

    public function getTiempoServicio()
	{
		return $this->tiempo_servicio;
	}

    public function setTiempoServicio($Value)
    {
        $this->tiempo_servicio = $Value;
    }

   /* public function getMensual()
	{
		return $this->mensual;
	}

    public function setMensual($Value)
    {
        $this->mensual = $Value;
    }

    public function getSemanal()
	{
		return $this->semanal;
	}

    public function setSemanal($Value)
    {
        $this->semanal = $Value;
    }*/
}


text:
import { Laya } from "Laya";
import { Video } from "laya/device/media/Video";
import { Sprite } from "laya/display/Sprite";
import { Stage } from "laya/display/Stage";
import { Event } from "laya/events/Event";
import { Rectangle } from "laya/maths/Rectangle";
import { Loader } from "laya/net/Loader";
import { Texture } from "laya/resource/Texture";
import { Button } from "laya/ui/Button";
import { Handler } from "laya/utils/Handler";
import { Stat } from "laya/utils/Stat";
import { Main } from "./../Main";

export class InputDevice_Video {
	private BackgroundSkin: string = "res/inputDevice/videoPlayer/background.png";
	private TimeLineBoxSkin: string = "res/inputDevice/videoPlayer/time line-box.png";
	private TimeLineSkin: string = "res/inputDevice/videoPlayer/time line.png";
	private ColorTimelineSkin: string = "res/inputDevice/videoPlayer/color time line.png";
	private PauseButtonSkin: string = "res/inputDevice/videoPlayer/pause button.png";
	private PlayButtonSkin: string = "res/inputDevice/videoPlayer/play button.png";
	private NormalSoundControlSkin: string = "res/inputDevice/videoPlayer/normal sound control.png";
	private SoundBgControlSkin: string = "res/inputDevice/videoPlayer/sound bg.png";
	private MuteButtonSkin: string = "res/inputDevice/videoPlayer/mute.png";
	private VolumnLineSkin: string = "res/inputDevice/videoPlayer/light-blue.png";
	private VolumeSliderSkin: string = "res/inputDevice/videoPlayer/volumeSlider.png";
	private PlayHeadSliderSkin: string = "res/inputDevice/videoPlayer/playHeadSlider.png";

	private video: Video;

	// UI
	private togglePlayButton: Button;
	private colorTimeline: Sprite;
	private volumeControl: Sprite;
	private playHeadSlider: Sprite;
	private timelineBox: Sprite;
	private volumeLine: Sprite;

	// 音量条和播放进度条的
	private volumeScrollRect: Rectangle;
	private playProgressScrollRect: Rectangle;

	Main: typeof Main = null;
	constructor(maincls: typeof Main) {
		this.Main = maincls;

		Laya.init(650, 350);
		Stat.show();

		Laya.stage.alignV = Stage.ALIGN_MIDDLE;
		Laya.stage.alignH = Stage.ALIGN_CENTER;

		Laya.stage.scaleMode = Stage.SCALE_SHOWALL;
		Laya.stage.bgColor = "#FFFFFF";
		Laya.loader.load(
			[this.BackgroundSkin, this.TimeLineBoxSkin, this.TimeLineSkin, this.ColorTimelineSkin, this.PauseButtonSkin, this.PlayButtonSkin, this.NormalSoundControlSkin, this.SoundBgControlSkin, this.MuteButtonSkin, this.VolumnLineSkin, this.VolumeSliderSkin, this.PlayHeadSliderSkin],
			Handler.create(this, this.setupUI));
	}

	// 以下是UI创建

	private setupUI(): void {
		this.showGUI();
		this.createVideo();
	}

	private showGUI(): void {
		this.showBackground();
		this.showTimelineControls();
		this.showSoundControl();
	}

	private showBackground(): void {
		var background: Sprite = new Sprite();
		this.Main.box2D.addChild(background);
		background.loadImage(this.BackgroundSkin);
		background.y = 25;
	}

	private showTimelineControls(): void {
		this.showTimelineBox();
		this.showPlaybackControls();
		this.showTimeline();
		this.showColorTimeline();
		this.showPlayHeadSlider();
	}

	private showTimelineBox(): void {
		this.timelineBox = new Sprite();
		this.Main.box2D.addChild(this.timelineBox);
		this.timelineBox.loadImage(this.TimeLineBoxSkin);
		this.timelineBox.pos(108, 280);
	}

	private showPlaybackControls(): void {
		this.togglePlayButton = new Button();
		this.togglePlayButton.skin = this.PlayButtonSkin;
		this.Main.box2D.addChild(this.togglePlayButton);
		this.togglePlayButton.pos(110, 290);
		this.togglePlayButton.on(Event.CLICK, this, this.onTogglePlay);
	}

	private showTimeline(): void {
		var timeline: Sprite = new Sprite();
		this.Main.box2D.addChild(timeline);
		timeline.loadImage(this.TimeLineSkin);
		timeline.pos(143, 295);
	}

	private showColorTimeline(): void {
		var texture: Texture = Loader.getRes(this.ColorTimelineSkin);
		this.colorTimeline = new Sprite();
		this.Main.box2D.addChild(this.colorTimeline);
		this.colorTimeline.graphics.drawTexture(texture, 0, 0);
		this.colorTimeline.size(texture.width, texture.height);
		this.colorTimeline.pos(143, 296);

		this.playProgressScrollRect = new Rectangle(0, 0, 0, 8);
		this.colorTimeline.scrollRect = this.playProgressScrollRect;
	}

	private prevX: number;
	private showPlayHeadSlider(): void {
		this.playHeadSlider = new Sprite();
		this.playHeadSlider.loadImage(this.PlayHeadSliderSkin);
		this.Main.box2D.addChild(this.playHeadSlider);
		this.playHeadSlider.pos(143, 292);
		this.playHeadSlider.pivotX = this.playHeadSlider.width / 2;

		this.timelineBox.on(Event.MOUSE_DOWN, this, function (): void {
			if (!this.video.paused)
				this.pause();

			Laya.stage.on(Event.MOUSE_MOVE, this, moveSlider);
			Laya.stage.on(Event.MOUSE_UP, this, endDrag);

			this.prevX = Laya.stage.mouseX;
		});

		function moveSlider(): void {
			var dx: number = Laya.stage.mouseX - this.prevX;
			this.playHeadSlider.x += dx;
			this.prevX = Laya.stage.mouseX;

			if (this.playHeadSlider.x < 143)
				this.playHeadSlider.x = 143;
			else if (this.playHeadSlider.x > 143 + this.colorTimeline.width)
				this.playHeadSlider.x = 143 + this.colorTimeline.width;

			this.video.currentTime = this.video.duration * (this.playHeadSlider.x - 143) / this.colorTimeline.width;
			console.log(this.video.currentTime);
			this.playProgressScrollRect.width = this.video.currentTime / this.video.duration * this.colorTimeline.width;
		}
		function endDrag(): void {
			Laya.stage.off(Event.MOUSE_MOVE, this, moveSlider);
			Laya.stage.off(Event.MOUSE_UP, this, endDrag);

			this.play();
		}
	}

	private showSoundControl(): void {
		this.showNormalSoundControl();
		this.createVolumeControl();
		this.createVolumeLine();
		this.createVolumeSlider();
		this.createMuteButton();
	}

	private showNormalSoundControl(): void {
		var soundContorl: Sprite = new Sprite();
		this.Main.box2D.addChild(soundContorl);
		soundContorl.loadImage(this.NormalSoundControlSkin);
		soundContorl.pos(68, 280);
		soundContorl.on(Event.CLICK, this, function (): void {
			if (this.volumeControl.parent)
				Laya.stage.removeChild(this.volumeControl);
			else
				this.Main.box2D.addChild(this.volumeControl);
		});
	}
	private createVolumeControl(): void {
		this.volumeControl = new Sprite();
		this.volumeControl.loadImage(this.SoundBgControlSkin);
		this.volumeControl.pos(68, 176);
	}

	private createVolumeLine(): void {
		this.volumeLine = new Sprite();
		this.volumeControl.addChild(this.volumeLine);
		this.volumeLine.loadImage(this.VolumnLineSkin);
		this.volumeLine.pos(15, 12);

		this.volumeScrollRect = new Rectangle(0, 0, 7, 55);
		this.volumeLine.scrollRect = this.volumeScrollRect;
	}

	private prevY: number;
	private createVolumeSlider(): void {
		var volumeSlider: Sprite = new Sprite();
		this.volumeControl.addChild(volumeSlider);
		volumeSlider.loadImage(this.VolumeSliderSkin);
		volumeSlider.pos(12, 8);

		this.volumeControl.on(Event.MOUSE_DOWN, this, function (): void {
			Laya.stage.on(Event.MOUSE_MOVE, this, moveSlider);
			Laya.stage.on(Event.MOUSE_UP, this, endDrag);

			this.prevY = Laya.stage.mouseY;
		});

		function moveSlider(): void {
			var dy: number = Laya.stage.mouseY - this.prevY;
			this.prevY = Laya.stage.mouseY;
			volumeSlider.y += dy;

			if (volumeSlider.y < 8)
				volumeSlider.y = 8;
			else if (volumeSlider.y > 8 + 50)
				volumeSlider.y = 8 + 50;

			this.video.volume = 1 - (volumeSlider.y - 8) / 50;
			this.volumeLine.y = volumeSlider.y - 8 + 12;
			this.volumeScrollRect.y = volumeSlider.y - 8;
		}
		function endDrag(): void {
			Laya.stage.off(Event.MOUSE_MOVE, this, moveSlider);
			Laya.stage.off(Event.MOUSE_UP, this, endDrag);
		}
	}
	private createMuteButton(): void {
		var muteButton: Sprite = new Sprite();
		this.volumeControl.addChild(muteButton);
		muteButton.loadImage(this.MuteButtonSkin);
		muteButton.y = -(muteButton.height + 3);

		muteButton.on(Event.CLICK, this, function (): void {
			this.video.muted = !this.video.muted;
		});
	}

	// 以上是UI创建

	// 创建Video
	private createVideo(): void {
		this.video = new Video();

		// 检查浏览器兼容性
		if (this.video.canPlayType(Video.MP4) == Video.SUPPORT_NO && this.video.canPlayType(Video.OGG) == Video.SUPPORT_NO) {
			alert("当前浏览器不支持播放本视频");
		}

		this.video.on('loadedmetadata', this, this.onVideoReady);
		this.video.on('ended', this, this.onVideoPlayEnded);

		// 加载视频源
		this.video.load("res/av/mov_bbb.mp4");

		this.Main.box2D.addChild(this.video);
	}

	private onTogglePlay(e: Event): void {
		if (this.video.paused)
			this.play();
		else
			this.pause();
	}

	private play(): void {
		this.video.play();
		this.togglePlayButton.skin = this.PauseButtonSkin;
		Laya.timer.frameLoop(1, this, this.loop);
	}

	private pause(): void {
		Laya.timer.clear(this, this.loop);
		this.video.pause();
		this.togglePlayButton.skin = this.PlayButtonSkin;
	}

	private onVideoPlayEnded(e: Event): void {
		this.togglePlayButton.skin = this.PlayButtonSkin;
		Laya.timer.clear(this, this.loop);
	}

	private onVideoReady(): void {
		if (this.video.readyState == 0)
			return;

		console.log("当前使用源:" + this.video.currentSrc);

		this.video.width = this.video.videoWidth;
		this.video.height = this.video.videoHeight;

		this.video.x = (Laya.stage.width - this.video.width) / 2;
		this.video.y = 65;
	}

	private loop(): void {
		this.playProgressScrollRect.width = this.video.currentTime / this.video.duration * this.colorTimeline.width;
		this.playHeadSlider.x = 143 + this.playProgressScrollRect.width;
	}
}


text:
<?php

namespace App\Middleware;

use Illuminate\Database\Capsule\Manager;
use Psr\Http\Message\ServerRequestInterface;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;

class Database implements MiddlewareInterface
{
    /**
     * PSR-15 middleware callback
     *
     * @param ServerRequestInterface $request
     * @param DelegateInterface $delegate
     * @return Psr\Http\Message\ServerRequestInterface
     */
    public function process(ServerRequestInterface $request, DelegateInterface $delegate)
    {
        $capsule = new Manager;
        $capsule->addConnection($request->getAttribute('config')['database']);
        $capsule->setAsGlobal();
        $capsule->bootEloquent();
        return $delegate->process($request->withAttribute('capsule', $capsule));
    }
}


text:
class wxTextCtrl;
class wxStaticBoxSizer;
class wxComboBox;
class wxFlexGridSizer;
class wxSpinButton;
class wxSpinEvent;
class wxButton;
class wxSplitterWindow;
class wxSplitterEvent;
class wxSpinCtrl;
class wxGLCanvas;
class wxBoxSizer;
class wxStaticText;
class wxRadioBox;
class wxCheckBox;
//*)

#include "OpenGLGraph.h"
#include "GraphUpdateThread.h"

class pnlSpectrum: public wxPanel
{
    friend class GraphUpdateThread;
	public:
        const static int GRAPH_UPDATE_MESSAGE_ID;
		pnlSpectrum(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize, int style=0, wxString str="");
		virtual ~pnlSpectrum();

		void onChipConnect();
        void onChipDisconnect();
        void PrintStatus(const char *msg);
        void Initialize();
        void UpdateGraphs();
        void RedrawGraphs();

        void SendSettings();
        void ReadSettings();

        void StartCapturing();
        void StopCapturing();

		//(*Declarations(pnlSpectrum)
		wxTextCtrl* txtRxFrequencyGHz;
		wxButton* btnSetTxFreq;
		wxCheckBox* chkQchannelEnabled;
		wxComboBox* cmbTxVGA1;
		wxPanel* Panel6;
		wxPanel* Panel1;
		wxStaticText* StaticText13;
		wxStaticText* StaticText14;
		wxPanel* Panel7;
		wxComboBox* cmbLNAGainMode;
		wxCheckBox* chkAverage;
		wxCheckBox* chkUpdateGraphs;
		wxSpinCtrl* spinCenterFreq;
		wxStaticText* lblDataRate;
		wxButton* btnStopCapture;
		OpenGLGraph* ogl_FFTline;
		wxButton* btnAddMarker;
		wxStaticText* lblFPS;
		OpenGLGraph* ogl_IQscatter;
		wxRadioBox* rgrTxDataSource;
		wxPanel* Panel9;
		wxPanel* Panel8;
		wxStaticText* StaticText1;
		wxStaticText* StaticText10;
		wxSpinCtrl* spinSamplingFreq;
		wxPanel* Panel2;
		wxSplitterWindow* SplitterWindow1;
		wxSpinButton* SpinButton1;
		wxStaticText* StaticText3;
		wxRadioBox* rgrDataSource;
		wxPanel* Panel4;
		wxSplitterWindow* SplitterWindow2;
		wxComboBox* cmbRxFEVGA1;
		wxSpinButton* SpinButton2;
		wxComboBox* cmbRxVGA2;
		wxStaticText* StaticText8;
		wxStaticText* StaticText12;
		wxTextCtrl* txtFFTsamples;
		wxComboBox* cmbTxVGA2;
		wxPanel* Panel3;
		wxStaticText* StaticText7;
		wxButton* btnSetRxFreq;
		wxStaticText* StaticText4;
		wxStaticText* StaticText5;
		wxTextCtrl* txtTxFrequencyGHz;
		wxStaticText* StaticText2;
		wxStaticText* StaticText6;
		wxComboBox* cmbRxFilter;
		OpenGLGraph* ogl_IQline;
		wxCheckBox* chkDCcorrection;
		wxCheckBox* chkIchannelEnabled;
		wxSpinCtrl* spinSpanFreq;
		wxButton* btnStartCapture;
		wxComboBox* cmbTxFilter;
		wxSpinButton* spinFFTsamples;
		wxStaticText* StaticText9;
		wxStaticText* StaticText11;
		wxButton* btnRemoveMarker;
		//*)

	protected:

		//(*Identifiers(pnlSpectrum)
		static const long ID_CHECKBOX3;
		static const long ID_CHECKBOX4;
		static const long ID_CHECKBOX5;
		static const long ID_STATICTEXT9;
		static const long ID_STATICTEXT10;
		static const long ID_STATICTEXT11;
		static const long ID_STATICTEXT16;
		static const long ID_PANEL1;
		static const long ID_GLCANVAS1;
		static const long ID_PANEL6;
		static const long ID_GLCANVAS2;
		static const long ID_PANEL7;
		static const long ID_SPLITTERWINDOW2;
		static const long ID_GLCANVAS3;
		static const long ID_BUTTON5;
		static const long ID_BUTTON6;
		static const long ID_STATICTEXT12;
		static const long ID_SPINCTRL1;
		static const long ID_STATICTEXT13;
		static const long ID_SPINCTRL2;
		static const long ID_PANEL4;
		static const long ID_PANEL3;
		static const long ID_SPLITTERWINDOW1;
		static const long ID_PANEL9;
		static const long ID_BUTTON1;
		static const long ID_BUTTON2;
		static const long ID_CHECKBOX1;
		static const long ID_STATICTEXT14;
		static const long ID_TEXTCTRL3;
		static const long ID_SPINBUTTON3;
		static const long ID_STATICTEXT15;
		static const long ID_SPINCTRL3;
		static const long ID_CHECKBOX2;
		static const long ID_RADIOBOX1;
		static const long ID_RADIOBOX2;
		static const long ID_STATICTEXT1;
		static const long ID_COMBOBOX1;
		static const long ID_STATICTEXT2;
		static const long ID_TEXTCTRL1;
		static const long ID_SPINBUTTON1;
		static const long ID_BUTTON3;
		static const long ID_STATICTEXT3;
		static const long ID_COMBOBOX2;
		static const long ID_STATICTEXT4;
		static const long ID_COMBOBOX3;
		static const long ID_STATICTEXT5;
		static const long ID_COMBOBOX4;
		static const long ID_STATICTEXT6;
		static const long ID_TEXTCTRL2;
		static const long ID_SPINBUTTON2;
		static const long ID_BUTTON4;
		static const long ID_STATICTEXT7;
		static const long ID_COMBOBOX5;
		static const long ID_STATICTEXT8;
		static const long ID_COMBOBOX6;
		static const long ID_COMBOBOX7;
		static const long ID_PANEL10;
		static const long ID_PANEL2;
		//*)

	private:
	    void initializeGraphs();
		void generateFFTxaxis(unsigned long samplingFrequency);
		void changeSamplingFrequency(long samplingFrequency);
        float *m_fftxaxisValues;
        void disableDCComparators();
        void initializeInterfaceValues();
		void allocateMemory(unsigned int samples);
        void freeMemory();

        int m_IQdataSize;
        int m_FFTdataSize;
        float *m_IchannelData;
        float *m_QchannelData;
        float *m_FFTfrequencies;
        float *m_FFTamplitudes;

        float *samplesXaxis;
        float m_frequencyStep;  //value for incrementing or decrementing frequency

        float m_TxFreq;
        float m_RxFreq;

        bool m_addingMarkers;
        GraphUpdateThread *t_graphUpdate;

        int m_FFTsamplesCount;
        unsigned long m_samplingFrequency;

		//(*Handlers(pnlSpectrum)
		void OnGLCanvas1Paint(wxPaintEvent& event);
		void OnbtnStartCaptureClick(wxCommandEvent& event);
		void OnbtnStopCaptureClick(wxCommandEvent& event);
		void OnchkIchannelEnabledClick(wxCommandEvent& event);
		void OnchkQchannelEnabledClick(wxCommandEvent& event);
		void OnchkDCcorrectionClick(wxCommandEvent& event);
		void OnrgrDataSourceSelect(wxCommandEvent& event);
		void OnrgrTxDataSourceSelect(wxCommandEvent& event);
		void OnComboBox1Selected(wxCommandEvent& event);
		void OncmbTxFilterSelected(wxCommandEvent& event);
		void OncmbRxFilterSelected(wxCommandEvent& event);
		void OncmbTxVGA1Selected(wxCommandEvent& event);
		void OncmbTxVGA2Selected(wxCommandEvent& event);
		void OncmbRxFEVGA1Selected(wxCommandEvent& event);
		void OncmbRxVGA2Selected(wxCommandEvent& event);
		void OncmbLNAGainModeSelected(wxCommandEvent& event);
		void OnbtnSetRxFreqClick(wxCommandEvent& event);
		void OnbtnSetTxFreqClick(wxCommandEvent& event);
		void OnSpinButton1Change(wxSpinEvent& event);
		void OnSpinButton1ChangeUp(wxSpinEvent& event);
		void OnSpinButton1ChangeDown(wxSpinEvent& event);
		void OnSpinButton2ChangeUp(wxSpinEvent& event);
		void OnSpinButton2ChangeDown(wxSpinEvent& event);
		void OnEraseBackground(wxEraseEvent& event);
		void OnbtnRemoveMarkerClick(wxCommandEvent& event);
		void OnbtnAddMarkerClick(wxCommandEvent& event);
		void Onogl_FFTlineLeftDown(wxMouseEvent& event);
		void OnchkIchannelEnabledClick1(wxCommandEvent& event);
		void OnchkQchannelEnabledClick1(wxCommandEvent& event);
		void OnspinCenterFreqChange(wxSpinEvent& event);
		void OnspinSpanFreqChange(wxSpinEvent& event);
		void OnspinFFTsamplesChange(wxSpinEvent& event);
		//*)

	protected:

		void BuildContent(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size);

		DECLARE_EVENT_TABLE()
};

#endif


text:
class TObjArray;

#endif

using namespace std;

class AliLatexTable : public TObject {

public:
  AliLatexTable() ;
  AliLatexTable(Int_t ncol, TString format);
  ~AliLatexTable();

  void LoadTeXFromFileAndPrintASCII(const char * filename);
  // first you set the value of each column
  void SetNextCol(Int_t val);
  void SetNextCol(Int_t val, Int_t err);

  void SetNextCol(Double_t val, Int_t scientificNotation = -1, Bool_t rounding = kTRUE); // if different from -1 gives significant digits
  void SetNextCol(Double_t val, Double_t err, Int_t scientificNotation = -1, Bool_t rounding = kTRUE);
  void SetNextCol(Double_t val, Double_t err, Double_t errSyst, Int_t scientificNotation = -1, Bool_t rounding = kTRUE);

  void SetNextCol(TString val);
//   // allows to use printf syntax
//   void SetNextColPrintf(const char *va_(fmt), ...);

  // Then you add the row (it's up to user make sure all columns are
  // there)
  void InsertRow();

  // insert a row without building it up with the methods. May be
  // usefull for header or multcol rows
  void InsertCustomRow(TString row);

  void InsertHline();

  void PrintTable(Option_t * opt = "");
  //  void ParseExponent(TString &expo);
  void GetMantissaAndExpBase10(Double_t num, Double_t &man, Double_t &exp) ;

  // used to print columns with correct width
  Int_t * GetColWidths();
  void StripLatex(TString &row, TString format) ;

private:

  Int_t fNcol;     // number of columns
  TString fFormat; // latex format (es "c|ccc")

  TObjArray * fRows; // rows
  TObjArray * fCols; // columns

  Int_t fNcolReady; // number of cols ready to be insert

  AliLatexTable(const AliLatexTable&);
  AliLatexTable& operator=(const AliLatexTable&);

  ClassDef(AliLatexTable, 1)

};

#endif


text:
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;

public class StateChartGUI extends JFrame implements ActionListener {

    Container container;

    JTabbedPane tabbedPane;

    JPanel bottomPanel, buttonPanel;

    JButton start, stop, pause, skip;

    public JTextArea logWindow;

    JScrollPane scrollWindow;

    boolean suspended;

    JButton okay, cancel;

    int iteration;

    Thread t;

    stateChart chart;

    stateEngine engine;

    messageServer mServer;

    eventList myList;

    StateChartGUI() {
        super("State Engine *alpha*");
        suspended = false;
        container = getContentPane();
        container.setLayout(new BorderLayout());
        iteration = 0;
        JPanel interf, menu;
        interf = new JPanel();
        JMenuBar menuBar = new JMenuBar();
        JMenu file;
        JMenuItem fileOpen, fileSave, fileClose;
        file = new JMenu("File");
        menuBar.add(file);
        fileOpen = new JMenuItem("Open");
        file.add(fileOpen);
        fileOpen.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                open();
            }
        });
        fileSave = new JMenuItem("Save");
        file.add(fileSave);
        fileClose = new JMenuItem("Close");
        file.add(fileClose);
        tabbedPane = new JTabbedPane();
        logWindow = new JTextArea(7, 5);
        logWindow.setEditable(false);
        scrollWindow = new JScrollPane(logWindow, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        scrollWindow.setPreferredSize(new Dimension(400, 100));
        start = new JButton("Start");
        stop = new JButton("Stop");
        pause = new JButton("Pause");
        skip = new JButton("Skip");
        start.addActionListener(this);
        pause.addActionListener(this);
        skip.addActionListener(this);
        container.add(menuBar, BorderLayout.PAGE_START);
        container.add(tabbedPane, BorderLayout.CENTER);
        bottomPanel = new JPanel();
        bottomPanel.setLayout(new BorderLayout());
        bottomPanel.add(scrollWindow, BorderLayout.CENTER);
        buttonPanel = new JPanel();
        buttonPanel.add(start);
        buttonPanel.add(stop);
        buttonPanel.add(pause);
        buttonPanel.add(skip);
        bottomPanel.add(buttonPanel, BorderLayout.PAGE_END);
        container.add(bottomPanel, BorderLayout.PAGE_END);
        myList = new eventList();
        mServer = new messageServer(myList, 6000);
        start.setEnabled(false);
        setSize(640, 480);
        setVisible(true);
    }

    protected void open() {
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        fileChooser.addChoosableFileFilter(new chartFilter());
        fileChooser.setCurrentDirectory(new File("."));
        int result = fileChooser.showOpenDialog(this);
        if (result == JFileChooser.CANCEL_OPTION) return;
        File fileName = fileChooser.getSelectedFile();
        if (fileName == null || fileName.getName().equals("")) {
            JOptionPane.showMessageDialog(this, "Invalid File Name", "Invalid File Name", JOptionPane.ERROR_MESSAGE);
        } else {
            chart = new stateChart(fileName.toString());
            start.setEnabled(true);
        }
    }

    class chartFilter extends javax.swing.filechooser.FileFilter {

        public boolean accept(File file) {
            String filename = file.getName();
            return filename.endsWith(".ESP") || file.isDirectory();
        }

        public String getDescription() {
            return "*.ESP";
        }
    }

    public void actionPerformed(ActionEvent e) {
        if ("Start".equals(e.getActionCommand())) {
            engine = new stateEngine(chart, myList, this, true, iteration);
            iteration++;
            t = new Thread(engine);
            t.start();
        } else if ("Pause".equals(e.getActionCommand())) {
        } else if ("Skip".equals(e.getActionCommand())) {
            t.stop();
        }
    }

    public static void main(String[] args) {
        StateChartGUI app = new StateChartGUI();
        app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}


text:
function ms_setup
mfile_path=fileparts(mfilename('fullpath'));
%addpath([mfile_path,'/mountainlab/matlab']);
%ms_setup_path;
%disp('Be sure to run mountainlab_setup.m');  % dont' want to see each time

addpath([mfile_path,'/sorting_algs']);
addpath([mfile_path,'/unit_tests']);
addpath([mfile_path,'/validation']);
addpath([mfile_path,'/examples']);
addpath([mfile_path,'/view']);

end


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

<title>A-Index (ARX API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I K L M N O P Q R S T U V W _

A

AbstractILMultiDimensional - Class in org.deidentifier.arx.metric.v2

This class implements an information loss which can be represented as a
 decimal number per quasi-identifier.

AbstractILMultiDimensionalReduced - Class in org.deidentifier.arx.metric.v2

This class implements an information loss which can be represented as a
 decimal number per quasi-identifier.

AbstractMetricMultiDimensional - Class in org.deidentifier.arx.metric.v2

This class provides an abstract skeleton for the implementation of multi-dimensional metrics.

AbstractMetricMultiDimensionalPotentiallyPrecomputed - Class in org.deidentifier.arx.metric.v2

This class provides an abstract skeleton for the implementation of metrics
 that can either be precomputed or not.

AbstractMetricSingleDimensional - Class in org.deidentifier.arx.metric.v2

This class provides an abstract skeleton for the implementation of single-dimensional metrics.

acceptsParameter(String) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.AggregateFunctionWithParameter

Returns whether the function accepts this parameter.

acceptsParameter(String) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericCommonPrefix

acceptsParameter(String) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericConstant

acceptsParameter(String) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericSetOfPrefixes

access() - Method in class org.deidentifier.arx.ARXLattice

Access fields of this class.

access() - Method in class org.deidentifier.arx.ARXLattice.ARXNode

Alter associated fields.

accuracy(double) - Method in class org.deidentifier.arx.ARXSolverConfiguration

add(String...) - Method in class org.deidentifier.arx.AttributeType.Hierarchy.DefaultHierarchy

Adds a row to the tabular representation of this hierarchy.

add(T) - Method in class org.deidentifier.arx.common.Groupify

Adds a new element

add(String...) - Method in class org.deidentifier.arx.Data.DefaultData

Adds a row to this data object.

add(Date, Date) - Method in class org.deidentifier.arx.DataType.ARXDate

add(Double, Double) - Method in class org.deidentifier.arx.DataType.ARXDecimal

add(Long, Long) - Method in class org.deidentifier.arx.DataType.ARXInteger

add(T, T) - Method in interface org.deidentifier.arx.DataType.DataTypeWithRatioScale

add(int) - Method in class org.deidentifier.arx.RowSet

Sets a bit

addColumn(int) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(int, DataType<?>) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(int, DataType<?>, boolean) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(int, String) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(int, String, DataType<?>) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(int, String, DataType<?>, boolean) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(String) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(String, DataType<?>) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(String, DataType<?>, boolean) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(String, String) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(String, String, DataType<?>) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(String, String, DataType<?>, boolean) - Method in class org.deidentifier.arx.DataSource

Adds a new column.

addColumn(ImportColumn) - Method in class org.deidentifier.arx.io.ImportConfiguration

Adds a single column to import from.

addColumn(ImportColumn) - Method in class org.deidentifier.arx.io.ImportConfigurationCSV

Adds a single column to import from

 This makes sure that only ImportColumnCSV can be added, otherwise
 an IllegalArgumentException will be thrown.

addColumn(ImportColumn) - Method in class org.deidentifier.arx.io.ImportConfigurationExcel

Adds a single column to import from

 This makes sure that only ImportColumnExcel can be added,
 otherwise an IllegalArgumentException will be thrown.

addColumn(ImportColumn) - Method in class org.deidentifier.arx.io.ImportConfigurationJDBC

Adds a single column to import from

 This makes sure that only ImportColumnJDBC can be added,
 otherwise an IllegalArgumentException will be thrown.

addCriterion(PrivacyCriterion) - Method in class org.deidentifier.arx.ARXConfiguration

Deprecated.

addGroup(int) - Method in class org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.Level

Adds the given group with the default aggregate function.

addGroup(int, AggregateFunction<U>) - Method in class org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.Level

Adds the given group with the given aggregate function.

addGroup(int, String) - Method in class org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.Level

Adds the given group.

addInterval(T, T) - Method in class org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased

Adds an interval.

addInterval(T, T, AggregateFunction<T>) - Method in class org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased

Adds an interval.

addInterval(T, T, String) - Method in class org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased

Adds an interval.

addItem(String) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds an item

addItem(ElementData) - Method in class org.deidentifier.arx.certificate.elements.ElementList

Adds element data

addItem(ElementList) - Method in class org.deidentifier.arx.certificate.elements.ElementList

Adds an item to this list

addItem(ElementText) - Method in class org.deidentifier.arx.certificate.elements.ElementList

Adds an item to this list

addPercentProperty(String, double) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a number between 0 and 1 as precentage

addPrivacyModel(PrivacyCriterion) - Method in class org.deidentifier.arx.ARXConfiguration

Adds a privacy model to the configuration.

addProperty(String, ARXLattice.Anonymity) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a property

addProperty(String, boolean) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a property

addProperty(String, double) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a property

addProperty(String, int) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a property

addProperty(String, long) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a property

addProperty(String, String) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a property

addProperty(String, ElementData) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Adds a property

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction

This function returns an aggregate value.

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericArithmeticMean

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericArithmeticMeanOfBounds

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericBounds

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericCommonPrefix

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericConstant

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericGeometricMean

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericGeometricMeanOfBounds

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericInterval

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericSet

aggregate(String[]) - Method in class org.deidentifier.arx.aggregates.AggregateFunction.GenericSetOfPrefixes

AggregateFunction<T> - Class in org.deidentifier.arx.aggregates

This abstract class represents an aggregate function.

AggregateFunction.AggregateFunctionBuilder<T> - Class in org.deidentifier.arx.aggregates

A builder for aggregate functions.

AggregateFunction.AggregateFunctionWithParameter<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that has a parameter.

AggregateFunction.GenericArithmeticMean<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns the arithmetic mean, if it may be computed, "NULL"
 otherwise.

AggregateFunction.GenericArithmeticMeanOfBounds<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns the arithmetic mean of min & max, if it may be computed, "NULL"
 otherwise.

AggregateFunction.GenericBounds<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns an interval consisting of the
 first and the last element following the predefined order .

AggregateFunction.GenericCommonPrefix<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns a common prefix.

AggregateFunction.GenericConstant<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns a constant value.

AggregateFunction.GenericGeometricMean<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns the geometric mean, if it may be computed, "NULL"
 otherwise.

AggregateFunction.GenericGeometricMeanOfBounds<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns the geometric mean of min & max, if it may be computed, "NULL"
 otherwise.

AggregateFunction.GenericInterval<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns an interval [min, max] .

AggregateFunction.GenericSet<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns a set of all data values.

AggregateFunction.GenericSetOfPrefixes<T> - Class in org.deidentifier.arx.aggregates

An aggregate function that returns a set of the prefixes of the data values.

and() - Method in class org.deidentifier.arx.DataSelector

anonymize(Data, ARXConfiguration) - Method in class org.deidentifier.arx.ARXAnonymizer

Performs data anonymization.

ANY_VALUE - Static variable in class org.deidentifier.arx.DataType

The string representing the ANY value

ARXAnonymizer - Class in org.deidentifier.arx

This class offers several methods to define parameters and execute the ARX
 algorithm.

ARXAnonymizer() - Constructor for class org.deidentifier.arx.ARXAnonymizer

Creates a new anonymizer with the default configuration.

ARXAnonymizer(int, double, double) - Constructor for class org.deidentifier.arx.ARXAnonymizer

Creates a new anonymizer with the given configuration.

ARXCertificate - Class in org.deidentifier.arx.certificate

A PDF document

ARXConfiguration - Class in org.deidentifier.arx

A generic configuration for the ARX anonymizer.

ARXConfiguration.ARXConfigurationInternal - Class in org.deidentifier.arx

Class for internal use that provides access to more parameters and functionality.

ARXConfiguration.Monotonicity - Enum in org.deidentifier.arx

Monotonicity.

ARXCostBenefitConfiguration - Class in org.deidentifier.arx

Basic configuration of monetary amounts, such as the publisher's benefit
 per record or the per-record fine fine for a successful re-identification attack.

ARXLattice - Class in org.deidentifier.arx

This class implements a representation of the generalization lattice that is
 exposed to users of the API.

ARXLattice.Access - Class in org.deidentifier.arx

The internal accessor class.

ARXLattice.Access(ARXLattice) - Constructor for class org.deidentifier.arx.ARXLattice.Access

Constructor

ARXLattice.Anonymity - Enum in org.deidentifier.arx

ReflectS different anonymity properties

ARXLattice.ARXNode - Class in org.deidentifier.arx

A node in the lattice.

ARXLattice.ARXNode(ARXLattice) - Constructor for class org.deidentifier.arx.ARXLattice.ARXNode

Internal constructor for deserialization.

ARXLattice.ARXNode.Access - Class in org.deidentifier.arx

Internal access class.

ARXLattice.ARXNode.Access(ARXLattice.ARXNode) - Constructor for class org.deidentifier.arx.ARXLattice.ARXNode.Access

Accessor class

ARXLattice.LatticeDeserializationContext - Class in org.deidentifier.arx

Context for deserialization.

ARXLattice.LatticeDeserializationContext() - Constructor for class org.deidentifier.arx.ARXLattice.LatticeDeserializationContext

ARXListener - Interface in org.deidentifier.arx

This class implements a listener for the ARX framework.

ARXLogisticRegressionConfiguration - Class in org.deidentifier.arx

Configuration for logistic regression

ARXLogisticRegressionConfiguration.PriorFunction - Enum in org.deidentifier.arx

Prior function for regularization

ARXPopulationModel - Class in org.deidentifier.arx

This class models population properties for risk estimation

ARXPopulationModel.Region - Enum in org.deidentifier.arx

Regions

ARXResult - Class in org.deidentifier.arx

Encapsulates the results of an execution of the ARX algorithm.

ARXResult(DataHandle, DataDefinition, ARXLattice, int, double, double, Metric<?>, ARXConfiguration, ARXLattice.ARXNode, long, SolutionSpace) - Constructor for class org.deidentifier.arx.ARXResult

Internal constructor for deserialization.

ARXSolverConfiguration - Class in org.deidentifier.arx

Runtime configuration for the solver

asList() - Method in class org.deidentifier.arx.certificate.elements.ElementData

Returns a list

asList(String) - Method in class org.deidentifier.arx.certificate.elements.ElementData

Returns a list

AttributeType - Class in org.deidentifier.arx

Represents an attribute type.

AttributeType.Hierarchy - Class in org.deidentifier.arx

This class implements a generalization hierarchy.

AttributeType.Hierarchy() - Constructor for class org.deidentifier.arx.AttributeType.Hierarchy

Instantiates a new hierarchy.

AttributeType.Hierarchy.DefaultHierarchy - Class in org.deidentifier.arx

The default implementation of a generalization hierarchy.

AttributeType.Hierarchy.DefaultHierarchy() - Constructor for class org.deidentifier.arx.AttributeType.Hierarchy.DefaultHierarchy

Instantiates a new default hierarchy.

AttributeType.MicroAggregationFunction - Class in org.deidentifier.arx

This class is used to define aggregate functions for microaggregation.

AttributeType.MicroAggregationFunctionDescription - Class in org.deidentifier.arx

This class describes a microaggregation function

AverageReidentificationRisk - Class in org.deidentifier.arx.criteria

This criterion ensures that an estimate for the average re-identification risk falls
 below a given threshold.

AverageReidentificationRisk(double) - Constructor for class org.deidentifier.arx.criteria.AverageReidentificationRisk

Creates a new instance of this criterion.

A B C D E F G H I K L M N O P Q R S T U V W _

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web.Http;
using System.Threading.Tasks;
using DeviceHive.API.Filters;
using DeviceHive.API.Internal;
using DeviceHive.Core;
using DeviceHive.Core.Mapping;
using DeviceHive.Data.Model;
using DeviceHive.Data.Repositories;
using Newtonsoft.Json.Linq;
using Ninject;

namespace DeviceHive.API.Controllers
{
    /// <resource cref="DeviceNotification" />
    public class DeviceNotificationPollController : BaseController
    {
        private ITimestampRepository _timestampRepository;
        private ObjectWaiter _notificationByDeviceIdWaiter;

        public DeviceNotificationPollController(ITimestampRepository timestampRepository,
            [Named("DeviceNotification.DeviceID")] ObjectWaiter notificationByDeviceIdWaiter)
        {
            _timestampRepository = timestampRepository;
            _notificationByDeviceIdWaiter = notificationByDeviceIdWaiter;
        }

        /// <name>poll</name>
        /// <summary>
        ///     <para>Polls new device notifications.</para>
        ///     <para>This method returns all device notifications that were created after specified timestamp.</para>
        ///     <para>In the case when no notifications were found, the method blocks until new notification is received.
        ///         If no notifications are received within the waitTimeout period, the server returns an empty response.
        ///         In this case, to continue polling, the client should repeat the call with the same timestamp value.
        ///     </para>
        /// </summary>
        /// <param name="deviceGuid">Device unique identifier.</param>
        /// <param name="timestamp">Timestamp of the last received notification (UTC). If not specified, the server's timestamp is taken instead.</param>
        /// <param name="names">Comma-separated list of notification names.</param>
        /// <param name="waitTimeout">Waiting timeout in seconds (default: 30 seconds, maximum: 60 seconds). Specify 0 to disable waiting.</param>
        /// <returns cref="DeviceNotification">If successful, this method returns array of <see cref="DeviceNotification"/> resources in the response body.</returns>
        [Route("device/{deviceGuid:deviceGuid}/notification/poll")]
        [AuthorizeUser(AccessKeyAction = "GetDeviceNotification")]
        public async Task<JArray> Get(string deviceGuid, DateTime? timestamp = null, string names = null, int? waitTimeout = null)
        {
            var device = DataContext.Device.Get(deviceGuid);
            if (device == null || !IsDeviceAccessible(device))
                ThrowHttpResponse(HttpStatusCode.NotFound, "Device not found!");

            var start = timestamp ?? _timestampRepository.GetCurrentTimestamp();
            var notificationNames = names != null ? names.Split(',') : null;
            if (waitTimeout <= 0)
            {
                var filter = new DeviceNotificationFilter { Start = start, IsDateInclusive = false, Notifications = notificationNames };
                var notifications = DataContext.DeviceNotification.GetByDevice(device.ID, filter);
                return new JArray(notifications.Select(n => Mapper.Map(n)));
            }

            var config = DeviceHiveConfiguration.RestEndpoint;
            var delayTask = Task.Delay(1000 * Math.Min(config.NotificationPollMaxInterval, waitTimeout ?? config.NotificationPollDefaultInterval));
            using (var waiterHandle = _notificationByDeviceIdWaiter.BeginWait(device.ID))
            {
                do
                {
                    var filter = new DeviceNotificationFilter { Start = start, IsDateInclusive = false, Notifications = notificationNames };
                    var notifications = DataContext.DeviceNotification.GetByDevice(device.ID, filter);
                    if (notifications != null && notifications.Any())
                        return new JArray(notifications.Select(n => Mapper.Map(n)));
                }
                while (await Task.WhenAny(waiterHandle.Wait(), delayTask) != delayTask);
            }

            return new JArray();
        }

        /// <name>pollMany</name>
        /// <summary>
        ///     <para>Polls new device notifications.</para>
        ///     <para>This method returns all device notifications that were created after specified timestamp.</para>
        ///     <para>In the case when no notifications were found, the method blocks until new notification is received.
        ///         If no notifications are received within the waitTimeout period, the server returns an empty response.
        ///         In this case, to continue polling, the client should repeat the call with the same timestamp value.
        ///     </para>
        /// </summary>
        /// <param name="deviceGuids">Comma-separated list of device unique identifiers.</param>
        /// <param name="timestamp">Timestamp of the last received notification (UTC). If not specified, the server's timestamp is taken instead.</param>
        /// <param name="names">Comma-separated list of notification names.</param>
        /// <param name="waitTimeout">Waiting timeout in seconds (default: 30 seconds, maximum: 60 seconds). Specify 0 to disable waiting.</param>
        /// <returns>If successful, this method returns array of the following resources in the response body.</returns>
        /// <response>
        ///     <parameter name="deviceGuid" type="guid">Associated device unique identifier.</parameter>
        ///     <parameter name="notification" cref="DeviceNotification"><see cref="DeviceNotification"/> resource.</parameter>
        /// </response>
        [Route("device/notification/poll")]
        [AuthorizeUser(AccessKeyAction = "GetDeviceNotification")]
        public async Task<JArray> GetMany(string deviceGuids = null, DateTime? timestamp = null, string names = null, int? waitTimeout = null)
        {
            var deviceIds = deviceGuids == null ? null : ParseDeviceGuids(deviceGuids).Select(deviceGuid =>
                {
                    var device = DataContext.Device.Get(deviceGuid);
                    if (device == null || !IsDeviceAccessible(device))
                        ThrowHttpResponse(HttpStatusCode.BadRequest, "Invalid deviceGuid: " + deviceGuid);

                    return device.ID;
                }).ToArray();

            var start = timestamp ?? _timestampRepository.GetCurrentTimestamp();
            var notificationNames = names != null ? names.Split(',') : null;
            if (waitTimeout <= 0)
            {
                var filter = new DeviceNotificationFilter { Start = start, IsDateInclusive = false, Notifications = notificationNames };
                var notifications = DataContext.DeviceNotification.GetByDevices(deviceIds, filter);
                return MapDeviceNotifications(notifications.Where(n => IsDeviceAccessible(n.Device)));
            }

            var config = DeviceHiveConfiguration.RestEndpoint;
            var delayTask = Task.Delay(1000 * Math.Min(config.NotificationPollMaxInterval, waitTimeout ?? config.NotificationPollDefaultInterval));
            using (var waiterHandle = _notificationByDeviceIdWaiter.BeginWait(
                deviceIds == null ? new object[] { null } : deviceIds.Cast<object>().ToArray()))
            {
                do
                {
                    var filter = new DeviceNotificationFilter { Start = start, IsDateInclusive = false, Notifications = notificationNames };
                    var notifications = DataContext.DeviceNotification.GetByDevices(deviceIds, filter)
                        .Where(n => IsDeviceAccessible(n.Device)).ToArray();
                    if (notifications != null && notifications.Any())
                        return MapDeviceNotifications(notifications);
                }
                while (await Task.WhenAny(waiterHandle.Wait(), delayTask) != delayTask);
            }

            return new JArray();
        }

        private JArray MapDeviceNotifications(IEnumerable<DeviceNotification> notifications)
        {
            return new JArray(notifications.Select(n =>
                {
                    return new JObject(
                        new JProperty("deviceGuid", n.Device.GUID),
                        new JProperty("notification", Mapper.Map(n)));
                }));
        }

        private string[] ParseDeviceGuids(string deviceGuids)
        {
            return deviceGuids.Split(',').ToArray();
        }

        private IJsonMapper<DeviceNotification> Mapper
        {
            get { return GetMapper<DeviceNotification>(); }
        }
    }
}