text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CompilerConfiguration">
    <resourceExtensions />
    <wildcardResourcePatterns>
      <entry name="!?*.java" />
      <entry name="!?*.form" />
      <entry name="!?*.class" />
      <entry name="!?*.groovy" />
      <entry name="!?*.scala" />
      <entry name="!?*.flex" />
      <entry name="!?*.kt" />
      <entry name="!?*.clj" />
      <entry name="!?*.aj" />
    </wildcardResourcePatterns>
    <annotationProcessing>
      <profile default="true" name="Default" enabled="false">
        <processorPath useClasspath="true" />
      </profile>
      <profile default="false" name="Maven default annotation processors profile" enabled="true">
        <sourceOutputDir name="target/generated-sources/annotations" />
        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
        <outputRelativeToContentRoot value="true" />
        <processorPath useClasspath="true" />
        <module name="huanyu-api" />
        <module name="huanyu-common" />
        <module name="huanyu-core" />
        <module name="huanyu-doc" />
        <module name="huanyu-server" />
      </profile>
      <profile default="false" name="Annotation profile for java-core-learning-example" enabled="true">
        <sourceOutputDir name="target/generated-sources/annotations" />
        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
        <outputRelativeToContentRoot value="true" />
        <processorPath useClasspath="true" />
      </profile>
    </annotationProcessing>
    <bytecodeTargetLevel>
      <module name="huanyu-api" target="1.5" />
      <module name="huanyu-comm" target="1.5" />
      <module name="huanyu-common" target="1.5" />
      <module name="huanyu-core" target="1.5" />
      <module name="huanyu-doc" target="1.5" />
      <module name="huanyu-server" target="1.5" />
      <module name="java-core-learning-example" target="1.8" />
      <module name="java-learing" target="1.5" />
    </bytecodeTargetLevel>
  </component>
</project>


text:
package org.adl.datamodels.ssp;

import java.io.Serializable;

/**
 * Enumeration of all SSP data model errors.

 *

 *
 * Filename: SSP_DMErrorCodes.java

 *

 *
 * Description: Enumeration of SSP error codes

 *

 *
 * @author ADL Technical Team
 */
public class SSP_DMErrorCodes implements Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -8648996862177072808L;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int NO_ERROR = 0;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int INVALID_SET_PARMS = 10000;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int INVALID_GET_PARMS = 10001;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int ALLOCATE_MIN_GREATER_MAX = 10002;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int DATABASE_UPDATE_FAILURE = 10003;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int TYPE_MISMATCH = 10004;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int ALLOCATE_SPACE_EXCEEDED = 10005;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int BUCKET_NOT_ALLOCATED_SET = 10006;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int BUCKET_NOT_ALLOCATED_GET = 10007;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int REQUESTED_SIZE_EXCEEDED_AVAIL = 10008;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int BUCKET_SIZE_EXCEEDED_SET = 10009;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int CREATE_BUCKET_PERSIST = 10010;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int DATABASE_CREATE_FAILURE = 10011;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int BUCKET_IMPROPERLY_DECLARED_SET = 10012;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int BUCKET_IMPROPERLY_DECLARED_GET = 10013;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int OFFSET_EXCEEDS_BUCKET_SIZE_SET = 10014;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int OFFSET_EXCEEDS_BUCKET_SIZE_GET = 10015;

	/**
	 * Enumeration of possible implementation specific data model exceptions.
	 */
	public static final int BUCKET_NOT_PACKED = 10016;

} // end SSP_DMErrorCodes

redpajama_set_name: RedPajamaGithub


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.hive;

import com.facebook.presto.spi.ColumnHandle;
import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import io.airlift.log.Logger;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.hadoop.hive.ql.io.DefaultHivePartitioner;
import org.apache.hadoop.hive.ql.io.HiveKey;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFHash;
import org.apache.hadoop.hive.serde2.SerDeException;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static com.facebook.presto.hive.HiveUtil.getTableStructFields;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Maps.immutableEntry;
import static com.google.common.collect.Sets.immutableEnumSet;
import static java.util.Map.Entry;
import static org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredJavaObject;
import static org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredObject;
import static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category;
import static org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaBooleanObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaByteObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaIntObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaLongObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaShortObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaStringObjectInspector;

final class HiveBucketing
{
    private static final Logger log = Logger.get(HiveBucketing.class);

    private static final Set<PrimitiveCategory> SUPPORTED_TYPES = immutableEnumSet(
            PrimitiveCategory.BYTE,
            PrimitiveCategory.SHORT,
            PrimitiveCategory.INT,
            PrimitiveCategory.LONG,
            PrimitiveCategory.BOOLEAN,
            PrimitiveCategory.STRING);

    private HiveBucketing() {}

    public static Optional<Integer> getBucketNumber(Table table, Map<ColumnHandle, Object> bindings)
    {
        if (!table.getSd().isSetBucketCols() || bindings.isEmpty()) {
            return Optional.absent();
        }

        List<String> bucketColumns = table.getSd().getBucketCols();
        Map<String, ObjectInspector> objectInspectors = new HashMap<>();

        // Get column name to object inspector mapping
        try {
            for (StructField field : getTableStructFields(table)) {
                objectInspectors.put(field.getFieldName(), field.getFieldObjectInspector());
            }
        }
        catch (MetaException | SerDeException e) {
            throw Throwables.propagate(e);
        }

        // Verify the bucket column types are supported
        for (String column : bucketColumns) {
            ObjectInspector inspector = objectInspectors.get(column);
            if (inspector.getCategory() != Category.PRIMITIVE) {
                return Optional.absent();
            }
            if (!SUPPORTED_TYPES.contains(((PrimitiveObjectInspector) inspector).getPrimitiveCategory())) {
                return Optional.absent();
            }
        }

        // Get bindings for bucket columns
        Map<String, Object> bucketBindings = new HashMap<>();
        for (Entry<ColumnHandle, Object> entry : bindings.entrySet()) {
            HiveColumnHandle colHandle = (HiveColumnHandle) entry.getKey();
            if (bucketColumns.contains(colHandle.getName())) {
                bucketBindings.put(colHandle.getName(), entry.getValue());
            }
        }

        // Check that we have bindings for all bucket columns
        if (bucketBindings.size() != bucketColumns.size()) {
            return Optional.absent();
        }

        // Get bindings of bucket columns
        ImmutableList.Builder<Entry<ObjectInspector, Object>> columnBindings = ImmutableList.builder();
        for (String column : bucketColumns) {
            columnBindings.add(immutableEntry(objectInspectors.get(column), bucketBindings.get(column)));
        }

        return getBucketNumber(columnBindings.build(), table.getSd().getNumBuckets());
    }

    public static Optional<Integer> getBucketNumber(List<Entry<ObjectInspector, Object>> columnBindings, int bucketCount)
    {
        try {
            GenericUDFHash udf = new GenericUDFHash();
            ObjectInspector[] objectInspectors = new ObjectInspector[columnBindings.size()];
            DeferredObject[] deferredObjects = new DeferredObject[columnBindings.size()];

            int i = 0;
            for (Entry<ObjectInspector, Object> entry : columnBindings) {
                objectInspectors[i] = getJavaObjectInspector(entry.getKey());
                deferredObjects[i] = getJavaDeferredObject(entry.getValue(), entry.getKey());
                i++;
            }

            ObjectInspector udfInspector = udf.initialize(objectInspectors);
            checkArgument(udfInspector instanceof IntObjectInspector, "expected IntObjectInspector: %s", udfInspector);
            IntObjectInspector inspector = (IntObjectInspector) udfInspector;

            Object result = udf.evaluate(deferredObjects);
            HiveKey hiveKey = new HiveKey();
            hiveKey.setHashCode(inspector.get(result));

            return Optional.of(new DefaultHivePartitioner<>().getBucket(hiveKey, null, bucketCount));
        }
        catch (HiveException e) {
            log.debug(e, "Error evaluating bucket number");
            return Optional.absent();
        }
    }

    private static ObjectInspector getJavaObjectInspector(ObjectInspector objectInspector)
    {
        checkArgument(objectInspector.getCategory() == Category.PRIMITIVE, "Unsupported object inspector category %s", objectInspector.getCategory());
        PrimitiveObjectInspector poi = ((PrimitiveObjectInspector) objectInspector);
        switch (poi.getPrimitiveCategory()) {
            case BOOLEAN:
                return javaBooleanObjectInspector;
            case BYTE:
                return javaByteObjectInspector;
            case SHORT:
                return javaShortObjectInspector;
            case INT:
                return javaIntObjectInspector;
            case LONG:
                return javaLongObjectInspector;
            case STRING:
                return javaStringObjectInspector;
        }
        throw new RuntimeException("Unsupported type: " + poi.getPrimitiveCategory());
    }

    private static DeferredObject getJavaDeferredObject(Object object, ObjectInspector objectInspector)
    {
        checkArgument(objectInspector.getCategory() == Category.PRIMITIVE, "Unsupported object inspector category %s", objectInspector.getCategory());
        PrimitiveObjectInspector poi = ((PrimitiveObjectInspector) objectInspector);
        switch (poi.getPrimitiveCategory()) {
            case BOOLEAN:
                return new DeferredJavaObject(object);
            case BYTE:
                return new DeferredJavaObject(((Long) object).byteValue());
            case SHORT:
                return new DeferredJavaObject(((Long) object).shortValue());
            case INT:
                return new DeferredJavaObject(((Long) object).intValue());
            case LONG:
                return new DeferredJavaObject(object);
            case STRING:
                return new DeferredJavaObject(object);
        }
        throw new RuntimeException("Unsupported type: " + poi.getPrimitiveCategory());
    }
}


text:
package com.five35.dex;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Nonnull;

final class Tokenizer {
	/**
	 * A regular expression describing what is recognized as a token.
	 *
	 * A token may be:
	 *
	 *

	 *
a sequence of one or more digits
	 *
a sequence of one or more letters or underscores
	 *
a single non-digit, non-letter, non-underscore, non-whitespace
	 * character
	 *

	 *
	 * Whitespace in Dex is optional and ignored except where necessary to
	 * separate two tokens (e.g. between a word operator and a variable, such as
	 * `count d 6`. All of the following are valid and tokenize identically:
	 *
	 *

	 *
4 d 6 drop - 1
	 *
4d6 drop -1
	 *
4d6drop-1
	 *

	 *
	 * Unicode digits and letters are recognized.
	 */
	private static final Pattern TOKEN_PATTERN = Pattern.compile("\\p{Digit}+|[\\p{Alpha}_]+|[^\\p{Alnum}_\\s]", Pattern.UNICODE_CHARACTER_CLASS);

	private Tokenizer() {
		throw new UnsupportedOperationException("Cannot instantiate a utility class");
	}

	@Nonnull
	static List<Token> tokenize(final String source) {
		final Matcher matcher = Tokenizer.TOKEN_PATTERN.matcher(source);
		final List<Token> tokens = new ArrayList<>();

		while (matcher.find()) {
			// add 1 so that the first character isn't "character 0"
			tokens.add(new Token(matcher.start() + 1, matcher.group()));
		}

		tokens.add(new Token(source.length(), "(end)"));

		return tokens;
	}
}


text:
package state

import (
	"fmt"
	"path"
	"sync"

	"k8s.io/klog/v2"
	"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
	"k8s.io/kubernetes/pkg/kubelet/checkpointmanager/errors"
)

var _ State = &stateCheckpoint{}

type stateCheckpoint struct {
	sync.RWMutex
	cache             State
	policyName        string
	checkpointManager checkpointmanager.CheckpointManager
	checkpointName    string
}

