text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.curso</groupId>
    <artifactId>EjemploSic</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <scm>
        <connection>
            scm:git:https://github.com/iconojdiazch/EjemploSic.git
        </connection>
        <developerConnection>scm:git:[fetch=]https://github.com/iconojdiazch/EjemploSic.git[push=]https://github.com/iconojdiazch/EjemploSic.git
        </developerConnection>
        <url>
            https:https://github.com/iconojdiazch/EjemploSic.git
        </url>
    </scm>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.9</version>
                <configuration>
                    <connectionType>
                        developerConnection
                    </connectionType>
                    <username>usuario</username>
                    <password>clave</password>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <outputDirectory>${project.build.directory}/site</outputDirectory>
        <plugins>
            <!-- Maven Project Info Reports Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>
            <!-- Cobertura Code Coverage Plugin -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <instrumentation>
                        <ignoreTrivial>true</ignoreTrivial>
                    </instrumentation>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
    </properties>
</project>


text:
'use strict';

class NewsletterController {
    constructor ($scope, $stateParams, titles) {
        'ngInject';

        this.$stateParams = $stateParams;
        this.titles = titles;

        $scope.getTitle = this.getTitle.bind(this);
        $scope.getVignetteImage = this.getVignetteImage.bind(this);
    }

    getTitle (article) {
        if (article != null) {
            return this.titles.articles[article];
        }
        return this.titles.title.replace(' ', '<br>');
    }

    getVignetteImage () {
        return `assets/images/menu/menu-${this.$stateParams.article}.svg`;
    }
}

export default NewsletterController;

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="favicon.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>qr-inv-restapp: QRInvoiceGeneratorResource</title>

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

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

  <link rel="stylesheet" href="css/style.css">

  <link href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.css" type="text/css">

        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
          Toggle navigation

        </button>
        qr-inv-restapp: QRInvoiceGeneratorResource

Resources

GET /generator/string

GET /generator/validator

GET /generator/image

GET /generator/imagefromstring

Back to Top

Home

Resources

QRInvoiceGeneratorResource

QRInvoiceGeneratorResource Resource

Created by zcg on 12.6.2016.
Resource for QR invoice REST API

GET /generator/string

Returns String representing QR payment, make basic validation of input params

Request Parameters

            name
            type
            description
            default
            constraints

            ACC
            query

            AM
            query

            BIC
            query

            CC
            query

            CZK

            DD
            query

            DPPD
            query

            DT
            query

            DUZP
            query

            FX
            query

            FXA
            query

            1

            INI
            query

            INR
            query

            MSG
            query

            NTB
            query

            ON
            query

            SA
            query

            0
            byte

            SPAYD-MSG
            query

            SPAYD-URL
            query

            T0
            query

            T1
            query

            T2
            query

            TB0
            query

            TB1
            query

            TB2
            query

            TD
            query

            byte

            TP
            query

            0
            byte

            VII
            query

            VIR
            query

            VS
            query

            X-SW
            query

            X-URL
            query

            accountBase
            query

            accountPrefix
            query

            bankCode
            query

            id
            query

            mode
            query
            indicates which mode of QR should be used, pure QR invoice or integrated with SPAYD
            INVOICE_MODE
            "INVOICE_MODE" or "SPAYD_MODE"

            transliterate
            query
            identifies if returned string has to have capitalized letters
            true
            boolean

Response Body

            media type
            data type
            description

            text/plain
            (custom)

            string with QR code data

GET /generator/validator

validate specialities which are not handled by bean validation
TODO create validation for InvoiceModel itself

Request Parameters

            name
            type
            description
            default
            constraints

            ACC
            query

            AM
            query

            BIC
            query

            CC
            query

            CZK

            DD
            query

            DPPD
            query

            DT
            query

            DUZP
            query

            FX
            query

            FXA
            query

            1

            INI
            query

            INR
            query

            MSG
            query

            NTB
            query

            ON
            query

            SA
            query

            0
            byte

            SPAYD-MSG
            query

            SPAYD-URL
            query

            T0
            query

            T1
            query

            T2
            query

            TB0
            query

            TB1
            query

            TB2
            query

            TD
            query

            byte

            TP
            query

            0
            byte

            VII
            query

            VIR
            query

            VS
            query

            X-SW
            query

            X-URL
            query

            accountBase
            query

            accountPrefix
            query

            bankCode
            query

            id
            query

            mode
            query
            indicates which mode of QR should be used, pure QR invoice or integrated with SPAYD
            INVOICE_MODE
            "INVOICE_MODE" or "SPAYD_MODE"

Response Body

            media type
            data type

            text/plain
            (custom)

GET /generator/image

generate QR code based on invoice data

Request Parameters

            name
            type
            description
            default
            constraints

            ACC
            query

            AM
            query

            BIC
            query

            CC
            query

            CZK

            DD
            query

            DPPD
            query

            DT
            query

            DUZP
            query

            FX
            query

            FXA
            query

            1

            INI
            query

            INR
            query

            MSG
            query

            NTB
            query

            ON
            query

            SA
            query

            0
            byte

            SPAYD-MSG
            query

            SPAYD-URL
            query

            T0
            query

            T1
            query

            T2
            query

            TB0
            query

            TB1
            query

            TB2
            query

            TD
            query

            byte

            TP
            query

            0
            byte

            VII
            query

            VIR
            query

            VS
            query

            X-SW
            query

            X-URL
            query

            accountBase
            query

            accountPrefix
            query

            bankCode
            query

            branding
            query
            if resulted image has to have branding labels
            true
            boolean

            id
            query

            mode
            query
            indicates which mode of QR should be used, pure QR invoice or integrated with SPAYD
            INVOICE_MODE
            "INVOICE_MODE" or "SPAYD_MODE"

            size
            query

            int

            transliterate
            query
            identifies if returned string has to have capitalized letters
            true
            boolean

Response Body

            media type
            data type
            description

            image/png
            (custom)

            png image

GET /generator/imagefromstring

Request Parameters

            name
            type
            description
            default
            constraints

            branding
            query

            true
            boolean

            invoicedata
            query

            mode
            query

            INVOICE_MODE
            "INVOICE_MODE" or "SPAYD_MODE"

            size
            query

            int

Response Body

            media type
            data type

            image/png
            (custom)

Generated by Enunciate.


text:
/// ============================================================================
/// declarations
/// ============================================================================

/// ----------------------------------------------------------------------------
/// Headers
/// ----------------------------------------------------------------------------

#include "ncjs/Core.h"
#include "ncjs/Process.h"
#include "ncjs/ModuleManager.h"
#include "ncjs/module.h"
#include "ncjs/constants.h"

#include <include/cef_command_line.h>
#include <include/cef_parser.h>

#include <sstream>

namespace ncjs {

/// ----------------------------------------------------------------------------
/// forward declaration
/// ----------------------------------------------------------------------------

NCJS_DECLARE_BUILTIN_MODULE(constants);
NCJS_DECLARE_BUILTIN_MODULE(natives);
NCJS_DECLARE_BUILTIN_MODULE(buffer);
NCJS_DECLARE_BUILTIN_MODULE(util);
NCJS_DECLARE_BUILTIN_MODULE(fs);
NCJS_DECLARE_BUILTIN_MODULE(fs_event_wrap);
NCJS_DECLARE_BUILTIN_MODULE(os);
NCJS_DECLARE_BUILTIN_MODULE(uv);

// defined in natives.cpp
const CefString& GetMainSource();

/// ----------------------------------------------------------------------------
/// variables
/// ----------------------------------------------------------------------------

Core* Core::s_instance = NULL;

uv_loop_t* s_loop = NULL;

static CefRefPtr<CefCommandLine> s_argsNode;
static CefRefPtr<CefCommandLine> s_argsExec;

static CefString s_extension(L"\'use strict\'\n\
Object.defineProperty(this, \"ncjs\", {\n\
    get: function() {\n\
        native function init();\n\
        delete this.ncjs;\n\
        return this.ncjs = init();\n\
    },\n\
    configurable : true\n\
});");

static inline bool Url2Path(const CefString& url, CefString& filePath)
{
    CefURLParts parts;

    if (!CefParseURL(url, parts))
        return false;

    if (consts::str_file != parts.scheme.str)
        return false;

    cef_char_t* path = parts.path.str;
    size_t len = parts.path.length;

    // windows : /C:/A/B.html
    if (len > 3 && path[2] == NCJS_TEXT(':')) {
        // convert '/' to '\\'
        for (size_t i = 0; i < len; ++i) {
            if (path[i] == NCJS_TEXT('/'))
                path[i] = NCJS_TEXT('\\');
        }
        // remove first slash
        path += 1;
        len -=1;
    } // else /root/A/B.html

    filePath = CefURIDecode(CefString(path, len, false), true, UU_SPACES);

    return true;
}

static class ExtensionHandler : public CefV8Handler {
public:
    virtual bool Execute(const CefString& name, CefRefPtr<CefV8Value> object,
        const CefV8ValueList& args, CefRefPtr<CefV8Value>& retval, CefString& except) OVERRIDE;

