text:
A plugin for [Kirby CMS](http://getkirby.com) to automatically post from a make request. Designed for IFTTT's [Maker channel](https://ifttt.com/channels/maker/).

## Kirby installation
* Put the `iftttbot/` folder in `/site/plugins/`
* In `config.php`, create a new route (http://getkirby.com/docs/advanced/routing) :
```php
c::set('routes', array(
  array(
    'pattern' => 'iftttbot/(:any)/(:any)/(:any)',
    'action'  => function($page, $blueprint, $title){
        return create_post($page, $blueprint, $title, $_POST);
      },
    'method' => 'POST'
  ),
 ));
```

## IFTTT configuration
* Select whatever trigger you want to use.
* Select (and activate) the Action Channel *Maker*.
* Select the *Make a web request* action.
* Fill the url field with the url you routed in `config.php`. The three params are pretty self explanatory, and can be dynamic IFTTT ingredients. For example :
```
http://my-kirby-website/iftttbot/projects/image-blueprint/{{ImageTitle}}
```
* Select the `POST` method.
* Select the `application/x-www-form-urlencoded` Content Type.
* In the *Body*, write a valid [application/x-www-form-urlencoded content](http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1). This string can embed any of your [blueprint's fields name](http://getkirby.com/docs/panel/blueprints/form-fields). If you want to skip some of them, you can : Kirby won't bother, and create empty values the next time you will save the article in the panel. In the same way, you can pass some parameters which aren't present in the blueprint : again, Kirby won't bother, and just skip them. This can be usefull to pass some additionnal options to the plugin, to make a post visible by default for example.
* Click the "Create Action" big blue button. Profit.

## Usage
Sending the IFTTT body :
```
tags=twitter,ifttt,{{UserName}}&text={{Text}}&url={{LinkToTweet}}
```
to the url :
```
http://my-kirby-website/iftttbot/tweets/tweet-blueprint/{{CreatedAt}}
```
will create a new article in `/content/2-tweets/august-23-2010-at-11-01pm/tweet-blueprint.txt` each time the recipe is triggered, with `tweet-blueprint.txt`containing at least :
```markdown
Title: August 23, 2010 at 11:01PM

----

Tags: twitter,ifttt,ltibbets

----

Text:

Is eating cheerios for breakfast.

----

Url: http://twitter.com/ifttt/status/33262764734693376
```

## Names and titles
* The plugin is designed to ignore visibility status, i.e
```
/content/1-articles/8-name-of-the-article
```
```
/content/1-articles/name-of-the-article
```
```
/content/articles/name-of-the-article
```
will all refer to the same
```
/content/articles/name-of-the-article
```
* If `/content/articles/name-of-the-article/` already exists, the plugin will create a new article in `/content/articles/name-of-the-article_1`, and so on. If you want to be able to override existing article, you'll have to comment the `(count($dir_matches) > 0)` condition in the `create_post()` function.
* The article's title will be passed in the `str::slug()` function, so don't be afraid to use spaces or special chars.

## Without IFTTT
Of course, you can also use the `create_post()` function to batch create post, or make some other automation without IFTTT service.

## Security
Despite having the article posted invisible by default, we personally chose to add a token in the routed url to avoid spam and various possible injections.
A simple implementation of this technic would be to get a md5 hash of the website's url or title :
```php
c::set('routes', array(
	array(
		'pattern' => md5(site()->url()) . '/(:any)/(:any)/(:any)',
		'action'  => function($page, $blueprint, $title){
			return create_post($page, $blueprint, $title, $_POST);
		},
		'method' => 'POST'
	),
));
```

## Authors
Louis Eveillard & Arnaud Juracek

## Changelog

* **1.0.0** Initial release

## License
[MIT License](http://opensource.org/licenses/mit-license.php)


text:
#pragma once

#include <mraa/i2c.h>

#define MAX_BUFFER_LENGTH 6

#define SERVO_MIN       0
#define SERVO_MAX       180
#define SERVO_FREQ      60
#define PCA9685_SUBADR1 0x2
#define PCA9685_SUBADR2 0x3
#define PCA9685_SUBADR3 0x4

#define PCA9685_MODE1    0x0
#define PCA9685_PRESCALE 0xFE

#define LED0_ON_L  0x6
#define LED0_ON_H  0x7
#define LED0_OFF_L 0x8
#define LED0_OFF_H 0x9

#define ALLLED_ON_L  0xFA
#define ALLLED_ON_H  0xFB
#define ALLLED_OFF_L 0xFC
#define ALLLED_OFF_H 0xFD

#define PCA9685_MODE1_REG       0x00
#define PCA9685_PRESCALE_REG    0xFE
#define LED0_REG                0x06

namespace upm {

 /**
  * @brief Adafruit PCA9685 based servo controller library
  * @defgroup adafruitss libupm-adafruitss
  * @ingroup adafruit i2c motor
  */

 /**
  * @library adafruitss
  * @sensor adafruitss
  * @comname Adafruit Servo Shield
  * @type motor
  * @man adafruit
  * @web http://www.adafruit.com/product/1411
  * @con i2c
  *
  * @brief C++ API for Adafruit Servo Shield
  *
  *	UPM library for the PCA9685 based Adafruit 16-channel servo shield. When 3
  * or more GWS servos attached results unpredictable. Adafruit do recommend a
  * capacitor be installed on the board which should alleviate the issue.
  * Sizing depends on servos and count.
  *
  * @snippet adafruitss.cxx Interesting
  */
  class adafruitss {
  public:
    /**
     * Creates a adafruitss object
     *
     * @param bus number of used i2c bus
     * @param i2c_address address of servo controller on i2c bus
     */
    adafruitss(int bus, int i2c_address);
    int update(void);
    /**
     * Sets the frequency for your servos
     *
     * @param freq the frequency at which the servos operate
     */
    void setPWMFreq(float freq);
    /**
     * Moves the one of the servos to the specified angle
     *
     * @param port port of the servo on the controller (servo number)
     * @param servo_type can be 0 = standard 1ms to 2ms, 1 = extended 0.6ms to 2.4ms, or 2 = extended 0.8ms to 2.2ms
     * @param degrees angle to set the servo to
     */
    void servo(uint8_t port, uint8_t servo_type, uint16_t degrees);

  private:

    int pca9685_addr;
    mraa_i2c_context m_i2c;
    uint8_t m_rx_tx_buf[MAX_BUFFER_LENGTH];
    float _pwm_frequency;
    float _duration_1ms;
};

}

redpajama_set_name: RedPajamaGithub


text:
//-----------------------------------------------------------------------
// <copyright file="DeviceUnpairingResultStatus.cs" company="In The Hand Ltd">
//   Copyright (c) 2017 In The Hand Ltd, All rights reserved.
//   This source code is licensed under the MIT License - see License.txt
// </copyright>
//-----------------------------------------------------------------------

namespace InTheHand.Devices.Enumeration
{
    /// <summary>
    /// The result of the unpairing action.
    /// </summary>
    public enum DeviceUnpairingResultStatus
    {
        /// <summary>
        /// The device object is successfully unpaired.
        /// </summary>
        Unpaired = 0,

        /// <summary>
        /// The device object was already unpaired.
        /// </summary>
        AlreadyUnpaired = 1,

        /// <summary>
        /// The device object is currently in the middle of either a pairing or unpairing action.
        /// </summary>
        OperationAlreadyInProgress = 2,

        /// <summary>
        /// The caller does not have sufficient permissions to unpair the device.
        /// </summary>
        AccessDenied = 3,

        /// <summary>
        /// An unknown failure occurred.
        /// </summary>
        Failed = 4,
    }
}


text:
  Steuert, wie Jenkins Builds an diesen Knoten zuweist.

      Diesen Knoten so viel wie möglich verwenden

      Dies ist die Vorgabe- und Normaleinstellung.
      In diesem Modus verwendet Jenkins den Knoten ohne Einschränkungen.
      Wann immer ein Build ansteht, der von diesem Knoten übernommen
      werden kann, wird Jenkins den Knoten verwenden.

      Diesen Knoten exklusiv für gebundene Jobs reservieren

      In diesem Modus wird Jenkins auf diesem Knoten nur dann einen Build
      starten, wenn das Projekt explizit an diesen Knoten gebunden wurde.

      Damit können Sie einen Agenten-Knoten für bestimmte Jobs reservieren.
      Beispiel: Um Leistungsmessungen kontinuierlich per Jenkins durchzuführen,
      legen Sie die Anzahl von Build-Prozessoren auf 1 fest, so dass zu jedem
      Zeitpunkt nur jeweils ein Leistungstest durchgeführt wird. Gleichzeitig
      blockiert der Build-Prozessor keine Builds, die auch auf anderen
      Knoten durchgeführt werden können.


text:
package com.laytonsmith.core.objects;

import com.laytonsmith.annotations.ExposedElement;
import com.laytonsmith.annotations.MEnum;

/**
 *
 * @author cailin
 */
@MEnum("ms.lang.ObjectModifier")
public enum ObjectModifier {
	/**
	 * A final class is one that cannot be extended by subclasses. Only a non-abstract class can use this keyword, as
	 * interfaces and abstract classes must be extended/implemented for its existence to make sense.
	 */
	FINAL,
	/**
	 * A static class is one that is not tied to the containing class's instance scope, but is tied to the static scope.
	 * This in not usable in top level classes, as it wouldn't make sense otherwise.
	 */
	STATIC,
	/**
	 * An abstract class is one that cannot be instantiated directly, only non-abstract subclasses can be. It is an
	 * error for a class to be both final and abstract in user code, though this restriction is not enforced for system
	 * level code (which is taken advantage of by enums, so that ms.lang.enum cannot be subclassed or instantiated).
	 */
	ABSTRACT,
	/**
	 * A native class maps to a class defined in the java code. This modifier is required on the class if any of the
	 * methods or fields are defined as native. And should generally be used for performance enhancement reasons if
	 * there does exist a native class. Additionally, the signatures of the methods and fields that are defined
	 * in this class must match the elements tagged with the {@link ExposedElement} annotations, or it will be an error.
	 */
	NATIVE,
	/**
	 * An immutable object is one in which none of the fields may be set, other than within the constructor.
	 */
	IMMUTABLE;
}


text:
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings

from simpleapp import urls

admin.autodiscover()

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'', include('pages.urls')),
    #url(r'', include(urls)),
]

urlpatterns = urlpatterns + patterns('', (r'^static/(?P<path>.*)$',
    'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),

) if settings.DEBUG else urlpatterns


text:
This page assumes a basic understanding of buttons in the Schema Framework.
[Adding Buttons](AddingButtons.md) is available for review or study.

Providing keystroke shortcuts for web page actions can greatly speed usage of
the page for experienced users.

Rather than attempting to design a generalized language for providing page-based
keystroke actions, the framework piggy-backs on the facilities in place for handling
buttons.  The designer simple designates a keystroke for a button, and when a user
presses the keystroke, the framework will behave as if the button had been pressed.
That ensures that when several button attributes are necessary to initiate an action,
pressing the matching keystroke will submit the same data as the already-working button.
It also more easily allows for an expansion of button utilities without leaving keystroke
actions behind.

## Example: Add a Keystroke to a Button

The following example is a simple mode that presents a table with an **add** button
for introducing new records to the database.

~~~srm
main
   procedure     : App_Main_Page
   type          : table
   on_line_click : edit
   buttons
      button
         type  : add
         label : Add Record
         task  : ?add
         key   : alt-a
~~~

Note the final line under the button: `key : alt-a`.  With this instruction, if the
user presses Alt-A, the *Add Record* button will fire.

## The Key Instruction

A key specifier, or *key spec* is a string consisting of a keyname, optionally preceded by key
modifiers *control*, *alt*, and *shift*.  Valid key specs include

- Shift-A
- Control-Shift-Delete
- Control-Alt-Q

A key instruction is a key tag with one or more key spec strings.  `key : shift-a` is an example
that has only a single key spec association.  `key : alt-plus alt-=` is an example where both the
shifted and unshifted characters of a key match.

When a keystroke matches a key spec associated with a button, the button's action is executed.

### Matching a Keystroke

The user keystroke matches the button if the *key value* matches, and the *key modifiers*
are the same.  If a user presses <nobr>Control-A,</nobr> it will not match <nobr>Control-Alt-A.</nobr>

### The Key Value

The key value corresponds to the key pressed.  Single characters are obvious whether they
are a letter, numeral, punctuation, or a symbol.  There are several keys on normal keyboard
whose names are more than one character in length.  They include:

- function keys *F1* - *F12*
- Keypad keys *Home*, *End*, *Insert*, *Delete*, *PgUp*, *PgDn*
- Arrow keys, named for the direction they point, *up*, *right*, *down*, and *left*.
- Special keys *Escape*, *Tab*, and *Backspace*
- The hyphen, or minus symbol should be named to avoid conflicts with the *-* delimiter
  of the key value.  That is, <nobr>*Control-minus*</nobr> and **not** <nobr>*Control--*</nobr>

The framework assumes the names of the named keys are as they are spelled in the list above.
For example, the framework recognized *backspace*, but not the common synonym *bs*.  Likewise,
Page up is *pgup*, not *pageup* and page down is *pgdn*.

### Key Modifiers

The framework recognizes three key modifiers: **Shift**, **Control**, and **Alt**
When specifying a *key* value, any modifiers should come before the key

### The Shift-key Modifier

Note that the **Shift** modifier is not recognized for characters on keys with two characters.
Examples of two-character keys are the numeric keys that contain a numeral and a symbol.  Holding
the shift-key while pressing the numeral 2 key will result in a *@* character.  Neither the *2*
nor the *@* can be shifted, so the shift value is completely ignored.

On the initial implementation, a capital C should be listed as <nobr>*shift-c*</nobr>.  This may
turn out to be too confusing, in which case the design decision will be reevaluated.

### Abbreviations

All values are set to lower case before making comparisons.

In practice, the framework matches only the first three characters of a multiple-character keyname,
so *ins* is the same as *insert* and *esc* is the same as *escape*.  This is to accommodate the
common abbreviations of these key values.

Similarly, the modifiers are abbreviated, but they are shorted to single characters, *a*, *c*, and
*s* for *Alt*, *Control*, and *Shift*, respectively.  This allows the designer to use alternate
spellings like *Control* vs *Ctrl* or *Alternate* vs *Alt*.

## Final Considerations

Although a the framework allows the designer to specify nearly any possible keystroke, be aware
that some keystrokes may result in conflicts.  Operating Systems and browsers map certain
keystrokes to specific actions within their domain.  Some examples of operating system key maps
are <nobr>Control-Alt-B</nobr> to open the default browser, and <nobr>Control-Alt-T</nobr> to open
a terminal window. F1 in almost every context opens a help window.  Browsers generally zoom in or
out with <nobr>Control-plus</nobr> and <nobr>Control-minus.</nobr>


text:
<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>

	<!-- in artifactory: rf-legacy-local/ModelGenerator/ModelGenerator -->
    <groupId>ModelGenerator</groupId>
    <artifactId>ModelGenerator</artifactId>
    <version>1.6.4-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ModelGenerator</name>
    <url>https://github.com/erikzielke/model_generator</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.26</version>
        </dependency>
        <dependency>
            <groupId>com.sun.codemodel</groupId>
            <artifactId>codemodel</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-lgpl</artifactId>
            <version>1.9.13</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-lgpl</artifactId>
            <version>1.9.13</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.5</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.github.erikzielke.model_generator.CommandLineRunner</mainClass>
                            <packageName>com.github.erikzielke.model_generator</packageName>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>libs</classpathPrefix>
                        </manifest>
                        <manifestEntries>
                            <mode>development</mode>
                            <url>${project.url}</url>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <!-- or whatever version you use -->
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/libs</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
/*
 * Include necessary headers...
 */

#include <phbase.h>
#include "config.h"
#include "mxml.h"

/*
 * 'mxmlSetCDATA()' - Set the element name of a CDATA node.
 *
 * The node is not changed if it (or its first child) is not a CDATA element node.
 *
 * @since Mini-XML 2.3@
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetCDATA(mxml_node_t *node,		/* I - Node to set */
             const char  *data)		/* I - New data string */
{
 /*
  * Range check input...
  */

  if (node && node->type == MXML_ELEMENT &&
      strncmp(node->value.element.name, "![CDATA[", 8) &&
      node->child && node->child->type == MXML_ELEMENT &&
      !strncmp(node->child->value.element.name, "![CDATA[", 8))
    node = node->child;

  if (!node || node->type != MXML_ELEMENT || !data ||
      strncmp(node->value.element.name, "![CDATA[", 8))
    return (-1);

 /*
  * Free any old element value and set the new value...
  */

  if (node->value.element.name)
    PhFree(node->value.element.name);

  node->value.element.name = _mxml_strdupf("![CDATA[%s]]", data);

  return (0);
}

/*
 * 'mxmlSetCustom()' - Set the data and destructor of a custom data node.
 *
 * The node is not changed if it (or its first child) is not a custom node.
 *
 * @since Mini-XML 2.1@
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetCustom(
    mxml_node_t              *node,	/* I - Node to set */
    void                     *data,	/* I - New data pointer */
    mxml_custom_destroy_cb_t destroy)	/* I - New destructor function */
{
 /*
  * Range check input...
  */

  if (node && node->type == MXML_ELEMENT &&
      node->child && node->child->type == MXML_CUSTOM)
    node = node->child;

  if (!node || node->type != MXML_CUSTOM)
    return (-1);

 /*
  * Free any old element value and set the new value...
  */

  if (node->value.custom.data && node->value.custom.destroy)
    (*(node->value.custom.destroy))(node->value.custom.data);

  node->value.custom.data    = data;
  node->value.custom.destroy = destroy;

  return (0);
}

/*
 * 'mxmlSetElement()' - Set the name of an element node.
 *
 * The node is not changed if it is not an element node.
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetElement(mxml_node_t *node,	/* I - Node to set */
               const char  *name)	/* I - New name string */
{
 /*
  * Range check input...
  */

  if (!node || node->type != MXML_ELEMENT || !name)
    return (-1);

 /*
  * Free any old element value and set the new value...
  */

  if (node->value.element.name)
    PhFree(node->value.element.name);

  node->value.element.name = PhDuplicateBytesZSafe((char *)name);

  return (0);
}