// NewCheckpointState creates new State for keeping track of memory/pod assignment with checkpoint backend
func NewCheckpointState(stateDir, checkpointName, policyName string) (State, error) {
	checkpointManager, err := checkpointmanager.NewCheckpointManager(stateDir)
	if err != nil {
		return nil, fmt.Errorf("failed to initialize checkpoint manager: %v", err)
	}
	stateCheckpoint := &stateCheckpoint{
		cache:             NewMemoryState(),
		policyName:        policyName,
		checkpointManager: checkpointManager,
		checkpointName:    checkpointName,
	}

	if err := stateCheckpoint.restoreState(); err != nil {
		//lint:ignore ST1005 user-facing error message
		return nil, fmt.Errorf("could not restore state from checkpoint: %v, please drain this node and delete the memory manager checkpoint file %q before restarting Kubelet",
			err, path.Join(stateDir, checkpointName))
	}

	return stateCheckpoint, nil
}

// restores state from a checkpoint and creates it if it doesn't exist
func (sc *stateCheckpoint) restoreState() error {
	sc.Lock()
	defer sc.Unlock()
	var err error

	checkpoint := NewMemoryManagerCheckpoint()
	if err = sc.checkpointManager.GetCheckpoint(sc.checkpointName, checkpoint); err != nil {
		if err == errors.ErrCheckpointNotFound {
			return sc.storeState()
		}
		return err
	}

	if sc.policyName != checkpoint.PolicyName {
		return fmt.Errorf("[memorymanager] configured policy %q differs from state checkpoint policy %q", sc.policyName, checkpoint.PolicyName)
	}

	sc.cache.SetMachineState(checkpoint.MachineState)
	sc.cache.SetMemoryAssignments(checkpoint.Entries)

	klog.V(2).Info("[memorymanager] state checkpoint: restored state from checkpoint")

	return nil
}

// saves state to a checkpoint, caller is responsible for locking
func (sc *stateCheckpoint) storeState() error {
	checkpoint := NewMemoryManagerCheckpoint()
	checkpoint.PolicyName = sc.policyName
	checkpoint.MachineState = sc.cache.GetMachineState()
	checkpoint.Entries = sc.cache.GetMemoryAssignments()

	err := sc.checkpointManager.CreateCheckpoint(sc.checkpointName, checkpoint)
	if err != nil {
		klog.Errorf("[memorymanager] could not save checkpoint: %v", err)
		return err
	}
	return nil
}

// GetMemoryState returns Memory Map stored in the State
func (sc *stateCheckpoint) GetMachineState() NUMANodeMap {
	sc.RLock()
	defer sc.RUnlock()

	return sc.cache.GetMachineState()
}

// GetMemoryBlocks returns memory assignments of a container
func (sc *stateCheckpoint) GetMemoryBlocks(podUID string, containerName string) []Block {
	sc.RLock()
	defer sc.RUnlock()

	return sc.cache.GetMemoryBlocks(podUID, containerName)
}

// GetMemoryAssignments returns ContainerMemoryAssignments
func (sc *stateCheckpoint) GetMemoryAssignments() ContainerMemoryAssignments {
	sc.RLock()
	defer sc.RUnlock()

	return sc.cache.GetMemoryAssignments()
}

// SetMachineState stores NUMANodeMap in State
func (sc *stateCheckpoint) SetMachineState(memoryMap NUMANodeMap) {
	sc.Lock()
	defer sc.Unlock()

	sc.cache.SetMachineState(memoryMap)
	err := sc.storeState()
	if err != nil {
		klog.Warningf("store state to checkpoint error: %v", err)
	}
}

// SetMemoryBlocks stores memory assignments of container
func (sc *stateCheckpoint) SetMemoryBlocks(podUID string, containerName string, blocks []Block) {
	sc.Lock()
	defer sc.Unlock()

	sc.cache.SetMemoryBlocks(podUID, containerName, blocks)
	err := sc.storeState()
	if err != nil {
		klog.Warningf("store state to checkpoint error: %v", err)
	}
}

// SetMemoryAssignments sets ContainerMemoryAssignments by using the passed parameter
func (sc *stateCheckpoint) SetMemoryAssignments(assignments ContainerMemoryAssignments) {
	sc.Lock()
	defer sc.Unlock()

	sc.cache.SetMemoryAssignments(assignments)
	err := sc.storeState()
	if err != nil {
		klog.Warningf("store state to checkpoint error: %v", err)
	}
}

// Delete deletes corresponding Blocks from ContainerMemoryAssignments
func (sc *stateCheckpoint) Delete(podUID string, containerName string) {
	sc.Lock()
	defer sc.Unlock()

	sc.cache.Delete(podUID, containerName)
	err := sc.storeState()
	if err != nil {
		klog.Warningf("store state to checkpoint error: %v", err)
	}
}

// ClearState clears machineState and ContainerMemoryAssignments
func (sc *stateCheckpoint) ClearState() {
	sc.Lock()
	defer sc.Unlock()

	sc.cache.ClearState()
	err := sc.storeState()
	if err != nil {
		klog.Warningf("store state to checkpoint error: %v", err)
	}
}


text:
<?php

use yii\helpers\Html;

/**
 * @var yii\web\View $this
 * @var dektrium\user\models\User $model
 */

$this->title = Yii::$app->getModule('user')->confirmable ?
    Yii::t('user', 'Confirmation needed') :
    Yii::t('user', 'Your account has been created');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php if (Yii::$app->getModule('user')->confirmable): ?>

<?= Yii::t('user', 'Awesome, almost there! We need to confirm your email address.') ?>

        <?= Yii::t('user', 'Please check your email and click the confirmation link to complete your registration.') ?>
        <?= Yii::t('user', 'The email can take a few minutes to arrive. But if you are having troubles, you can request a new one.') ?>
        <?= Html::a(Yii::t('user', 'Request new confirmation message'), ['/user/registration/resend']) ?>

<?php else: ?>

<?= Html::encode($this->title) ?>

        <?= Yii::t('user', 'Thank you for registration on our website. You may sign in using your credentials.') ?>

<?php endif; ?>


text:
/************************************************************************************\
 * FuncHooker - An Andrew Shurney Production                                        *
\************************************************************************************/

/*! \file		Disassembler.cpp
 *  \author		Andrew Shurney
 *  \brief		Dissassembles x86 and x64 machine code
 */

#include "privateInc/Disassembler.h"
#include "udis86.h"

Disassembler::Disassembler(void *addr) : disasm(new ud_t), curPos(reinterpret_cast<uint8_t*>(addr))
{
	ud_init(disasm);
	ud_set_mode(disasm, sizeof(void*)*8);
	ud_set_user_opaque_data(disasm, this);
	ud_set_input_hook(disasm, &Disassembler::NextFuncByte);
}

Disassembler::Disassembler(const Disassembler& rhs) : disasm(new ud_t), curPos(rhs.curPos)
{
	ud_init(disasm);
	ud_set_mode(disasm, sizeof(void*)*8);
	ud_set_user_opaque_data(disasm, this);
	ud_set_input_hook(disasm, &Disassembler::NextFuncByte);

	*this = rhs;
}

Disassembler::Disassembler(Disassembler&& rhs) : disasm(rhs.disasm), curPos(rhs.curPos)
{
	rhs.disasm = NULL;
}

Disassembler::~Disassembler()
{
	delete disasm;
}

Disassembler& Disassembler::operator=(const Disassembler& rhs)
{
	if(this == &rhs)
		return *this;

	curPos = rhs.curPos;

	return *this;
}

void *Disassembler::GetIP() const
{
	return curPos;
}

void Disassembler::SetIP(void *addr)
{
	curPos = reinterpret_cast<uint8_t*>(addr);
}

Operation Disassembler::ReadNextOperation()
{
	return Operation(disasm);
}

int Disassembler::NextFuncByte(ud_t* disasm)
{
	Disassembler *thisPtr = (Disassembler*)ud_get_user_opaque_data(disasm);
	return *thisPtr->curPos++;
}


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace Air.Client
{
    public enum Severity
    {
        Trace,
        Debug,
        Information,
        Warning,
        Error,
        Fatal,
    }
}


text:
from msrest.serialization import Model

class AutomationRunbookReceiver(Model):
    """The Azure Automation Runbook notification receiver.

    All required parameters must be populated in order to send to Azure.

    :param automation_account_id: Required. The Azure automation account Id
     which holds this runbook and authenticate to Azure resource.
    :type automation_account_id: str
    :param runbook_name: Required. The name for this runbook.
    :type runbook_name: str
    :param webhook_resource_id: Required. The resource id for webhook linked
     to this runbook.
    :type webhook_resource_id: str
    :param is_global_runbook: Required. Indicates whether this instance is
     global runbook.
    :type is_global_runbook: bool
    :param name: Indicates name of the webhook.
    :type name: str
    :param service_uri: The URI where webhooks should be sent.
    :type service_uri: str
    """

    _validation = {
        'automation_account_id': {'required': True},
        'runbook_name': {'required': True},
        'webhook_resource_id': {'required': True},
        'is_global_runbook': {'required': True},
    }

    _attribute_map = {
        'automation_account_id': {'key': 'automationAccountId', 'type': 'str'},
        'runbook_name': {'key': 'runbookName', 'type': 'str'},
        'webhook_resource_id': {'key': 'webhookResourceId', 'type': 'str'},
        'is_global_runbook': {'key': 'isGlobalRunbook', 'type': 'bool'},
        'name': {'key': 'name', 'type': 'str'},
        'service_uri': {'key': 'serviceUri', 'type': 'str'},
    }

    def __init__(self, *, automation_account_id: str, runbook_name: str, webhook_resource_id: str, is_global_runbook: bool, name: str=None, service_uri: str=None, **kwargs) -> None:
        super(AutomationRunbookReceiver, self).__init__(**kwargs)
        self.automation_account_id = automation_account_id
        self.runbook_name = runbook_name
        self.webhook_resource_id = webhook_resource_id
        self.is_global_runbook = is_global_runbook
        self.name = name
        self.service_uri = service_uri


text:
import macro from 'vtk.js/Sources/macros';

// ----------------------------------------------------------------------------
// vtkCompositeMouseManipulator methods
// ----------------------------------------------------------------------------

function vtkCompositeGestureManipulator(publicAPI, model) {
  // Set our className
  model.classHierarchy.push('vtkCompositeGestureManipulator');

  publicAPI.startInteraction = () => {};
  publicAPI.endInteraction = () => {};

  publicAPI.onStartPinch = (interactor, scale) => {};
  publicAPI.onStartRotate = (interactor, rotation) => {};
  publicAPI.onStartPan = (interactor, translation) => {};
  publicAPI.onPinch = (interactor, renderer, scale) => {};
  publicAPI.onRotate = (interactor, renderer, rotation) => {};
  publicAPI.onPan = (interactor, renderer, translation) => {};
  publicAPI.onEndPinch = (interactor) => {};
  publicAPI.onEndRotate = (interactor) => {};
  publicAPI.onEndPan = (interactor) => {};

  publicAPI.isPinchEnabled = () => model.pinchEnabled;
  publicAPI.isPanEnabled = () => model.panEnabled;
  publicAPI.isRotateEnabled = () => model.rotateEnabled;
}

// ----------------------------------------------------------------------------
// Object factory
// ----------------------------------------------------------------------------

const DEFAULT_VALUES = {
  pinchEnabled: true,
  panEnabled: true,
  rotateEnabled: true,
};

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

export function extend(publicAPI, model, initialValues = {}) {
  Object.assign(model, DEFAULT_VALUES, initialValues);

  // Create get-set macros
  macro.set(publicAPI, model, ['pinchEnabled', 'panEnabled', 'rotateEnabled']);
  macro.setGet(publicAPI, model, ['interactorStyle']);

  // Object specific methods
  vtkCompositeGestureManipulator(publicAPI, model);
}

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