    NCJS_IMPL_NO_REFCOUNTING(ExtensionHandler);
} s_handler;

/// ============================================================================
/// implementation
/// ============================================================================

bool ExtensionHandler::Execute(const CefString& name, CefRefPtr<CefV8Value> object,
        const CefV8ValueList& args, CefRefPtr<CefV8Value>& retval, CefString& except)
{
    if (!Core::IsInitialized()) {
        except = NCJS_TEXT("Node-CEF not initialized.");
        return true;
    }

    CefRefPtr<CefV8Context> context = CefV8Context::GetCurrentContext();
    CefRefPtr<CefFrame> frame = context->GetFrame();
    CefRefPtr<CefV8Exception> exception;

    // Check URL, also forbid remote invoking currently.
    // TODO: Add remote modules support.
    CefString frameUrl = frame->GetURL();
    CefString execPath = s_argsNode->GetProgram();
    CefString pagePath;
    if (!Url2Path(frameUrl, pagePath)) {
        except = NCJS_TEXT("Invalid request source.");
        return true;
    }

    CefRefPtr<CefV8Value> init;
    if (!context->Eval(GetMainSource(), init, exception)) {
        except = NCJS_TEXT("Failed to evaluate nc.js.");
        return true;
    }

    // Create node environment

    CefRefPtr<Environment> env = Environment::Create(context);
    CefRefPtr<CefV8Value> process = Process::CreateObject(env, context);
    env->Setup(execPath, pagePath, frameUrl, process);

    CefV8ValueList arg;
    arg.push_back(process);
    retval = init->ExecuteFunction(object, arg);

    if (!(retval.get() && retval->IsObject())) {
        except = NCJS_TEXT("Failed to create nc.js object.");
        return true;
    }

    return true;
}

/// ----------------------------------------------------------------------------
/// constructor & destructor
/// ----------------------------------------------------------------------------

Core::Core() {}

Core::~Core()
{
    if (this == s_instance) {
        ModuleManager::Reset();
        Environment::Shutdown();

        s_instance = NULL;
    }
}

/// ----------------------------------------------------------------------------
/// static functions
/// ----------------------------------------------------------------------------

bool Core::RegisterExtension()
{
    if (s_instance == NULL)
        return false;

    return CefRegisterExtension(L"v8/Node-CEF", s_extension, &s_handler);
}

bool Core::Initialize(const CefRefPtr<CefCommandLine>& cmd)
{
    if (s_instance)
        return true;

    if (!cmd.get())
        return false;

    if (!Environment::Initialize())
        return false;

    // store command line arguments
    // TODO: add command line options support
    s_argsNode = cmd->Copy();
    s_argsExec = cmd->Copy();

    // To get rid of the buggy self registration when modules are linked as
    // static libraries with MSVC linkers, we have to register all built in
    // and native modules manually.
    ModuleManager::Register(NCJS_BUILTIN_MODULE(constants));
    ModuleManager::Register(NCJS_BUILTIN_MODULE(natives));
    ModuleManager::Register(NCJS_BUILTIN_MODULE(buffer));
    ModuleManager::Register(NCJS_BUILTIN_MODULE(util));
    ModuleManager::Register(NCJS_BUILTIN_MODULE(fs));
    ModuleManager::Register(NCJS_BUILTIN_MODULE(fs_event_wrap));
    ModuleManager::Register(NCJS_BUILTIN_MODULE(os));
    ModuleManager::Register(NCJS_BUILTIN_MODULE(uv));

    s_instance = this;

    return true;
}

} // ncjs


text:
package com.appleframework.data.hbase.hql.node.binary;

import org.w3c.dom.Node;

import com.appleframework.data.hbase.hql.HQLNode;
/**
 * @author xinzhi
 */
public class IsNotEqualNodeHandler extends BinaryNodeHandler {

    @Override
    public HQLNode handle(Node node) {
        IsNotEqualNode isNotEqualNode = new IsNotEqualNode();
        super.handle(isNotEqualNode, node);
        return isNotEqualNode;
    }
}


text:
<?php

declare(strict_types=1);

/*
 * This file is part of the RollerworksSearch package.
 *
 * (c) Sebastiaan Stok <s.stok@rollerscapes.net>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Rollerworks\Component\Search\Field;

use Rollerworks\Component\Search\Exception\InvalidArgumentException;
use Rollerworks\Component\Search\SearchExtension;

/**
 * @author Sebastiaan Stok <s.stok@rollerscapes.net>
 */
interface TypeRegistry
{
    /**
     * Returns a field type by name.
     *
     * @throws InvalidArgumentException if the type cannot be retrieved from any extension
     */
    public function getType(string $name): ResolvedFieldType;

    /**
     * Returns whether the given field type is supported.
     */
    public function hasType(string $name): bool;

    /**
     * Returns the extensions loaded on the registry.
     *
     * @return SearchExtension[]
     */
    public function getExtensions(): array;
}


text:
All notable changes to this project will be documented in this file. This
project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

## 0.4.8

### Miscellaneous

- Fix top-level navigation links
- Improve file loader error handling

## 0.4.7

### Fixes