/*
 * 'mxmlSetInteger()' - Set the value of an integer node.
 *
 * The node is not changed if it (or its first child) is not an integer node.
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetInteger(mxml_node_t *node,	/* I - Node to set */
               int         integer)	/* I - Integer value */
{
 /*
  * Range check input...
  */

  if (node && node->type == MXML_ELEMENT &&
      node->child && node->child->type == MXML_INTEGER)
    node = node->child;

  if (!node || node->type != MXML_INTEGER)
    return (-1);

 /*
  * Set the new value and return...
  */

  node->value.integer = integer;

  return (0);
}

/*
 * 'mxmlSetOpaque()' - Set the value of an opaque node.
 *
 * The node is not changed if it (or its first child) is not an opaque node.
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetOpaque(mxml_node_t *node,	/* I - Node to set */
              const char  *opaque)	/* I - Opaque string */
{
 /*
  * Range check input...
  */

  if (node && node->type == MXML_ELEMENT &&
      node->child && node->child->type == MXML_OPAQUE)
    node = node->child;

  if (!node || node->type != MXML_OPAQUE || !opaque)
    return (-1);

 /*
  * Free any old opaque value and set the new value...
  */

  if (node->value.opaque)
    PhFree(node->value.opaque);

  node->value.opaque = PhDuplicateBytesZSafe((char *)opaque);

  return (0);
}

/*
 * 'mxmlSetReal()' - Set the value of a real number node.
 *
 * The node is not changed if it (or its first child) is not a real number node.
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetReal(mxml_node_t *node,		/* I - Node to set */
            double      real)		/* I - Real number value */
{
 /*
  * Range check input...
  */

  if (node && node->type == MXML_ELEMENT &&
      node->child && node->child->type == MXML_REAL)
    node = node->child;

  if (!node || node->type != MXML_REAL)
    return (-1);

 /*
  * Set the new value and return...
  */

  node->value.real = real;

  return (0);
}

/*
 * 'mxmlSetText()' - Set the value of a text node.
 *
 * The node is not changed if it (or its first child) is not a text node.
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetText(mxml_node_t *node,		/* I - Node to set */
            int         whitespace,	/* I - 1 = leading whitespace, 0 = no whitespace */
        const char  *string)	/* I - String */
{
 /*
  * Range check input...
  */

  if (node && node->type == MXML_ELEMENT &&
      node->child && node->child->type == MXML_TEXT)
    node = node->child;

  if (!node || node->type != MXML_TEXT || !string)
    return (-1);

 /*
  * Free any old string value and set the new value...
  */

  if (node->value.text.string)
    PhFree(node->value.text.string);

  node->value.text.whitespace = whitespace;
  node->value.text.string     = PhDuplicateBytesZSafe((char *)string);

  return (0);
}