export default { extend };


text:
electronVetoId = 'egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-veto'
electronLooseId = 'egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-loose'
electronMediumId = 'egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-medium'
electronTightId = 'egmGsfElectronIDs:cutBasedElectronID-Summer16-80X-V1-tight'
electronHLTId = 'egmGsfElectronIDs:cutBasedElectronHLTPreselection-Summer16-V1'
electronCombIsoEA = 'RecoEgamma/ElectronIdentification/data/Summer16/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_80X.txt'
electronEcalIsoEA = 'RecoEgamma/ElectronIdentification/data/Summer16/effAreaElectrons_HLT_ecalPFClusterIso.txt'
electronHcalIsoEA = 'RecoEgamma/ElectronIdentification/data/Summer16/effAreaElectrons_HLT_hcalPFClusterIso.txt'

photonLooseId = 'egmPhotonIDs:cutBasedPhotonID-Spring16-V2p2-loose'
photonMediumId = 'egmPhotonIDs:cutBasedPhotonID-Spring16-V2p2-medium'
photonTightId = 'egmPhotonIDs:cutBasedPhotonID-Spring16-V2p2-tight'
photonCHIsoEA = 'RecoEgamma/PhotonIdentification/data/Spring16/effAreaPhotons_cone03_pfChargedHadrons_90percentBased.txt'
photonNHIsoEA = 'RecoEgamma/PhotonIdentification/data/Spring16/effAreaPhotons_cone03_pfNeutralHadrons_90percentBased.txt'
photonPhIsoEA = 'RecoEgamma/PhotonIdentification/data/Spring16/effAreaPhotons_cone03_pfPhotons_90percentBased.txt'

# https://twiki.cern.ch/twiki/bin/view/CMS/EGMSmearer#Energy_smearing_and_scale_correc
# https://github.com/ECALELFS/ScalesSmearings/tree/Moriond17_23Jan_v2

electronSmearingData = {
    "Prompt2015":"PandaProd/Producer/data/ScalesSmearings/74X_Prompt_2015",
    "76XReReco" :"PandaProd/Producer/data/ScalesSmearings/76X_16DecRereco_2015_Etunc",
    "80Xapproval" : "PandaProd/Producer/data/ScalesSmearings/80X_ichepV1_2016_ele",
    "Moriond2017_JEC" : "PandaProd/Producer/data/ScalesSmearings/Winter_2016_reReco_v1_ele"     #only to derive JEC corrections
}

photonSmearingData = {
    "Prompt2015":"PandaProd/Producer/data/ScalesSmearings/74X_Prompt_2015",
    "76XReReco" :"PandaProd/Producer/data/ScalesSmearings/76X_16DecRereco_2015_Etunc",
    "80Xapproval" : "PandaProd/Producer/data/ScalesSmearings/80X_ichepV2_2016_pho",
    "Moriond2017_JEC" : "PandaProd/Producer/data/ScalesSmearings/Winter_2016_reReco_v1_ele"     #only to derive JEC correctionsb
}


text:
use strict;
use Perl::Module;
use Data::Hub qw($Hub);
use Data::Hub::Util qw(:all);
use WWW::Livesite::OutputStream;
use Error::Programatic;

our $Conf_Key = 'compile';
our $Stream;
our $Config;

# System
# ------------------------------------------------------------------------------

sub ACCESS {
  $Stream = undef;
  $Config = undef;
  my $u = $Hub->get('/sys/user') or return;
  return unless $u->is_member('admins');
  $Stream = $Hub->get('./Stream.pm')->{'new'}();
  $Config = $Hub->get('./Config.pm')->{'new'}($Stream, $Conf_Key);
  1;
}

# Public
# ------------------------------------------------------------------------------

sub query_local {
  my $compiler = _create_compiler();
  $compiler->query_local();
  $Stream->report('status', 'Finished.');
}

sub compile {
  my $compiler = _create_compiler();
  $compiler->delete_local();
  $compiler->fetch_local($compiler->query_local());
  $Stream->report('status', 'Finished.');
}

sub rsync {
  my $rsync = _create_rsync();
  $rsync->rsync();
  $Stream->report('status', 'Finished.');
}

sub publish {
  my $compiler = _create_compiler();
  $compiler->delete_local();
  $compiler->fetch_local($compiler->query_local());
  my $rsync = _create_rsync();
  $rsync->rsync();
  $Stream->report('status', 'Finished.');
}

sub get_config {
  $Config->get_config(@_);
}

sub set_config {
  $Config->set_config(@_);
}

# Internal
# ------------------------------------------------------------------------------

sub _create_compiler {
  $Hub->get('./SiteCompile.pm')->{'new'}($Stream, $Config);
}

sub _create_rsync {
  $Hub->get('./Rsync.pm')->{'new'}($Stream, $Config);
}

1;


text:
//******************************************************************************************************
//  AddNew.xaml.cs - Gbtc
//
//  Copyright © 2010, Grid Protection Alliance.  All Rights Reserved.
//
//  Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
//  the NOTICE file distributed with this work for additional information regarding copyright ownership.
//  The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may
//  not use this file except in compliance with the License. You may obtain a copy of the License at:
//
//      http://www.opensource.org/licenses/eclipse-1.0.php
//
//  Unless agreed to in writing, the subject software distributed under the License is distributed on an
//  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
//  License for the specific language governing permissions and limitations.
//
//  Code Modification History:
//  ----------------------------------------------------------------------------------------------------
//  09/28/2009 - Mehulbhai P Thakkar
//       Generated original version of source code.
//
//******************************************************************************************************

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using openPDCManager.PhasorDataServiceProxy;

namespace openPDCManager.Pages.Devices
{
	public partial class AddNew : Page
	{
		#region [ Constructor ]

		public AddNew()
		{
			InitializeComponent();
		}

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (this.NavigationContext.QueryString.ContainsKey("did"))
            {
                UserControlManageDevices.hasQueryString = true;
                UserControlManageDevices.m_deviceID = Convert.ToInt32(this.NavigationContext.QueryString["did"]);
                UserControlManageDevices.m_copyDevice = false;
            }
            else if (this.NavigationContext.QueryString.ContainsKey("copydid"))
            {
                UserControlManageDevices.hasQueryString = true;
                UserControlManageDevices.m_deviceID = Convert.ToInt32(this.NavigationContext.QueryString["copydid"]);
                UserControlManageDevices.m_copyDevice = true;
            }
            UserControlManageDevices.GetDevices(DeviceType.Concentrator, ((App)Application.Current).NodeValue, true);
            UserControlManageDevices.GetCompanies();
            UserControlManageDevices.GetNodes();
            UserControlManageDevices.GetHistorians();
            UserControlManageDevices.GetInterconnections();
            UserControlManageDevices.GetVendorDevices();
            UserControlManageDevices.GetProtocols();
            UserControlManageDevices.GetTimeZones();
        }

		#endregion
	}
}


text:
Java
-----
@mymodule/MyJavaClass.java
```java
package mymodule;

public class MyJavaClass{
	public MyJavaClass(){
	}
	public double bar(double a, double b){
		return a*b;
	}
}
```

Gwis Wrapper
-------
Gwis generates JNI wrappers so the Java object can be used from C++.
https://github.com/opencollab/giws
@gwis
```xml
<package name="mymodule">
  <object name="MyJavaClass">
        <method name="bar" returnType="double">
          <param type="double" name="a" />
          <param type="double" name="b" />
        </method>
  </object>
</package>
```

Rusthon
------------
```rusthon
import jvm
jvm.namespace('mymodule')

def foo( ob: MyJavaClass ):
	print ob.bar( 10.0, 100.0 )

def main():
	ob = jvm( MyJavaClass() )
	foo( ob )

```


text:
'use strict';

angular.module('zenith.room', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/room', {
        templateUrl: '03_room/room.html',
        controller: 'RoomCtrl'
    });
}])

.controller('RoomCtrl', ['$scope', '$location', '$http', 'CommonFunctions', 'Data',
    function($scope, $location, $http, CommonFunctions, Data) {
		var lsData = CommonFunctions.loadData();
		if (lsData != null) {
			$scope.data = lsData;
		}

		var socket = io();

		/*
		getUserMedia(conf, function(localMediaStream){
			var video = document.getElementById('localVideo');
			video.src = window.URL.createObjectURL(localMediaStream);
			socket.emit('video', video.src);
		}, function(err){
			console.log(err);
		});

		socket.on('video', function(localMediaStream){
			var video = document.getElementById('remoteVideo');
			video.src = localMediaStream;
		});
		*/

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

		var servers = {
			iceServers: [
				{url:'stun:stun.l.google.com:19302'},
				{url:'stun:stun1.l.google.com:19302'},
				{url:'stun:stun2.l.google.com:19302'},
				{url:'stun:stun3.l.google.com:19302'},
				{url:'stun:stun4.l.google.com:19302'}
			]
		};

		// Si el navegador es Firefox, quita los iceServers
		if (typeof InstallTrigger !== 'undefined') {
			servers = null;
		}

		var userMediaConf = {video: true, audio: false};

		var pc = new RTCPeerConnection(servers);

		pc.onaddstream = function(obj) {
			var video = document.createElement("video");
			document.getElementById("videoChat").appendChild(video);
			video.src = window.URL.createObjectURL(obj.stream);
			video.autoplay = true;
		}

		// Helper functions
		function endCall() {
			var videos = document.getElementsByTagName("video");
			for (var i = 0; i < videos.length; i++) {
				videos[i].pause();
			}

			pc.close();
		}

		function error(err) {
			endCall();
			$scope.buttonDisabled = false;
		}

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

		$scope.buttonDisabled = false;
		$scope.data.myOffer = {};
		$scope.data.myAnswer = {};

		$scope.startCall = function() {
			// Get a list of friends from a server
			// User selects a friend to start a peer connection with
			//
			getUserMedia(userMediaConf, function(stream) {
				// Adding a local stream won't trigger the onaddstream callback,
				// so call it manually.
				pc.onaddstream({stream: stream});
				pc.addStream(stream);

				pc.createOffer(function(offer) {
					pc.setLocalDescription(offer, function() {
						// send the offer to a server to be forwarded to the friend you're calling.
						$scope.data.myOffer = offer;
						socket.emit('video offer', offer);
					}, error);
				}, error);
			}, error);
		}

		socket.on('video offer', function(offer){
			$scope.buttonDisabled = true;
			if (offer.sdp != $scope.data.myOffer.sdp) {
				/*
				pc.setRemoteDescription(new RTCSessionDescription(offer), function() {
					pc.createAnswer(function(answer) {
						pc.setLocalDescription(new RTCSessionDescription(answer), function() {
							// send the answer to a server to be forwarded back to the caller (you)
							$scope.data.myAnswer = answer;
							socket.emit('video answer', answer);
						}, error);
					}, error);
				}, error);
				*/
				getUserMedia({video: true}, function(stream) {
					pc.onaddstream({stream: stream});
					pc.addStream(stream);

					pc.setRemoteDescription(new RTCSessionDescription(offer), function() {
						pc.createAnswer(function(answer) {
							pc.setLocalDescription(answer, function() {
								// send the answer to a server to be forwarded back to the caller (you)
								$scope.data.myAnswer = answer;
								socket.emit('video answer', answer);
							}, error);
						}, error);
					}, error);
				}, error);
			}
		});

		socket.on('video answer', function(answer){
			if (answer.sdp != $scope.data.myAnswer.sdp) {
				pc.setRemoteDescription(new RTCSessionDescription(answer), function() {console.log("OKI DOKI")}, error);
			}
		});
//----------------------------------------------------------------------------//

		socket.on('chat message', function(msg){
			console.log(msg);
		});

		socket.emit('chat message', $scope.data.username);

		$(window).on('beforeunload', function(){
			socket.close();
		});

	}]);