- Fix recursive binding by short-circuiting ref eval ([#298](https://github.com/open-policy-agent/opa/issues/298))
- Fix reordering for unsafe ref heads ([#297](https://github.com/open-policy-agent/opa/issues/297))
- Fix rewriting of single term exprs ([#299](https://github.com/open-policy-agent/opa/issues/299))

## 0.4.6

This release changes the `run` command options:

- Removed glog in favour of Sirupsen/logrus. This means the command line arguments to control logging have changed. See `run --help` for details.
- Removed `--policy-dir` option. For now, if policy persistence is required, users can treat policies as config files and manage them outside of OPA. Once OPA supports persistence of data (e.g., with file-based storage) then policy persistence will be added back in.

### Fixes

- Add support for additional HTTP listener ([#289](https://github.com/open-policy-agent/opa/issues/289))
- Allow slash in policy id/path ([#292](https://github.com/open-policy-agent/opa/issues/292))
- Improve request logging ([#281](https://github.com/open-policy-agent/opa/issues/281))

### Miscellaneous

- Add deployment documentation
- Remove erroneous flag.Parse() call
- Remove persist/--policy-dir option
- Replace glog with logrus

Also, updated Docker tagging so that latest points to most recent release (instead of most recent development build). The most recent development build can still be obtained with the {version}-dev tag.

## 0.4.5

### API security

This release adds support for TLS, token-based authentication, and authorization in the OPA APIs!

For details on how to secure the OPA API, go to http://openpolicyagent.org/documentation/references/security.

### Fixes

- Fix stray built-in error messages ([#275](https://github.com/open-policy-agent/opa/issues/275))
- Update error codes and messages throughout ([#237](https://github.com/open-policy-agent/opa/issues/237))
- [Fix evaluation bug with nested value refs](https://github.com/open-policy-agent/opa/pull/276/commits/e3336cce130eedda08f224ce4f28e19212447dcb)
- [Fix rego.Eval to close transactions](https://github.com/open-policy-agent/opa/pull/276/commits/745bd235127fae6bc22ff870bf62922c9358ccc0)
- [Fix buggy usage of errors.Cause](https://github.com/open-policy-agent/opa/pull/276/commits/bdf43b6a52de639e4f66810306311641ed7eea85)

### Miscellaneous

- Updated to support Go 1.8

## 0.4.4

### Fixes

- Fix issue in high-level Go API ([#261](https://github.com/open-policy-agent/opa/issues/261))

## 0.4.3

### Fixes

- Fix parsing of inline comments ([#258](https://github.com/open-policy-agent/opa/issues/258))
- Fix unset of input/data in REPL ([#259](https://github.com/open-policy-agent/opa/issues/259))
- Handle non-string/var values in rule tree lookup ([#257](https://github.com/open-policy-agent/opa/issues/257))

## 0.4.2

### Rego

This release changes the Rego syntax. The two main changes are:

- Expressions are now separated by semicolons (instead of commas). When writing rules, the semicolons are optional.
- Rules are no longer written in the form: `head :- body`. Instead they are written as `head { body }`.

Also:

- Set, array, and object literals now support trailing commas.
- To declare a set literal with one element, you must include a trailing comma, e.g., `{ foo, }`.
- Arithmetic and set operations can now be performed with infix notation, e.g., `x = 2 + 1`.
- Sets can be referred to like objects and arrays now ([#243](https://github.com/open-policy-agent/opa/issues/243)). E.g., `p[_].foo = 1 # check if element in has attr foo equal to 1`.

### Evaluation

This release changes the evaluation behaviour for packages. Previously, if a package contained no rules OR all of the rules were undefined when evaluated, a query against the package path would return undefined. As of v0.4.2 the query will return an empty object.

### REST API

This release changes the Data API to return an HTTP 200 response if the document is undefined. The message body will contain an object without the `result` property.

### Fixes

- Allow sets to be treated like objects/arrays

### Miscellaneous

- Added high level API for Go users. See `github.com/open-policy-agent/opa/rego` package.
- Improved expression String() function to handle infix operators better.
- Added support for set intersection and union built-ins. See language docs.

## 0.4.1

### Rego

For more details on these changes see sections in [How Do I Write Policies](http://www.openpolicyagent.org/documentation/how-do-i-write-policies/).

- Added new **default** keyword. The default keyword can be used to provide a default value for rules with complete definitions.
- Added new **with** keyword. The with keyword can be used to programmatically set the value of the input document inside policies.

### Fixes

- Fix input document definition in REPL ([#231](https://github.com/open-policy-agent/opa/issues/231))
- Fix reference evaluation bug ([#238](https://github.com/open-policy-agent/opa/issues/238))

### Miscellaneous

- Add basic REST API authorization benchmark

## 0.4.0

### REST API changes

This release contains a few non-backwards compatible changes to the REST API:

- The `request` document has been renamed to `input`. If you were calling the
  GET /data[/path]?request=value you should update to use [POST
  requests](http://www.openpolicyagent.org/documentation/references/rest#get-a-document-with-input)
  (see below).

- The API responses have been updated to return results embedded inside a
  wrapper object: `{"result": value}`. This will allow OPA to return unambiguous
  metadata in future (e.g., pagination, analysis, etc.) If you were previously
  consuming Data API GET responses, you should update your code to access the
  value under the `"result"` key of the response object.

- The API models have been updated to use snake_case
  ([#222](https://github.com/open-policy-agent/opa/issues/222)). This would only
  affect you if you were previously consuming error responses or policy ASTs.

The Data API has been updated to support the [POST
requests](http://www.openpolicyagent.org/documentation/references/rest#get-a-document-with-input).
This is the recommended way of supplying query inputs.

### Built-in Function changes

The built-in framework has been extended to support simplified built-in
implementations:

- Refactor topdown built-in functions
  ([#205](https://github.com/open-policy-agent/opa/issues/205))

### Fixes

- Add cURL note to REST API docs ([#211](https://github.com/open-policy-agent/opa/issues/211))
- Fix empty request parameter parsing ([#212](https://github.com/open-policy-agent/opa/issues/212))
- Fix handling of missing input document ([#227](https://github.com/open-policy-agent/opa/issues/227))
- Improve floating point literal support ([#215](https://github.com/open-policy-agent/opa/issues/215))
- Improve module parsing errors ([#213](https://github.com/open-policy-agent/opa/issues/213))
- Fix ast.Number hash and equality
- Fix parsing of escaped strings

### Miscellaneous

- Improve evaluation error messages

## 0.3.1

### Fixes

- Fixed unsafe vars with built-in operator names bug ([#206](https://github.com/open-policy-agent/opa/issues/206))
- Fixed body to rule conversion bug ([#202](https://github.com/open-policy-agent/opa/issues/202))
- Improved request parameter handling ([#201](https://github.com/open-policy-agent/opa/issues/201))

### Miscellaneous

- Improved release infrastructure

## 0.3.0

The last major/minor release of 2016! Woohoo! This release contains a few
non-backwards compatible changes to the APIs.

### Storage API changes

These changes simplify and clean up the storage.Store interface. This should
make it easier to implement custom stores in the future.

- Update storage to support context.Context ([#155](https://github.com/open-policy-agent/opa/issues/155))
- Update underlying number representation ([#154](https://github.com/open-policy-agent/opa/issues/154))
- Updates to use new storage.Path type ([#159](https://github.com/open-policy-agent/opa/issues/159))

### The request Document

These changes update the language to align query arguments with state stored in
OPA. With these changes, OPA can readily analyze policies and determine
references that refer to state stored in OPA versus query arguments versus local
variables.

These changes also update how query arguments are provided via the REST API.

- Updates to how query arguments are handled [#197](https://github.com/open-policy-agent/opa/pull/197)

### topdown API changes

- topdown.Context has been renamed to topdown.Topdown to avoid confusion with Golang's context.

### Fixes

- Add help topics to REPL ([#172](https://github.com/open-policy-agent/opa/issues/172))
- Fix error handling bug in Query API ([#183](https://github.com/open-policy-agent/opa/issues/183))
- Fix handling of prefixed paths with -w flag ([#193](https://github.com/open-policy-agent/opa/issues/193))
- Improve exit handling in REPL ([#175](https://github.com/open-policy-agent/opa/issues/175))
- Update parser support for <var> = <term> rules ([#192](https://github.com/open-policy-agent/opa/issues/192))

### Miscellaneous

- Add Visual Studio and Atom plugins
- Add lazy loading of modules during compilation
- Fix bug in serialization of empty objects/arrays

## 0.2.2

### Fixes

- Add YAML loading and refactor into separate file ([#135](https://github.com/open-policy-agent/opa/issues/135))
- Add command line flag to eval, print, and exit ([#152](https://github.com/open-policy-agent/opa/issues/152))
- Add compiler check for consistent rule types ([#147](https://github.com/open-policy-agent/opa/issues/147))
- Add set_diff built-in ([#133](https://github.com/open-policy-agent/opa/issues/133))
- Add simple 'show' command to print current module ([#108](https://github.com/open-policy-agent/opa/issues/108))
- Added examples to 'help' output in REPL ([#151](https://github.com/open-policy-agent/opa/issues/151))
- Check package declarations for conflicts ([#137](https://github.com/open-policy-agent/opa/issues/137))
- Deep copy modules in compiler ([#158](https://github.com/open-policy-agent/opa/issues/158))
- Fix evaluation of refs to set literals ([#149](https://github.com/open-policy-agent/opa/issues/149))
- Fix indexing usage for refs with intersecting vars ([#153](https://github.com/open-policy-agent/opa/issues/153))
- Fix output for references iterating sets ([#148](https://github.com/open-policy-agent/opa/issues/148))
- Fix parser handling of keywords in variable names ([#178](https://github.com/open-policy-agent/opa/issues/178))
- Improve file loading support ([#163](https://github.com/open-policy-agent/opa/issues/163))
- Remove conflict error for same key/value pairs ([#165](https://github.com/open-policy-agent/opa/issues/165))
- Support "data" query in REPL ([#150](https://github.com/open-policy-agent/opa/issues/150))

### Miscellaneous

- Add new compiler harness for ad-hoc queries
- Add tab completion of imports

## 0.2.1

### Improvements

- Added support for non-ground global values
- Added several new string manipulation built-ins
- Added TextMate grammar file
- Setup Docker image build and push to Docker Hub as part of CI

## 0.2.0

### Language

- Set literals
- Composite and reference values in Rule head
- Complete Rule definitions containing variables
- Builtins for regular expressions, string concatenation, casting to numbers

### Compiler

- Improved error reporting in parser and compiler

### Evaluation

- Iteration over base and virtual documents (in the same reference)
- Query tracing and explanation support

### Storage

- Pluggable data storage support

### Documentation

- GoDoc strings with examples
- REST API specification
- Concise language reference

### Performance

- Per-query cache of virtual documents in topdown

And many other small improvements and fixes.

## 0.1.0

### Language

- Basic value types: null, boolean, number, string, object, and array
- Reference and variables types
- Array comprehensions
- Built-in functions for basic arithmetic and aggregation
- Incremental and complete rule definitions
- Negation and disjunction
- Module system

### Compiler

- Reference resolver to support packages
- Safety check to prevent recursive rules
- Safety checks to ensure successful evaluation will bind all variables in head
  and body of rules

### Evaluation

- Initial top down query evaluation algorithm

### Storage

- Basic in-memory storage that exposes JSON Patch style API

### Tooling

- REPL that can be run to experiment with ad-hoc queries

### APIs

- Server mode supports HTTP APIs to manage policies, push and query documents, and execute ad-hoc queries.

### Infrastructure

- Basic build infrastructure to produce cross-platform builds, run
  style/lint/format checks, execute tests, static HTML site

### Documentation

- Introductions to policy, policy-enabling, and how OPA works
- Language reference that serves as guide for new users
- Tutorial that introduces users to the REPL
- Tutorial that introduces users to policy-enabling with a Docker Authorization plugin


text:
namespace _05.CapitalizeWords
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class CapitalizeWords
    {
        public static void Main(string[] args)
        {
            var line = Console.ReadLine();

            while (!line.Equals("end"))
            {
                var lineTokens = line
                    .Split(".?!, -:;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
                    .ToArray();

                var words = new List<string>();

                foreach (var word in lineTokens)
                {
                    var currentWord = word
                        .Substring(0, 1)
                        .ToUpper() + (new string(word.Skip(1).ToArray()))
                        .ToLower();

                    words.Add(currentWord);
                }

                Console.WriteLine(string.Join(", ", words));
                line = Console.ReadLine();
            }
        }
    }
}


text:
@interface RABoundingSphere : NSObject {
    GLKVector3  center;
    float       radius;
}

@property (assign, atomic) GLKVector3 center;
@property (assign, atomic) float radius;

@property (readonly) float radius2;
@property (readonly) BOOL valid;

- (void)expandByPoint:(GLKVector3)point;
- (void)expandByBoundingSphere:(RABoundingSphere *)bound;

- (BOOL)contains:(GLKVector3)point;
- (BOOL)intersectsBoundingSphere:(RABoundingSphere *)bound;

- (RABoundingSphere *)transform:(GLKMatrix4)m;
- (RABoundingSphere *)transformPlanar:(GLKMatrix4)m;

@end


text:
/**
 * @file    主要功能
 * @author  clmtulip(车丽美, clmtulip@gmail.com) liyong(liyong1239@163.com)
 */
define(function (require) {
    function ZeroArray(option) {
        this.defaultOption = {type: 'RECT'};
        this._init(option);
    }

    ZeroArray.prototype = {
        RECT: '_calculateRect',

        _init: function (option) {
            this._initOption(option);
            this._initCanvas();
        },

        _initOption: function (option) {
            for (k in option) {
                this.defaultOption[k] = option[k];
            }
        },

        _initCanvas: function () {
            var canvas = document.createElement("canvas");
            canvas.width = 1;
            canvas.height = 1;

            var ratio = Math.sqrt(canvas.getContext("2d").getImageData(0, 0, 1, 1).data.length >> 2);

            canvas.width = this.defaultOption.width;
            canvas.height = this.defaultOption.height;

            if (canvas.getContext) {
                var ctx = canvas.getContext('2d');
            }

            this.canvas = canvas;
            this.ctx = ctx;
            this.ratio = ratio;
        },

        /**执行计算, 并返回
         *
         * @param callback
         * 返回 {initarr, area, maxHit, maxWit} 给callback
         */
        calculate: function (callback, callbackObj) {
            var calType = this.defaultOption.type,
                calmethod = this[calType];

            this[calmethod].call(this, callback, callbackObj);
        },

        /**
         * callback 函数的 正确执行
         * @param result 计算后的结果,{initarr, area, maxHit, maxWit}
         * @param callback  计算成功之后的回调函数
         * @param callbackObj 回调函数的执行作用域
         * @private
         */
        _calculateReturn: function (result, callback, callbackObj) {
            callback.call(callbackObj, result);
        },

        _calculateRect: function (callback, callbackObj) {
            var result = {},
                width = this.defaultOption.width >> 5 << 5,
                height = this.defaultOption.height;

            // 初始化数组
            result.initarr = this._rectZeroArray(width * height);

            // 总面积
            result.area = width * height;

            // 最大高度
            result.maxHit = height;

            // 最大宽度
            result.maxWit = width;

            // 边界
            result.imgboard = this._rectBoard(width, height);

            this._calculateReturn(result, callback, callbackObj);
        },

        _rectBoard: function (width, height) {

            var row = [];
            for (var i = 0; i < height; i++) {
                row.push({
                    y: i,
                    start: 0,
                    end: width
                })
            }

            var cloumn = [];
            for (var i = 0; i < width; i++) {
                cloumn.push({
                    x: i,
                    start: 0,
                    end: height
                })
            }

            return {row: row, cloumn: cloumn};
        },

        _rectZeroArray: function (num) {
            var a = [],
                n = num,
                i = -1;
            while (++i < n) a[i] = 0;
            return a;
        }
    };

    return ZeroArray;
});


text:
const npm = require('npm');
const sinopia = require('sinopia');
const path = require('path');
const pify = require('pify');
const rimraf = pify(require('rimraf'));
const mkdirp = pify(require('mkdirp'));
const _ = require('lodash');
const fs = pify(require('fs'));
const inquirer = require("inquirer");
const ncp = require('ncp').ncp;

ncp.limit = 16;

var server;

const paths = {
  temp: '.tmp',
  storage: '.tmp/storage',
  export: 'export/storage'
};

var packagesToInstall = [];
var packagesAlreadyInstalled = [];

function getFolderPackages() {
  return fs.readdir(paths.storage)
    .then(files => _.without(files, '.sinopia-db.json'));
}

function reinstallReq() {
  if (packagesToInstall.length == 0) {
    return Promise.resolve();
  }

  return pify(npm.commands.install.bind(npm.commands))(paths.temp, packagesToInstall)
    .then(function () {
      packagesAlreadyInstalled = packagesAlreadyInstalled.concat(packagesToInstall);

      return getFolderPackages();
    }, err => console.log(err))
    .then(function (folderPackages) {
      packagesToInstall = _.difference(folderPackages, packagesAlreadyInstalled);

      return reinstallReq();
    });
}

function megaFunction() {
  return rimraf(path.resolve(process.env.APPDATA, "npm-cache"))
    .then(() => rimraf(paths.temp))
    .then(() => mkdirp(paths.storage))
    .then(() => new Promise((resolve, reject) => {
      server = sinopia({
        storage: paths.storage,
        "uplinks": {
          "npmjs": {
            "url": "http://registry.npmjs.org/"
          }
        },
        "packages": {
          "*": {
            "allow_access": "$all",
            "allow_publish": "$all",
            "proxy": "npmjs"
          }
        },
        self_path: paths.temp
      })
        .listen(4873, 'localhost', err=> {
          if (err) {
            return reject(err);
          }

          resolve();
        });
    }))
    .then(() => pify(npm.load.bind(npm))({registry: "http://localhost:4873/"}))
    .then(() => {
      npm.on("log", message => console.log(message));
    })
    .then(reinstallReq)
    .then(() => {
      if (server) {
        server.close();
        server = null;
      }
    })
    .then(() => mkdirp(paths.export))
    .then(() => pify(ncp)(paths.storage, paths.export))
    .then(() => rimraf(paths.temp))
    .then(() => console.log('all done!'))
    .catch(err => console.error(err))
    .then(function () {
      if (server) {
        server.close();
      }

      process.exit();
    });
}

function askPackage() {
  return inquirer.prompt([
    {
      type: "input",
      name: "package",
      message: "What is the name of the package you want to cache?"
    },
    {
      type: "confirm",
      name: "askAgain",
      message: "Want to enter another package (just hit enter for YES)?",
      default: true
    }
  ])
    .then(answers => {
      packagesToInstall.push(answers.package);

      if (answers.askAgain) {
        return askPackage();
      }
    });
}

if (process.argv.length > 2) {
  packagesToInstall = process.argv.slice(2);
  console.log('Going to cache these packages: ' + packagesToInstall.join(', '));

  megaFunction();
  return;
}

askPackage()
  .then(function () {
    console.log('Going to cache these packages: ' + packagesToInstall.join(', '));

    return inquirer.prompt([{
      type: "confirm",
      name: "confirm",
      message: "Is this OK (just hit enter for YES)?",
      default: true
    }])
      .then(answers => {
        if (answers.confirm) {
          return megaFunction();
        }
      });
  });


text:
package gwt.material.design.demo.client.application.datatable.infinite;

import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;

public class InfiniteDataTableModule extends AbstractPresenterModule {
    @Override
    protected void configure() {
        bindPresenter(InfiniteDataTablePresenter.class, InfiniteDataTablePresenter.MyView.class, InfiniteDataTableView.class, InfiniteDataTablePresenter.MyProxy.class);
    }
}


text:
These settings apply only when `--azureresourceschema` is specified on the command line.

### AzureResourceSchema multi-api

``` yaml $(azureresourceschema) && $(multiapi)
batch:
  - tag: schema-containerservice-2021-03-01
  - tag: schema-containerservice-2021-02-01
  - tag: schema-containerservice-2020-12-01
  - tag: schema-containerservice-2020-11-01
  - tag: schema-containerservice-2020-09-01
  - tag: schema-containerservice-2020-07-01
  - tag: schema-containerservice-2020-06-01
  - tag: schema-containerservice-2020-04-01
  - tag: schema-containerservice-2020-03-01
  - tag: schema-containerservice-2020-02-01
  - tag: schema-containerservice-2020-01-01
  - tag: schema-containerservice-2019-11-01
  - tag: schema-containerservice-2019-10-27-preview
  - tag: schema-containerservice-2019-10-01
  - tag: schema-containerservice-2019-09-30
  - tag: schema-containerservice-2019-08-01
  - tag: schema-containerservice-2019-06-01
  - tag: schema-containerservice-2019-04-30
  - tag: schema-containerservice-2019-04-01
  - tag: schema-containerservice-2019-02-01
  - tag: schema-containerservice-2018-09-30-preview
  - tag: schema-containerservice-2018-08-01-preview
  - tag: schema-containerservice-2018-03-31
  - tag: schema-containerservice-2017-09-30
  - tag: schema-containerservice-2017-08-31
  - tag: schema-containerservice-2017-07-01
  - tag: schema-containerservice-2017-01-31
  - tag: schema-containerservice-2016-09-30
  - tag: schema-containerservice-2016-03-30

```

Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.

### Tag: schema-containerservice-2021-03-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2021-03-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2021-03-01/managedClusters.json

```

### Tag: schema-containerservice-2021-02-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2021-02-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2021-02-01/managedClusters.json

```

### Tag: schema-containerservice-2020-12-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-12-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-12-01/managedClusters.json

```

### Tag: schema-containerservice-2020-11-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-11-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-11-01/managedClusters.json

```

### Tag: schema-containerservice-2020-09-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-09-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-09-01/managedClusters.json

```

### Tag: schema-containerservice-2020-07-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-07-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-07-01/managedClusters.json

```

### Tag: schema-containerservice-2020-06-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-06-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-06-01/managedClusters.json

```

### Tag: schema-containerservice-2020-04-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-04-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-04-01/managedClusters.json

```

### Tag: schema-containerservice-2020-03-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-03-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-03-01/managedClusters.json

```

### Tag: schema-containerservice-2020-02-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-02-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-02-01/managedClusters.json

```

### Tag: schema-containerservice-2020-01-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2020-01-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2020-01-01/managedClusters.json

```

### Tag: schema-containerservice-2019-11-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-11-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2019-11-01/managedClusters.json

```

### Tag: schema-containerservice-2019-10-27-preview and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-10-27-preview' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/preview/2019-10-27-preview/openShiftManagedClusters.json

```

### Tag: schema-containerservice-2019-10-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-10-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2019-10-01/managedClusters.json

```

### Tag: schema-containerservice-2019-09-30 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-09-30' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/preview/2019-09-30/openShiftManagedClusters.json

```

### Tag: schema-containerservice-2019-08-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-08-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2019-08-01/location.json
  - Microsoft.ContainerService/stable/2019-08-01/managedClusters.json

```

### Tag: schema-containerservice-2019-06-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-06-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2019-06-01/location.json
  - Microsoft.ContainerService/stable/2019-06-01/managedClusters.json

```

### Tag: schema-containerservice-2019-04-30 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-04-30' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2019-04-30/openShiftManagedClusters.json

```

### Tag: schema-containerservice-2019-04-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-04-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2019-04-01/managedClusters.json
  - Microsoft.ContainerService/stable/2019-04-01/location.json

```

### Tag: schema-containerservice-2019-02-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2019-02-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2019-02-01/managedClusters.json

```

### Tag: schema-containerservice-2018-09-30-preview and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2018-09-30-preview' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/preview/2018-09-30-preview/openShiftManagedClusters.json

```

### Tag: schema-containerservice-2018-08-01-preview and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2018-08-01-preview' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/preview/2018-08-01-preview/managedClusters.json

```

### Tag: schema-containerservice-2018-03-31 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2018-03-31' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2018-03-31/managedClusters.json

```

### Tag: schema-containerservice-2017-09-30 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2017-09-30' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2017-09-30/location.json

```

### Tag: schema-containerservice-2017-08-31 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2017-08-31' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2017-08-31/managedClusters.json

```

### Tag: schema-containerservice-2017-07-01 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2017-07-01' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2017-07-01/containerService.json

```

### Tag: schema-containerservice-2017-01-31 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2017-01-31' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2017-01-31/containerService.json

```

### Tag: schema-containerservice-2016-09-30 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2016-09-30' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2016-09-30/containerService.json

```

### Tag: schema-containerservice-2016-03-30 and azureresourceschema

``` yaml $(tag) == 'schema-containerservice-2016-03-30' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.ContainerService/stable/2016-03-30/containerService.json

```


text:
(function() {

	//tinymce.PluginManager.requireLangPack('tinycimmimage');

	tinymce.create('tinymce.plugins.TinyCIMM', {
		/**
		 * Initializes the plugin, this will be executed after the plugin has been created.
		 * This call is done before the editor instance has finished it's initialization so use the onInit event
		 * of the editor instance to intercept that event.
		 *
		 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
		 * @param {string} url Absolute URL to where the plugin is located.
		 */
		init : function(ed, url) {

			ed.addCommand('mceTinyCIMM-Image', function(resize) {
				ed.windowManager.open({
					file : url + '/image.htm',
					width : 574,
					height : 462,
					inline : 1
				}, {
					plugin_url : url,
					resize : resize
				});
			});

			// register image manager button
			ed.addButton('tinycimm-image', {
				title : 'Image Manager',
				cmd : 'mceTinyCIMM-Image',
				image : url + '/img/insertimage.gif'
			});

			// Add a node change handler, selects the button in the UI when a image is selected
			ed.onNodeChange.add(function(ed, cm, n) {
				cm.setActive('tinycimm-image', n.nodeName == 'IMG');
			});
		},

		/**
		 * Returns information about the plugin as a name/value array.
		 * The current keys are longname, author, authorurl, infourl and version.
		 *
		 * @return {Object} Name/value array containing information about the plugin.
		 */
		getInfo : function() {
			return {
				longname : 'TinyCIMM',
				author : 'Richard Willis',
				authorurl : 'http://badsyntax.co.uk',
				infourl : 'http://tinycimm.googlecode.com/',
				version : "0.1"
			};
		}
	});

	// Register plugin
	tinymce.PluginManager.add('tinycimm', tinymce.plugins.TinyCIMM);
})();


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Hatfield.EnviroData.MVC.AutoMapper
{
    public static class MappingHelper
    {
        public static double? ToNullableDouble(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return null;
            }
            else
            {
                double parseValue = 0.0;
                if(double.TryParse(value, out parseValue))
                {
                    return parseValue;
                }
                else
                {
                    return null;
                }
            }
        }
    }
}


text:
function [stLagrangianRelax, strLine, iReadCount] = cfg_load_lg_relax(fptrConfigFile, stConstStringLagRelax)

%%% default value
stLagrangianRelax = lgrlx_struct_def();

%%%
strConstFlagOptionRepair = stConstStringLagRelax.strConstFlagOptionRepair;
lenConstFlagOptionRepair = length(strConstFlagOptionRepair);

strConstMaxIter = stConstStringLagRelax.strConstMaxIter;
lenConstMaxIter = length(strConstMaxIter);

strConstDesireDualGap = stConstStringLagRelax.strConstDesireDualGap;
lenConstDesireDualGap = length(strConstDesireDualGap);

strConstStepSizeAlpha = stConstStringLagRelax.strConstStepSizeAlpha;
lenConstStepSizeAlpha = length(strConstStepSizeAlpha);

iReadCount = 0;
strLine = fgets(fptrConfigFile);

while strLine(1) ~= '['
   strLine = sprintf('%sMINIMIMLENGTH_TO_BE_COMPATIBLE_WITH_READER', strLine);
   if strLine(1:lenConstFlagOptionRepair) == strConstFlagOptionRepair
%       strLine
       stLagrangianRelax.iHeuristicAchieveFeasibility = sscanf(strLine((lenConstFlagOptionRepair + 1): end), ' = %d');
       iReadCount = iReadCount + 1;

   elseif strLine(1:lenConstMaxIter) == strConstMaxIter
%       strLine
       stLagrangianRelax.iMaxIter = sscanf(strLine((lenConstMaxIter + 1): end), ' = %d');
       iReadCount = iReadCount + 1;

   elseif strLine(1:lenConstStepSizeAlpha) == strConstStepSizeAlpha
       stLagrangianRelax.alpha_r = sscanf(strLine((lenConstStepSizeAlpha + 1): end), ' = %f');
       iReadCount = iReadCount + 1;

   elseif strLine(1:lenConstDesireDualGap) == strConstDesireDualGap
       stLagrangianRelax.fDesiredDualityGap = sscanf(strLine((lenConstDesireDualGap + 1): end), ' = %f');
       iReadCount = iReadCount + 1;

   elseif feof(fptrConfigFile)
       error('Not compatible input.');
   end
   strLine = fgets(fptrConfigFile);
end

strLine = sprintf('%sMINIMIMLENGTH_TO_BE_COMPATIBLE_WITH_READER', strLine);


text:
package fr.ironcraft.nowel.items;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

/**
 * Created by adrien on 10/11/15.
 */
public class SantaHat extends Item
{

	public SantaHat()
	{
		setUnlocalizedName("santa_hat");
		setCreativeTab(CreativeTabs.tabCombat);
		setMaxStackSize(1);
	}

	@Override
	public boolean isValidArmor(ItemStack stack, int armorType, Entity entity)
	{
		if (armorType == 0)
			return true;
		return false;
	}

	@Override
	public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
	{
		ItemStack itemstack1 = playerIn.getCurrentArmor(3);

		if (itemstack1 == null)
		{
			playerIn.setCurrentItemOrArmor(4, itemStackIn.copy()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players.
			itemStackIn.stackSize = 0;
		}

		return itemStackIn;
	}

}


text:
package cn.edu.buaa.g305.qpm.regression.server.imp;

import java.util.List;

import org.apache.commons.math3.distribution.FDistribution;
import org.apache.commons.math3.distribution.TDistribution;
import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Component;

import cn.edu.buaa.g305.qpm.regression.dao.RegressRepository;
import cn.edu.buaa.g305.qpm.regression.domain.Regress;
import cn.edu.buaa.g305.qpm.regression.domain.RegressAnalysis;
import cn.edu.buaa.g305.qpm.regression.domain.RegressOut;
import cn.edu.buaa.g305.qpm.regression.server.RegressServer;
import static cn.edu.buaa.g305.qpm.system.DoublePrecisonArrayToStringArray.*;
import static cn.edu.buaa.g305.qpm.system.StringArrayToDoubleArray.*;
import cn.edu.buaa.g305.qpm.system.domain.Project;
import cn.edu.buaa.g305.qpm.system.server.SystemFind;
@Component
public class RegressServerImp implements RegressServer{

	@Autowired
	private RegressRepository regressRepository;
	@Autowired
	private SystemFind systemFind;

	@Override
	public Regress getByName(String name) {
		Regress regress=regressRepository.findByName(name);
		if(regress==null)
		{
			regress=new Regress("名为"+name+"的资源不存在!");
		}

		return regress;
	}

	@Override
	public Regress getById(String id) {

		Regress mc=regressRepository.findOne(id);
		if(mc==null)
		{
			mc=new Regress("ID为"+id+"的资源不存在!");
		}

		return mc;
	}

	@Override
	public Regress save(Regress regress) {

		regress.setId(null);
		regress.setProject(systemFind.findProductAffiliation(regress.getProject().getName()));
		regress=computer(regress);
		try{
			regress=regressRepository.save(regress);
		}
		catch(DuplicateKeyException e)
		{
			regress=new Regress("名重复");
			return regress;
		}

		regress=computer(regress);
		return regress;

	}

	@Override
	public Regress update(Regress mc, String id) {

		mc.setId(id);
		mc.setProject(systemFind.findProductAffiliation(mc.getProject().getName()));
		mc=computer(mc);
		try{
			mc=regressRepository.save(mc);
		}
		catch(DuplicateKeyException e)
		{
			mc=new Regress("名重复");
			return mc;
		}

		return mc;

	}
	@Override
	public Regress delete(String id) {
		Regress mc=regressRepository.findOne(id);
		if(mc!=null)
		{
			regressRepository.delete(id);
			return null;
		}
		else {
			mc=new Regress("id:"+id+"的资源不存在!");
			return mc;
		}

	}

	@Override
	public Regress deleteByName(String name) {
		Regress mc=regressRepository.findByName(name);
		if(mc!=null)
		{
			regressRepository.delete(mc);
			return null;
		}
		else {
			mc=new Regress("name:"+name+"的资源不存在!");
			return mc;
		}
	}

	@Override
	public List<Regress> getAllList() {

		return (List<Regress>) regressRepository.findAll();
	}

	@Override
	public List<Regress> getListByProject(String name) {
		Project project=systemFind.findProjectByName(name);
		if(project==null)
		{
			return null;
		}
		else {
			return regressRepository.findByProject(project);
		}
	}

	@Override
	public Regress computer(Regress regress) {
		int precision=3;
		OLSMultipleLinearRegression ols=new OLSMultipleLinearRegression();
		double[] y=toDouble(regress.getInput().getY());
		String yName=regress.getInput().getyName();
		double[][] x=toDouble(regress.getInput().getX());
		ols.newSampleData(y, x);
		//系数
		double[] beta=ols.estimateRegressionParameters();
		//系数对应的标准误差(第一个为常量)
		double[] standardErrors=ols.estimateRegressionParametersStandardErrors();

		//自变量个数、回归自由度
		int dfr=beta.length-1;
		//总自由度
		int dft=y.length-1;
		//残差自由度
		int dfe=dft-dfr;
		String regressFunction=yName+"=";
		String[] xName=regress.getInput().getxName();
		double[] t=new double[beta.length];
		double[] p=new double[beta.length];
		RegressAnalysis[] raArray=new RegressAnalysis[beta.length];
		TDistribution tDistribution=new TDistribution(dfe);
		//系数对应T
		for(int i=0;i<beta.length;i++)
		{
			t[i]=beta[i]/standardErrors[i];
			p[i]=tDistribution.cumulativeProbability(t[i]>0?-t[i]:t[i])*2;
			if(i==0)
			{
				raArray[i]=new RegressAnalysis("常量",
						toStringPrecision(beta[i], 3),
						toStringPrecision(standardErrors[i], 3),
						toStringPrecision(t[i], 3),
						toStringPrecision(p[i], 3)
						);

				regressFunction+=raArray[i].getBeta();

			}
			else{
				raArray[i]=new RegressAnalysis(xName[i-1],
						toStringPrecision(beta[i], precision),
						toStringPrecision(standardErrors[i], precision),
						toStringPrecision(t[i], precision),
						toStringPrecision(p[i], precision)
						);
				if(beta[i]>0)
				{
					regressFunction+="+"+raArray[i].getBeta()+"*"+xName[i-1];
				}
				else{
					regressFunction+=raArray[i].getBeta()+"*"+xName[i-1];
				}

			}
		}
		//回归R-sq  R-sq调整
		double r_sq=ols.calculateRSquared();
		double r_sq_ad=ols.calculateAdjustedRSquared();

		double sst=ols.calculateTotalSumOfSquares();
		double sse=ols.calculateResidualSumOfSquares();
		double ssr=sst-sse;

		double msr=ssr/dfr;
		double mse=sse/dfe;

		double f=msr/mse;
		FDistribution fDistribution=new FDistribution(dfr,dfe);
		double p_f=1-fDistribution.cumulativeProbability(f);
		double s=Math.sqrt(mse);

		RegressOut regressOut=new RegressOut();
		regressOut.setRegressAnalysis(raArray);
		regressOut.setS(toStringPrecision(s, precision));
		regressOut.setR_sq(toStringPrecision(r_sq, precision));
		regressOut.setR_sq_ad(toStringPrecision(r_sq_ad, precision));
		regressOut.setDfe(dfe);
		regressOut.setDfr(dfr);
		regressOut.setDft(dft);
		regressOut.setSst(toStringPrecision(sst, precision));
		regressOut.setSse(toStringPrecision(sse, precision));
		regressOut.setSsr(toStringPrecision(ssr, precision));
		regressOut.setMse(toStringPrecision(mse, precision));
		regressOut.setMsr(toStringPrecision(msr, precision));
		regressOut.setF(toStringPrecision(f, precision));
		regressOut.setP(toStringPrecision(p_f, precision));
		regressOut.setRegressFunction(regressFunction);

		regressOut.setyEstimate(ols.calculateHat().operate(y));
		regressOut.setResidual(ols.estimateResiduals());

		regress.setOutput(regressOut);

		return regress;
	}

}


text:
package org.cloudfoundry.test.core;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import java.lang.management.ManagementFactory;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Utility methods for mutating the memory of an application
 */
@RestController
public class MemoryUtils {

    private final Map<String, String> environment;

    private final ExecutorService executor = Executors.newFixedThreadPool(2);

    private final long outOfMemorySize;

    /**
     * Create an instance of the utility
     */
    public MemoryUtils() {
        this(System.getenv(), ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax());
    }

    MemoryUtils(Map<String, String> environment, long outOfMemorySize) {
        this.environment = environment;
        this.outOfMemorySize = outOfMemorySize;
    }

    /**
     * Generates an {@link OutOfMemoryError} if the {@code FAIL_OOM} environment variable is {@code true}. Otherwise does nothing.
     *
     * @return Never returns as it will generate an {@link OutOfMemoryError}
     */
    @RequestMapping(method = RequestMethod.POST, value = "/out-of-memory")
    public byte[][] outOfMemory() {
        try {
            MemorySizeLogger memorySizeLogger = new MemorySizeLogger();

            this.executor.submit(memorySizeLogger);
            return this.executor.submit(new MemoryExhauster(memorySizeLogger, this.outOfMemorySize)).get();
        } catch (InterruptedException | ExecutionException e) {
            throw new RuntimeException(e);
        }
    }

    @PostConstruct
    void outOfMemoryOnStart() {
        Optional.ofNullable(this.environment.get("FAIL_OOM"))
            .map(Boolean::parseBoolean)
            .filter(b -> b)
            .ifPresent(f -> {
                System.err.println("$FAIL_OOM caused memory exhaustion");
                outOfMemory();
            });
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</sem:predicate>
    <sem:object datatype="sem:iri">http://www.w3.org/2004/02/skos/core#Concept</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object xml:lang="eng" datatype="xsd:string">Heir</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.lds.org/core#partOfSpeech</sem:predicate>
    <sem:object xml:lang="eng" datatype="xsd:string">noun</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.lds.org/core#instanceOf</sem:predicate>
    <sem:object datatype="xsd:anyURI">http://www.lds.org/scriptures/tg/heir?lang=eng</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.lds.org/core#instanceOf</sem:predicate>
    <sem:object datatype="xsd:anyURI">http://www.lds.org/scriptures/triple-index/heir?lang=eng</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.lds.org/core#instanceOf</sem:predicate>
    <sem:object datatype="xsd:anyURI">http://www.lds.org/scriptures/gs/heir</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#definition</sem:predicate>
    <sem:object xml:lang="eng" datatype="xsd:string">A person entitled to inherit physical or spiritual gifts. In the scriptures, the righteous are promised that they will become heirs to all that God has.</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#related</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept/gs/birthright</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#related</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept/gs/election</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#related</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept/gs/exaltation</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#related</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept/gs/children-of-god</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/guide-to-the-scriptures</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/concept/gs/heir</sem:subject>
    <sem:predicate>http://www.lds.org/core#relCount</sem:predicate>
    <sem:object datatype="xsd:integer">4</sem:object>
  </sem:triple>
</sem:triples>


text:
import { InjectionToken } from '@angular/core';
import { SwiperOptions } from 'swiper';
import { SwiperEvents } from 'swiper/types/swiper-events';

export const SWIPER_CONFIG = new InjectionToken<SwiperOptions>('SWIPER_CONFIG');

export type SwiperEvent = keyof SwiperEvents
// Custom Events
| 'scroll' | 'keyPress' | 'beforeResize'
// swiper prefixed events that were added in v4.5.0
| 'swiperTap'
| 'swiperClick'
| 'swiperDoubleTap'
| 'swiperTouchEnd'
| 'swiperTouchMove'
| 'swiperTouchStart'
| 'swiperTouchMoveOpposite'
| 'swiperTransitionEnd'
| 'swiperTransitionStart';

export const SwiperEventNames: SwiperEvent[] = [

  'init',
  'beforeDestroy',

  'scroll',
  'progress',
  'keyPress',

  'resize',
  'loopFix',
  'breakpoint',
  'zoomChange',
  'beforeResize',
  'beforeLoopFix',

  'sliderMove',
  'slideChange',

  'setTranslate',
  'setTransition',

  'fromEdge',
  'reachEnd',
  'reachBeginning',

  'autoplay',
  'autoplayStop',
  'autoplayStart',

  'imagesReady',
  'lazyImageLoad',
  'lazyImageReady',

  'scrollbarDragEnd',
  'scrollbarDragMove',
  'scrollbarDragStart',

  'navigationHide',
  'navigationShow',

  'paginationRender',
  'paginationUpdate',
  'paginationHide',
  'paginationShow',

  'swiperTap',
  'swiperClick',
  'swiperDoubleTap',
  'swiperTouchEnd',
  'swiperTouchMove',
  'swiperTouchStart',
  'swiperTouchMoveOpposite',
  'swiperTransitionEnd',
  'swiperTransitionStart',

  'slideNextTransitionEnd',
  'slideNextTransitionStart',
  'slidePrevTransitionEnd',
  'slidePrevTransitionStart',
  'slideChangeTransitionEnd',
  'slideChangeTransitionStart',

  'toEdge',
  'observerUpdate'
];

export interface SwiperA11YInterface {
  enabled?: boolean,
  prevSlideMessage?: string,
  nextSlideMessage?: string,
  firstSlideMessage?: string,
  lastSlideMessage?: string,
  paginationBulletMessage?: string,
  notificationClass?: string
}

export interface SwiperLazyInterface {
  loadPrevNext?: boolean,
  loadPrevNextAmount?: number,
  loadOnTransitionStart?: boolean,
  elementClass?: string,
  loadingClass?: string,
  loadedClass?: string,
  preloaderClass?: string
}

export interface SwiperZoomInterface {
  maxRatio?: number,
  minRatio?: number,
  toggle?: boolean,
  containerClass?: string,
  zoomedSlideClass?: string
}

export interface SwiperThumbsInterface {
  swiper?: any,
  slideThumbActiveClass?: string,
  thumbsContainerClass?: string,
  multipleActiveThumbs?: boolean
}

export interface SwiperHistoryInterface {
  replaceState?: boolean,
  key?: string
}

export interface SwiperVirtualInterface {
  slides?: any[],
  cache?: boolean,
  renderSlide?: SwiperRenderSlideFunction,
  renderExternal?: SwiperRenderExternalFunction,
  addSlidesBefore?: number,
  addSlidesAfter?: number
}

export interface SwiperKeyboardInterface {
  enabled?: boolean,
  onlyInViewport?: boolean
}

export interface SwiperAutoplayInterface {
  delay?: number,
  stopOnLastSlide?: boolean,
  disableOnInteraction?: boolean,
  reverseDirection?: boolean,
  waitForTransition?: boolean
}

export interface SwiperScrollbarInterface {
  el?: string | HTMLElement,
  hide?: boolean,
  draggable?: boolean,
  snapOnRelease?: boolean,
  dragSize?: number | 'auto',
  loclClass?: string,
  dragClass?: string
}

export interface SwiperControllerInterface {
  control?: any,
  inverse?: boolean,
  by?: 'slide' | 'container'
}

export interface SwiperNavigationInterface {
  nextEl?: string | HTMLElement,
  prevEl?: string | HTMLElement,
  hideOnClick?: boolean,
  disabledClass?: string,
  hiddenClass?: string
}

export interface SwiperPaginationInterface {
  el?: string | HTMLElement,
  type?: 'bullets' | 'fraction' | 'progressbar' | 'custom',
  bulletElement?: string,
  dynamicBullets?: boolean,
  dynamicMainBullets?: number,
  hideOnClick?: boolean,
  clickable?: boolean,
  progressbarOpposite?: boolean,
  formatFractionCurrent?: SwiperFormatFractionFunction,
  formatFractionTotal?: SwiperFormatFractionFunction,
  renderBullet?: SwiperRenderBulletFunction,
  renderFraction?: SwiperRenderFractionFunction,
  renderProgressbar?: SwiperRenderProgressbarFunction,
  renderCustom?: SwiperRenderCustomFunction,
  bulletClass?: string,
  bulletActiveClass?: string,
  modifierClass?: string,
  currentClass?: string,
  totalClass?: string,
  hiddenClass?: string,
  progressbarFillClass?: string,
  clickableClass?: string,
  lockClass?: string
}

export interface SwiperMousewheelInterface {
  forceToAxis?: boolean,
  releaseOnEdges?: boolean,
  invert?: boolean,
  sensitivity?: number,
  eventsTarget?: string | HTMLElement
}

export interface SwiperHashNavigationInterface {
  watchState?: boolean,
  replaceState?: boolean
}

export interface SwiperFadeEffectInterface {
  crossFade?: boolean
}

export interface SwiperFlipEffectInterface {
  slideShadows?: boolean,
  limitRotation?: boolean
}

export interface SwiperCubeEffectInterface {
  slideShadows?: boolean,
  shadow?: boolean,
  shadowOffset?: number,
  shadowScale?: number
}

export interface SwiperCoverflowEffectInterface {
  slideShadows?: boolean,
  rotate?: number,
  stretch?: number,
  depth?: number,
  modifier?: number
}

export interface SwiperBreakpointsInterface {
  [size: number]: SwiperOptions
}

export class SwiperConfig implements SwiperOptions {
  public on?: any;

  // Swiper parameters
  public init?: boolean;
  public updateOnWindowResize?: boolean;
  public initialSlide?: number;
  public direction?: 'horizontal' | 'vertical';
  public speed?: number;
  public setWrapperSize?: boolean;
  public virtualTranslate?: boolean;
  public width?: number;
  public height?: number;
  public autoHeight?: boolean;
  public roundLengths?: boolean;
  public nested?: boolean;
  public uniqueNavElements?: boolean;
  public effect?: 'slide' | 'fade' | 'cube' | 'coverflow' | 'flip';
  public runCallbacksOnInit?: boolean;
  public watchOverflow?: boolean;

  // CSS scroll snapOnRelease
  public cssMode?: boolean;

  // Slides grid
  public spaceBetween?: number;
  public slidesPerView?: number | 'auto';
  public slidesPerColumn?: number;
  public slidesPerColumnFill?: 'row' | 'column';
  public slidesPerGroup?: number;
  public centeredSlides?: boolean;
  public centeredSlidesBounds?: boolean;
  public slidesOffsetBefore?: number;
  public slidesOffsetAfter?: number;
  public normalizeSlideIndex?: boolean;
  public centerInsufficientSlides?: boolean;

  // Grab cursor
  public grabCursor?: boolean;

  // Touches
  public touchEventsTarget?: 'container' | 'wrapper';
  public touchRatio?: number;
  public touchAngle?: number;
  public simulateTouch?: boolean;
  public shortSwipes?: boolean;
  public longSwipes?: boolean;
  public longSwipesRatio?: number;
  public longSwipesMs?: number;
  public followFinger?: boolean;
  public allowTouchMove?: boolean;
  public threshold?: number;
  public touchStartPreventDefault?: boolean;
  public touchStartForcePreventDefault?: boolean;
  public touchMoveStopPropagation?: boolean;
  public iOSEdgeSwipeDetection?: boolean;
  public iOSEdgeSwipeThreshold?: number;
  public touchReleaseOnEdges?: boolean;
  public passiveListeners?: boolean;

  // Touch resistance
  public resistance?: boolean;
  public resistanceRatio?: number;

  // Swiping / no swiping
  public preventInteractionOnTransition?: boolean;
  public allowSlidePrev?: boolean;
  public allowSlideNext?: boolean;
  public noSwiping?: boolean;
  public noSwipingClass?: string;
  public noSwipingSelector?: string;
  public swipeHandler?: string | HTMLElement;

  // Clicks
  public preventClicks?: boolean;
  public preventClicksPropagation?: boolean;
  public slideToClickedSlide?: boolean;

  // Freemode
  public freeMode?: boolean;
  public freeModeMomentum?: boolean;
  public freeModeMomentumRatio?: number;
  public freeModeMomentumVelocityRatio?: number;
  public freeModeMomentumBounce?: boolean;
  public freeModeMomentumBounceRatio?: number;
  public freeModeMinimumVelocity?: number;
  public freeModeSticky?: boolean;

  // Progress
  public watchSlidesProgress?: boolean;
  public watchSlidesVisibility?: boolean;

  // Images
  public preloadImages?: boolean;
  public updateOnImagesReady?: boolean;

  // Loop
  public loop?: boolean;
  public loopAdditionalSlides?: number;
  public loopedSlides?: number;
  public loopFillGroupWithBlank?: boolean;

  // Breakpoints
  public breakpoints?: any;

  // Observer
  public observer?: boolean;
  public observeParents?: boolean;
  public observeSlideChildren?: boolean;

  // Namespace
  public containerModifierClass?: string;
  public slideClass?: string;
  public slideActiveClass?: string;
  public slideDuplicatedActiveClass?: string;
  public slideVisibleClass?: string;
  public slideDuplicateClass?: string;
  public slideNextClass?: string;
  public slideDuplicatedNextClass?: string;
  public slidePrevClass?: string;
  public slideDuplicatedPrevClass?: string;
  public wrapperClass?: string;

  // Effects
  public fadeEffect?: any;
  public flipEffect?: any;
  public cubeEffect?: any;
  public coverflowEffect?: any;

  // Components
  public parallax?: boolean;

  public a11y?: boolean | any;
  public lazy?: boolean | any;
  public zoom?: boolean | any;
  public history?: boolean | any;
  public virtual?: boolean | any;
  public autoplay?: boolean | any;
  public keyboard?: boolean | any;
  public scrollbar?: boolean | any;
  public mousewheel?: boolean | any;
  public controller?: boolean | any;
  public navigation?: boolean | any;
  public pagination?: boolean | any;
  public hashNavigation?: boolean | any;

  constructor(config: SwiperOptions = {}) {
    this.assign(config);
  }

  assign(config: SwiperOptions | any = {}, target?: any) {
    target = target || this;

    for (const key in config) {
      if (config[key] != null && !Array.isArray(config[key]) && typeof config[key] === 'object' &&
         (typeof HTMLElement === 'undefined' || !(config[key] instanceof HTMLElement)))
      {
        target[key] = {};

        this.assign(config[key], target[key]);
      } else {
        target[key] = config[key];
      }
    }
  }
}

export type SwiperFormatFractionFunction = (fraction: number) => number;

export type SwiperRenderSlideFunction = (slide: any, index: number) => HTMLElement;
export type SwiperRenderExternalFunction = (data: any) => void;

export type SwiperRenderCustomFunction = (swiper: any, current: number, total: number) => string;

export type SwiperRenderBulletFunction = (index: number, className: string) => string;
export type SwiperRenderFractionFunction = (currentClass: string, totalClass: string) => string;
export type SwiperRenderProgressbarFunction = (progressbarClass: string) => string;


text:
#include <assert.h>
#include <stdlib.h>
#include <process.h>
#include "socket_internal.h"
#include "_netsocket.h"
#include "cthread.h"
#include "crosslib.h"
#include "log.h"

#ifdef _DEBUG_NETWORK
#define debuglog debug_print_call
#else
#define debuglog(...) ((void) 0)
#endif

/* event type. */
enum e_socket_ioevent {
	e_socket_io_event_read_complete = 0,	/* read operate. */
	e_socket_io_event_write_end,			/* write operate. */
	e_socket_io_thread_shutdown,			/* stop iocp. */
};

struct iocpmgr {
	bool is_init;
	bool is_run;
	int thread_num;
	HANDLE completeport;
};

static struct iocpmgr s_iocp = {false};

/* add socket to event manager. */
void eventmgr_add_socket(struct socketer *self) {
	/* socket object point into iocp. */
	CreateIoCompletionPort((HANDLE)self->sockfd, s_iocp.completeport, (ULONG_PTR)self, 0);
}

/* remove socket from event manager. */
void eventmgr_remove_socket(struct socketer *self) {

}

/* set recv event. */
void eventmgr_setup_socket_recv_event(struct socketer *self) {
	self->recv_event.m_event = e_socket_io_event_read_complete;
	if (!PostQueuedCompletionStatus(s_iocp.completeport, 0, (ULONG_PTR)self, &self->recv_event.m_overlap)) {
		socketer_close(self);

		if (catomic_dec(&self->ref) < 1) {
			log_error("%x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, thread_id:%d, connect:%d, deleted:%d",
					self, (int)catomic_read(&self->recvlock), (int)catomic_read(&self->sendlock), self->sockfd,
					(int)catomic_read(&self->ref), cthread_self_id(), self->connected, self->deleted);
		}
	}
}

/* set recv data. */
void eventmgr_setup_socket_recv_data_event(struct socketer *self, char *data, int len) {
	DWORD flags = 0;
	DWORD w_length = len;
	WSABUF buf;
	buf.len = len;
	buf.buf = data;

	assert(self != NULL);
	assert(catomic_read(&self->recvlock) == 1);

	if (catomic_read(&self->recvlock) != 1) {
		log_error("%x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, thread_id:%d, connect:%d, deleted:%d",
				self, (int)catomic_read(&self->recvlock), (int)catomic_read(&self->sendlock), self->sockfd,
				(int)catomic_read(&self->ref), cthread_self_id(), self->connected, self->deleted);
	}

	memset(&self->recv_event, 0, sizeof(self->recv_event));
	self->recv_event.m_event = e_socket_io_event_read_complete;
	if (WSARecv(self->sockfd, &buf, 1, &w_length, &flags, &self->recv_event.m_overlap, 0) == SOCKET_ERROR) {
		/* overlapped operation failed to start. */
		if (WSAGetLastError() != WSA_IO_PENDING) {
			debuglog("eventmgr_setup_socket_recv_data_event error!, error:%d\n", WSAGetLastError());
			socketer_close(self);

			if (catomic_dec(&self->ref) < 1) {
				log_error("%x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, thread_id:%d, connect:%d, deleted:%d",
						self, (int)catomic_read(&self->recvlock), (int)catomic_read(&self->sendlock), self->sockfd,
						(int)catomic_read(&self->ref), cthread_self_id(), self->connected, self->deleted);
			}
		}
	}
}

/* set send event. */
void eventmgr_setup_socket_send_event(struct socketer *self) {
	self->send_event.m_event = e_socket_io_event_write_end;
	if (!PostQueuedCompletionStatus(s_iocp.completeport, 0, (ULONG_PTR)self, &self->send_event.m_overlap)) {
		socketer_close(self);

		if (catomic_dec(&self->ref) < 1) {
			log_error("%x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, thread_id:%d, connect:%d, deleted:%d",
					self, (int)catomic_read(&self->recvlock), (int)catomic_read(&self->sendlock), self->sockfd,
					(int)catomic_read(&self->ref), cthread_self_id(), self->connected, self->deleted);
		}
	}
}

/* set send data. */
void eventmgr_setup_socket_send_data_event(struct socketer *self, char *data, int len) {
	DWORD flags = 0;
	DWORD w_length = len;
	WSABUF buf;
	buf.len = len;
	buf.buf = data;

	assert(self != NULL);
	assert(catomic_read(&self->sendlock) == 1);

	if (catomic_read(&self->sendlock) != 1) {
		log_error("%x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, thread_id:%d, connect:%d, deleted:%d",
				self, (int)catomic_read(&self->recvlock), (int)catomic_read(&self->sendlock), self->sockfd,
				(int)catomic_read(&self->ref), cthread_self_id(), self->connected, self->deleted);
	}

	memset(&self->send_event, 0, sizeof(self->send_event));
	self->send_event.m_event = e_socket_io_event_write_end;
	if (WSASend(self->sockfd, &buf, 1, &w_length, flags, &self->send_event.m_overlap, 0) == SOCKET_ERROR) {
		/* overlapped operation failed to start. */
		if (WSAGetLastError() != WSA_IO_PENDING) {
			debuglog("eventmgr_setup_socket_send_data_event error!, error:%d\n", WSAGetLastError());
			socketer_close(self);

			if (catomic_dec(&self->ref) < 1) {
				log_error("%x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, thread_id:%d, connect:%d, deleted:%d",
						self, (int)catomic_read(&self->recvlock), (int)catomic_read(&self->sendlock), self->sockfd,
						(int)catomic_read(&self->ref), cthread_self_id(), self->connected, self->deleted);
			}
		}
	}
}

/* iocp work thread function. */
static void _iocp_thread_run(void *data) {
	struct iocpmgr *mgr = (struct iocpmgr *)data;
	HANDLE cp = mgr->completeport;	/* complete port handle. */
	DWORD len = 0;					/* len variable is real transfers byte size. */
	ULONG_PTR s = (ULONG_PTR)NULL;	/* call = CreateIoCompletionPort((HANDLE), self->sockfd, s_iocp.completeport, (ULONG_PTR)self, 0); transfers self pointer. */
	struct overlappedstruct *ov = NULL;
	LPOVERLAPPED ol_ptr = NULL;		/* ol_ptr variable is io handle the overlap result, this is actually a very important parameter, because it is used for each I/O data operation .*/
	BOOL res;

	/*
	 * 10000 --- wait time. ms.
	 * INFINITE --- wait forever.
	 */
	while (mgr->is_run) {
		ol_ptr = NULL;
		s = 0;
		ov = NULL;
		len = 0;
		res = GetQueuedCompletionStatus(cp, &len, &s, &ol_ptr, INFINITE /* 10000 */);
		debuglog("res:%d, ol_ptr:%x, s:%x\n", res, ol_ptr, s);
		if ((ol_ptr) && (s)) {
			struct socketer *sser = (struct socketer *)s;
			ov = CONTAINING_RECORD(ol_ptr, struct overlappedstruct, m_overlap);
			switch (ov->m_event) {

			/* recv. */
			case e_socket_io_event_read_complete: {
					if (catomic_read(&sser->recvlock) != 1) {
						log_error("res:%d, %x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, len:%d, thread_id:%d, error:%d, connect:%d, deleted:%d",
								res, sser, (int)catomic_read(&sser->recvlock), (int)catomic_read(&sser->sendlock), sser->sockfd,
								(int)catomic_read(&sser->ref), (int)len, cthread_self_id(), WSAGetLastError(), sser->connected, sser->deleted);
					}

					debuglog("read handle complete! line:%d thread_id:%d\n", __LINE__, cthread_self_id());
					socketer_on_recv(sser, (int)len);
				}
				break;

			/* send. */
			case e_socket_io_event_write_end: {
					if (catomic_read(&sser->sendlock) != 1) {
						log_error("res:%d, %x socket recvlock:%d, sendlock:%d, fd:%d, ref:%d, len:%d, thread_id:%d, error:%d, connect:%d, deleted:%d",
								res, sser, (int)catomic_read(&sser->recvlock), (int)catomic_read(&sser->sendlock), sser->sockfd,
								(int)catomic_read(&sser->ref), (int)len, cthread_self_id(), WSAGetLastError(), sser->connected, sser->deleted);
					}

					debuglog("send handle complete! line:%d thread_id:%d\n", __LINE__, cthread_self_id());
					socketer_on_send(sser, (int)len);
				}
				break;
			case e_socket_io_thread_shutdown: {
					Sleep(100);
					free((void *)s);
					free(ov);
					return;
				}
				break;
			default: {
					log_error("unknow type!.");
				}
			}
		}
	}
}

/*
 * initialize event manager.
 * socketer_num --- socket total number. must greater than 1.
 * thread_num --- thread number, if less than 0, then start by the number of cpu threads
 */
bool eventmgr_init(int socketer_num, int thread_num) {
	if (s_iocp.is_init)
		return false;

	if (socketer_num < 1)
		return false;

	if (thread_num <= 0) {
		thread_num = get_cpu_num();
	}

	s_iocp.thread_num = thread_num;

	/* create complete port, fourthly parameter is 0. */
	s_iocp.completeport = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, (ULONG_PTR)0, 0);
	if (!s_iocp.completeport)
		return false;

	s_iocp.is_init = true;
	s_iocp.is_run = true;

	/* create iocp work thread. */
	for (; thread_num > 0; --thread_num) {
		_beginthread(_iocp_thread_run, 0, &s_iocp);
	}

	/* initialize windows socket dll*/
	{
		WSADATA ws;
		WSAStartup(MAKEWORD(2,2), &ws);
	}
	return true;
}

/*
 * release event manager.
 */
void eventmgr_release() {
	int i;
	if (!s_iocp.is_init)
		return;

	for (i = 0; i < s_iocp.thread_num; ++i) {
		struct overlappedstruct *cs;
		struct socketer *sock;
		cs = (struct overlappedstruct *)malloc(sizeof(struct overlappedstruct));
		sock = (struct socketer *)malloc(sizeof(struct socketer));
		cs->m_event = e_socket_io_thread_shutdown;

		/* let iocp work thread exit. */
		PostQueuedCompletionStatus(s_iocp.completeport, 0, (ULONG_PTR)sock, &cs->m_overlap);
	}

	s_iocp.is_run = false;
	s_iocp.is_init = false;

	Sleep(500);
	CloseHandle(s_iocp.completeport);
	WSACleanup();
}


text:
title: Prezi
layout: post
author: barney.mepham
permalink: /prezi/
source-id: 12II1MKedk-NMKm4Oe05jJfdr8Rq7JckTOicQcHMnPXw
published: true
---
Prezi

This week we watched a video about prezi and then we started making our own presentations. I made mine on the earth and i tested out each font.

I had lots of points that I hid in places we would not normally think to look one was bigger than the earth.

For homework we had to experiment with prezi I spent a lot of time exploring and pressing things.


text:
<?php
$TRANSLATIONS = array(
"Recovery key successfully enabled" => "Palautusavain kytketty päälle onnistuneesti",
"Password successfully changed." => "Salasana vaihdettiin onnistuneesti.",
"Could not change the password. Maybe the old password was not correct." => "Salasanan vaihto epäonnistui. Kenties vanha salasana oli väärin.",
"Following users are not set up for encryption:" => "Seuraavat käyttäjät eivät ole määrittäneet salausta:",
"Saving..." => "Tallennetaan...",
"personal settings" => "henkilökohtaiset asetukset",
"Encryption" => "Salaus",
"Recovery key password" => "Palautusavaimen salasana",
"Enabled" => "Käytössä",
"Disabled" => "Ei käytössä",
"Change recovery key password:" => "Vaihda palautusavaimen salasana:",
"Old Recovery key password" => "Vanha palautusavaimen salasana",
"New Recovery key password" => "Uusi palautusavaimen salasana",
"Change Password" => "Vaihda salasana",
"Old log-in password" => "Vanha kirjautumis-salasana",
"Current log-in password" => "Nykyinen kirjautumis-salasana",
"Enable password recovery:" => "Ota salasanan palautus käyttöön:"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";


text:
<?xml version='1.0'?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://importedXSD test72702.imp" xmlns:foo="http://importedXSD">
      <e2/>
</root>


text:
package org.saiku.olap.util;

import org.olap4j.CellSet;
import org.saiku.olap.dto.resultset.AbstractBaseCell;
import org.saiku.olap.dto.resultset.CellDataSet;
import org.saiku.olap.dto.resultset.Matrix;
import org.saiku.olap.util.formatter.HierarchicalCellSetFormatter;
import org.saiku.olap.util.formatter.ICellSetFormatter;

public class OlapResultSetUtil {

  public static CellDataSet cellSet2Matrix( final CellSet cellSet ) {
    final ICellSetFormatter formatter = new HierarchicalCellSetFormatter();
    return cellSet2Matrix( cellSet, formatter );
  }

  public static CellDataSet cellSet2Matrix( final CellSet cellSet, ICellSetFormatter formatter ) {
    if ( cellSet == null ) {
      return new CellDataSet( 0, 0 );
    }

    final Matrix matrix = formatter.format( cellSet );
    final CellDataSet cds = new CellDataSet( matrix.getMatrixWidth(), matrix.getMatrixHeight() );

    int z = 0;
    final AbstractBaseCell[][] bodyvalues =
      new AbstractBaseCell[ matrix.getMatrixHeight() - matrix.getOffset() ]
                          [ matrix.getMatrixWidth() ];

    for ( int y = matrix.getOffset(); y < matrix.getMatrixHeight(); y++ ) {
      for ( int x = 0; x < matrix.getMatrixWidth(); x++ ) {
        bodyvalues[ z ][ x ] = matrix.get( x, y );
      }

      z++;
    }

    cds.setCellSetBody( bodyvalues );

    final AbstractBaseCell[][] headervalues =
        new AbstractBaseCell[ matrix.getOffset() ][ matrix.getMatrixWidth() ];

    for ( int y = 0; y < matrix.getOffset(); y++ ) {
      for ( int x = 0; x < matrix.getMatrixWidth(); x++ ) {
        headervalues[ y ][ x ] = matrix.get( x, y );
      }
    }

    cds.setCellSetHeaders( headervalues );
    cds.setOffset( matrix.getOffset() );

    return cds;
  }
}


text:
from fixture.creator import CreatorHelper
from model.contact import Contact
from random import randrange

class ContactHelper(CreatorHelper):

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

    def create_contact(self, contact):
        wd = self.app.wd
        # Go to contact creator
        wd.find_element_by_link_text("nowy wpis").click()
        self.fill_contact_form(contact)
        # Submit to add new contact
        wd.find_element_by_xpath("//div[@id='content']/form/input[21]").click()
        self.app.return_to_home_page()
        self.contact_cache = None

    def fill_contact_form(self, contact):
        wd = self.app.wd
        self.change_field_value("firstname", contact.firstname)
        self.change_field_value("lastname", contact.surename)
        self.change_field_value("address", contact.address)

    def delete_contact_by_index(self, index):
        wd = self.app.wd
        self.app.open_home_page()
        self.select_contact_by_index(index)
        # Click delete
        wd.find_element_by_xpath("//*[@value='Usuń']").click()
        # Accept deletion
        wd.switch_to_alert().accept()
        self.app.open_home_page()
        self.contact_cache = None

    def select_first_contact(self):
        wd = self.app.wd
        wd.find_element_by_name("selected[]").click()

    def select_contact_by_index(self, index):
        wd = self.app.wd
        wd.find_elements_by_name("selected[]")[index].click()

    def delete_first_contact(self):
        wd = self.app.wd
        self.delete_contact_by_index(0)

    def modify_first_contact(self):
        wd = self.app.wd
        self.modify_contact_by_index(0)

    def modify_contact_by_index(self, index, new_contact_data):
        wd = self.app.wd
        self.app.open_home_page()
        self.select_contact_by_index(index)
        # Click edit
        wd.find_element_by_xpath("//*[@title='Edytuj']").click()
        self.fill_contact_form(new_contact_data)
        # Submit edition
        wd.find_element_by_name("update").click()
        self.app.return_to_home_page()
        self.contact_cache = None

    def count_of_contact(self):
        wd = self.app.wd
        self.app.open_home_page()
        return len(wd.find_elements_by_name("selected[]"))

    contact_cache = None

    def get_contact_list(self):
        if self.contact_cache is None:
            wd = self.app.wd
            self.app.open_home_page()
            self.contact_cache = []
            i = 2  # because first element is in row nr = 2
            for row in wd.find_elements_by_name("selected[]"):
                # i-th row td 2nd and 3rd
                last_name = wd.find_element_by_xpath("//*[@id='maintable']/tbody/tr[%d]/td[2]" % i).text
                first_name = wd.find_element_by_xpath("//*[@id='maintable']/tbody/tr[%d]/td[3]" % i).text
                contact_id = row.get_attribute("value")
                self.contact_cache.append(Contact(firstname=first_name, surename=last_name, contact_id=contact_id))
                i += 1  # making iterator +1 for next row in loop
        return list(self.contact_cache)