/*
 * 'mxmlSetTextf()' - Set the value of a text node to a formatted string.
 *
 * The node is not changed if it (or its first child) is not a text node.
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetTextf(mxml_node_t *node,		/* I - Node to set */
             int         whitespace,	/* I - 1 = leading whitespace, 0 = no whitespace */
             const char  *format,	/* I - Printf-style format string */
         ...)			/* I - Additional arguments as needed */
{
  va_list	ap;			/* Pointer to arguments */

 /*
  * Range check input...
  */

  if (node && node->type == MXML_ELEMENT &&
      node->child && node->child->type == MXML_TEXT)
    node = node->child;

  if (!node || node->type != MXML_TEXT || !format)
    return (-1);

 /*
  * Free any old string value and set the new value...
  */

  if (node->value.text.string)
    PhFree(node->value.text.string);

  va_start(ap, format);

  node->value.text.whitespace = whitespace;
  node->value.text.string     = _mxml_strdupf(format, ap);

  va_end(ap);

  return (0);
}

/*
 * 'mxmlSetUserData()' - Set the user data pointer for a node.
 *
 * @since Mini-XML 2.7@
 */

int					/* O - 0 on success, -1 on failure */
mxmlSetUserData(mxml_node_t *node,	/* I - Node to set */
                void        *data)	/* I - User data pointer */
{
 /*
  * Range check input...
  */

  if (!node)
    return (-1);

 /*
  * Set the user data pointer and return...
  */

  node->user_data = data;
  return (0);
}

/*
 * End of "$Id: mxml-set.c 451 2014-01-04 21:50:06Z msweet $".
 */


text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;

using JetBrains.Annotations;

namespace LinqToDB.DataProvider.SqlServer
{
	using Data;

	public static class SqlServerTools
	{
		#region Init

		static readonly SqlServerDataProvider _sqlServerDataProvider2000 = new SqlServerDataProvider(ProviderName.SqlServer2000, SqlServerVersion.v2000);
		static readonly SqlServerDataProvider _sqlServerDataProvider2005 = new SqlServerDataProvider(ProviderName.SqlServer2005, SqlServerVersion.v2005);
		static readonly SqlServerDataProvider _sqlServerDataProvider2008 = new SqlServerDataProvider(ProviderName.SqlServer2008, SqlServerVersion.v2008);
		static readonly SqlServerDataProvider _sqlServerDataProvider2012 = new SqlServerDataProvider(ProviderName.SqlServer2012, SqlServerVersion.v2012);

		public static bool AutoDetectProvider { get; set; }

		static SqlServerTools()
		{
			AutoDetectProvider = true;

			DataConnection.AddDataProvider(ProviderName.SqlServer, _sqlServerDataProvider2008);
			DataConnection.AddDataProvider(_sqlServerDataProvider2012);
			DataConnection.AddDataProvider(_sqlServerDataProvider2008);
			DataConnection.AddDataProvider(_sqlServerDataProvider2005);
			DataConnection.AddDataProvider(_sqlServerDataProvider2000);

			DataConnection.AddProviderDetector(ProviderDetector);
		}

		static IDataProvider ProviderDetector(ConnectionStringSettings css)
		{
			if (DataConnection.IsMachineConfig(css))
				return null;

			switch (css.ProviderName)
			{
				case ""                      :
				case null                    :

					if (css.Name == "SqlServer")
						goto case "SqlServer";
					break;

				case "SqlServer2000"         :
				case "SqlServer.2000"        : return _sqlServerDataProvider2000;
				case "SqlServer2005"         :
				case "SqlServer.2005"        : return _sqlServerDataProvider2005;
				case "SqlServer2008"         :
				case "SqlServer.2008"        : return _sqlServerDataProvider2008;
				case "SqlServer2012"         :
				case "SqlServer.2012"        : return _sqlServerDataProvider2012;
				case "SqlServer2014"         :
				case "SqlServer.2014"        : return _sqlServerDataProvider2012;

				case "SqlServer"             :
				case "System.Data.SqlClient" :

					if (css.Name.Contains("2000")) return _sqlServerDataProvider2000;
					if (css.Name.Contains("2005")) return _sqlServerDataProvider2005;
					if (css.Name.Contains("2008")) return _sqlServerDataProvider2008;
					if (css.Name.Contains("2012")) return _sqlServerDataProvider2012;
					if (css.Name.Contains("2014")) return _sqlServerDataProvider2012;

					if (AutoDetectProvider)
					{
						try
						{
							var connectionString = css.ConnectionString;

							using (var conn = new SqlConnection(connectionString))
							{
								conn.Open();

								int version;

								if (int.TryParse(conn.ServerVersion.Split('.')[0], out version))
								{
									switch (version)
									{
										case  8 : return _sqlServerDataProvider2000;
										case  9 : return _sqlServerDataProvider2005;
										case 10 : return _sqlServerDataProvider2008;
										case 11 : return _sqlServerDataProvider2012;
										case 12 : return _sqlServerDataProvider2012;
										default :
											if (version > 12)
												return _sqlServerDataProvider2012;
											break;
									}
								}
							}
						}
						catch (Exception)
						{
						}
					}

					break;
			}

			return null;
		}

		#endregion

		#region Public Members

		public static IDataProvider GetDataProvider(SqlServerVersion version = SqlServerVersion.v2008)
		{
			switch (version)
			{
				case SqlServerVersion.v2000 : return _sqlServerDataProvider2000;
				case SqlServerVersion.v2005 : return _sqlServerDataProvider2005;
				case SqlServerVersion.v2012 : return _sqlServerDataProvider2012;
			}

			return _sqlServerDataProvider2008;
		}

		public static void AddUdtType(Type type, string udtName)
		{
			_sqlServerDataProvider2000.AddUdtType(type, udtName);
			_sqlServerDataProvider2005.AddUdtType(type, udtName);
			_sqlServerDataProvider2008.AddUdtType(type, udtName);
			_sqlServerDataProvider2012.AddUdtType(type, udtName);
		}

		public static void AddUdtType<T>(string udtName, T nullValue, DataType dataType = DataType.Undefined)
		{
			_sqlServerDataProvider2000.AddUdtType(udtName, nullValue, dataType);
			_sqlServerDataProvider2005.AddUdtType(udtName, nullValue, dataType);
			_sqlServerDataProvider2008.AddUdtType(udtName, nullValue, dataType);
			_sqlServerDataProvider2012.AddUdtType(udtName, nullValue, dataType);
		}

		public static void ResolveSqlTypes([NotNull] string path)
		{
			if (path == null) throw new ArgumentNullException("path");
			new AssemblyResolver(path, "Microsoft.SqlServer.Types");
		}

		public static void ResolveSqlTypes([NotNull] Assembly assembly)
		{
			SqlHierarchyIdType = assembly.GetType("SqlHierarchyId", true);
			SqlGeographyType   = assembly.GetType("SqlGeography",   true);
			SqlGeometryType    = assembly.GetType("SqlGeometry",    true);
		}

		internal static Type SqlHierarchyIdType;
		internal static Type SqlGeographyType;
		internal static Type SqlGeometryType;

		public static void SetSqlTypes(Type sqlHierarchyIdType, Type sqlGeographyType, Type sqlGeometryType)
		{
			SqlHierarchyIdType = sqlHierarchyIdType;
			SqlGeographyType   = sqlGeographyType;
			SqlGeometryType    = sqlGeometryType;
		}

		#endregion

		#region CreateDataConnection

		public static DataConnection CreateDataConnection(string connectionString, SqlServerVersion version = SqlServerVersion.v2008)
		{
			switch (version)
			{
				case SqlServerVersion.v2000 : return new DataConnection(_sqlServerDataProvider2000, connectionString);
				case SqlServerVersion.v2005 : return new DataConnection(_sqlServerDataProvider2005, connectionString);
				case SqlServerVersion.v2012 : return new DataConnection(_sqlServerDataProvider2012, connectionString);
			}

			return new DataConnection(_sqlServerDataProvider2008, connectionString);
		}

		public static DataConnection CreateDataConnection(IDbConnection connection, SqlServerVersion version = SqlServerVersion.v2008)
		{
			switch (version)
			{
				case SqlServerVersion.v2000 : return new DataConnection(_sqlServerDataProvider2000, connection);
				case SqlServerVersion.v2005 : return new DataConnection(_sqlServerDataProvider2005, connection);
				case SqlServerVersion.v2012 : return new DataConnection(_sqlServerDataProvider2012, connection);
			}

			return new DataConnection(_sqlServerDataProvider2008, connection);
		}

		public static DataConnection CreateDataConnection(IDbTransaction transaction, SqlServerVersion version = SqlServerVersion.v2008)
		{
			switch (version)
			{
				case SqlServerVersion.v2000 : return new DataConnection(_sqlServerDataProvider2000, transaction);
				case SqlServerVersion.v2005 : return new DataConnection(_sqlServerDataProvider2005, transaction);
				case SqlServerVersion.v2012 : return new DataConnection(_sqlServerDataProvider2012, transaction);
			}

			return new DataConnection(_sqlServerDataProvider2008, transaction);
		}

		#endregion

		#region BulkCopy

		private static BulkCopyType _defaultBulkCopyType = BulkCopyType.ProviderSpecific;
		public  static BulkCopyType  DefaultBulkCopyType
		{
			get { return _defaultBulkCopyType;  }
			set { _defaultBulkCopyType = value; }
		}

//		public static int MultipleRowsCopy<T>(DataConnection dataConnection, IEnumerable<T> source, int maxBatchSize = 1000)
//		{
//			return dataConnection.BulkCopy(
//				new BulkCopyOptions
//				{
//					BulkCopyType = BulkCopyType.MultipleRows,
//					MaxBatchSize = maxBatchSize,
//				}, source);
//		}

		public static BulkCopyRowsCopied ProviderSpecificBulkCopy<T>(
			DataConnection             dataConnection,
			IEnumerable<T>             source,
			int?                       maxBatchSize       = null,
			int?                       bulkCopyTimeout    = null,
			bool                       keepIdentity       = false,
			bool                       checkConstraints   = false,
			int                        notifyAfter        = 0,
			Action<BulkCopyRowsCopied> rowsCopiedCallback = null)
		{
			return dataConnection.BulkCopy(
				new BulkCopyOptions
				{
					BulkCopyType       = BulkCopyType.ProviderSpecific,
					MaxBatchSize       = maxBatchSize,
					BulkCopyTimeout    = bulkCopyTimeout,
					KeepIdentity       = keepIdentity,
					CheckConstraints   = checkConstraints,
					NotifyAfter        = notifyAfter,
					RowsCopiedCallback = rowsCopiedCallback,
				}, source);
		}