text:
<?php

declare(strict_types=1);

namespace KejawenLab\Application\SemartHris\DependencyInjection\Compiler;

use KejawenLab\Application\SemartHris\Component\Contract\Repository\ContractableRepositoryFactory;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

/**
 * @author Muhamad Surya Iksanudin <surya.iksanudin@gmail.com>
 */
class ContractableRepositoryFactoryPass implements CompilerPassInterface
{
    /**
     * @param ContainerBuilder $container
     */
    public function process(ContainerBuilder $container)
    {
        if (!$container->has(ContractableRepositoryFactory::class)) {
            return;
        }

        $services = $container->findTaggedServiceIds(ContractableRepositoryFactory::SEMARTHRIS_CONTRACTABLE_REPOSITORY);
        $repositories = [];
        foreach ($services as $serviceId => $tags) {
            $repositories[] = new Reference($serviceId);
        }

        $container->getDefinition(ContractableRepositoryFactory::class)->addArgument($repositories);
    }
}


text:
import { markdown } from 'markdown';
import { getSession, requireSession } from './auth';
import { backgroundColor, catcher } from './utils';

const BACKGROUND_COLOR = '#f2f2f2';

export const renderNotification = (message, label, url) => ({
  html:
`

${markdown.toHTML(message || '')}

${label}

`,
  text:
`
${message}

${url}
`,
});

export const renderEmail = contents => `

  ${markdown.toHTML(contents || '*awaiting some content*')}

`;

export default function (router) {
  router.post('/email/render', (req, res) => {
    getSession(req)
      .then(requireSession)
      .then(() => renderEmail(req.body.contents))
      .then(markup => res.send(markup))
      .catch(error => catcher(error, res));
  });
}


text:
package main

import (
	"fmt"
	"io/ioutil"
)

type Page struct {
	Title string
	Body  []byte
}

func (p *Page) save() error {
	filename := p.Title + ".txt"
	return ioutil.WriteFile(filename, p.Body, 0600)
}

func loadPage(title string) *Page {
	filename := title + ".txt"
	body, _ := ioutil.ReadFile(filename)
	return &Page{Title: title, Body: body}
}

func main() {
	p1 := &Page{Title: "TestPage", Body: []byte("This is a sample page.")}
	p1.save()
	p2 := loadPage("TestPage")
	fmt.Println(string(p2.Body))
}


text:
import os
import sys

import cheshire3
from cheshire3.baseObjects import Session
from cheshire3.server import SimpleServer
from cheshire3.internal import cheshire3Root

# Launch a Cheshire session
session = Session()
serverConfig = os.path.join(cheshire3Root, 'configs', 'serverConfig.xml')
serv = SimpleServer(session, serverConfig)

# Grab our objects
db = serv.get_object(session, 'db_test_pgsql')
recStore = db.get_object(session, 'recordStore')
rssStore = db.get_object(session, 'resultSetStore')
qfac = db.get_object(session, 'defaultQueryFactory')

# Prove that we have some records in postgres

rec = recStore.fetch_record(session, 0)
if not rec:
	print "Could not retrieve records, have you run cheshire3-load?"
	sys.exit()

# Make a query, and store results in resultSetStore
try:
	qidx = sys.argv.index('--query')
except:
	qidx = -1
if qidx > -1:
	try:
		term = sys.argv[qidx+1]
	except:
		term = "a"
	q = qfac.get_query(session, "cql.anywhere = \"%s\"" % term)
	rs = db.search(session, q)
	rsid = rssStore.create_resultSet(session, rs)
	print "Searched for: %s" % term
	print "Number of hits stored: %s" % len(rs)
	print "ResultSetId: %s" % rsid

# Retrieve ResultSet from Store
try:
	fidx = sys.argv.index('--fetch')
except:
	fidx = -1
if fidx > -1:
	rssid = sys.argv[fidx+1]
	if rssid.isdigit():
		rssid = int(rssid)
	rs = rssStore.fetch_resultSet(session, rssid)
	print "ResultSet Query Term: %s" % rs.queryTerm
	print "Number of hits from store: %s" % len(rs)


text:
var duplex = require('duplexify')

var writeFiles = require('./lib/write-files')
var readFiles = require('./lib/read-files')

module.exports = melvin

function melvin (source, _dirFilter, _fileFilter) {
  var writable = writeFiles()
  var readable

  if (!source) {
    return writable
  }

  readable = readFiles(source, _dirFilter, _fileFilter)

  return duplex.obj(writable, readable)
}


text:
typedef struct _GPollFD GPollFD;
typedef struct _GSource GSource;
typedef struct _XDisplay Display;

namespace base {

// This class implements a message-pump for dispatching X events.
//
// If there's a current dispatcher given through RunWithDispatcher(), that
// dispatcher receives events. Otherwise, we route to messages to dispatchers
// who have subscribed to messages from a specific X11 window.
class BASE_EXPORT MessagePumpAuraX11 : public MessagePumpGlib,
                                       public MessagePumpDispatcher {
 public:
  MessagePumpAuraX11();

  // Returns default X Display.
  static Display* GetDefaultXDisplay();

  // Returns true if the system supports XINPUT2.
  static bool HasXInput2();

  // Returns the UI message pump.
  static MessagePumpAuraX11* Current();

  // Adds/Removes |dispatcher| for the |xid|. This will route all messages from
  // the window |xid| to |dispatcher.
  void AddDispatcherForWindow(MessagePumpDispatcher* dispatcher,
                              unsigned long xid);
  void RemoveDispatcherForWindow(unsigned long xid);

  // Adds/Removes |dispatcher| to receive all events sent to the X root
  // window. A root window can have multiple dispatchers, and events on root
  // windows will be dispatched to all.
  void AddDispatcherForRootWindow(MessagePumpDispatcher* dispatcher);
  void RemoveDispatcherForRootWindow(MessagePumpDispatcher* dispatcher);

  // Internal function. Called by the glib source dispatch function. Processes
  // all available X events.
  bool DispatchXEvents();

  // Blocks on the X11 event queue until we receive notification from the
  // xserver that |w| has been mapped; StructureNotifyMask events on |w| are
  // pulled out from the queue and dispatched out of order.
  //
  // For those that know X11, this is really a wrapper around XWindowEvent
  // which still makes sure the preempted event is dispatched instead of
  // dropped on the floor. This method exists because mapping a window is
  // asynchronous (and we receive an XEvent when mapped), while there are also
  // functions which require a mapped window.
  void BlockUntilWindowMapped(unsigned long xid);

 protected:
  virtual ~MessagePumpAuraX11();

 private:
  typedef std::map<unsigned long, MessagePumpDispatcher*> DispatchersMap;

  // Initializes the glib event source for X.
  void InitXSource();

  // Dispatches the XEvent and returns true if we should exit the current loop
  // of message processing.
  bool ProcessXEvent(MessagePumpDispatcher* dispatcher, XEvent* event);

  // Sends the event to the observers. If an observer returns true, then it does
  // not send the event to any other observers and returns true. Returns false
  // if no observer returns true.
  bool WillProcessXEvent(XEvent* xevent);
  void DidProcessXEvent(XEvent* xevent);

  // Returns the Dispatcher based on the event's target window.
  MessagePumpDispatcher* GetDispatcherForXEvent(
      const base::NativeEvent& xev) const;

  // Overridden from MessagePumpDispatcher:
  virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;

  // The event source for X events.
  GSource* x_source_;

  // The poll attached to |x_source_|.
  scoped_ptr<GPollFD> x_poll_;

  DispatchersMap dispatchers_;

  // Dispatch calls can cause addition of new dispatchers as we iterate
  // through them. Use ObserverList to ensure the iterator remains valid across
  // additions.
  ObserverList<MessagePumpDispatcher> root_window_dispatchers_;

  unsigned long x_root_window_;

  DISALLOW_COPY_AND_ASSIGN(MessagePumpAuraX11);
};

typedef MessagePumpAuraX11 MessagePumpForUI;

}  // namespace base

#endif  // BASE_MESSAGE_PUMP_AURAX11_H


text:
package me.martinez.sergio.daggertwobasearchitecture.di.injectableelements.base;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import me.martinez.sergio.daggertwobasearchitecture.di.components.AppComponent;

/**
 * Created by Sergio Martinez Rodriguez
 * Date 15/7/15.
 */
public abstract class BaseInjectionActivity<T> extends AppCompatActivity{

  protected T activityComponent;

  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initDI();
  }

  protected abstract void initDI();

  public AppComponent getAppComponent() {
    AppComponent appComponent = ((App) getApplication()).getAppComponent();
    return appComponent;
  }

  public Object getActivityComponent() {
      return activityComponent;
  }

}


text:
/**
 * @date 2014-09-11
 * @author Clément Désiles <main@jokester.fr>
 * @description
 * Translate the data-localize DOM elements found to the desired language.
 * This is intended to work with *grunt-locales*.
 * @see https://github.com/blueimp/grunt-locales
 */

/* globals CustomEvent, HTMLElement */
;(function (window, document) {
  'use strict'
  if (window.Localizer) return
  var singletonFlag

  /**
   * Extends object a with b options
   * @param  {Object} a first set of options (of this object)
   * @param  {Object} b set of options to merge
   */
  function extend (a, b) {
    for (var key in b) {
      if (b.hasOwnProperty(key)) {
        a[key] = b[key]
      }
    }
  }

  /**
   * Escape html chars from string to prevent
   * Cross-site scripting attacks.
   * @see https://github.com/blueimp/grunt-locales#dom-replacement
   */
  function escapeHTML (str) {
    return str.replace(/[<>&"]/g, function (c) {
      return {
        '<': '<',
        '>': '>',
        '&': '&',
        '"': '"'
      }[c]
    })
  }

  /**
   * Load a javascript script dynamically into the dom <head>
   * @param {String} url - path of the source script to load
   * @param {String} id - identifier for switching purpose
   * @param {Function} callback - gives(Error err)
   */
  function insertScript (url, id, callback) {
    // Check if we need to update script
    if (id) {
      var old = document.getElementById(id)
      if (old) {
        if (url === old.getAttribute('url')) return callback()
        else old.parentNode.removeChild(old)
      }
    }

    // Reset previous i18n set (if any)
    window.i18n = {}

    // Adding the script tag to the head as suggested before
    var script = document.createElement('script')
    script.type = 'text/javascript'
    script.src = url
    script.id = id

    // Then bind the event to the callback function.
    // There are several events for cross browser compatibility.
    script.onreadystatechange = callback
    script.onload = callback
    script.onerror = function () {
      throw new Error('cannot import ' + url + ', no translation available')
    }

    // Fire the loading
    document.head.appendChild(script)
  }

  /**
   * A singleton class to handle the localization process.
   * @class Localizer
   * @param {Object} options
   */
  var Localizer = function (options) {
    if (singletonFlag) {
      console.log('Psiit, check this out: window.localizer')
      throw new Error('singleton class can be instanciated once')
    }
    singletonFlag = true
    this.locale = null
    this.registeredElements = []
    extend(this.options, options)

    // Export can be defined once (singleton)
    window.localizer = this
    window.localize = this.localize.bind(this)
  }

  /**
   * Localizer options
   */
  Localizer.prototype = {
    options: {
      // Where the pre-built javascript files will be retrieved from
      localePath: 'locales/{locale}/i18n.js',

      // The default locale to be used
      defaultLocale: 'en_US',

      // Where the script is inserted in the page
      scriptAnchor: 'i18n-src'
    },

    /**
     * Load new language script if not the same
     * and create and dispatch the event.
     * @public
     * @param {String} locale
     * @emits {Object} localeChange - "en_US" for example
     * @param {Function} callback - gives (Error err)
     * @return none
     */
    setLocale: function (locale, callback) {
      callback = callback || function () {}
      if (!locale) locale = this.options.defaultLocale
      else if (locale === this.locale) return callback()

      // Get locale path
      var path = this.options.localePath.replace(/\{locale\}/, locale)

      // Insert language file and apply changes to all registered elements
      insertScript(path, this.options.scriptAnchor, function () {
        this.locale = locale
        console.log('language changed to', this.locale)

        // Dispatch event on document for listeners
        var evt = new CustomEvent('localeChange', { detail: locale })
        document.dispatchEvent(evt)

        this.registeredElements.forEach(this.localize.bind(this))
        return callback()
      }.bind(this))
    },

    /**
     * Simple getter for current locale.
     * @return {String} locale
     */
    getLocale: function () {
      return this.locale
    },

    /**
     * Localizer the string in accordance with given data,
     * if key is an HTML element, this handle it properly.
     * @param {String or HTMLElement} key
     * @param {Object} data
     * @return {String}
     */
    localize: function (key, data) {
      if (!key) return

      // String case
      // -----------
      if (!(key instanceof HTMLElement)) {
        var func = window.i18n && window.i18n[key]
        if (func) {
          /*
           * Now grunt-locales can map to String in its
           * locale generated array, not only functions
           * @see https://github.com/blueimp/grunt-locales#optionswrapstatictranslations
           */
          if (typeof func === 'function') return func(data)
          else return func
        }
        return key
      }

      // HTMLElement case
      // ----------------

      // Register it
      var elt = key
      if (this.registeredElements.indexOf(elt) === -1) {
        this.registeredElements.push(elt)
      }

      // Apply localize change
      if (elt.hasAttribute('data-localize')) elt = elt.parentNode
      var nodes = elt.querySelectorAll('[data-localize]')
      Array.prototype.forEach.call(nodes, function (node) {
        var dataset = node.dataset
        var data = {}
        var attr = dataset && dataset.localize
        var func = window.i18n && window.i18n[attr || node.innerHTML]
        var key
        if (func) {
          if (!attr) {
            node.setAttribute('data-localize', node.textContent)
          }
          for (key in dataset) {
            // Data is guessed on the fly with the dataset
            if (dataset.hasOwnProperty(key) && key !== 'localize') {
              data[key] = escapeHTML(dataset[key])
              // NOTE: this feature is disabled for now - we don't think it's useful
              // to enable translation on data-stuff, this can be error prone!
              // ----- DISABLED CODE -----
              // If a the key itself can be translated, do it
              // var f = data[key] && window.i18n && window.i18n[data[key]]
              // if (f) {
              //   if (typeof f === 'function') data[key] = f(dataset)
              //   else data[key] = f
              // }
            }
          }
          if (typeof func === 'function') node.innerHTML = func(data)
          else node.innerHTML = func
        } else if (attr) {
          node.textContent = attr
        } else {
          node.setAttribute('data-localize', node.textContent)
        }
      })
      return
    },

    /**
     * Add a listener on localeChange event.
     * We do use here the native *addEventListener*
     * mecanism to register listeners.
     * @param {String} eventName
     * @param {Function} listener
     * @return none
     */
    on: function (eventName, listener) {
      listener = typeof eventName === 'function' ? eventName : listener
      if (!listener) throw new Error('listener cannot be null')
      eventName = 'localeChange' // only one for now
      document.addEventListener(eventName, function (evt) {
        return listener(evt.detail)
      })
    }
  }

  /**
   * @alias Localizer.prototype.on
   */
  Localizer.prototype.addEventListener = Localizer.prototype.on

  // Exports
  window.Localizer = Localizer
  window.localize = function () {
    throw new Error('instanciate Localizer once before usage')
  }
})(window, document)


text:
/*
 * patVirtualNetwork.cc
 *
 *  Created on: Oct 28, 2011
 *      Author: jchen
 */

#include "patVirtualNetwork.h"

patVirtualNetwork::patVirtualNetwork() {
	//

}

patVirtualNetwork::~patVirtualNetwork() {
	//
}


text:
Title: Hackfest in Berlin on July 27
Date: 2013-06-11 17:43:00
Author: stpeter
Slug: hackfest-in-berlin-on-july-27
Category: post
Tags: community, events
Summary:
description:
Link: http://xmpp.org/2013/03/hackfest-in-berlin-on-july-27/
post_id:

The XSF will hold a developer hackfest on July 27, 2013 in Berlin, Germany.

This is the Saturday before IETF 87.

Details are available at http://wiki.xmpp.org/web/Berlin_Hackfest.


text:
package com.google.appengine.datanucleus.test.jpa;

import com.google.appengine.api.datastore.Key;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 * @author Max Ross <maxr@google.com>
 */
@Entity
public class HasOneToOneStringPkParentKeyPkJPA {
  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  private Key id;

  @OneToOne(mappedBy = "hasParentKeyPK", fetch = FetchType.LAZY)
  private HasOneToOneStringPkJPA parent;

  private String str;

  public Key getId() {
    return id;
  }

  public HasOneToOneStringPkJPA getParent() {
    return parent;
  }

  public void setParent(HasOneToOneStringPkJPA parent) {
    this.parent = parent;
  }

  public String getStr() {
    return str;
  }

  public void setStr(String str) {
    this.str = str;
  }
}


text:
<?php

$mod_strings['LBL_MAP'] = 'Mapa';
$mod_strings['LBL_MAPS'] = 'Mapas';
$mod_strings['LBL_MODULE_NAME'] = 'Mapas';
$mod_strings['LBL_MODULE_TITLE'] = 'Mapas: Inicio';
$mod_strings['LBL_MODULE_ID'] = 'Mapas';
$mod_strings['LBL_LIST_FORM_TITLE'] = 'Mapas de Venta';
$mod_strings['LBL_MAP_CUSTOM_MARKER'] = 'Marcador';
$mod_strings['LBL_MAP_CUSTOM_AREA'] = 'Espacio';
$mod_strings['LBL_HOMEPAGE_TITLE'] = 'Mapas de Venta';

$mod_strings['LBL_FLEX_RELATE'] = 'Relacionado a la (Centro):';
$mod_strings['LBL_MODULE_TYPE'] = 'Módulo Tipo de Pantalla:';
$mod_strings['LBL_DISTANCE'] = 'Distancia (Radio):';
$mod_strings['LBL_UNIT_TYPE'] = 'Tipo de Unidad:';

$mod_strings['LBL_MAP_ACTION'] = 'Mapa Es';
$mod_strings['LBL_MAP_DISPLAY'] = 'Visualización de Mapa';
$mod_strings['LBL_MAP_LEGEND'] = 'Leyenda:';
$mod_strings['LBL_MAP_USERS'] = 'Usuarios:';
$mod_strings['LBL_MAP_USER_GROUPS'] = 'Grupos de Usuarios:';
$mod_strings['LBL_MAP_GROUP'] = 'Grupo';
$mod_strings['LBL_MAP_TYPE'] = 'Tipo';
$mod_strings['LBL_MAP_ASSIGNED_TO'] = 'Asignado a:';
$mod_strings['LBL_MAP_GET_DIRECTIONS'] = 'Get Directions';

$mod_strings['LNK_NEW_MAP'] = 'Añadir Nuevo Mapa';
$mod_strings['LNK_NEW_RECORD'] = 'Añadir Nuevo Mapa';
$mod_strings['LNK_MAP_LIST'] = 'Mapas Lista';
$mod_strings['LNK_IMPORT_MAPS'] = 'Mapas de Importación';
$mod_strings['LBL_MAP_GEOCODE_ADDRESSES'] = 'Geocodificar Direcciones';
$mod_strings['LBL_MAP_DONATE'] = 'Donar';
$mod_strings['LBL_MAP_DONATE_TO_THIS_PROJECT'] = 'Haz Una Donación a Este Proyecto';
$mod_strings['LBL_BUG_FIX'] = 'Bug Fix';

$mod_strings['LBL_MAP_ADDRESS_TEST'] = 'Prueba de Geocodificación';
$mod_strings['LBL_MAP_QUICK_RADIUS'] = 'Mapa Radio rápida';
$mod_strings['LBL_MAP_NULL_GROUP_NAME'] = 'Nada';
$mod_strings['LBL_MAP_ADDRESS'] = 'Dirección';
$mod_strings['LBL_MAP_PROCESS'] = 'Se Proceso!';

$mod_strings['LBL_MAP_LAST_STATUS'] = 'Estado Geocode Última';
$mod_strings['LBL_MAP_GEOCODED_COUNTS'] = 'Cuentas Geocodificadas';
$mod_strings['LBL_GEOCODED_COUNTS'] = 'Módulo Condes Geocodificadas';
$mod_strings['LBL_CRON_URL'] = 'Cron URL:';
$mod_strings['LBL_MODULE_HEADING'] = 'Módulo';
$mod_strings['LBL_MODULE_TOTAL_HEADING'] = 'Total';
$mod_strings['LBL_MODULE_RESET_HEADING'] = 'Reset';
$mod_strings['LBL_GEOCODED_COUNTS_DESCRIPTION'] = 'La tabla de abajo, muestra el número de objetos de geocodificados, agrupados por respuesta. '.
'Tenga en cuenta que las APIS de Google Maps públicas limitan el uso a 2.500 solicitudes de geocodificación por día, y por dirección IP.'.
'Este módulo de caché de direcciones geocodificadas, tiene por objeto reducir el número total de peticiones necesarias e información durante el proceso de geocoficación.';
$mod_strings['LBL_CRON_URL'] = 'CRON URL';
$mod_strings['LBL_CRON_INSTRUCTIONS'] = 'Para procesar las solicitudes de códigos geográficos, se recomienda que configure las tareas programadas durante la noche. '.
'Un punto de acceso personalizado se ha creado para este fin y se puede acceder sin autenticación. '.
'La URL que se muestra a continuación está destinada a ser utilizada dentro de la tarea programada. '.
'Por favor, consulte la documentación de SugarCRM para más información.';
$mod_strings['LBL_EXPORT_ADDRESS_URL'] = 'Exportación de URLs';
$mod_strings['LBL_EXPORT_INSTRUCTIONS'] = 'Utilice los enlaces siguientes para exportar las direcciones completas si necesita la información geocodificada. '.
'A continuación, utilice una herramienta geocodificar las direcciones. '.
'Cuando haya terminado la geocodificación, importe las direcciones al módulo de caché de direcciones para ser utilizado con sus mapas. '.
'Tenga en cuenta que el módulo de caché de direcciones es opcional. Toda la información de geocodificación se almacena en el módulo de representación.';
$mod_strings['LBL_ADDRESS_CACHE'] = 'Caché de Direcciones';
$mod_strings['LBL_ADD_TO_TARGET_LIST'] = 'Añadir a la Lista de destinos';
$mod_strings['LBL_ADD_TO_TARGET_LIST_CONFIRM'] = '¿Está seguro que desea agregar los elementos seleccionados a la Lista de destinos?';
$mod_strings['LBL_ADD_TO_TARGET_LIST_PROCESSING'] = 'Tratamiento...';