		#endregion

		#region Extensions

		public static void SetIdentityInsert<T>(this DataConnection dataConnection, ITable<T> table, bool isOn)
		{
			dataConnection.Execute("SET IDENTITY_INSERT ");
		}

		#endregion

		public static class Sql
		{
			public const string OptionRecompile = "OPTION(RECOMPILE)";
		}
	}
}


text:
/**
* @fileoverview server模式专用,资源地址替换
* @author  liweitao
*/

'use strict';

var path = require('path');
var fs = require('fs');
var _ = require('lodash');
var gutil = require('gulp-util');
var through2 = require('through2');
var mkdirp = require('mkdirp');
var request = require('sync-request');

var Util = require('../../util');

var mapJSONCache = {};
var appConf = null;
var comboConf = null;

function replace(opts) {
  var config = _.assign({
    cwd: undefined,
    module: undefined,
    replaceType: 'local',
    serve: false,
    release: false
  }, opts);

  config.base64Opts = config.base64Opts || {
    enable: false,
    exclude: [],
    size: 5000
  };

  if (!config.cwd || !config.module) {
    gutil.log(gutil.colors.red('传入参数有误 at replace!'));
    return;
  }
  var includeJson = {};
  config.replaceType = config.replaceType ? config.replaceType : 'local';

  var modulePath = path.join(config.cwd, config.module);
  // 读取module-conf配置文件
  config.moduleConf = require(path.join(modulePath, 'module-conf'));
  appConf = require(path.join(config.cwd, 'app-conf'));
  comboConf = (typeof appConf.comboConf === 'object') && !_.isEmpty(appConf.comboConf) ? appConf.comboConf : {
    mode: 'client'
  };
  var resourcePrefix = null;
  var mapJson = null;
  var gMapJson = null;
  try {
    mapJson = JSON.parse(fs.readFileSync(path.join(modulePath, 'dist', 'map.json')).toString());
  } catch (e) {
    mapJson = null;
  }
  if (!config.serve) {
    try {
      gMapJson = JSON.parse(fs.readFileSync(path.join(Util.getAthenaPath(), 'cache', 'common', appConf.app + '_' + appConf.common + '.json')).toString());
    } catch (e) {
      gMapJson = null;
    }
  }

  if (!_.isEmpty(mapJson)) {
    mapJSONCache[config.module] = mapJson;
  }
  if (!_.isEmpty(gMapJson)) {
    mapJSONCache[appConf.common] = gMapJson;
  }
  if (appConf && config.moduleConf) {
    var deployObj = appConf.deploy;
    resourcePrefix = {};
    for (var key in deployObj) {
      if (key === 'local') {
        resourcePrefix.local = deployObj.local ? (deployObj.local.fdPath ? deployObj.local.fdPath : '/') : '/';
      } else {
        resourcePrefix[key] = '//' + Util.urlJoin(deployObj[key].domain, deployObj[key].fdPath);
      }
    }
  }
  if (config.release) {
    resourcePrefix['release-mode'] = comboConf.server.onlineDomain;
    config.replaceType = 'release-mode';
  }
  var stream = through2.obj(function (file, encoding, callback) {
    if (file.isNull() || file.isStream()) {
      return callback(null, file);
    }
    if (file.isBuffer()) {
      var extname = path.extname(file.path);
      var basename = path.basename(file.path);
      var fileContents = file.contents.toString();
      includeJson[basename] = [];
      if (Util.regexps.js.test(extname)) {
        file.contents = new Buffer(processJs(basename, fileContents, resourcePrefix[config.replaceType], config, includeJson));
      } else if (Util.regexps.css.test(extname)) {
        file.contents = new Buffer(processCss(basename, fileContents, resourcePrefix[config.replaceType], config, includeJson));
      } else if (Util.regexps.tpl.test(extname)) {
        file.contents = new Buffer(processHtml(basename, fileContents, resourcePrefix[config.replaceType], config, includeJson));
      }
      this.push(file);
      callback();
    }
  }, function (callback) {
    var mapJsonInclude = mapJson.include;
    if (mapJsonInclude && (typeof mapJsonInclude === 'object')) {
      for (var i in mapJsonInclude) {
        var pageInclude = includeJson[i];
        if (pageInclude && pageInclude.sort) {
          mapJsonInclude[i].images = pageInclude;
        }
        var mapJsonIncludeCss = mapJsonInclude[i].css;
        if (mapJsonIncludeCss && mapJsonIncludeCss.forEach) {
          mapJsonIncludeCss.map(function (item) {
            var name = item.name;
            if (includeJson[name] && includeJson[name].sort) {
              item.images = includeJson[name];
            }
            return item;
          });
        }
        var mapJsonIncludeJs = mapJsonInclude[i].js;
        if (mapJsonIncludeJs && mapJsonIncludeJs.forEach) {
          mapJsonIncludeJs.map(function (item) {
            var name = item.name;
            if (includeJson[name] && includeJson[name].sort) {
              item.images = includeJson[name];
            }
            return item;
          });
        }
      }
      var dest = path.join(modulePath, 'dist');
      if (!fs.existsSync(dest)) {
        fs.mkdirSync(dest);
      }
      fs.writeFileSync(path.join(dest, 'map.json'), JSON.stringify(mapJson, null, 2));
    }
    callback();
  });

  return stream;
}

function processHtml (filename, contents, resourcePrefix, config, includeJson) {
  contents = Util.processHtml(contents, function (value, type) {
    if (!type || type === 'url') {
      value = splitValue(filename, value, resourcePrefix, config, includeJson, true);
    } else if (type === 'content') {
      value = printResource(filename, value, resourcePrefix, config, includeJson);
    }
    return value;
  });
  return contents;
}

function processJs (filename, contents, resourcePrefix, config, includeJson) {
  contents = Util.processJs(contents, function (value, type) {
    if (!type || type === 'url') {
      value = splitValue(filename, value, resourcePrefix, config, includeJson, true);
    } else if (type === 'content') {
      value = printResource(filename, value, resourcePrefix, config, includeJson);
    } else if (type === 'hash') {
      value = getHashName(filename, value, config);
    }
    return value;
  });
  return contents;
}

function processCss (filename, contents, resourcePrefix, config, includeJson) {
  contents = Util.processCss(contents, function (value, type) {
    if (!type || type === 'url') {
      value = splitValue(filename, value, resourcePrefix, config, includeJson, true);
    } else if (type === 'content') {
      value = printResource(filename, value, resourcePrefix, config, includeJson);
    }
    return value;
  });
  return contents;
}