$mod_strings['LBL_CONFIG_TITLE'] = 'Configuración';
$mod_strings['LBL_CONFIG_SAVED'] = 'Configuraciones Guardadas con Exito!';
$mod_strings['LBL_BILLING_ADDRESS'] = 'Dirección de Facturación';
$mod_strings['LBL_SHIPPING_ADDRESS'] = 'Dirección de Envío';
$mod_strings['LBL_PRIMARY_ADDRESS'] = 'Dirección Primaria';
$mod_strings['LBL_ALTERNATIVE_ADDRESS'] = 'Dirección Alternativa';
$mod_strings['LBL_ADDRESS_FLEX_RELATE'] = 'Flex Relate';
$mod_strings['LBL_ADDRESS_ADDRESS'] = 'Address (Simple, Users)';
$mod_strings['LBL_ADDRESS_CUSTOM'] = 'Custom (Custom Controller Logic)';
$mod_strings['LBL_ENABLED'] = 'Habilitada';
$mod_strings['LBL_DISABLED'] = 'Deshabilitada';
$mod_strings['LBL_DEFAULT'] = 'Por Defecto:';
$mod_strings['LBL_CONFIG_DEFAULT'] = 'Por Defecto:';

$mod_strings['LBL_CONFIG_VALID_GEOCODE_MODULES'] = 'Módulos Geocodificar válidos:';
$mod_strings['LBL_CONFIG_VALID_GEOCODE_TABLES'] = 'Tablas Geocodificar válidos:';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_SETTINGS_TITLE'] = "Configuración de tipo de Dirección: Esto define los tipos de direcciones en los módulos que se desean utilizar como dirección a geocodificar. Valores aceptables: 'billing'; 'shipping'; 'primary'; 'alt'; 'flex_relate'";
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR'] = 'Address Type for ';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_ACCOUNTS'] = 'Tipos de direcciones para Cuentas:';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_CONTACTS'] = 'Tipos de direcciones para Contacts:';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_LEADS'] = 'Tipos de direcciones para Clientes Potenciales:';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_OPPORTUNITIES'] = 'Tipos de direcciones para Oportunidades:';
$mod_strings['LBL_CONFIG_OF_RELATED_ACCOUNT'] = '(de Cuenta Relacionada)';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_CASES'] = 'Tipos de direcciones para Casos:';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_PROJECTS'] = 'Tipos de direcciones para Proyectos:';
$mod_strings['LBL_CONFIG_OF_RELATED_ACCOUNT_OPPORTUNITY'] = '(de la Cuenta/Oportunidad relacionada)';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_MEETINGS'] = 'Tipos de direcciones para Reuniones:';
$mod_strings['LBL_CONFIG_ADDRESS_TYPE_FOR_PROSPECTS'] = 'Tipos de direcciones para Prospectos/Público Objetivo:';
$mod_strings['LBL_CONFIG_RELATED_OBJECT_THRU_FLEX_RELATE'] = 'Objetos relacionados a través de campo de relación flexible';

$mod_strings['LBL_CONFIG_MARKER_GROUP_FIELD_SETTINGS_TITLE'] = "Seteo de Marcador de Campo de Agrupamiento: Este define el 'campo' a ser uytilizado como parámetro de grupo cuando se muestran marcadores en un mapa. Ejemplos: assigned_user_name, industry, status, sales_stage, priority";
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR'] = 'Group Field for ';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_ACCOUNTS'] = 'Campo de Agrupamiento para Cuentas:';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_CONTACTS'] = 'Campo de Agrupamiento para Contactos:';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_LEADS'] = 'Campo de Agrupamiento para Clientes Potenciales:';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_OPPORTUNITIES'] = 'Campo de Agrupamiento para Oportunidades:';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_CASES'] = 'Campo de Agrupamiento para Casos:';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_PROJECTS'] = 'Campo de Agrupamiento para para Proyectos:';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_MEETINGS'] = 'Campo de Agrupamiento para Reuniones:';
$mod_strings['LBL_CONFIG_GROUP_FIELD_FOR_PROSPECTS'] = 'Campo de Agrupamiento para Prospectos/Público Objetivo:';

$mod_strings['LBL_CONFIG_GEOCODING_SETTINGS_TITLE'] = 'Configuración de Geocodificación de Google:';
$mod_strings['LBL_CONFIG_GEOCODING_API_URL_TITLE'] = 'URL Geocodificación API:';
$mod_strings['LBL_CONFIG_GEOCODING_API_URL_DESC'] = 'La URL de Google Maps API V3 o Proxy';
$mod_strings['LBL_CONFIG_GEOCODING_API_SECRET_TITLE'] = 'Frase secreta para Proxy:';
$mod_strings['LBL_CONFIG_GEOCODING_API_SECRET_DESC'] = 'La frase secreta para ser utilizado con la comparación MD5 Proxy.';
$mod_strings['LBL_CONFIG_GEOCODING_LIMIT_TITLE'] = 'Límite de Geocodificación:';
$mod_strings['LBL_CONFIG_GEOCODING_LIMIT_DESC'] = "'geocoding_limit' establece el límite de consultas cuando se seleccionan registros para geocodificar.";
$mod_strings['LBL_CONFIG_GOOGLE_GEOCODING_LIMIT_TITLE'] = 'Límite de Geocodificación de Google:';
$mod_strings['LBL_CONFIG_GOOGLE_GEOCODING_LIMIT_DESC'] = "'google_geocoding_limit' establece el límite de solicitudes cuando se usann las APIs de Google Maps API.";
$mod_strings['LBL_CONFIG_EXPORT_ADDRESSES_LIMIT_TITLE'] = 'Exporta el límite de Direcciones:';
$mod_strings['LBL_CONFIG_EXPORT_ADDRESSES_LIMIT_DESC'] = "'export_addresses_limit' establece el limite de consultas cuando se selecciones registros para exportar.";
$mod_strings['LBL_CONFIG_ALLOW_APPROXIMATE_LOCATION_TYPE_TITLE'] = "Permitir a 'APPROXIMATE' Ubicación Tipos:";
$mod_strings['LBL_CONFIG_ALLOW_APPROXIMATE_LOCATION_TYPE_DESC'] = "'allow_approximate_location_type' - permite que los tipos de ubicación de 'APPROXIMATE' a tener en cuenta los resultados de geocodificación 'OK'.";

$mod_strings['LBL_CONFIG_ADDRESS_CACHE_SETTINGS_TITLE'] = 'Seteos de Caché de Direcciones:';
$mod_strings['LBL_CONFIG_ADDRESS_CACHE_GET_ENABLED_TITLE'] = 'Habilita el Cache de Direcciones (Get):';
$mod_strings['LBL_CONFIG_ADDRESS_CACHE_GET_ENABLED_DESC'] = "'address_cache_get_enabled' permite al módulo de caché de direcciones recuperar datos de la tabla de caché.";
$mod_strings['LBL_CONFIG_ADDRESS_CACHE_SAVE_ENABLED_TITLE'] = 'Habilita El guardado del Caché de Direcciones (Save):';
$mod_strings['LBL_CONFIG_ADDRESS_CACHE_SAVE_ENABLED_DESC'] = "'address_cache_save_enabled' permite que el módulo de caché de direcciones guarde datos en la tabla de caché.";

$mod_strings['LBL_CONFIG_LOGIC_HOOKS_SETTINGS_TITLE'] = 'Configuración de Logic Hooks:';
$mod_strings['LBL_CONFIG_LOGIC_HOOKS_ENABLED_TITLE'] = 'Habilita todos los Logic Hooks: ';
$mod_strings['LBL_CONFIG_LOGIC_HOOKS_ENABLED_DESC'] = "'logic_hooks_enabled' permite que los logic hooks actualicen automáticamente basado en los objetos relacionados. Se recomienda deshabilitar cuando se actualiza SugarCRM.";

$mod_strings['LBL_CONFIG_MARKER_MAPPING_SETTINGS_TITLE'] = 'Configuración de Marcadores/Mapas:';
$mod_strings['LBL_CONFIG_MAP_MARKERS_LIMIT_TITLE'] = "Límite de Marcadores de Mapa:";
$mod_strings['LBL_CONFIG_MAP_MARKERS_LIMIT_DESC'] = "'map_markers_limit' establece el límite de consulta cuando se seleccionan registros para mostrar en un mapa.";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_CENTER_LATITUDE_TITLE'] = "Latitud Central por defecto en los Mapas:";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_CENTER_LATITUDE_DESC'] = "'map_default_center_latitude' establece la latitud central por defecto para los mapas.";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_CENTER_LONGITUDE_TITLE'] = "Longitud Central por defecto en los Mapas:";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_CENTER_LONGITUDE_DESC'] = "'map_default_center_longitude' establece la longitud central por defecto para los for mapas.";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_UNIT_TYPE_TITLE'] = "Tipo de Unidad por defecto en los Mapas:";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_UNIT_TYPE_DESC'] = "'map_default_unit_type' establece el tipo de unidad de medida por defecto para los calculos. Valores: 'mi' (millas) or 'km' (kilometros).";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_DISTANCE_TITLE'] = "Distancia por defecto en los Mapas:";
$mod_strings['LBL_CONFIG_MAP_DEFAULT_DISTANCE_DESC'] = "'map_default_distance' establece la unidad de meddida por defecto utilizada para las distancias.";
$mod_strings['LBL_CONFIG_MAP_DUPLICATE_MARKER_ADJUSTMENT_TITLE'] = "Ajuste de marca duplicada:";
$mod_strings['LBL_CONFIG_MAP_DUPLICATE_MARKER_ADJUSTMENT_DESC'] = "'map_duplicate_marker_adjustment' establece un ajuste de offset para ser agregado a la longitud y latitud en caso de posición de marcador duplicada.";
$mod_strings['LBL_CONFIG_MAP_CLUSTER_GRID_SIZE_TITLE'] = "Tamaño de Grilla de Marcadores de Clusters:";
$mod_strings['LBL_CONFIG_MAP_CLUSTER_GRID_SIZE_DESC'] = "'map_clusterer_grid_size' es usado para establecer el tamaño de la grilla para calcular los clusters de mapas.";
$mod_strings['LBL_CONFIG_MAP_MARKERS_CLUSTERER_MAX_ZOOM_TITLE'] = "Zoom máximo de Markers Clusters:";
$mod_strings['LBL_CONFIG_MAP_MARKERS_CLUSTERER_MAX_ZOOM_DESC'] = "'map_clusterer_max_zoom' es usado para establecer el nivel máximo de zoom  al cual el clusterizado no se aplica.";
$mod_strings['LBL_CONFIG_CUSTOM_CONTROLLER_DESC'] = "Nota Importante: Todas las configuraciones guardadas pueden ser encontradas en la tabla 'config' bao la categoría 'jjwg'. Nota: la utilización del archivo 'controller.php' personalizado para ignorar las configuraciones, queda obsoleto a partir de ahora.";
$mod_strings['LBL_CONFIG_MAP_ADSENSE_REMOVAL_KEY_TITLE'] = 'Clave Removal Mapa AdSense:';
$mod_strings['LBL_CONFIG_MAP_ADSENSE_REMOVAL_KEY_DESC'] = 'Donar a este proyecto! Entonces póngase en contacto JJWDesign.com para una clave de eliminación de AdSense.';


text:
type: post
category: fe
---
# cloudflare worker 增加 CSP

```javascript
addEventListener('fetch', event => {

  event.respondWith(fetch(event.request)
      .then(function(response){
            response = new Response(response.body, response);
            // Set content-security-policy header to self and also include
            // cloudflare workers dashboard to make it easy to preview
            response.headers.set("content-security-policy",
               "frame-ancestors 'self' https://dash.cloudflare.com;");

            return response;
        }

      ));

});
```


text:
using System;
using agsXMPP.protocol.client;

namespace agsXMPP.protocol.extensions.bytestreams
{
    /// <summary>
    /// a Bytestream IQ
    /// </summary>
    public class ByteStreamIq : IQ
    {
        private ByteStream m_ByteStream = new ByteStream();