function splitValue(filename, value, resourcePrefix, config, includeJson, needMd5) {
  var vStart = '';
  var vEnd = '';
  var extname = path.extname(value);
  if (value.indexOf('\"') >= 0 || value.indexOf('\'') >= 0) {
    vStart = value[0];
    vEnd = value[value.length - 1];
    value = value.replace(/\"/g, '').replace(/\'/g, '');
  }
  if (value === 'domain_prefix') {
    return vStart + resourcePrefix + Util.urlJoin(comboConf.server.shortPath) + vEnd;
  }
  if (Util.regexps.url.test(value)
    || value.length <= 0
    || value.indexOf('data:image') >= 0
    || (typeof extname === 'string' && extname.length === 0)
    || typeof extname !== 'string') {
    value = vStart + value + vEnd;
    return value;
  }
  var valueArr = value.split(',');
  valueArr = valueArr.map(function (item) {
    var valueItem = item;
    var moduleName = undefined;
    if (item.indexOf(':') >= 0) {
      item = item.split(':');
      moduleName = item[0];
      valueItem = item[1];
    }
    return transmitResource(filename, valueItem, moduleName, config, includeJson, needMd5);
  });
  if (valueArr.length > 1) {
    value = vStart + resourcePrefix + Util.urlJoin(comboConf.server.shortPath, comboConf.server.flag, valueArr.join(',')) + vEnd;
  } else {
    if (valueArr[0].indexOf('data:image') >= 0) {
      return valueArr[0];
    }
    value = vStart + resourcePrefix + Util.urlJoin(comboConf.server.shortPath, valueArr.join(',')) + vEnd;
  }
  return value;
}

// 处理单个资源
function transmitResource(filename, value, moduleName, config, includeJson, needMd5) {
  var valueInfo = trackResource(filename, value, config);
  value = valueInfo.value.replace(/\\/ig, '/');
  moduleName = valueInfo.module;
  var mapJSONModuleCache = mapJSONCache[moduleName];
  if (!mapJSONModuleCache || _.isEmpty(mapJSONModuleCache)) {
    mapJSONCache[moduleName] = JSON.parse(fs.readFileSync(path.join(config.cwd, moduleName, 'dist', 'map.json')).toString());
  }
  if (Util.regexps.media.test(value)) {
    includeJson[filename] = includeJson[filename] ? includeJson[filename] : [];
    var isResExist = false;
    includeJson[filename].forEach(function (item) {
      if (item.res === value) {
        isResExist = true;
      }
    });
    if (!isResExist) {
      includeJson[filename].push({
        res: value,
        module: moduleName
      });
    }
  }
  var pathname = path.join(path.join(config.cwd, moduleName, 'dist', 'output', 's', value), '..', path.basename(value));
  var query = Util.getQueryObj(pathname);
  var size;
  var _pathname = pathname.split('?')[0];
  if (Util.regexps.images.test(path.basename(_pathname)) && Util.existsSync(_pathname)) {
    // 判断是否有__inline标或者是打开了base64开关被excluded
    var baseExclude = config.base64Opts.exclude;
    if (query.__inline || config.base64Opts.enable && (!baseExclude || _.isArray(baseExclude) && baseExclude.indexOf(value) === -1)) {

      try {
        size = fs.statSync(_pathname).size;
        if (query.__inline || size < config.base64Opts.size) {
          return Util.transform2DataURI(_pathname);
        }
      }
      catch (e) {
        gutil.log(gutil.colors.red('无法转base64,文件' + _pathname + '没有找到!'));
        return value;
      }
    }
  }
  var mapJson = mapJSONCache[moduleName];
  if (mapJson && needMd5) {
    value = Util.getHashNameServer(value, mapJson);
  }
  value = '/' + moduleName + '/' + value;
  return value;
}

function trackResource(filename, value, config) {
  var dirname = path.dirname(value);
  var dirnameArr = dirname.split('/');
  // 多媒体资源都在images下
  if (Util.regexps.media.test(value)) {
    var imagesIndex = dirnameArr.indexOf('images');
    value = value.split('/').splice(imagesIndex).join('/');
  }
  var distPath = path.join(config.cwd, config.module, 'dist', '_static');
  var gDistPath = path.join(config.cwd, appConf.common, 'dist', '_static');
  var valueParse = Util.getUrlParseSplit(value);
  var splitAfter = valueParse.split;
  var newValue = valueParse.pathname;
  value = newValue;
  if (path.dirname(value).length <= 1) {
    var extname = path.extname(value);
    if (extname.indexOf('.') >= 0 && extname.length > 1) {
      value = path.join('static', extname.slice(1), value);
    }
  }
  var resourcePath = path.join(distPath, value);
  var gResourcePath = path.join(gDistPath, value);
  var moduleName = '';
  // 优先判断资源是否在当前模块
  // 在当前模块找到
  if (Util.existsSync(resourcePath)) {
    moduleName = config.module;
  } else {
    // 在公共模块找到
    if (Util.existsSync(gResourcePath)) {
      moduleName = appConf.common;
    } else {
      // 若在公共模块也没有找到,则认为资源是不存在的资源,将模块设置成当前模块
      moduleName = config.module;
      gutil.log(gutil.colors.red('文件 ' + filename + ' 中引用资源 ' + value + ' 没有找到!'));
    }
  }
  value += splitAfter;
  return {
    module: moduleName,
    value: value
  };
}

function printResource (filename, value, resourcePrefix, config, includeJson) {
  var res = '';
  var fpath = '';
  if (value.indexOf('\"') >= 0 || value.indexOf('\'') >= 0) {
    value = value.replace(/\"/g, '').replace(/\'/g, '');
  }
  var valueArr = [];
  var moduleName = config.module;
  if (value.indexOf(',') >= 0) {
    valueArr = value.split(',');
    value = valueArr[0].replace(Util.regexps.blank, '');
    moduleName = valueArr[1].replace(Util.regexps.blank, '');
  }
  // URL
  if (Util.regexps.url.test(value)) {
    try {
      var result = request('GET', value);
      res = String(result.getBody());
    } catch (error) {
      res = '';
      gutil.log(gutil.colors.red('链接 ' + value + ' 请求出错,请检查后重试!'));
      return res;
    }
    return printLocalResource(filename, value, resourcePrefix, config, includeJson, null, res);
  }

  if (Util.regexps.css.test(value)) {
    fpath = path.join(config.cwd, moduleName, 'dist', '_static', 'static', 'css', value);
  } else if (Util.regexps.js.test(value)) {
    fpath = path.join(config.cwd, moduleName, 'dist', '_static', 'static', 'js', value);
  } else if (Util.regexps.images.test(value)) {
    fpath = path.join(config.cwd, moduleName, 'dist', '_static', 'images', value);
  } else {
    fpath = path.join(config.cwd, moduleName, 'dist', '_', value);
  }
  return printLocalResource(filename, value, resourcePrefix, config, includeJson, fpath);
}

function printLocalResource (filename, value, resourcePrefix, config, includeJson, fpath, content) {
  var res = '';
  if ((!path || !Util.existsSync(fpath)) && !content) {
    gutil.log(gutil.colors.red('文件' + value + '并不存在!'));
    return res;
  }
  if (fpath) {
    content = String(fs.readFileSync(fpath));
  }
  // 本地CSS
  if (Util.regexps.css.test(value)) {
    if (!Util.regexps.css.test(filename)) {
      res += '\n<style>\n';
      res += processCss(value, content, resourcePrefix, config, includeJson) + '\n';
      res += '</style>';
    } else {
      res += processCss(value, content, resourcePrefix, config, includeJson) + '\n';
    }
    return res;
  }
  // 本地JS
  if (Util.regexps.js.test(value)) {
    if (!Util.regexps.js.test(filename)) {
      res += '\n<script>\n';
      res += '/*filename=' + value + '*/\n';
      res += processJs(value, content, resourcePrefix, config, includeJson) + '\n';
      res += '</script>';
    } else {
      res += processJs(value, content, resourcePrefix, config, includeJson) + '\n';
    }
    return res;
  }
  // 本地HTML
  if (Util.regexps.tpl.test(value)) {
    res += '\n<!--filename=' + value + '-->\n';
    res += processHtml(value, content, resourcePrefix, config, includeJson) + '\n';
    return res;
  }
  // 本地图片
  if (Util.regexps.images.test(value)) {
    var _pathname = fpath.split('?')[0];
    res += Util.transform2DataURI(_pathname);
    return res;
  }
  // 其他文件
  res += '\n' + content;
  return res;
}

function getHashName (filename, value, config) {
  var valueInfo = trackResource(filename, value, config);
  var moduleName = valueInfo.module;
  value = valueInfo.value.replace(/\\/ig, '/');
  var mapJSONModuleCache = mapJSONCache[moduleName];
  if (!mapJSONModuleCache || _.isEmpty(mapJSONModuleCache)) {
    mapJSONCache[moduleName] = JSON.parse(fs.readFileSync(path.join(config.cwd, moduleName, 'dist', 'map.json')).toString());
  }

  var mapJson = mapJSONCache[moduleName];
  if (mapJson) {
    value = Util.getHashNameServer(value, mapJson);
  }
  return value;
}

module.exports = replace;


text:
package org.apache.metron.management;

import com.google.common.collect.ImmutableMap;
import org.apache.metron.common.configuration.IndexingConfigurations;
import org.apache.metron.stellar.dsl.Context;
import org.apache.metron.stellar.dsl.StellarFunctions;
import org.apache.metron.stellar.common.StellarProcessor;
import org.apache.metron.stellar.common.shell.StellarExecutor;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

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

import static org.apache.metron.common.configuration.ConfigurationType.INDEXING;
import static org.apache.metron.management.EnrichmentConfigFunctionsTest.toMap;

public class IndexingConfigFunctionsTest {

  Map<String, StellarExecutor.VariableResult> variables;
  Context context = null;

  private Object run(String rule, Map<String, Object> variables) {
    StellarProcessor processor = new StellarProcessor();
    return processor.parse(rule, x -> variables.get(x), StellarFunctions.FUNCTION_RESOLVER(), context);
  }

  @Before
  public void setup() {
    variables = ImmutableMap.of(
            "upper", new StellarExecutor.VariableResult("TO_UPPER('foo')", "FOO"),
            "lower", new StellarExecutor.VariableResult("TO_LOWER('FOO')", "foo")
    );

    context = new Context.Builder()
            .with(StellarExecutor.SHELL_VARIABLES, () -> variables)
            .build();
  }

  @Test
  public void testSetBatch() {
    String out = (String) run("INDEXING_SET_BATCH(config, 'hdfs', 10)"
                             , toMap("config", "{}")
    );
    Map<String, Object> config = (Map<String, Object>)INDEXING.deserialize(out);
    Assert.assertEquals(IndexingConfigurations.getBatchSize((Map<String, Object>) config.get("hdfs")), 10);
  }

  @Test(expected=IllegalStateException.class)
  public void testSetBatchBad() {
    run("INDEXING_SET_BATCH(config, 'hdfs', 10)"
                             , new HashMap<>()
    );
  }

  @Test
  public void testSetEnabled() {
    String out = (String) run("INDEXING_SET_ENABLED(config, 'hdfs', true)"
                             , toMap("config", "{}")
    );
    Map<String, Object> config = (Map<String, Object>)INDEXING.deserialize(out);
    Assert.assertTrue(IndexingConfigurations.isEnabled((Map<String, Object>) config.get("hdfs")));
  }

  @Test(expected=IllegalStateException.class)
  public void testSetEnabledBad() {
    run("INDEXING_SET_ENABLED(config, 'hdfs', 10)"
                             , new HashMap<>()
    );
  }

  @Test
  public void testSetIndex() {
    String out = (String) run("INDEXING_SET_INDEX(config, 'hdfs', 'foo')"
            , toMap("config", "{}")
    );
    Map<String, Object> config = (Map<String, Object>)INDEXING.deserialize(out);
    Assert.assertEquals("foo", IndexingConfigurations.getIndex((Map<String, Object>)config.get("hdfs"), null));
  }

  @Test(expected= IllegalStateException.class)
  public void testSetIndexBad() {
    run("INDEXING_SET_INDEX(config, 'hdfs', NULL)"
            , new HashMap<>()
    );
  }
}


text:
using System;
using System.Linq.Expressions;

namespace LCL.Domain.Specifications
{
    public interface ISpecification<T>
    {
        Guid ID { get;  }
        bool IsSatisfiedBy(T obj);
        ISpecification<T> And(ISpecification<T> other);
        ISpecification<T> Or(ISpecification<T> other);
        ISpecification<T> AndNot(ISpecification<T> other);
        ISpecification<T> Not();
        Expression<Func<T, bool>> GetExpression();
    }
}


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

namespace Codestellation.Emisstar.Testing
{
    public class TestHandler<TMessage> : IHandler<TMessage>
    {
        private readonly List<TMessage> _messages;

        private readonly ManualResetEventSlim _called;
        private int _calledTimes;

        public void WaitUntilCalled(int timeout = 10)
        {
            if (_called.Wait(timeout)) return;
            throw new InvalidOperationException(string.Format("TestHandler<{0}> was not called in a second.", typeof(TMessage)));
        }

        public TestHandler()
        {
            _messages = new List<TMessage>();
            _called = new ManualResetEventSlim(false);
        }

        public int CalledTimes
        {
            get { return _calledTimes; }
        }

        public bool WasCalledAtLeastOnce
        {
            get { return CalledTimes > 0; }
        }

        public TMessage LastMessage
        {
            get { return _messages.Last(); }
        }

        public IList<TMessage> Messages
        {
            get { return _messages.AsReadOnly(); }
        }

        public bool WasCalledOnce
        {
            get { return CalledTimes == 1; }
        }

        public void Handle(TMessage message)
        {
            Interlocked.Increment(ref _calledTimes);

            _messages.Add(message);
            _called.Set();
        }
    }
}


text:
$:.unshift File.dirname(__FILE__)

require 'records/base'
require 'records/v2_0_2'


text:
package hgoo
import (
	"os/exec"
	"os"
	"strings"
	"path/filepath"

)
var (
	DisableWeb bool
	app *application
	AppName string
	HttpAddr string
	HttpPort int
	webApp string
	templateDir string
	TemplateExt string
	staticDir string
	LogEnable bool
)
type Config struct {

}
func init() {
	AppName = "hgoo"
	HttpAddr = "0.0.0.0"
	HttpPort = 8080
	LogEnable = false
	DisableWeb = false
	TemplateExt = "tpl"
	WebApp("webapp")
	Static("static")
	Template("template")
	app = newApplication()
}
func WebApp(dir string) {
	if (strings.Index(dir, "/") < 0) {
		file, _ := exec.LookPath(os.Args[0])
		path, _ := filepath.Abs(file)
		webApp = filepath.Join(filepath.Dir(path), dir)
	}else {
		webApp = dir
	}
}
//Relative WebApp directory
func Static(dir string) {
	staticDir = filepath.Join(webApp, dir)
}
//Relative WebApp directory
func Template(dir string) {
	templateDir = filepath.Join(webApp, dir)
}


text:
KeywordMixedSequenceDialog::KeywordMixedSequenceDialog(QWidget *parent)
  : QDialog(parent), keyword(""), columnar(false), mode(true), dump(false)
{
  QLabel *header = new QLabel(tr("Generate the keyword-mixed sequence."));
  QLabel *lblKeyword = new QLabel(tr("Keyword:"));

  txtKeyword = new QLineEdit(keyword);

  chkColumnar = new QCheckBox(tr("Use columnar transposition"));
  chkColumnar->setCheckState(columnar ? Qt::Checked : Qt::Unchecked);

  chkMode = new QCheckBox(tr("Do decipherment"));
  chkMode->setCheckState(mode ? Qt::Checked : Qt::Unchecked);

  chkDump = new QCheckBox(tr("Dump sequence"));
  chkDump->setCheckState(dump ? Qt::Checked : Qt::Unchecked);

  QDialogButtonBox *box =
    new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
  connect(box, SIGNAL(accepted()), this, SLOT(onFinished()));
  connect(box, SIGNAL(rejected()), this, SLOT(reject()));

  QHBoxLayout *layoutKeyword = new QHBoxLayout;
  layoutKeyword->addWidget(lblKeyword);
  layoutKeyword->addWidget(txtKeyword);

  QVBoxLayout *layout = new QVBoxLayout;
  layout->addWidget(header);
  layout->addLayout(layoutKeyword);
  layout->addWidget(chkColumnar);
  layout->addWidget(chkMode);
  layout->addWidget(chkDump);
  layout->addWidget(box);

  setLayout(layout);

  setWindowTitle(tr("Keyword-mixed Sequence"));
  centerWidget(this);
}

void KeywordMixedSequenceDialog::onFinished() {
  keyword = txtKeyword->text();
  columnar = (chkColumnar->checkState() == Qt::Checked);
  mode = (chkMode->checkState() == Qt::Checked);
  dump = (chkDump->checkState() == Qt::Checked);

  accept();
}


text:
var animalAppControllers = angular.module('RegistrationController', []);

animalApp.controller('RegistrationController', ['$scope', '$location', '$route', 'currentDate', 'AuthenticationService',
                                                'hashPassword', 'OauthAuthenticationService', '$filter',
                                               function($scope, $location, $route, currentDate, AuthenticationService,
                                            		   hashPassword, OauthAuthenticationService, $filter) {
		$scope.errors = [];

		var locale = localStorage.getItem("NG_TRANSLATE_LANG_KEY");

		$scope.submitRegForm=function(){

			$scope.errorConfirmMessage=false;
			$scope.fields.isActive = false;
			$scope.fields.userRole = [{"id":3,"role":"guest"}]; //userRole=гість
			$scope.fields.userType = {"id":1,"type":"owner"};	//userType=власник

			$scope.fields.registrationDate = currentDate;

			$scope.fields.password=hashPassword($scope.password);
			AuthenticationService.registerUser($scope.fields, locale).then(
				function(result){

					if(result.userId==0){
				        $scope.errorRegistrationMessage1=true;
				        console.log("Registration error. SocialLogin is already exist");
					} else if(result.userId==-1){
						$scope.errorRegistrationMessage2=true;
				        console.log("Registration error. Email is already exist");
					} else if (result.userId==1){
				        $location.path("/ua/user/confirmRegistration");
						$route.reload();
				    } else if (result.length>0){
				    	for (i = 0; i < result.length; i++) {
						    $scope.errors.push({msg: $filter('translate')(result[i])});
						}
				    	 $scope.errorRegistrationMessage4=true;
				    } else {
				        console.log("error");
				        $scope.errorRegistrationMessage3=true;
				    }
				}
			);

		};

		$scope.RegisterGoogle=function(){

			OauthAuthenticationService.loginGoogle();

		}

		$scope.RegisterFacebook=function(){

			OauthAuthenticationService.loginFacebook();

		}

		$scope.RegisterTwitter=function(){

			OauthAuthenticationService.loginTwitter();

		}

}]);


text:
namespace ui {

// static
XEventWaiter* XEventWaiter::Create(x11::Window window,
                                   base::OnceClosure callback) {
  auto* connection = x11::Connection::Get();

  x11::ClientMessageEvent marker_event{
      .format = 8,
      .window = window,
      .type = MarkerEventAtom(),
  };

  x11::SendEvent(marker_event, window, x11::EventMask::NoEvent);
  connection->Flush();

  // Will be deallocated when the expected event is received.
  return new XEventWaiter(std::move(callback));
}

// XEventWaiter implementation
XEventWaiter::XEventWaiter(base::OnceClosure callback)
    : success_callback_(std::move(callback)) {
  x11::Connection::Get()->AddEventObserver(this);
}

XEventWaiter::~XEventWaiter() {
  x11::Connection::Get()->RemoveEventObserver(this);
}

void XEventWaiter::OnEvent(const x11::Event& xev) {
  auto* client = xev.As<x11::ClientMessageEvent>();
  if (client && client->type == MarkerEventAtom()) {
    base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
        FROM_HERE, std::move(success_callback_));
    delete this;
  }
}

// Returns atom that indidates that the XEvent is marker event.
x11::Atom XEventWaiter::MarkerEventAtom() {
  return x11::GetAtom("marker_event");
}

}  // namespace ui


text:
// Copyright (c) Ratish Philip
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// This file is part of the CompositionProToolkit project:
// https://github.com/ratishphilip/CompositionProToolkit
//
// CompositionProToolkit v1.0.1
//

using System;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using CompositionProToolkit.Win2d.Common;
using CompositionProToolkit.Win2d.Core;
using Microsoft.Graphics.Canvas.Geometry;

namespace CompositionProToolkit.Win2d.Geometry.Path
{
    /// <summary>
    /// Class representing the Polygon Figure in a Path Geometry
    /// </summary>
    internal class CanvasPolygonFigure : AbstractPathElement
    {
        #region Fields

        private int _numSides;
        private float _radius;
        private float _x;
        private float _y;

        #endregion

        #region Construction / Initialization

        public CanvasPolygonFigure()
        {
            _numSides = 0;
            _radius = _x = _y = 0;
        }

        #endregion

        #region APIs

        /// <summary>
        /// Adds the Path Element to the Path.
        /// </summary>
        /// <param name="pathBuilder">CanvasPathBuilder object</param>
        /// <param name="currentPoint">The last active location in the Path before adding
        /// the PolygonFigure</param>
        /// <param name="lastElement">The previous PathElement in the Path.</param>
        /// <param name="logger">For logging purpose. To log the set of CanvasPathBuilder
        /// commands, used for creating the CanvasGeometry, in string format.</param>
        /// <returns>The latest location in the Path after adding the PolygonFigure</returns>
        public override Vector2 CreatePath(CanvasPathBuilder pathBuilder, Vector2 currentPoint,
            ref ICanvasPathElement lastElement, StringBuilder logger)
        {
            // Calculate coordinates
            var center = new Vector2(_x, _y);
            if (IsRelative)
            {
                center += currentPoint;
            }

            // Execute command
            pathBuilder.AddPolygonFigure(_numSides, center.X, center.Y, _radius);

            // Log command
            logger?.AppendLine();
            logger?.AppendLine($"{Indent}pathBuilder.AddPolygonFigure({_numSides}, {center.X}, {center.Y}, {_radius});");

            // No need to update the lastElement or currentPoint here as we are creating
            // a separate closed figure here. So current point will not change.
            return currentPoint;
        }

        #endregion

        #region Helpers

        /// <summary>
        /// Get the Regex for extracting Path Element Attributes
        /// </summary>
        /// <returns></returns>
        protected override Regex GetAttributesRegex()
        {
            return RegexFactory.GetAttributesRegex(PathFigureType.PolygonFigure);
        }

        /// <summary>
        /// Gets the Path Element Attributes from the Match
        /// </summary>
        /// <param name="match">Match object</param>
        protected override void GetAttributes(Match match)
        {
            int.TryParse(match.Groups["Sides"].Value, out _numSides);
            // Sanitize by taking the absolute value
            _numSides = Math.Abs(_numSides);
            Single.TryParse(match.Groups["Radius"].Value, out _radius);
            // Sanitize by taking the absolute value
            _radius = Math.Abs(_radius);
            Single.TryParse(match.Groups["X"].Value, out _x);
            Single.TryParse(match.Groups["Y"].Value, out _y);
        }

        #endregion
    }
}


text:
/*
 * arch/arm/mach-mv78xx0/include/mach/timex.h
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#define CLOCK_TICK_RATE		(100 * HZ)


text:
Gitlab::Seeder.quiet do
  20.times do |i|
    begin
      User.create!(
        username: FFaker::Internet.user_name,
        name: FFaker::Name.name,
        email: FFaker::Internet.email,
        confirmed_at: DateTime.now,
        password: '12345678'
      )

      print '.'
    rescue ActiveRecord::RecordInvalid
      print 'F'
    end
  end

  5.times do |i|
    begin
      User.create!(
        username: "user#{i}",
        name: "User #{i}",
        email: "user#{i}@example.com",
        confirmed_at: DateTime.now,
        password: '12345678'
      )
      print '.'
    rescue ActiveRecord::RecordInvalid
      print 'F'
    end
  end
end


text:
#ifndef _SkyX_SkyX_H_
#define _SkyX_SkyX_H_

#include "Prerequisites.h"

#include "MeshManager.h"
#include "AtmosphereManager.h"
#include "GPUManager.h"
#include "MoonManager.h"
#include "CloudsManager.h"
#include "VCloudsManager.h"
#include "VClouds/VClouds.h"
#include "ColorGradient.h"

namespace SkyX
{
	/** Main SkyX class
	    Create simple and beautiful skies!
     */
    class DllExport SkyX
	{
	public:
		/** Lighting mode enumeration
		    SkyX is designed for true HDR rendering, but there're a lot of applications
			that doesn't use HDR rendering, due to this a little exponential tone-mapping
			algoritm is applied to SkyX materials if LM_LDR is selected. (See: AtmosphereManager::Options::Exposure)
			Select LM_HDR if your app is designed for true HDR rendering.
		 */
		enum LightingMode
		{
			/// Low dynamic range
			LM_LDR = 0,
			/// High dynamic range
			LM_HDR = 1
		};

		/** Contructor
		    @param sm Ogre Scene manager pointer
		    @param c Ogre Camera pointer
		 */
		SkyX(Ogre::SceneManager* sm, Ogre::Camera *c);

		/** Destructor
		 */
		~SkyX();

		/** Create SkyX
         */
        void create();

		/** Remove SkyX, you can call this method to remove SkyX from the scene
		    or release (secondary) SkyX memory, call create() to return SkyX to the scene.
		 */
		void remove();

        /** Call every frame
		    @param timeSinceLastFrame Time elapsed since last frame
            @todo Add listener interface
         */
        void update(const Ogre::Real &timeSinceLastFrame);

		/** Is SkyX created?
		    @return true if yes, false if not
		 */
		inline const bool isCreated() const
		{
			return mCreated;
		}

		/** Set time multiplier
		    @param TimeMultiplier Time multiplier
			@remarks The time multiplier can be a negative number, 0 will disable auto-updating
			         For setting a custom time of day, check: AtmosphereManager::Options::Time
		 */
		inline void setTimeMultiplier(const Ogre::Real& TimeMultiplier)
		{
			mTimeMultiplier = TimeMultiplier;
			mVCloudsManager->_updateWindSpeedConfig();
		}

		/** Get time multiplier
		    @return Time multiplier
		 */
		inline const Ogre::Real& getTimeMultiplier() const
		{
			return mTimeMultiplier;
		}

		/** Get time offset
		    @return Time offset
			@remarks Only for internal use
		 */
		inline const Ogre::Real& _getTimeOffset() const
		{
			return mTimeOffset;
		}

		/** Get mesh manager
		    @return Mesh manager pointer
		 */
		inline MeshManager* getMeshManager()
		{
			return mMeshManager;
		}

		/** Get atmosphere manager
		    @return Atmosphere manager pointer
		 */
		inline AtmosphereManager* getAtmosphereManager()
		{
			return mAtmosphereManager;
		}

		/** Get GPU manager
		    @return Atmosphere manager pointer
		 */
		inline GPUManager* getGPUManager()
		{
			return mGPUManager;
		}

		/** Get moon manager
		    @return Moon manager
		 */
		inline MoonManager* getMoonManager()
		{
			return mMoonManager;
		}

		/** Get clouds manager
		    @return Clouds manager
		 */
		inline CloudsManager* getCloudsManager()
		{
			return mCloudsManager;
		}

		/** Get volumetric clouds manager
		    @return Volumetric clouds manager
		 */
		inline VCloudsManager* getVCloudsManager()
		{
			return mVCloudsManager;
		}

		/** Set lighting mode
		    @param lm Lighting mode
			@remarks SkyX is designed for true HDR rendering, but there're a lot of applications
			that doesn't use HDR rendering, due to this a little exponential tone-mapping
			algoritm is applied to SkyX materials if LM_LDR is selected. (See: AtmosphereManager::Options::Exposure)
			Select LM_HDR if your app is designed for true HDR rendering.
		 */
		void setLightingMode(const LightingMode& lm);

		/** Get lighting mode
		    @return Lighting mode
		 */
		inline const LightingMode& getLightingMode() const
		{
			return mLightingMode;
		}

		/** Set the starfield enabled/disabled
		    @param Enabled true for starfield, false for not
		 */
		void setStarfieldEnabled(const bool& Enabled);

		/** Is the starfield enable?
		    @return true if the starfield is enabled, false if it isn't
		 */
		inline const bool& isStarfieldEnabled() const
		{
			return mStarfield;
		}

		/** Get scene manager
		    @return Ogre::SceneManager pointer
		 */
		inline Ogre::SceneManager* getSceneManager()
		{
			return mSceneManager;
		}

		/** Get camera
		    @return SkyX camera
		 */
		inline Ogre::Camera* getCamera()
		{
            return mCamera;
		}

	private:
		/// Is SkyX created?
		bool mCreated;

		/// Mesh manager
		MeshManager* mMeshManager;
		/// Atmosphere manager
		AtmosphereManager* mAtmosphereManager;
		/// GPU manager
		GPUManager* mGPUManager;
		/// Moon manager
		MoonManager* mMoonManager;
		/// Clouds manager
		CloudsManager* mCloudsManager;
		/// Volumetric clouds manager
		VCloudsManager* mVCloudsManager;

		/// Pointer to Ogre::SceneManager
        Ogre::SceneManager *mSceneManager;
		/// Main ogre camera
		Ogre::Camera* mCamera;

		/// Last camera position
		Ogre::Vector3 mLastCameraPosition;
		/// Last camera far clip distance
		Ogre::Real mLastCameraFarClipDistance;

		/// Lighting mode
		LightingMode mLightingMode;
		/// Enable starfield?
		bool mStarfield;

		/// Time multiplier
		Ogre::Real mTimeMultiplier;
		/// Time offset
		Ogre::Real mTimeOffset;
	};
}