        public ByteStreamIq()
        {
            base.Query = m_ByteStream;
            this.GenerateId();
        }

        public ByteStreamIq(IqType type) : this()
        {
            this.Type = type;
        }

        public ByteStreamIq(IqType type, Jid to)
            : this(type)
        {
            this.To = to;
        }

        public ByteStreamIq(IqType type, Jid to, Jid from)
            : this(type, to)
        {
            this.From = from;
        }

        public ByteStreamIq(IqType type, Jid to, Jid from, string Id)
            : this(type, to, from)
        {
            this.Id = Id;
        }

        public new ByteStream Query
        {
            get
            {
                return m_ByteStream;
            }
        }
    }
}


text:
require 'spec_helper'

describe 'jenkins-hardening::proxy' do

  # converge
  cached(:chef_run) do
    ChefSpec::SoloRunner.new do |node|
      node.automatic['root_group'] = 'root'
    end.converge(described_recipe)
  end

  before do
    stub_command('which nginx').and_return(true)
    stub_data_bag_item('jenkins', 'ssl').and_return(
      id: 'ssl',
      server: {
        key: '-----BEGIN RSA PRIVATE KEY-----\nSERVERaabbcc=\n-----END RSA PRIVATE KEY-----\n',
        cert: '-----BEGIN CERTIFICATE-----\nSERVERaabbcc=\n-----END CERTIFICATE-----\n',
        cacert: '-----BEGIN CERTIFICATE-----\nSERVERaabbcc==\n-----END CERTIFICATE-----\n'
      },
      client: {
        key: '-----BEGIN RSA PRIVATE KEY-----\nCLIENTaabbcc=\n-----END RSA PRIVATE KEY-----\n',
        cert: '-----BEGIN CERTIFICATE-----\nCLIENTaabbcc==\n-----END CERTIFICATE-----\n'
      })
  end

  it 'includes nginx recipe' do
    expect(chef_run).to include_recipe('nginx::default')
  end

  it 'creates the jenkins cert with the correct attributes' do
    expect(chef_run).to create_file('/etc/nginx/conf.d/jenkins.cert').with(
        owner: 'root',
        group: 'root',
        mode:  '0644'
    )
  end

  it 'the jenkins cert has the correct content' do
    expect(chef_run).to render_file('/etc/nginx/conf.d/jenkins.cert')
      .with_content(/BEGIN CERTIFICATE-----\\nCLIENT/)
  end

  it 'creates the jenkins key with the correct attributes' do
    expect(chef_run).to create_file('/etc/nginx/conf.d/jenkins.key').with(
        owner: 'root',
        group: 'root',
        mode:  '0600'
    )
  end

  it 'the jenkins key has the correct content' do
    expect(chef_run).to render_file('/etc/nginx/conf.d/jenkins.key')
      .with_content(/BEGIN RSA PRIVATE KEY-----\\nCLIENT/)
  end

  it 'creates the jenkins site template with the correct attributes' do
    expect(chef_run).to create_template('/etc/nginx/conf.d/jenkins.conf').with(
        owner: 'root',
        group: 'root',
        mode:  '0644'
    )
  end

  it 'the jenkins site template has the correct content' do
    expect(chef_run).to render_file('/etc/nginx/conf.d/jenkins.conf')
      .with_content(/ssl_prefer_server_ciphers/)
  end
end


text:
package org.apache.gobblin.publisher;

import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.util.Collection;

import org.apache.gobblin.configuration.ConfigurationKeys;
import org.apache.gobblin.configuration.State;
import org.apache.gobblin.configuration.WorkUnitState;

/**
 * Defines how to publish data and its corresponding metadata. Can be used for either task level or job level publishing.
 */
public abstract class DataPublisher implements Closeable {

  protected final State state;

  public DataPublisher(State state) {
    this.state = state;
  }

  /**
   * @deprecated {@link DataPublisher} initialization should be done in the constructor.
   */
  @Deprecated
  public abstract void initialize()
      throws IOException;

  /**
   * Publish the data for the given tasks.
   */
  public abstract void publishData(Collection<? extends WorkUnitState> states)
      throws IOException;

  /**
   * Publish the metadata (e.g., schema) for the given tasks. Checkpoints should not be published as part of metadata.
   * They are published by Gobblin runtime after the metadata and data are published.
   */
  public abstract void publishMetadata(Collection<? extends WorkUnitState> states)
      throws IOException;

  /**
   * First publish the metadata via {@link DataPublisher#publishMetadata(Collection)}, and then publish the output data
   * via the {@link DataPublisher#publishData(Collection)} method.
   *
   * @param states is a {@link Collection} of {@link WorkUnitState}s.
   * @throws IOException if there is a problem with publishing the metadata or the data.
   */
  public void publish(Collection<? extends WorkUnitState> states)
      throws IOException {
    if (shouldPublishMetadataFirst()) {
      publishMetadata(states);
      publishData(states);
    } else {
      publishData(states);
      publishMetadata(states);
    }
  }

  public State getState() {
    return this.state;
  }

  /**
   * Get an instance of {@link DataPublisher}.
   *
   * @param dataPublisherClass A concrete class that extends {@link DataPublisher}.
   * @param state A {@link State} used to instantiate the {@link DataPublisher}.
   * @return A {@link DataPublisher} instance.
   */
  public static DataPublisher getInstance(Class<? extends DataPublisher> dataPublisherClass, State state)
      throws ReflectiveOperationException {
    Constructor<? extends DataPublisher> dataPublisherConstructor = dataPublisherClass.getConstructor(State.class);
    return dataPublisherConstructor.newInstance(state);
  }

  /**
   * Returns true if the implementation of {@link DataPublisher} is thread-safe.
   *
   *

   *   For a thread-safe {@link DataPublisher}, this method should return this.getClass() == <class>.class
   *   to ensure that any extensions must explicitly be marked as thread safe.
   *

   */
  public boolean isThreadSafe() {
    return this.getClass() == DataPublisher.class;
  }

  /**
   * Return true if the current publisher can be skipped.
   *
   *

   *   For a publisher that can be skipped, it should not have any effect on state persistence. It will be skipped when
   *   a job is cancelled, and all finished tasks are configured to be committed.
   *

   */
  public boolean canBeSkipped() {
    return this.state.getPropAsBoolean(ConfigurationKeys.DATA_PUBLISHER_CAN_BE_SKIPPED,
        ConfigurationKeys.DEFAULT_DATA_PUBLISHER_CAN_BE_SKIPPED);
  }

  /**
   * Generally metadata should be published before the data it represents, but this allows subclasses to override
   * if they are dependent on data getting published first.
   */
  protected boolean shouldPublishMetadataFirst() {
    return true;
  }
}


text:
SYNONYM

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

#### Published in
Himalayan Botanical Researches (New Delhi) 152 (1991)

#### Original name
Helotium immarginatum P. Karst., 1871

### Remarks
null


text:
package uima.ae.qa

import org.apache.uima.cas.FSIterator
import org.apache.uima.jcas.JCas
import org.apache.uima.jcas.cas.FSArray
import uima.modules.common.MultiLingualDocumentAnnotator
import us.feliscat.text.StringOption
import us.feliscat.time.TimeTmp
import us.feliscat.types._
import us.feliscat.util.uima.fsList.FSListUtils
import us.feliscat.util.uima.seq2fs._
import us.feliscat.util.uima.{FeatureStructure, JCasID, JCasUtils}

/**
  * <pre>
  * Created on 2017/02/05.
  * </pre>
  *
  * @author K.Sakamoto
  */
trait MultiLingualQuestionAnalyzer extends MultiLingualDocumentAnnotator {
  protected def extractTime(sentenceList: Seq[Sentence]): TimeTmp
  protected def extractGeography(sentenceList: Seq[Sentence]): (Seq[String], Seq[String])
  protected def analyzeQuestionFocus(sentenceSet: Seq[Sentence]): Seq[String]
  protected def generateQuery(aJCas: JCas, question: Question)(implicit id: JCasID): Seq[Query]

  def processQuestion(aView: JCas, question: Question)(implicit id: JCasID): Unit = {
    println("- ".concat(question.getLabel))
    val document: Document = question.getDocument
    if (StringOption(document.getText).nonEmpty) {

      annotate(aView, document, Nil)
      document.setTitle(question.getLabel)

      question.setDocument(document)

      val sentenceList: Seq[Sentence] = document.getSentenceSet.toSeq.asInstanceOf[Seq[Sentence]]

      //文脈的な時間解析
      val sentenceArray: Array[Sentence] = sentenceList.toArray
      for (j <- 1 until sentenceArray.length) {
        val sentence: Sentence = sentenceArray(j)
        if (Option(sentence.getBeginTime).isEmpty && Option(sentence.getEndTime).isEmpty) {
          val previousSentence: Sentence = sentenceArray(j - 1)
          sentence.setBeginTime(previousSentence.getBeginTime)
          sentence.setEndTime(previousSentence.getEndTime)
        }
      }

      //begin {time limit analysis}
      val timeLimit: TimeTmp = extractTime(sentenceList)
      timeLimit.beginTime match {
        case Some(beginTime) =>
          val beginTimeLimit = FeatureStructure.create[Time]
          beginTimeLimit.setYear(beginTime)
          beginTimeLimit.setTextList(timeLimit.beginTimeTextList.toStringList)
          question.setBeginTimeLimit(beginTimeLimit)
        case None =>
        // Do nothing
      }

      timeLimit.endTime match {
        case Some(endTime) =>
          val endTimeLimit = FeatureStructure.create[Time]
          endTimeLimit.setYear(endTime)
          endTimeLimit.setTextList(timeLimit.endTimeTextList.toStringList)
          question.setEndTimeLimit(endTimeLimit)
        case None =>
        // Do nothing
      }
      //end {time limit analysis}

      //begin {geography limit}
      val (areaList, termList): (Seq[String], Seq[String]) = extractGeography(sentenceList)
      val geographyLimit = FeatureStructure.create[Geography]
      geographyLimit.setTermList(termList.toStringList)
      geographyLimit.setArea(areaList.toStringList)
      question.setGeographyLimit(geographyLimit)
      //end {geography limit}

      //begin {question focus}
      question.setQuestionFocusSet(analyzeQuestionFocus(sentenceList).toStringList)
      //end {question focus}

      //begin {question format type}
      question.setQuestionFormatType(
        if (question.getKeywordSet.toSeq.nonEmpty) {
          "essayWithKeywords"
        } else {
          "essayWithoutKeyword"
        }
      )
      //end {question format type}

      //begin {answer format type}
      question.setAnswerFormatType("essay")
      //end {answer format type}

      //begin {lexical answer type}
      //question.setLexicalAnswerTypeSet(document.getContentWordList)
      //end {lexical answer type}

      //begin {semantic answer type}
      //question.setSemanticAnswerTypeSet(document.getContentWordList)
      //end {semantic answer type}

      //begin {query}
      question.setQuerySet(generateQuery(aView, question).toFSArray)
      //end {query}
    }
  }

  def process(aJCas: JCas)(implicit id: JCasID): Unit = {
    println(s">> ${locale.getDisplayLanguage} Question Analyzer Processing")
    val aView: JCas = aJCas.getView(localeId)
    JCasUtils.setAJCas(aView)

    @SuppressWarnings(Array[String]("rawtypes"))
    val itExam: FSIterator[Nothing] = aView.getAnnotationIndex(Exam.`type`).iterator(true)
    while (itExam.hasNext) {
      val exam: Exam = itExam.next
      print(
        s"""Dataset:"
           |* ${exam.getLabel}
           |Question:
           |""".stripMargin)
      val questionSet: FSArray = exam.getQuestionSet
      for (i <- 0 until questionSet.size) {
        val question: Question = questionSet.get(i).asInstanceOf[Question]
        processQuestion(aView, question)
      }
    }
  }
}


text:
package com.microsoft.azure.management.devtestlab;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Defines values for CustomImageOsType.
 */
public final class CustomImageOsType {
    /** Static value Windows for CustomImageOsType. */
    public static final CustomImageOsType WINDOWS = new CustomImageOsType("Windows");

    /** Static value Linux for CustomImageOsType. */
    public static final CustomImageOsType LINUX = new CustomImageOsType("Linux");

    /** Static value None for CustomImageOsType. */
    public static final CustomImageOsType NONE = new CustomImageOsType("None");

    private String value;

    /**
     * Creates a custom value for CustomImageOsType.
     * @param value the custom value
     */
    public CustomImageOsType(String value) {
        this.value = value;
    }

    @JsonValue
    @Override
    public String toString() {
        return value;
    }

    @Override
    public int hashCode() {
        return value.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof CustomImageOsType)) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        CustomImageOsType rhs = (CustomImageOsType) obj;
        if (value == null) {
            return rhs.value == null;
        } else {
            return value.equals(rhs.value);
        }
    }
}


text:
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Collections.Generic;
using System.Linq.Expressions;
using NControlDemo.Classes;
using NControlDemo.FormsApp.Providers;
using NControlDemo.Helpers;

namespace NControlDemo.FormsApp.ViewModels
{
	/// <summary>
	/// Base view model.
	/// </summary>
	public abstract class BaseViewModel : BaseNotifyPropertyChangedObject
	{
		#region Private Members

		/// <summary>
		/// The busy count.
		/// </summary>
		private int _busyCount = 0;

		/// <summary>
		/// The view model storage.
		/// </summary>
		private readonly ViewModelStorageProvider _viewModelStorage =
			new ViewModelStorageProvider();

		/// <summary>
		/// Command dependencies - key == property, value = list of commands
		/// </summary>
		private readonly Dictionary<string, List<Command>> _commandDependencies =
			new Dictionary<string, List<Command>>();

		/// <summary>
		/// Command dependencies - key == property, value = list of property names
		/// </summary>
		private readonly Dictionary<string, List<Expression<Func<object>>>> _propertyDependencies =
			new Dictionary<string, List<Expression<Func<object>>>>();

		/// <summary>
		/// Command cache
		/// </summary>
		private readonly Dictionary<string, Command> _commands = new Dictionary<string, Command> ();

        /// <summary>
        /// The notify change for same values.
        /// </summary>
        private readonly List<string> _notifyChangeForSameValues = new List<string>();

        /// <summary>
        /// The property change listeners.
        /// </summary>
        private readonly List<PropertyChangeListener> _propertyChangeListeners = new List<PropertyChangeListener>();

		#endregion

		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="CF.Xamarin.Forms.Mvvm.ViewModels.BaseViewModel"/> class.
		/// </summary>
		/// <param name="viewModelStorage">View model storage.</param>
		public BaseViewModel()
		{
			// Property dependencies
			AddPropertyDependency<BaseViewModel> (() => IsBusyText, () => IsBusyTextVisible);

		}

		#endregion

		#region Protected Members

		/// <summary>
		/// Sets a value in viewmodel storage and raises property changed if value has changed
		/// </summary>
		/// <param name="name">Name.</param>
		/// <param name="value">Value.</param>
		/// <typeparam name="TValueType">The 1st type parameter.</typeparam>
		protected bool SetValue<TValueType>(Expression<Func<object>> property, TValueType value)
		{
			var existingValue = GetValue<TValueType>(property);
            var propertyName = PropertyNameHelper.GetPropertyName<BaseViewModel>(property);

			// Check for equality
            if (!_notifyChangeForSameValues.Contains(propertyName) &&
                EqualityComparer<TValueType>.Default.Equals (existingValue, value))
				return false;

			_viewModelStorage.SetObjectForKey<TValueType> (propertyName, value);

			RaisePropertyChangedEvent (property);

			// Dependent properties?
			if (_propertyDependencies.ContainsKey (propertyName)) {
				foreach (var dependentProperty in _propertyDependencies[propertyName])
					RaisePropertyChangedEvent (dependentProperty);
			}

			// Dependent commands
			if (_commandDependencies.ContainsKey (propertyName)) {
				foreach (var dependentCommand in _commandDependencies[propertyName])
					RaiseCommandStateChangedEvent (dependentCommand);
			}

			return true;
		}

		/// <summary>
		/// Returns a value from the viewmodel storage
		/// </summary>
		/// <returns>The value.</returns>
		/// <param name="name">Name.</param>
		/// <typeparam name="TValueType">The 1st type parameter.</typeparam>
		protected TValueType GetValue<TValueType>(Expression<Func<object>> property)
		{
			return GetValue<TValueType> (property, default(TValueType));
		}

		/// Returns a value from the viewmodel storage
		/// </summary>
		/// <returns>The value.</returns>
		/// <param name="name">Name.</param>
		/// <typeparam name="TValueType">The 1st type parameter.</typeparam>
		protected TValueType GetValue<TValueType>(Expression<Func<object>> property, TValueType defaultValue)
		{
			var propertyName = PropertyNameHelper.GetPropertyName<BaseViewModel> (property);
			return _viewModelStorage.GetObjectForKey<TValueType> (propertyName, defaultValue);
		}

		/// <summary>
		/// Adds a dependency between a command and a property. Whenever the property changes, the command's
		/// state will be updated
		/// </summary>
		/// <param name="property">Source Property.</param>
		/// <param name="command">Target Command.</param>
		protected void AddCommandDependency<TViewModel>(Expression<Func<object>> property, Command command)
		{
			var propertyName = PropertyNameHelper.GetPropertyName <TViewModel>(property);
			if (!_commandDependencies.ContainsKey (propertyName))
				_commandDependencies.Add (propertyName, new List<Command> ());

			var list = _commandDependencies [propertyName];
			list.Add (command);
		}

		/// <summary>
		/// Adds a dependency between a property and another property. Whenever the property changes, the command's
		/// state will be updated
		/// </summary>
		/// <param name="property">Source property.</param>
		/// <param name="dependantProperty">Target property.</param>
		protected void AddPropertyDependency<TViewModel>(Expression<Func<object>> property,
			Expression<Func<object>> dependantProperty)
		{
			var propertyName = PropertyNameHelper.GetPropertyName <TViewModel>(property);
			if (!_propertyDependencies.ContainsKey (propertyName))
				_propertyDependencies.Add (propertyName, new List<Expression<Func<object>>> ());

			var list = _propertyDependencies [propertyName];
			list.Add (dependantProperty);
		}

        /// <summary>
        /// Adds the raise notify changed for property when value is the same.
        /// </summary>
        /// <param name="property">Property.</param>
        /// <param name="dependantProperty">Dependant property.</param>
        /// <typeparam name="TViewModel">The 1st type parameter.</typeparam>
        protected void AddRaiseNotifyChangedForPropertyWhenValueIsTheSame<TViewModel>(Expression<Func<object>> property)
        {
            var propertyName = PropertyNameHelper.GetPropertyName <TViewModel>(property);
            _notifyChangeForSameValues.Add(propertyName);
        }

		/// <summary>
		/// Raises the command state changed event.
		/// </summary>
		/// <param name="command">Command.</param>
		protected void RaiseCommandStateChangedEvent(Command command)
		{
			command.ChangeCanExecute ();
		}

		/// <summary>
		/// Creates or returns the
		/// </summary>
		/// <returns>The command.</returns>
		/// <param name="action">Action.</param>
		/// <param name="state">State.</param>
		protected Command GetOrCreateCommand<TViewModel>(Expression<Func<object>> commandProperty,
			Command command)
		{
			var commandName = PropertyNameHelper.GetPropertyName<TViewModel> (commandProperty);
			if (!_commands.ContainsKey (commandName))
				_commands.Add (commandName, command);

			return _commands [commandName];
		}

		/// <summary>
		/// Creates or returns the
		/// </summary>
		/// <returns>The command.</returns>
		/// <param name="action">Action.</param>
		/// <param name="state">State.</param>
		protected Command<T> GetOrCreateCommand<TViewModel, T>(Expression<Func<object>> commandProperty,
			Command<T> command)
		{
			var commandName = PropertyNameHelper.GetPropertyName<TViewModel> (commandProperty);
			if (!_commands.ContainsKey (commandName))
				_commands.Add (commandName, command);

			return _commands [commandName] as Command<T>;
		}

        /// <summary>
        /// Listens for property change.
        /// </summary>
        /// <param name="property">Property.</param>
        /// <typeparam name="TViewModel">The 1st type parameter.</typeparam>
        protected void ListenForPropertyChange<TObject>(Expression<Func<TObject, object>> property, TObject obj, Action callback)
        {
            var changeListener = new PropertyChangeListener();
            changeListener.Listen<TObject>(property, obj, callback);
            _propertyChangeListeners.Add(changeListener);
        }

		#endregion

		#region ViewModel LifeCycle

		/// <summary>
		/// Initializes the viewmodel
		/// </summary>
		public virtual Task InitializeAsync()
		{
			return Task.FromResult (true);
		}

		/// <summary>
		/// Override to implement logic when the view has been set up on screen
		/// </summary>
		public virtual async Task OnAppearingAsync()
		{
		   // Call initialize
            await InitializeAsync ();

		}

		/// <summary>
		/// Called whenever the view is hidden
		/// </summary>
		public virtual Task OnDisappearingAsync()
		{
			return Task.FromResult (true);
		}

		#endregion

		#region Properties

		/// <summary>
		/// Returns the view title
		/// </summary>
		/// <value>The view title.</value>
		public virtual string Title { get { return string.Empty; } }

        /// <summary>
        /// Gets the back button command.
        /// </summary>
        /// <value>The back button command.</value>
        public virtual Command BackButtonCommand { get { return null; } }

		/// <summary>
		/// Gets or sets a value indicating whether this instance is busy.
		/// </summary>
		/// <value><c>true</c> if this instance is busy; otherwise, <c>false</c>.</value>
		public bool IsBusy {
			get{
				return _busyCount > 0;
			}
			set{
				if (value)
					_busyCount=1;
				else
					_busyCount=0;

				RaisePropertyChangedEvent (() => IsBusy);
			}
		}

		/// <summary>
		/// Gets or sets a value indicating whether this instance is busy.
		/// </summary>
		/// <value><c>true</c> if this instance is busy; otherwise, <c>false</c>.</value>
		public string IsBusyText
		{
			get{ return GetValue<string>(() => IsBusyText); }
			set{ SetValue<string> (() => IsBusyText, value); }
		}

		/// <summary>
		/// Gets or sets a value indicating whether this instance is busy.
		/// </summary>
		/// <value><c>true</c> if this instance is busy; otherwise, <c>false</c>.</value>
		public bool IsBusyTextVisible {
			get { return !String.IsNullOrEmpty (IsBusyText); }
		}

		#endregion

	}
}


text:
{-# LANGUAGE GADTs #-}

module Opt where
import Control.Arrow
import Control.Category
import Prelude hiding (id, (.))

data Opt arr a b where
  Lift  :: arr a b -> Opt arr a b
  First :: Opt arr a b -> Opt arr (a,c) (b,c)

runOpt :: Arrow arr => Opt arr a b -> arr a b
runOpt (Lift f) = f
runOpt (First f) = first (runOpt f)

instance Arrow arr => Category (Opt arr) where
  id = Lift id
  First f . First g = First (f . g)
  f . g = Lift (runOpt f . runOpt g)

instance Arrow arr => Arrow (Opt arr) where
  arr = Lift . arr

  first = First