#endif


text:
function move(command) {
    switch (command) {
        case "right":
            moveRight();
            break;
        case "left":
            moveLeft();
            break;
        case "print":
            printSelected();
            break;
    }

    function moveRight() {
        $("#available-towns option:selected").appendTo($("#selected-towns"));
        $("#selected-towns option:selected").prop("selected", false);
    }

    function moveLeft() {
        $("#selected-towns option:selected").appendTo($("#available-towns"));
        $("#available-towns option:selected").prop("selected", false);
    }

    function printSelected() {
        let text = $.map($("#selected-towns").children(), (e) => $(e).text()).join("; ");
        $("#output").text(text);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>css-data-uri</title>


text:
set -euo pipefail
. $IMPALA_HOME/bin/report_build_error.sh
setup_report_build_error

if [[ $# -eq 1 && "$1" == -format ]]; then
  SHOULD_FORMAT=true
elif [[ $# -ne 0 ]]; then
  echo "Usage: $0 [-format]"
  echo "[-format] : Format the mini-dfs cluster before starting"
  exit 1
else
  SHOULD_FORMAT=false
fi

# Kill and clean data for a clean start.
$IMPALA_HOME/testdata/bin/kill-mini-dfs.sh

if $SHOULD_FORMAT; then
  $IMPALA_HOME/testdata/cluster/admin delete_data
fi

set +e
$IMPALA_HOME/testdata/cluster/admin start_cluster
if [[ $? != 0 ]]; then
  # Only issue Java version warning when running Java 7.
  $JAVA -version 2>&1 | grep -q 'java version "1.7' || exit 1

  cat << EOF

Start of the minicluster failed. If the error looks similar to
"Unsupported major.minor version 52.0", make sure you are running at least Java 8.
Your JAVA binary currently points to $JAVA and reports the following version:

EOF
  $JAVA -version
  echo
  exit 1
fi


text:
module.exports = {
  extends: ['airbnb'],
  parser: 'babel-eslint',
  env: {
    browser: true,
  },
  rules: {
    'object-curly-newline': ['error', { consistent: true }],
    'function-paren-newline': ['error', 'consistent'],

    'react/jsx-filename-extension': 0,
    'react/forbid-prop-types': 0,
  },
};


text:
package com.linkedin.thirdeye.client.diffsummary;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Multimap;
import com.linkedin.thirdeye.client.diffsummary.costfunctions.CostFunction;
import com.linkedin.thirdeye.constant.MetricAggFunction;
import com.linkedin.thirdeye.dashboard.Utils;
import com.linkedin.thirdeye.dashboard.views.diffsummary.Summary;
import com.linkedin.thirdeye.dashboard.views.diffsummary.SummaryResponse;
import com.linkedin.thirdeye.datasource.MetricExpression;
import java.util.List;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

/**
 * A portal class that is used to trigger the multi-dimensional summary algorithm and to get the summary response.
 */
public class MultiDimensionalSummary {
  private OLAPDataBaseClient olapClient;
  private CostFunction costFunction;
  private DateTimeZone dateTimeZone;

  public MultiDimensionalSummary(OLAPDataBaseClient olapClient, CostFunction costFunction,
      DateTimeZone dateTimeZone) {
    Preconditions.checkNotNull(olapClient);
    Preconditions.checkNotNull(dateTimeZone);
    Preconditions.checkNotNull(costFunction);
    this.olapClient = olapClient;
    this.costFunction = costFunction;
    this.dateTimeZone = dateTimeZone;
  }

  /**
   * Builds the summary given the given metric information.
   *
   * @param dataset the dataset of the metric.
   * @param metric the name of the metric.
   * @param currentStartInclusive the start time of current data cube, inclusive.
   * @param currentEndExclusive the end time of the current data cube, exclusive.
   * @param baselineStartInclusive the start of the baseline data cube, inclusive.
   * @param baselineEndExclusive the end of the baseline data cube, exclusive.
   * @param dimensions the dimensions to be considered in the summary. If the variable depth is zero, then the order
   *                   of the dimension is used; otherwise, this method will determine the order of the dimensions
   *                   depending on their cost. After the order is determined, the first 'depth' dimensions are used
   *                   the generated the summary.
   * @param dataFilters the filter to be applied on the data cube.
   * @param summarySize the number of entries to be put in the summary.
   * @param depth the number of dimensions to be drilled down when analyzing the summary.
   * @param hierarchies the hierarchy among the dimensions. The order will always be honored when determining the order
   *                    of dimensions.
   * @param doOneSideError if the summary should only consider one side error.
   *
   * @return the multi-dimensional summary.
   */
  public SummaryResponse buildSummary(String dataset, String metric, long currentStartInclusive,
      long currentEndExclusive, long baselineStartInclusive, long baselineEndExclusive, Dimensions dimensions,
      Multimap<String, String> dataFilters, int summarySize, int depth, List<List<String>> hierarchies,
      boolean doOneSideError) throws Exception {
    Preconditions.checkArgument(!Strings.isNullOrEmpty(dataset));
    Preconditions.checkArgument(!Strings.isNullOrEmpty(metric));
    Preconditions.checkArgument(currentStartInclusive < currentEndExclusive);
    Preconditions.checkArgument(baselineStartInclusive < baselineEndExclusive);
    Preconditions.checkNotNull(dimensions);
    Preconditions.checkArgument(dimensions.size() > 0);
    Preconditions.checkNotNull(dataFilters);
    Preconditions.checkArgument(summarySize > 1);
    Preconditions.checkNotNull(hierarchies);
    Preconditions.checkArgument(depth >= 0);

    olapClient.setCollection(dataset);
    List<MetricExpression> metricExpressions = Utils.convertToMetricExpressions(metric, MetricAggFunction.SUM, dataset);
    olapClient.setMetricExpression(metricExpressions.get(0));
    olapClient.setCurrentStartInclusive(new DateTime(currentStartInclusive, dateTimeZone));
    olapClient.setCurrentEndExclusive(new DateTime(currentEndExclusive, dateTimeZone));
    olapClient.setBaselineStartInclusive(new DateTime(baselineStartInclusive, dateTimeZone));
    olapClient.setBaselineEndExclusive(new DateTime(baselineEndExclusive, dateTimeZone));

    Cube cube = new Cube(costFunction);
    SummaryResponse response;
    if (depth > 0) { // depth != 0 means manual dimension order
      cube.buildWithAutoDimensionOrder(olapClient, dimensions, dataFilters, depth, hierarchies);
      Summary summary = new Summary(cube, costFunction);
      response = summary.computeSummary(summarySize, doOneSideError, depth);
    } else { // manual dimension order
      cube.buildWithManualDimensionOrder(olapClient, dimensions, dataFilters);
      Summary summary = new Summary(cube, costFunction);
      response = summary.computeSummary(summarySize, doOneSideError);
    }
    response.setDataset(dataset);
    response.setMetricName(metric);

    return response;
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Main Page</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Related Pages

Classes

Files

<address style="text-align: right;">Generated on Mon Jan 4 20:57:12 2010 by

 1.5.6 </address>


text:
package jp.ac.nagoya_u.dsmoq.sdk.request.json

private[request] case class UpdateDatasetMetaJson(
  name: String,
  description: String,
  license: String,
  attributes: Seq[UpdateDatasetAttributeJson]
) extends Jsonable

private[request] case class UpdateDatasetAttributeJson(name: String, value: String)


text:
package org.mitre.mrald.admin;

import java.io.File;
import java.io.FilenameFilter;

public class ErrFileFilter implements FilenameFilter
{
     public boolean accept(File dir, String name)
     {
         return name.matches("mrald\\d*\\.err");
     }
}


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<simulation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="postal.xsd">
  <cost>
    <company>Air NZ</company>
    <to>Rome</to>
    <from>Wellington</from>
    <type>Air</type>
    <weightcost>6</weightcost>
    <volumecost>6</volumecost>
    <maxWeight>350</maxWeight>
    <maxVolume>50</maxVolume>
    <duration>16</duration>
    <frequency>36</frequency>
    <day>Thursday</day>
  </cost>
  <cost>
    <company>Kelburn Airways</company>
    <to>Sydney</to>
    <from>Wellington</from>
    <type>Air</type>
    <weightcost>2</weightcost>
    <volumecost>0</volumecost>
    <maxWeight>800</maxWeight>
    <maxVolume>80</maxVolume>
    <duration>3</duration>
    <frequency>12</frequency>
    <day>Friday</day>
  </cost>
  <cost>
    <company>Qantas</company>
    <to>Sydney</to>
    <from>Wellington</from>
    <type>Air</type>
    <weightcost>2</weightcost>
    <volumecost>1</volumecost>
    <maxWeight>700</maxWeight>
    <maxVolume>60</maxVolume>
    <duration>3</duration>
    <frequency>12</frequency>
    <day>Monday</day>
  </cost>
  <cost>
    <company>Kelburn Freight</company>
    <to>Wellington</to>
    <from>Auckland</from>
    <type>Land</type>
    <weightcost>0</weightcost>
    <volumecost>1</volumecost>
    <maxWeight>1200</maxWeight>
    <maxVolume>120</maxVolume>
    <duration>14</duration>
    <frequency>24</frequency>
    <day>Thursday</day>
  </cost>
  <cost>
    <company>Kelburn Freight</company>
    <to>Wellington</to>
    <from>Hamilton</from>
    <type>Land</type>
    <weightcost>0</weightcost>
    <volumecost>1</volumecost>
    <maxWeight>1100</maxWeight>
    <maxVolume>130</maxVolume>
    <duration>10</duration>
    <frequency>24</frequency>
    <day>Tuesday</day>
  </cost>
  <cost>
    <company>Rodney's Longhaul</company>
    <to>Hamilton</to>
    <from>Auckland</from>
    <type>Land</type>
    <weightcost>0</weightcost>
    <volumecost>1</volumecost>
    <maxWeight>8000</maxWeight>
    <maxVolume>260</maxVolume>
    <duration>2</duration>
    <frequency>12</frequency>
    <day>Monday</day>
  </cost>
  <cost>
    <company>Roman Air Freight Ltd</company>
    <to>Rome</to>
    <from>Sydney</from>
    <type>Air</type>
    <weightcost>2</weightcost>
    <volumecost>3</volumecost>
    <maxWeight>120</maxWeight>
    <maxVolume>140</maxVolume>
    <duration>12</duration>
    <frequency>24</frequency>
    <day>Monday</day>
  </cost>
  <cost>
    <company>Pacifica Merchants</company>
    <to>Suva</to>
    <from>Sydney</from>
    <type>Sea</type>
    <weightcost>3</weightcost>
    <volumecost>3</volumecost>
    <maxWeight>100</maxWeight>
    <maxVolume>100</maxVolume>
    <duration>36</duration>
    <frequency>168</frequency>
    <day>Monday</day>
  </cost>
  <cost>
    <company>Davy Jones Ltd</company>
    <to>Rome</to>
    <from>Auckland</from>
    <type>Sea</type>
    <weightcost>5</weightcost>
    <volumecost>4</volumecost>
    <maxWeight>1000</maxWeight>
    <maxVolume>1000</maxVolume>
    <duration>36</duration>
    <frequency>168</frequency>
    <day>Monday</day>
  </cost>
  <price>
    <to>Rome</to>
    <from>New Zealand</from>
    <priority>International Air</priority>
    <weightcost>6</weightcost>
    <volumecost>8</volumecost>
  </price>
  <price>
    <to>Sydney</to>
    <from>New Zealand</from>
    <priority>International Air</priority>
    <weightcost>3</weightcost>
    <volumecost>2</volumecost>
  </price>
  <price>
    <to>Suva</to>
    <from>New Zealand</from>
    <priority>International Air</priority>
    <weightcost>4</weightcost>
    <volumecost>4</volumecost>
  </price>
  <price>
    <to>Suva</to>
    <from>New Zealand</from>
    <priority>International Standard</priority>
    <weightcost>3</weightcost>
    <volumecost>2</volumecost>
  </price>
  <price>
    <to>New Zealand</to>
    <from>New Zealand</from>
    <priority>Domestic Standard</priority>
    <weightcost>1</weightcost>
    <volumecost>1</volumecost>
  </price>
  <price>
    <to>New Zealand</to>
    <from>New Zealand</from>
    <priority>Domestic Air</priority>
    <weightcost>1</weightcost>
    <volumecost>2</volumecost>
  </price>
  <mail>
    <day>Monday</day>
    <to>Rome</to>
    <from>Wellington</from>
    <weight>100</weight>
    <volume>5</volume>
    <priority>International Air</priority>
  </mail>
  <mail>
    <day>Monday</day>
    <to>Sydney</to>
    <from>Wellington</from>
    <weight>1000</weight>
    <volume>120</volume>
    <priority>International Air</priority>
  </mail>
  <mail>
    <day>Tuesday</day>
    <to>Rome</to>
    <from>Wellington</from>
    <weight>100</weight>
    <volume>5</volume>
    <priority>International Air</priority>
  </mail>
  <timelimit>
    <to>Wellington</to>
    <from>Rome</from>
    <priority>International Air</priority>
    <maxDeliveryTime>4</maxDeliveryTime>
  </timelimit>
  <mail>
    <day>Thursday</day>
    <to>Suva</to>
    <from>Wellington</from>
    <weight>2000</weight>
    <volume>120</volume>
    <priority>International Standard</priority>
  </mail>
  <discontinue>
    <company>Kelburn Airways</company>
    <to>Sydney</to>
    <from>Wellington</from>
    <type>Air</type>
  </discontinue>
  <cost>
    <company>Qantas</company>
    <to>Sydney</to>
    <from>Wellington</from>
    <type>Air</type>
    <weightcost>2</weightcost>
    <volumecost>1</volumecost>
    <maxWeight>120</maxWeight>
    <maxVolume>150</maxVolume>
    <duration>3</duration>
    <frequency>12</frequency>
    <day>Monday</day>
  </cost>
  <price>
    <to>Sydney</to>
    <from>New Zealand</from>
    <priority>International Air</priority>
    <weightcost>3</weightcost>
    <volumecost>3</volumecost>
  </price>
  <mail>
    <day>Thursday</day>
    <to>Wellington</to>
    <from>Auckland</from>
    <weight>100</weight>
    <volume>3</volume>
    <priority>Domestic Standard</priority>
  </mail>
  <mail>
    <day>Friday</day>
    <to>Rome</to>
    <from>Hamilton</from>
    <weight>400</weight>
    <volume>50</volume>
    <priority>International Air</priority>
  </mail>
  <mail>
    <day>Wednesday</day>
    <to>Rome</to>
    <from>Hamilton</from>
    <weight>400</weight>
    <volume>25</volume>
    <priority>International Standard</priority>
  </mail>
  <mail>
    <day>Wednesday</day>
    <to>Sydney</to>
    <from>Auckland</from>
    <weight>100</weight>
    <volume>5</volume>
    <priority>International Standard</priority>
  </mail>
  <mail>
    <day>Friday</day>
    <to>Rome</to>
    <from>Wellington</from>
    <weight>100</weight>
    <volume>5</volume>
    <priority>International Air</priority>
  </mail>
</simulation>


text:
<?php

/**
 * Submit observer.
 *
 * Following methods can be implemented: _postUpdate, _postInsert, _postDelete
 * @package Core_Model
 * @subpackage Core_Model_Observer
 */
class Core_Model_Observer_Submit extends TA_Model_Acl_Abstract implements TA_Model_Observer_Interface
{

	public function _postInsert(TA_Model_Observed_Interface $subject, $msg)
	{
		$conference = Zend_Registry::get('conference');

		$userModel = new Core_Model_User();
		$values['submit'] = $subject->toArray();

		$mailer = new TA_Controller_Action_Helper_SendEmail();
		$mailer->sendEmail(array(
		   'to_email' => $conference['email'],
		   'html' => true,
		   'subject' => 'CORE Observer: '.__CLASS__,
		   'template' => 'submit/postinsert'
		), $values);
	}
}