text:
package azgo

import (
	"encoding/xml"
	"reflect"

	log "github.com/sirupsen/logrus"
)

// LunInfoType is a structure to represent a lun-info ZAPI object
type LunInfoType struct {
	XMLName                      xml.Name       `xml:"lun-info"`
	AlignmentPtr                 *string        `xml:"alignment"`
	ApplicationPtr               *string        `xml:"application"`
	ApplicationUuidPtr           *string        `xml:"application-uuid"`
	BackingSnapshotPtr           *string        `xml:"backing-snapshot"`
	BlockSizePtr                 *int           `xml:"block-size"`
	CachingPolicyPtr             *string        `xml:"caching-policy"`
	ClassPtr                     *string        `xml:"class"`
	CloneBackingSnapshotPtr      *string        `xml:"clone-backing-snapshot"`
	CommentPtr                   *string        `xml:"comment"`
	CreationTimestampPtr         *int           `xml:"creation-timestamp"`
	DeviceBinaryIdPtr            *string        `xml:"device-binary-id"`
	DeviceIdPtr                  *int           `xml:"device-id"`
	DeviceTextIdPtr              *string        `xml:"device-text-id"`
	IsClonePtr                   *bool          `xml:"is-clone"`
	IsCloneAutodeleteEnabledPtr  *bool          `xml:"is-clone-autodelete-enabled"`
	IsInconsistentImportPtr      *bool          `xml:"is-inconsistent-import"`
	IsRestoreInaccessiblePtr     *bool          `xml:"is-restore-inaccessible"`
	IsSpaceAllocEnabledPtr       *bool          `xml:"is-space-alloc-enabled"`
	IsSpaceReservationEnabledPtr *bool          `xml:"is-space-reservation-enabled"`
	MappedPtr                    *bool          `xml:"mapped"`
	MultiprotocolTypePtr         *LunOsTypeType `xml:"multiprotocol-type"`
	NodePtr                      *NodeNameType  `xml:"node"`
	OnlinePtr                    *bool          `xml:"online"`
	PathPtr                      *string        `xml:"path"`
	PrefixSizePtr                *int           `xml:"prefix-size"`
	QosAdaptivePolicyGroupPtr    *string        `xml:"qos-adaptive-policy-group"`
	QosPolicyGroupPtr            *string        `xml:"qos-policy-group"`
	QtreePtr                     *string        `xml:"qtree"`
	ReadOnlyPtr                  *bool          `xml:"read-only"`
	Serial7ModePtr               *string        `xml:"serial-7-mode"`
	SerialNumberPtr              *string        `xml:"serial-number"`
	ShareStatePtr                *string        `xml:"share-state"`
	SizePtr                      *int           `xml:"size"`
	SizeUsedPtr                  *int           `xml:"size-used"`
	StagingPtr                   *bool          `xml:"staging"`
	StatePtr                     *string        `xml:"state"`
	SuffixSizePtr                *int           `xml:"suffix-size"`
	UuidPtr                      *string        `xml:"uuid"`
	VolumePtr                    *string        `xml:"volume"`
	VserverPtr                   *string        `xml:"vserver"`
}

// NewLunInfoType is a factory method for creating new instances of LunInfoType objects
func NewLunInfoType() *LunInfoType {
	return &LunInfoType{}
}

// ToXML converts this object into an xml string representation
func (o *LunInfoType) ToXML() (string, error) {
	output, err := xml.MarshalIndent(o, " ", "    ")
	if err != nil {
		log.Errorf("error: %v", err)
	}
	return string(output), err
}

// String returns a string representation of this object's fields and implements the Stringer interface
func (o LunInfoType) String() string {
	return ToString(reflect.ValueOf(o))
}

// Alignment is a 'getter' method
func (o *LunInfoType) Alignment() string {
	r := *o.AlignmentPtr
	return r
}

// SetAlignment is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetAlignment(newValue string) *LunInfoType {
	o.AlignmentPtr = &newValue
	return o
}

// Application is a 'getter' method
func (o *LunInfoType) Application() string {
	r := *o.ApplicationPtr
	return r
}

// SetApplication is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetApplication(newValue string) *LunInfoType {
	o.ApplicationPtr = &newValue
	return o
}

// ApplicationUuid is a 'getter' method
func (o *LunInfoType) ApplicationUuid() string {
	r := *o.ApplicationUuidPtr
	return r
}

// SetApplicationUuid is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetApplicationUuid(newValue string) *LunInfoType {
	o.ApplicationUuidPtr = &newValue
	return o
}

// BackingSnapshot is a 'getter' method
func (o *LunInfoType) BackingSnapshot() string {
	r := *o.BackingSnapshotPtr
	return r
}

// SetBackingSnapshot is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetBackingSnapshot(newValue string) *LunInfoType {
	o.BackingSnapshotPtr = &newValue
	return o
}

// BlockSize is a 'getter' method
func (o *LunInfoType) BlockSize() int {
	r := *o.BlockSizePtr
	return r
}

// SetBlockSize is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetBlockSize(newValue int) *LunInfoType {
	o.BlockSizePtr = &newValue
	return o
}

// CachingPolicy is a 'getter' method
func (o *LunInfoType) CachingPolicy() string {
	r := *o.CachingPolicyPtr
	return r
}

// SetCachingPolicy is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetCachingPolicy(newValue string) *LunInfoType {
	o.CachingPolicyPtr = &newValue
	return o
}

// Class is a 'getter' method
func (o *LunInfoType) Class() string {
	r := *o.ClassPtr
	return r
}

// SetClass is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetClass(newValue string) *LunInfoType {
	o.ClassPtr = &newValue
	return o
}

// CloneBackingSnapshot is a 'getter' method
func (o *LunInfoType) CloneBackingSnapshot() string {
	r := *o.CloneBackingSnapshotPtr
	return r
}

// SetCloneBackingSnapshot is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetCloneBackingSnapshot(newValue string) *LunInfoType {
	o.CloneBackingSnapshotPtr = &newValue
	return o
}

// Comment is a 'getter' method
func (o *LunInfoType) Comment() string {
	r := *o.CommentPtr
	return r
}

// SetComment is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetComment(newValue string) *LunInfoType {
	o.CommentPtr = &newValue
	return o
}

// CreationTimestamp is a 'getter' method
func (o *LunInfoType) CreationTimestamp() int {
	r := *o.CreationTimestampPtr
	return r
}

// SetCreationTimestamp is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetCreationTimestamp(newValue int) *LunInfoType {
	o.CreationTimestampPtr = &newValue
	return o
}

// DeviceBinaryId is a 'getter' method
func (o *LunInfoType) DeviceBinaryId() string {
	r := *o.DeviceBinaryIdPtr
	return r
}

// SetDeviceBinaryId is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetDeviceBinaryId(newValue string) *LunInfoType {
	o.DeviceBinaryIdPtr = &newValue
	return o
}

// DeviceId is a 'getter' method
func (o *LunInfoType) DeviceId() int {
	r := *o.DeviceIdPtr
	return r
}

// SetDeviceId is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetDeviceId(newValue int) *LunInfoType {
	o.DeviceIdPtr = &newValue
	return o
}

// DeviceTextId is a 'getter' method
func (o *LunInfoType) DeviceTextId() string {
	r := *o.DeviceTextIdPtr
	return r
}

// SetDeviceTextId is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetDeviceTextId(newValue string) *LunInfoType {
	o.DeviceTextIdPtr = &newValue
	return o
}

// IsClone is a 'getter' method
func (o *LunInfoType) IsClone() bool {
	r := *o.IsClonePtr
	return r
}

// SetIsClone is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetIsClone(newValue bool) *LunInfoType {
	o.IsClonePtr = &newValue
	return o
}

// IsCloneAutodeleteEnabled is a 'getter' method
func (o *LunInfoType) IsCloneAutodeleteEnabled() bool {
	r := *o.IsCloneAutodeleteEnabledPtr
	return r
}

// SetIsCloneAutodeleteEnabled is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetIsCloneAutodeleteEnabled(newValue bool) *LunInfoType {
	o.IsCloneAutodeleteEnabledPtr = &newValue
	return o
}

// IsInconsistentImport is a 'getter' method
func (o *LunInfoType) IsInconsistentImport() bool {
	r := *o.IsInconsistentImportPtr
	return r
}

// SetIsInconsistentImport is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetIsInconsistentImport(newValue bool) *LunInfoType {
	o.IsInconsistentImportPtr = &newValue
	return o
}

// IsRestoreInaccessible is a 'getter' method
func (o *LunInfoType) IsRestoreInaccessible() bool {
	r := *o.IsRestoreInaccessiblePtr
	return r
}

// SetIsRestoreInaccessible is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetIsRestoreInaccessible(newValue bool) *LunInfoType {
	o.IsRestoreInaccessiblePtr = &newValue
	return o
}

// IsSpaceAllocEnabled is a 'getter' method
func (o *LunInfoType) IsSpaceAllocEnabled() bool {
	r := *o.IsSpaceAllocEnabledPtr
	return r
}

// SetIsSpaceAllocEnabled is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetIsSpaceAllocEnabled(newValue bool) *LunInfoType {
	o.IsSpaceAllocEnabledPtr = &newValue
	return o
}

// IsSpaceReservationEnabled is a 'getter' method
func (o *LunInfoType) IsSpaceReservationEnabled() bool {
	r := *o.IsSpaceReservationEnabledPtr
	return r
}

// SetIsSpaceReservationEnabled is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetIsSpaceReservationEnabled(newValue bool) *LunInfoType {
	o.IsSpaceReservationEnabledPtr = &newValue
	return o
}

// Mapped is a 'getter' method
func (o *LunInfoType) Mapped() bool {
	r := *o.MappedPtr
	return r
}

// SetMapped is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetMapped(newValue bool) *LunInfoType {
	o.MappedPtr = &newValue
	return o
}

// MultiprotocolType is a 'getter' method
func (o *LunInfoType) MultiprotocolType() LunOsTypeType {
	r := *o.MultiprotocolTypePtr
	return r
}

// SetMultiprotocolType is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetMultiprotocolType(newValue LunOsTypeType) *LunInfoType {
	o.MultiprotocolTypePtr = &newValue
	return o
}

// Node is a 'getter' method
func (o *LunInfoType) Node() NodeNameType {
	r := *o.NodePtr
	return r
}

// SetNode is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetNode(newValue NodeNameType) *LunInfoType {
	o.NodePtr = &newValue
	return o
}

// Online is a 'getter' method
func (o *LunInfoType) Online() bool {
	r := *o.OnlinePtr
	return r
}

// SetOnline is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetOnline(newValue bool) *LunInfoType {
	o.OnlinePtr = &newValue
	return o
}

// Path is a 'getter' method
func (o *LunInfoType) Path() string {
	r := *o.PathPtr
	return r
}

// SetPath is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetPath(newValue string) *LunInfoType {
	o.PathPtr = &newValue
	return o
}

// PrefixSize is a 'getter' method
func (o *LunInfoType) PrefixSize() int {
	r := *o.PrefixSizePtr
	return r
}

// SetPrefixSize is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetPrefixSize(newValue int) *LunInfoType {
	o.PrefixSizePtr = &newValue
	return o
}

// QosAdaptivePolicyGroup is a 'getter' method
func (o *LunInfoType) QosAdaptivePolicyGroup() string {
	r := *o.QosAdaptivePolicyGroupPtr
	return r
}

// SetQosAdaptivePolicyGroup is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetQosAdaptivePolicyGroup(newValue string) *LunInfoType {
	o.QosAdaptivePolicyGroupPtr = &newValue
	return o
}

// QosPolicyGroup is a 'getter' method
func (o *LunInfoType) QosPolicyGroup() string {
	r := *o.QosPolicyGroupPtr
	return r
}

// SetQosPolicyGroup is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetQosPolicyGroup(newValue string) *LunInfoType {
	o.QosPolicyGroupPtr = &newValue
	return o
}

// Qtree is a 'getter' method
func (o *LunInfoType) Qtree() string {
	r := *o.QtreePtr
	return r
}

// SetQtree is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetQtree(newValue string) *LunInfoType {
	o.QtreePtr = &newValue
	return o
}

// ReadOnly is a 'getter' method
func (o *LunInfoType) ReadOnly() bool {
	r := *o.ReadOnlyPtr
	return r
}

// SetReadOnly is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetReadOnly(newValue bool) *LunInfoType {
	o.ReadOnlyPtr = &newValue
	return o
}

// Serial7Mode is a 'getter' method
func (o *LunInfoType) Serial7Mode() string {
	r := *o.Serial7ModePtr
	return r
}

// SetSerial7Mode is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetSerial7Mode(newValue string) *LunInfoType {
	o.Serial7ModePtr = &newValue
	return o
}

// SerialNumber is a 'getter' method
func (o *LunInfoType) SerialNumber() string {
	r := *o.SerialNumberPtr
	return r
}

// SetSerialNumber is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetSerialNumber(newValue string) *LunInfoType {
	o.SerialNumberPtr = &newValue
	return o
}

// ShareState is a 'getter' method
func (o *LunInfoType) ShareState() string {
	r := *o.ShareStatePtr
	return r
}

// SetShareState is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetShareState(newValue string) *LunInfoType {
	o.ShareStatePtr = &newValue
	return o
}

// Size is a 'getter' method
func (o *LunInfoType) Size() int {
	r := *o.SizePtr
	return r
}

// SetSize is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetSize(newValue int) *LunInfoType {
	o.SizePtr = &newValue
	return o
}

// SizeUsed is a 'getter' method
func (o *LunInfoType) SizeUsed() int {
	r := *o.SizeUsedPtr
	return r
}

// SetSizeUsed is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetSizeUsed(newValue int) *LunInfoType {
	o.SizeUsedPtr = &newValue
	return o
}

// Staging is a 'getter' method
func (o *LunInfoType) Staging() bool {
	r := *o.StagingPtr
	return r
}

// SetStaging is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetStaging(newValue bool) *LunInfoType {
	o.StagingPtr = &newValue
	return o
}

// State is a 'getter' method
func (o *LunInfoType) State() string {
	r := *o.StatePtr
	return r
}

// SetState is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetState(newValue string) *LunInfoType {
	o.StatePtr = &newValue
	return o
}

// SuffixSize is a 'getter' method
func (o *LunInfoType) SuffixSize() int {
	r := *o.SuffixSizePtr
	return r
}

// SetSuffixSize is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetSuffixSize(newValue int) *LunInfoType {
	o.SuffixSizePtr = &newValue
	return o
}

// Uuid is a 'getter' method
func (o *LunInfoType) Uuid() string {
	r := *o.UuidPtr
	return r
}

// SetUuid is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetUuid(newValue string) *LunInfoType {
	o.UuidPtr = &newValue
	return o
}

// Volume is a 'getter' method
func (o *LunInfoType) Volume() string {
	r := *o.VolumePtr
	return r
}

// SetVolume is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetVolume(newValue string) *LunInfoType {
	o.VolumePtr = &newValue
	return o
}

// Vserver is a 'getter' method
func (o *LunInfoType) Vserver() string {
	r := *o.VserverPtr
	return r
}

// SetVserver is a fluent style 'setter' method that can be chained
func (o *LunInfoType) SetVserver(newValue string) *LunInfoType {
	o.VserverPtr = &newValue
	return o
}


text:
require "capistrano-rvm/capistrano_integration"
require "capistrano-rvm/version"

redpajama_set_name: RedPajamaGithub


text:
const webpack = require('webpack');

// Helpers
const clean = plugins => plugins.filter(x => !!x);

module.exports = (options = {}) => {
  const isProduction = !!options.production;

  return {
    output: {
      library: 'simpleReduxUtils',
      libraryTarget: 'umd',
    },
    module: {
      loaders: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loaders: [
            { loader: 'babel-loader' },
            {
              loader: 'eslint-loader',
              query: {
                configFile: '.eslintrc',
                failOnError: isProduction,
                failOnWarning: isProduction,
              },
            },
          ],
        },
      ],
    },
    plugins: clean([
      new webpack.optimize.OccurrenceOrderPlugin(),

      // Only for production
      isProduction && new webpack.optimize.UglifyJsPlugin({
        compress: {
          screw_ie8: true,
          warnings: false,
        },
        mangle: {
          screw_ie8: true,
        },
        output: {
          comments: false,
          screw_ie8: true,
        },
      }),
    ]),
  };
};


text:
package com.flat502.rox.server;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.flat502.rox.marshal.RpcCall;
import com.flat502.rox.marshal.RpcResponse;
import com.flat502.rox.marshal.xmlrpc.XmlRpcFaultException;
import com.flat502.rox.marshal.xmlrpc.XmlRpcMethodFault;
import com.flat502.rox.marshal.xmlrpc.XmlRpcMethodResponse;

public class ManualSynchronousHandler implements SynchronousRequestHandler {
	public RpcCall call;
	public List<RpcCall> calls = new ArrayList<>();
	public RpcCallContext context;

	@Override
    public RpcResponse handleRequest(RpcCall call, RpcCallContext context) throws Exception {
		this.calls.add(call);
		this.call = call;
		this.context = context;
		if (call.getName().equals("server.toUpper")) {
			return new XmlRpcMethodResponse(((String)call.getParameters()[0]).toUpperCase());
		} else if (call.getName().equals("server.delay")) {
			Thread.sleep(((Integer)call.getParameters()[0]).intValue());
			return new XmlRpcMethodResponse(call.getParameters()[1]);
		} else if (call.getName().equals("server.returnFault")) {
			return new XmlRpcMethodFault(0, "return error");
		} else if (call.getName().equals("server.raiseFault")) {
			throw new XmlRpcFaultException(0, "raise error");
		} else if (call.getName().equals("server.map")) {
			return new XmlRpcMethodResponse(((Map)call.getParameters()[0]).size());
		} else if (call.getName().equals("server.raiseNoSuchMethodException")) {
			throw new NoSuchMethodException(call.getName());
		}

		return null;
	}
}


text:
package org.asynchttpclient;

import static org.asynchttpclient.Dsl.*;
import static org.testng.Assert.assertNotNull;

import java.security.GeneralSecurityException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

import org.testng.annotations.Test;

public class NoNullResponseTest extends AbstractBasicTest {
    private static final String GOOGLE_HTTPS_URL = "https://www.google.com";

    @Test(invocationCount = 4, groups = { "online", "default_provider" })
    public void multipleSslRequestsWithDelayAndKeepAlive() throws Exception {

        AsyncHttpClientConfig config = config()//
                .setFollowRedirect(true)//
                .setSslContext(getSSLContext())//
                .setKeepAlive(true)//
                .setConnectTimeout(10000)//
                .setPooledConnectionIdleTimeout(60000)//
                .setRequestTimeout(10000)//
                .setMaxConnectionsPerHost(-1)//
                .setMaxConnections(-1)//
                .build();

        try (AsyncHttpClient client = asyncHttpClient(config)) {
            final BoundRequestBuilder builder = client.prepareGet(GOOGLE_HTTPS_URL);
            final Response response1 = builder.execute().get();
            Thread.sleep(4000);
            final Response response2 = builder.execute().get();
            if (response2 != null) {
                System.out.println("Success (2nd response was not null).");
            } else {
                System.out.println("Failed (2nd response was null).");
            }
            assertNotNull(response1);
            assertNotNull(response2);
        }
    }

    private SSLContext getSSLContext() throws GeneralSecurityException {
        final SSLContext sslContext = SSLContext.getInstance("TLS");
        sslContext.init(null, new TrustManager[] { new MockTrustManager() }, null);
        return sslContext;
    }

    private static class MockTrustManager implements X509TrustManager {
        public X509Certificate[] getAcceptedIssuers() {
            return null;
        }

        public void checkClientTrusted(final X509Certificate[] chain, final String authType) throws CertificateException {
            // do nothing.
        }

        public void checkServerTrusted(final X509Certificate[] chain, final String authType) throws CertificateException {
            // Do nothing.
        }
    }
}


text:
{
  var styles = window.getComputedStyle(el);
  var transitionDelays = styles[transitionProp + "Delay"].split(", ");
  var transitionDurations = styles[transitionProp + "Duration"].split(", ");
  var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  var animationDelays = styles[animationProp + "Delay"].split(", ");
  var animationDurations = styles[animationProp + "Duration"].split(", ");
  var animationTimeout = getTimeout(animationDelays, animationDurations);
  var type;
  var timeout = 0;
  var propCount = 0;

  if (expectedType === TRANSITION) {
    if (transitionTimeout > 0) {
      type = TRANSITION;
      timeout = transitionTimeout;
      propCount = transitionDurations.length;
    }
  } else if (expectedType === ANIMATION) {
    if (animationTimeout > 0) {
      type = ANIMATION;
      timeout = animationTimeout;
      propCount = animationDurations.length;
    }
  } else {
    timeout = Math.max(transitionTimeout, animationTimeout);
    type =
      timeout > 0
        ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION
        : null;
    propCount = type
      ? type === TRANSITION
        ? transitionDurations.length
        : animationDurations.length
      : 0;
  }

  var hasTransform =
    type === TRANSITION &&
    transformRE.test(styles[transitionProp + "Property"]);
  return {
    type: type,
    timeout: timeout,
    propCount: propCount,
    hasTransform: hasTransform
  };
}


text:
<?php
/**
 * Main plugin configuration file
 *
 * @author Developpment team <dev@eoxia.com>
 * @version 1.0
 * @package core
 * @subpackage configuration
 */

/** Check if the plugin version is defined. If not defined script will be stopped here	*/
if ( !defined( 'WPS_LOCALISATION_VERSION' ) ) {
	die( __("You are not allowed to use this service.", 'wpeo_geoloc') );
}

/**	Include display component	*/
require_once(WPS_LOCALISATION_CORELIBS_DIR . 'wps_address.class.php' );


text:
#pragma once

#define NOMINMAX
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#define WIN32_LEAN_AND_MEAN

#include <SDKDDKVer.h>

#include <stdio.h>
#include <pqxx/pqxx>
#include <windows.h>
#include <vector>
#include <string>
#include <sstream>


text:
<?php if (!defined('APPLICATION')) exit();

$this->FireEvent('BeforeCommentPreviewFormat');
$this->Comment->Body = Gdn_Format::To($this->Comment->Body, GetValue('Format', $this->Comment, C('Garden.InputFormatter')));
$this->FireEvent('AfterCommentPreviewFormat');
?>

<?php echo $this->Comment->Body; ?>


text:
This session teaches you how to build your first Uberfire App in just 5 minutes.

## Prerequisites
This guide assumes you have the following software set up and working on your computer:

* A Java Development Kit (JDK) version 8 or newer.

**Microsoft Windows users:** be sure to use a 64-bit version of the JDK because Uberfire requires more heap space than can be addressed by a 32-bit VM.

* Maven 3.x

## Creating your first App

 In a command line, run the archetype to create your first app.

```
 mvn archetype:generate -B \
-DarchetypeGroupId=org.uberfire \
-DarchetypeArtifactId=uberfire-project-archetype \
-DarchetypeVersion=1.0.0-SNAPSHOT \
-DgroupId=org.uberfire \
-DartifactId=demo \
-Dversion=1.0.0-SNAPSHOT \
-Dpackage=org.uberfire \
-DcapitalizedRootArtifactId=Demo
```
Run it and then you should see the message:
```
[INFO] ---------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------
[INFO] Total time: 3:32.347s
[INFO] Finished at: Wed Jan 14 20:30:27 BRST 2015
[INFO] Final Memory: 29M/959M
[INFO] ---------------------------------------------------------
````
## Building your first App

To build your first app, go to directory demo, build the project in maven and wait for the build to finish.

```
$ cd demo
$ mvn clean install

```
You should see the maven build success message again.

## See it work!

How about running our first project?
```
$ cd demo-showcase/demo-webapp
$ mvn clean gwt:run
```
Wait for GWT console build your app:

![gwt build](gwt-console.png)

Click on "Launch Default Browser" to open your Uberfire App. Log in with the username "admin" and the password "admin". You should see our Hello World screen!

![hello world](helloWorld.png)

After you see that Hello World, you'll soon be able to taste the power of Uberfire.


text:
from __future__ import annotations

import logging
from dataclasses import dataclass

from pants.backend.java.dependency_inference.package_prefix_tree import PackageRootedDependencyMap
from pants.backend.java.dependency_inference.types import JavaSourceDependencyAnalysis
from pants.backend.java.target_types import JavaSourceField
from pants.base.specs import AddressSpecs, DescendantAddresses
from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
from pants.engine.rules import Get, MultiGet, collect_rules, rule
from pants.engine.target import Targets
from pants.engine.unions import UnionMembership, UnionRule, union
from pants.util.logging import LogLevel

logger = logging.getLogger(__name__)

# -----------------------------------------------------------------------------------------------
# First-party package mapping
# -----------------------------------------------------------------------------------------------

@dataclass(frozen=True)
class FirstPartyJavaMappingImpl:
    """A mapping of package names to owning addresses that a specific implementation adds for Java
    import dependency inference."""

    package_rooted_dependency_map: PackageRootedDependencyMap

@union
class FirstPartyJavaMappingImplMarker:
    """An entry point for a specific implementation of mapping package names to owning targets for
    Java import dependency inference.

    All implementations will be merged together.

    The addresses should all be file addresses, rather than BUILD addresses.
    """

@dataclass(frozen=True)
class FirstPartyJavaPackageMapping:
    """A merged mapping of package names to owning addresses."""

    package_rooted_dependency_map: PackageRootedDependencyMap

@rule(level=LogLevel.DEBUG)
async def merge_first_party_module_mappings(
    union_membership: UnionMembership,
) -> FirstPartyJavaPackageMapping:
    all_mappings = await MultiGet(
        Get(
            FirstPartyJavaMappingImpl,
            FirstPartyJavaMappingImplMarker,
            marker_cls(),
        )
        for marker_cls in union_membership.get(FirstPartyJavaMappingImplMarker)
    )

    merged_dep_map = PackageRootedDependencyMap()
    for dep_map in all_mappings:
        merged_dep_map.merge(dep_map.package_rooted_dependency_map)

    return FirstPartyJavaPackageMapping(package_rooted_dependency_map=merged_dep_map)

# This is only used to register our implementation with the plugin hook via unions. Note that we
# implement this like any other plugin implementation so that we can run them all in parallel.
class FirstPartyJavaTargetsMappingMarker(FirstPartyJavaMappingImplMarker):
    pass

@rule(desc="Creating map of first party Java targets to Java packages", level=LogLevel.DEBUG)
async def map_first_party_java_targets_to_symbols(
    _: FirstPartyJavaTargetsMappingMarker,
) -> FirstPartyJavaMappingImpl:
    all_expanded_targets = await Get(Targets, AddressSpecs([DescendantAddresses("")]))
    java_targets = tuple(tgt for tgt in all_expanded_targets if tgt.has_field(JavaSourceField))
    source_files = await MultiGet(
        Get(SourceFiles, SourceFilesRequest([target[JavaSourceField]])) for target in java_targets
    )
    source_analysis = await MultiGet(
        Get(JavaSourceDependencyAnalysis, SourceFiles, source_files)
        for source_files in source_files
    )
    address_and_analysis = zip([t.address for t in java_targets], source_analysis)

    dep_map = PackageRootedDependencyMap()
    for address, analysis in address_and_analysis:
        for top_level_type in analysis.top_level_types:
            components = top_level_type.rsplit(".", maxsplit=1)
            if len(components) != 2:
                # A package without a name cannot be imported, and so does not expose any symbols.
                # https://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.4.2
                continue
            package, type_ = components
            dep_map.add_top_level_type(package=package, type_=type_, address=address)

    return FirstPartyJavaMappingImpl(package_rooted_dependency_map=dep_map)

def rules():
    return (
        *collect_rules(),
        UnionRule(FirstPartyJavaMappingImplMarker, FirstPartyJavaTargetsMappingMarker),
    )


text:
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using System.Threading.Tasks;

namespace DragonSpark.Application.Entities.Transactions;

public class SessionCurrentDatabaseTransactions : ITransactions
{
	readonly DbContext                                      _context;
	readonly DatabaseFacade                                 _facade;
	readonly CurrentDatabaseTransaction.TransactionNotFound _log;

	public SessionCurrentDatabaseTransactions(DbContext owner, CurrentDatabaseTransaction.TransactionNotFound log)
		: this(owner, owner.Database, log) {}

	public SessionCurrentDatabaseTransactions(DbContext context, DatabaseFacade facade, CurrentDatabaseTransaction.TransactionNotFound log)
	{
		_context = context;
		_facade  = facade;
		_log     = log;
	}

	public async ValueTask<ITransaction> Get()
	{
		await _facade.BeginTransactionAsync().ConfigureAwait(false);
		return new CurrentDatabaseTransaction(_context, _facade, _log);
	}
}


text:
<?php
namespace Concrete\Core\Entity\Attribute\Key\Type;

use Concrete\Core\Entity\Attribute\Value\Value\RatingValue;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="RatingAttributeKeyTypes")
 */
class RatingType extends Type
{
    public function getAttributeValue()
    {
        return new RatingValue();
    }

}


text:
@echo off
cd compiler
python buildmusic.py
cd ..
cd app
zip -q -r ../release.zip .
mv ../release.zip /tmp
cd ..


text:
package io.piotrjastrzebski.dungen;

/**
 * Created by PiotrJ on 28/07/15.
 */
public interface PlatformBridge {
	float getPixelScaleFactor ();
	void save (String name, String data);
}


text:
var runnerResultSent = false, runnerResultTimeout;
function runnerResult(status, log) {
  if(runnerResultTimeout)
   	clearTimeout( runnerResultTimeout );
  if(!runnerResultSent) {
    try{
      top.opener.rr( status, log );
    } catch (e) {}
    runnerResultSent = true;
  }
}
function overrideCurrentRunner(func, timeout) {
	if(runnerResultTimeout)
		clearTimeout( runnerResultTimeout );
    runnerResultTimeout = setTimeout( func, timeout || 2000 );
}
runnerResultTimeout = setTimeout(function() {
	runnerResult(undefined, "script did not run.")
}, 4000 ); // default runner timeout


text:
package com.thinkgem.jeesite.modules.sys.utils;

public abstract class CacheUpdateFlagUtil {

	private static long updateTimestamp;

	public static Object updateLock = new Object();

	public static long getUpdateTimestamp() {
		return updateTimestamp;
	}

	public static void setUpdateTimestamp() {
		updateTimestamp = System.currentTimeMillis();
		notifyLock();
	}

	public static void notifyLock() {
		synchronized (updateLock) {
	        updateLock.notifyAll();
        }
	}

	public static boolean isNeedUpdate(String timestamp) {
		try {
			if (Long.parseLong(timestamp) == updateTimestamp) {
				return false;
			}
		} catch (Exception e) {
			// DO NOTHING
		}
		return true;
	}
}


text:
package buffer

import (
	"errors"
	"fmt"
	"strings"
	"time"

	"github.com/spf13/pflag"

	"vitess.io/vitess/go/vt/log"
	"vitess.io/vitess/go/vt/servenv"
	"vitess.io/vitess/go/vt/topo/topoproto"
)

var (
	bufferEnabled       bool
	bufferEnabledDryRun bool

	bufferWindow                  = 10 * time.Second
	bufferSize                    = 1000
	bufferMaxFailoverDuration     = 20 * time.Second
	bufferMinTimeBetweenFailovers = time.Minute

	bufferDrainConcurrency = 1
	bufferKeyspaceShards   string
)

func registerFlags(fs *pflag.FlagSet) {
	fs.BoolVar(&bufferEnabled, "enable_buffer", false, "Enable buffering (stalling) of primary traffic during failovers.")
	fs.BoolVar(&bufferEnabledDryRun, "enable_buffer_dry_run", false, "Detect and log failover events, but do not actually buffer requests.")

	fs.DurationVar(&bufferWindow, "buffer_window", 10*time.Second, "Duration for how long a request should be buffered at most.")
	fs.IntVar(&bufferSize, "buffer_size", 1000, "Maximum number of buffered requests in flight (across all ongoing failovers).")
	fs.DurationVar(&bufferMaxFailoverDuration, "buffer_max_failover_duration", 20*time.Second, "Stop buffering completely if a failover takes longer than this duration.")
	fs.DurationVar(&bufferMinTimeBetweenFailovers, "buffer_min_time_between_failovers", 1*time.Minute, "Minimum time between the end of a failover and the start of the next one (tracked per shard). Faster consecutive failovers will not trigger buffering.")

	fs.IntVar(&bufferDrainConcurrency, "buffer_drain_concurrency", 1, "Maximum number of requests retried simultaneously. More concurrency will increase the load on the PRIMARY vttablet when draining the buffer.")
	fs.StringVar(&bufferKeyspaceShards, "buffer_keyspace_shards", "", "If not empty, limit buffering to these entries (comma separated). Entry format: keyspace or keyspace/shard. Requires --enable_buffer=true.")
}

func init() {
	servenv.OnParseFor("vtgate", registerFlags)
	servenv.OnParseFor("vtcombo", registerFlags)
}

func verifyFlags() error {
	if bufferWindow < 1*time.Second {
		return fmt.Errorf("--buffer_window must be >= 1s (specified value: %v)", bufferWindow)
	}
	if bufferWindow > bufferMaxFailoverDuration {
		return fmt.Errorf("--buffer_window must be <= --buffer_max_failover_duration: %v vs. %v", bufferWindow, bufferMaxFailoverDuration)
	}
	if bufferSize < 1 {
		return fmt.Errorf("--buffer_size must be >= 1 (specified value: %d)", bufferSize)
	}
	if bufferMinTimeBetweenFailovers < bufferMaxFailoverDuration*time.Duration(2) {
		return fmt.Errorf("--buffer_min_time_between_failovers should be at least twice the length of --buffer_max_failover_duration: %v vs. %v", bufferMinTimeBetweenFailovers, bufferMaxFailoverDuration)
	}

	if bufferDrainConcurrency < 1 {
		return fmt.Errorf("--buffer_drain_concurrency must be >= 1 (specified value: %d)", bufferDrainConcurrency)
	}

	if bufferKeyspaceShards != "" && !bufferEnabled {
		return fmt.Errorf("--buffer_keyspace_shards=%v also requires that --enable_buffer is set", bufferKeyspaceShards)
	}
	if bufferEnabled && bufferEnabledDryRun && bufferKeyspaceShards == "" {
		return errors.New("both the dry-run mode and actual buffering is enabled. To avoid ambiguity, keyspaces and shards for actual buffering must be explicitly listed in --buffer_keyspace_shards")
	}

	keyspaces, shards := keyspaceShardsToSets(bufferKeyspaceShards)
	for s := range shards {
		keyspace, _, err := topoproto.ParseKeyspaceShard(s)
		if err != nil {
			return err
		}
		if keyspaces[keyspace] {
			return fmt.Errorf("--buffer_keyspace_shards has overlapping entries (keyspace only vs. keyspace/shard): %v vs. %v Please remove one or the other", keyspace, s)
		}
	}

	return nil
}

// keyspaceShardsToSets converts a comma separated list of keyspace[/shard]
// entries to two sets: keyspaces (if the shard is not specified) and shards (if
// both keyspace and shard is specified).
func keyspaceShardsToSets(list string) (map[string]bool, map[string]bool) {
	keyspaces := make(map[string]bool)
	shards := make(map[string]bool)
	if list == "" {
		return keyspaces, shards
	}

	for _, item := range strings.Split(list, ",") {
		if strings.Contains(item, "/") {
			shards[item] = true
		} else {
			keyspaces[item] = true
		}
	}
	return keyspaces, shards
}

// setToString joins the set to a ", " separated string.
func setToString(set map[string]bool) string {
	result := ""
	for item := range set {
		if result != "" {
			result += ", "
		}
		result += item
	}
	return result
}

type Config struct {
	Enabled bool
	DryRun  bool

	Window                  time.Duration
	Size                    int
	MaxFailoverDuration     time.Duration
	MinTimeBetweenFailovers time.Duration

	DrainConcurrency int

	// keyspaces has the same purpose as "shards" but applies to a whole keyspace.
	Keyspaces map[string]bool
	// shards is a set of keyspace/shard entries to which buffering is limited.
	// If empty (and *enabled==true), buffering is enabled for all shards.
	Shards map[string]bool

	// internal: used for testing
	now func() time.Time
}

func NewDefaultConfig() *Config {
	return &Config{
		Enabled:                 false,
		DryRun:                  false,
		Size:                    10,
		Window:                  10 * time.Second,
		MaxFailoverDuration:     20 * time.Second,
		MinTimeBetweenFailovers: 1 * time.Minute,
		DrainConcurrency:        1,
		now:                     time.Now,
	}
}

func NewConfigFromFlags() *Config {
	if err := verifyFlags(); err != nil {
		log.Fatalf("Invalid buffer configuration: %v", err)
	}
	bufferSizeStat.Set(int64(bufferSize))
	keyspaces, shards := keyspaceShardsToSets(bufferKeyspaceShards)

	if bufferEnabledDryRun {
		log.Infof("vtgate buffer in dry-run mode enabled for all requests. Dry-run bufferings will log failovers but not buffer requests.")
	}

	if bufferEnabled {
		log.Infof("vtgate buffer enabled. PRIMARY requests will be buffered during detected failovers.")

		// Log a second line if it's only enabled for some keyspaces or shards.
		header := "Buffering limited to configured "
		limited := ""
		if len(keyspaces) > 0 {
			limited += "keyspaces: " + setToString(keyspaces)
		}
		if len(shards) > 0 {
			if limited == "" {
				limited += " and "
			}
			limited += "shards: " + setToString(shards)
		}
		if limited != "" {
			limited = header + limited
			dryRunOverride := ""
			if bufferEnabledDryRun {
				dryRunOverride = " Dry-run mode is overridden for these entries and actual buffering will take place."
			}
			log.Infof("%v.%v", limited, dryRunOverride)
		}
	}

	if !bufferEnabledDryRun && !bufferEnabled {
		log.Infof("vtgate buffer not enabled.")
	}

	return &Config{
		Enabled: bufferEnabled,
		DryRun:  bufferEnabledDryRun,

		Window:                  bufferWindow,
		Size:                    bufferSize,
		MaxFailoverDuration:     bufferMaxFailoverDuration,
		MinTimeBetweenFailovers: bufferMinTimeBetweenFailovers,

		DrainConcurrency: bufferDrainConcurrency,

		Keyspaces: keyspaces,
		Shards:    shards,

		now: time.Now,
	}
}

func (cfg *Config) bufferingMode(keyspace, shard string) bufferMode {
	// Actual buffering is enabled if
	// a) no keyspaces and shards were listed in particular,
	if cfg.Enabled && len(cfg.Keyspaces) == 0 && len(cfg.Shards) == 0 {
		// No explicit whitelist given i.e. all shards should be buffered.
		return bufferModeEnabled
	}
	// b) or this keyspace is listed,
	if cfg.Keyspaces[keyspace] {
		return bufferModeEnabled
	}
	// c) or this shard is listed.
	keyspaceShard := topoproto.KeyspaceShardString(keyspace, shard)
	if cfg.Shards[keyspaceShard] {
		return bufferModeEnabled
	}

	if cfg.DryRun {
		return bufferModeDryRun
	}

	return bufferModeDisabled
}


text:
package handlers

import (
	"bytes"
	"errors"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"os"
	"path/filepath"
	"reflect"
	"strings"

	"golang.org/x/net/context"

	libsass "github.com/wellington/go-libsass"
	"github.com/wellington/go-libsass/libs"
	sw "github.com/wellington/spritewell"
	"github.com/wellington/wellington/payload"
)

func init() {

	libsass.RegisterSassFunc("image-url($name)", ImageURL)
	libsass.RegisterSassFunc("image-height($path)", ImageHeight)
	libsass.RegisterSassFunc("image-width($path)", ImageWidth)
	libsass.RegisterSassFunc("inline-image($path, $encode: false)", InlineImage)
}

// ErrPayloadNil prevents panics on invalid payload; nil check helps
// find non-obvious dependency failures like mismatched dependencies.
var ErrPayloadNil = errors.New("payload is nil")

// ImageURL handles calls to resolve the path to a local image from the
// built css file path.
func ImageURL(ctx context.Context, csv libsass.SassValue) (*libsass.SassValue, error) {
	comp, err := libsass.CompFromCtx(ctx)
	if err != nil {
		return nil, err
	}
	pather := comp.(libsass.Pather)
	var path []string
	err = libsass.Unmarshal(csv, &path)
	// This should create and throw a sass error
	if err != nil {
		return nil, err
	}

	if len(path) != 1 {
		return nil, errors.New("path not found")
	}

	imgdir := pather.ImgDir()

	abspath := filepath.Join(imgdir, path[0])
	method := comp.CacheBust()

	qry, err := qs(method, abspath)
	if err != nil {
		return nil, err
	}
	rel, err := relativeImage(pather.BuildDir(), pather.ImgDir())
	if err != nil {
		return nil, err
	}
	url := strings.Join([]string{
		rel,
		path[0],
	}, "/")
	res, err := libsass.Marshal(fmt.Sprintf("url('%s%s')", url, qry))
	if err != nil {
		return nil, err
	}
	return &res, nil
}

func relativeImage(buildDir, imageDir string) (string, error) {
	rel, err := filepath.Rel(buildDir, imageDir)
	return filepath.ToSlash(filepath.Clean(rel)), err
}

// ImageHeight takes a file path (or sprite glob) and returns the
// height in pixels of the image being referenced.
func ImageHeight(mainctx context.Context, usv libsass.SassValue) (*libsass.SassValue, error) {
	var (
		glob string
		name string
	)

	comp, err := libsass.CompFromCtx(mainctx)
	if err != nil {
		return nil, err
	}

	err = libsass.Unmarshal(usv, &name)
	// Check for sprite-file override first
	if err != nil {
		var inf interface{}
		var infs []interface{}
		// Can't unmarshal to []interface{}, so unmarshal to
		// interface{} then reflect it into a []interface{}
		err = libsass.Unmarshal(usv, &inf)
		k := reflect.ValueOf(&infs).Elem()
		k.Set(reflect.ValueOf(inf))

		if err != nil {
			return nil, err
		}
		glob = infs[0].(string)
		name = infs[1].(string)
	}
	paths := comp.(libsass.Pather)
	imgs := sw.New(&sw.Options{
		ImageDir:  paths.ImgDir(),
		BuildDir:  paths.BuildDir(),
		GenImgDir: paths.ImgBuildDir(),
	})

	loadctx := comp.Payload()
	if loadctx == nil {
		return nil, ErrPayloadNil
	}

	images := payload.Image(loadctx)
	if images == nil {
		return nil, errors.New("inline payload not available")
	}

	if len(glob) == 0 {
		exst := images.Get(name)
		if exst != nil {
			imgs = exst
		} else {
			imgs.Decode(name)
			// Store images in global cache
			images.Set(name, imgs)
		}
	} else {
		sprites := payload.Sprite(loadctx)
		imgs = sprites.Get(glob)
		if imgs == nil {
			return nil, errors.New("Sprite not found")
		}
	}
	height := imgs.SImageHeight(name)
	Hheight := libs.SassNumber{
		Value: float64(height),
		Unit:  "px",
	}
	res, err := libsass.Marshal(Hheight)
	return &res, err
}

// ImageWidth takes a file path (or sprite glob) and returns the
// width in pixels of the image being referenced.
func ImageWidth(mainctx context.Context, usv libsass.SassValue) (rsv *libsass.SassValue, err error) {
	var (
		glob, name string
	)
	comp, err := libsass.CompFromCtx(mainctx)
	if err != nil {
		return
	}

	err = libsass.Unmarshal(usv, &name)
	// Check for sprite-file override first
	if err != nil {
		var inf interface{}
		var infs []interface{}
		// Can't unmarshal to []interface{}, so unmarshal to
		// interface{} then reflect it into a []interface{}
		err = libsass.Unmarshal(usv, &inf)
		k := reflect.ValueOf(&infs).Elem()
		k.Set(reflect.ValueOf(inf))

		if err != nil {
			return
		}
		glob = infs[0].(string)
		name = infs[1].(string)
	}
	paths := comp.(libsass.Pather)
	imgs := sw.New(&sw.Options{
		ImageDir:  paths.ImgDir(),
		BuildDir:  paths.BuildDir(),
		GenImgDir: paths.ImgBuildDir(),
	})

	loadctx := comp.Payload()
	var images payload.Payloader

	if len(glob) == 0 {
		images = payload.Image(loadctx)
		hit := images.Get(name)
		if hit != nil {
			imgs = hit
		} else {
			imgs.Decode(name)
			images.Set(name, imgs)
		}
	} else {
		// Glob present, look up in sprites
		sprites := payload.Sprite(loadctx)
		imgs = sprites.Get(glob)
	}
	w := imgs.SImageWidth(name)
	ww := libs.SassNumber{
		Value: float64(w),
		Unit:  "px",
	}
	res, err := libsass.Marshal(ww)
	return &res, err
}

// Resolver interface returns a ReadCloser from a path
type Resolver interface {
	Do(string) (io.ReadCloser, error)
}

// img implements Resolver for http urls
type img struct {
}

func (g img) Do(name string) (io.ReadCloser, error) {
	// Check for valid URL
	u, err := url.Parse(name)
	if err != nil || len(u.Scheme) == 0 {
		return nil, fmt.Errorf("invalid image URL: %s", name)
	}

	// No point in check this error, we already are more aggressive
	// about error checking by validating scheme exists
	req, _ := http.NewRequest("GET", name, nil)
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		return nil, err
	}

	if resp.StatusCode >= http.StatusBadRequest {
		resp.Body.Close()
		return nil, fmt.Errorf("could not resolve image: %d", resp.StatusCode)
	}

	return resp.Body, nil
}

var imgResolver Resolver = img{}

// InlineImage returns a base64 encoded png from the input image
func InlineImage(mainctx context.Context, usv libsass.SassValue) (rsv *libsass.SassValue, err error) {
	var (
		name   string
		encode bool
		f      io.ReadCloser
	)
	comp, err := libsass.CompFromCtx(mainctx)
	if err != nil {
		return nil, err
	}

	err = libsass.Unmarshal(usv, &name, &encode)
	if err != nil {
		return nil, err
	}

	paths := comp.(libsass.Pather)

	// check for valid URL. If true, attempt to resolve image.
	// This is really going to slow down compilation think about
	// writing data to disk instead of inlining.
	u, err := url.Parse(name)
	if err == nil && len(u.Scheme) > 0 {
		f, err = imgResolver.Do(u.String())
	} else {
		f, err = os.Open(filepath.Join(paths.ImgDir(), name))
	}
	if err != nil {
		return nil, err
	}
	defer f.Close()

	var buf bytes.Buffer
	err = sw.Inline(f, &buf, encode)
	if err != nil {
		return nil, err
	}
	res, err := libsass.Marshal(buf.String())
	if err != nil {
		return nil, err
	}
	return &res, nil
}

func setErrorAndReturn(err error, rsv *libsass.SassValue) error {
	if rsv == nil {
		panic("rsv not initialized")
	}
	*rsv = libsass.Error(err)
	return err
}


text:
'use strict';

/**
 * Main JavaScript file.
 *
 * Browserify transform every single file started with app.**.js into a bundle,
 * so you can easily generate multiple bundles.
 *
 * You can also write your JavaScript in es2015/es6,
 * https://github.com/lukehoban/es6features thanks to https://babeljs.io/
 *
 */

console.log('Hi there :)');


text:
@interface LFXSiteID : NSObject <NSCopying>

// The canonical representation of a Site ID is a hex string. This is the form
// used in the LIFX Cloud API.
+ (LFXSiteID *)siteIDWithString:(NSString *)siteIDString;
- (NSString *)stringValue;

// The LIFX Protocol uses 6-bytes to represent a Site ID
+ (LFXSiteID *)siteIDWithData:(NSData *)data;
- (NSData *)dataValue;

// When a device hasn't been added to a site yet, it will have a 'zero' Site ID.
+ (LFXSiteID *)zeroSiteID;
- (BOOL)isZeroSite;

// A shorter string representation - useful for logging and diagnostics
- (NSString *)debugStringValue;

@end


text:
/* eslint-env jest */

import * as actions from '../weatherActions';

describe('actions', () => {
    it('should create an action to toggle options', () => {
        expect(actions.setCity('Budapest')).toEqual({
            type: 'SET_CITY',
            payload: 'Budapest'
        });
    });

    it('should create an action to toggle apps', () => {
        expect(actions.setCurrent('testObjData')).toEqual({
            type: 'SET_CURRENT',
            payload: 'testObjData'
        });
    });

    it('should creat an action to set unit', function() {
        expect(actions.setForecast('testArrayData')).toEqual({
            type: 'SET_FORECAST',
            payload: 'testArrayData'
        });
    });
});


text:
set -x
set -e

# This is a workaround until this is resolved: https://github.com/kubernetes/ingress-gce/pull/388
# The long-term solution is to use a managed SSL certificate on GKE once the feature is GA.

# The ingress is initially created without a tls spec.
# Wait until cert-manager generates the certificate using the http-01 challenge on the GCLB ingress.
# After the certificate is obtained, patch the ingress with the tls spec to enable SSL on the GCLB.

# Wait for certificate.
(until kubectl -n ${NAMESPACE} get secret ${TLS_SECRET_NAME} 2>/dev/null; do echo "Waiting for certificate..." ; sleep 2; done)

kubectl -n ${NAMESPACE} patch ingress ${INGRESS_NAME} --type='json' -p '[{"op": "add", "path": "/spec/tls", "value": [{"secretName": "'${TLS_SECRET_NAME}'"}]}]'

echo "Done"


text:
#include <aws/s3/model/NoncurrentVersionTransition.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::S3::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

NoncurrentVersionTransition::NoncurrentVersionTransition() :
    m_noncurrentDays(0),
    m_noncurrentDaysHasBeenSet(false),
    m_storageClassHasBeenSet(false)
{
}

NoncurrentVersionTransition::NoncurrentVersionTransition(const XmlNode& xmlNode) :
    m_noncurrentDays(0),
    m_noncurrentDaysHasBeenSet(false),
    m_storageClassHasBeenSet(false)
{
  *this = xmlNode;
}

NoncurrentVersionTransition& NoncurrentVersionTransition::operator =(const XmlNode& xmlNode)
{
  XmlNode resultNode = xmlNode;

  if(!resultNode.IsNull())
  {
    XmlNode noncurrentDaysNode = resultNode.FirstChild("NoncurrentDays");
    if(!noncurrentDaysNode.IsNull())
    {
      m_noncurrentDays = StringUtils::ConvertToInt32(StringUtils::Trim(noncurrentDaysNode.GetText().c_str()).c_str());
      m_noncurrentDaysHasBeenSet = true;
    }
    XmlNode storageClassNode = resultNode.FirstChild("StorageClass");
    if(!storageClassNode.IsNull())
    {
      m_storageClass = TransitionStorageClassMapper::GetTransitionStorageClassForName(StringUtils::Trim(storageClassNode.GetText().c_str()).c_str());
      m_storageClassHasBeenSet = true;
    }
  }

  return *this;
}

void NoncurrentVersionTransition::AddToNode(XmlNode& parentNode) const
{
  Aws::StringStream ss;
  if(m_noncurrentDaysHasBeenSet)
  {
   XmlNode noncurrentDaysNode = parentNode.CreateChildElement("NoncurrentDays");
  ss << m_noncurrentDays;
   noncurrentDaysNode.SetText(ss.str());
  ss.str("");
  }

  if(m_storageClassHasBeenSet)
  {
   XmlNode storageClassNode = parentNode.CreateChildElement("StorageClass");
   storageClassNode.SetText(TransitionStorageClassMapper::GetNameForTransitionStorageClass(m_storageClass));
  }

}


text:
from tkinter import *
#from tkinter.ttk import *

from tkdraw.tools.tool import Tool

class CreateLineTool(Tool):
    """\
    Multiple segment, straight line tool. Left click to start and create segments. Right click to end.
    """

    def __init__(self, app):
        super().__init__(app)
        self.drawing = False  # If True a line is currently being drawn
        self.coordinate_pairs = []
        self.object_id = -1  # If -1 then no current line

    def activate(self, ):
        # First step on activate should always be switch.
        self.switch()

        # Register all callable actions
        self.register_binding("<Button-1>", self.left_click)
        self.register_binding("<Motion>", self.motion)
        self.register_binding("<Button-3>", self.right_click)

        # Display Tool Options
        self.line_width = Scale(self.app.frame_option, from_=1, to=10, orient=HORIZONTAL)
        self.line_width.pack(anchor=W)

    def left_click(self, event):
        """\
        Start a new line.
        """
        # Get canvas coordinates instead of window
        x, y = self.canvas_coordinates(event)

        # Append to the actual line coordinates
        self.coordinate_pairs.append((x, y))

        # Flag that we are now drawing
        self.drawing = True

    def motion(self, event):
        """\
        Draw existing segments and preview next segment.
        """

        # Function is called even when a line hasn't been started. Only proceed if drawing
        if self.drawing:
            # Get canvas coordinates instead of window
            x, y = self.canvas_coordinates(event)

            # Create a temporary copy of the line and append preview coordinates
            temp_list = self.coordinate_pairs[:]
            temp_list.append((x, y))

            # Remove old temporary line
            if self.object_id > -1:
                self.app.canvas.delete(self.object_id)

            # Draw new line with preview segment
            self.object_id = self.draw_line(temp_list)

    def right_click(self, event):
        """\
        Finish the line and reset for next line.
        """
        # Get canvas coordinates instead of window
        x, y = self.canvas_coordinates(event)

        # Append to the actual line coordinates
        self.coordinate_pairs.append((x, y))

        # Draw the line on the canvas
        self.draw_line(self.coordinate_pairs)

        # Reset object variables for next line
        self.coordinate_pairs.clear()
        self.object_id = -1
        self.drawing = False

    def draw_line(self, coordinate_pairs):
        """\
        Draw line and return object id.
        """
        line_width = self.line_width.get()
        return self.app.canvas.create_line(*coordinate_pairs,  # Expand List to arguments
                                           fill=self.app.fill_color,
                                           width=line_width)


text:
private class BadNodeException
{
};


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
using Mindscape.Raygun4Net.Messages;
using NUnit.Framework;

namespace Mindscape.Raygun4Net.Tests
{
  [TestFixture]
  public class RaygunClientTests
  {
    private FakeRaygunClient _client;
    private Exception _exception = new NullReferenceException("The thing is null");

    [SetUp]
    public void SetUp()
    {
      _client = new FakeRaygunClient();
    }

    [Test]
    public void DefaultProxyCredentials()
    {
      Assert.IsNull(_client.ProxyCredentials);
    }

    [Test]
    public void DefaultWebProxy()
    {
      Assert.IsNull(_client.WebProxy);
    }

    [Test]
    public void ProxyCredentials()
    {
      var credentials = new NetworkCredential();
      _client.ProxyCredentials = credentials;
      Assert.AreSame(credentials, _client.ProxyCredentials);
    }

    [Test]
    public void WebProxy()
    {
      var proxy = new WebProxy();
      _client.WebProxy = proxy;
      Assert.AreSame(proxy, _client.WebProxy);
    }

    // User tests

    [Test]
    public void DefaultUser()
    {
      Assert.IsNull(_client.User);
    }

    [Test]
    public void DefaultUserInfo()
    {
      Assert.IsNull(_client.UserInfo);
    }

    [Test]
    public void UserProperty()
    {
      _client.User = "Robbie Robot";
      Assert.AreEqual("Robbie Robot", _client.User);
    }

    [Test]
    public void UserInfoProperty()
    {
      RaygunIdentifierMessage user = new RaygunIdentifierMessage("Robbie Robot");
      _client.UserInfo = user;
      Assert.AreSame(user, _client.UserInfo);
    }

    [Test]
    public void MessageWithNoUser()
    {
      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.IsNull(message.Details.User);
    }

    [Test]
    public void MessageWithUser()
    {
      _client.User = "Robbie Robot";

      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.AreEqual("Robbie Robot", message.Details.User.Identifier);
    }

    [Test]
    public void MessageWithUserInfo()
    {
      RaygunIdentifierMessage user = new RaygunIdentifierMessage("Robbie Robot") { IsAnonymous = true };
      _client.UserInfo = user;

      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.AreEqual("Robbie Robot", message.Details.User.Identifier);
      Assert.IsTrue(message.Details.User.IsAnonymous);
    }

    [Test]
    public void UserInfoTrumpsUser()
    {
      RaygunIdentifierMessage user = new RaygunIdentifierMessage("Robbie Robot") { IsAnonymous = true };
      _client.UserInfo = user;
      _client.User = "Not Robbie Robot";

      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.AreEqual("Robbie Robot", message.Details.User.Identifier);
      Assert.IsTrue(message.Details.User.IsAnonymous);
    }

    [Test]
    public void MessageWithUserInfoFromBuild()
    {
        RaygunMessage message = _client.ExposeBuildMessage(_exception, null, null, new RaygunIdentifierMessage("Robbie Robot"));
        Assert.AreEqual("Robbie Robot", message.Details.User.Identifier);
        Assert.IsFalse(message.Details.User.IsAnonymous);
    }

    [Test]
    public void UserInfoFromBuildTrumpsAll()
    {
        RaygunIdentifierMessage user = new RaygunIdentifierMessage("Not Robbie Robot") { IsAnonymous = true };
        _client.UserInfo = user;
        _client.User = "Also Not Robbie Robot";

        RaygunMessage message = _client.ExposeBuildMessage(_exception, null, null, new RaygunIdentifierMessage("Robbie Robot"));
        Assert.AreEqual("Robbie Robot", message.Details.User.Identifier);
        Assert.IsFalse(message.Details.User.IsAnonymous);
    }

    [Test]
    public void IsAnonymousDefault()
    {
      RaygunIdentifierMessage user = new RaygunIdentifierMessage("Robbie Robot");
      Assert.IsFalse(user.IsAnonymous);

      _client.User = "Robbie Robot";
      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.IsFalse(message.Details.User.IsAnonymous);
    }

    // Application version tests

    [Test]
    public void DefaultApplicationVersion()
    {
      Assert.IsNull(_client.ApplicationVersion);
    }

    [Test]
    public void ApplicationVersionProperty()
    {
      _client.ApplicationVersion = "Custom Version";
      Assert.AreEqual("Custom Version", _client.ApplicationVersion);
    }

    [Test]
    public void SetCustomApplicationVersion()
    {
      _client.ApplicationVersion = "Custom Version";

      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.AreEqual("Custom Version", message.Details.Version);
    }

    // Exception stripping tests

    [Test]
    public void StripTargetInvocationExceptionByDefault()
    {
      TargetInvocationException wrapper = new TargetInvocationException(_exception);

      RaygunMessage message = _client.ExposeBuildMessage(wrapper);
      Assert.AreEqual("System.NullReferenceException", message.Details.Error.ClassName);
    }

    [Test]
    public void StripSpecifiedWrapperException()
    {
      _client.AddWrapperExceptions(new Type[] { typeof(WrapperException) });

      WrapperException wrapper = new WrapperException(_exception);

      RaygunMessage message = _client.ExposeBuildMessage(wrapper);
      Assert.AreEqual("System.NullReferenceException", message.Details.Error.ClassName);
    }

    [Test]
    public void DontStripIfNoInnerException()
    {
      TargetInvocationException wrapper = new TargetInvocationException(null);

      RaygunMessage message = _client.ExposeBuildMessage(wrapper);
      Assert.AreEqual("System.Reflection.TargetInvocationException", message.Details.Error.ClassName);
      Assert.IsNull(message.Details.Error.InnerError);
    }

    [Test]
    public void DontStripNull()
    {
      RaygunMessage message = _client.ExposeBuildMessage(null);
      Assert.IsNull(message.Details.Error);
    }

    [Test]
    public void StripMultipleWrapperExceptions()
    {
      _client.AddWrapperExceptions(new Type[] { typeof(WrapperException) });

      WrapperException wrapper = new WrapperException(_exception);
      TargetInvocationException wrapper2 = new TargetInvocationException(wrapper);

      RaygunMessage message = _client.ExposeBuildMessage(wrapper2);
      Assert.AreEqual("System.NullReferenceException", message.Details.Error.ClassName);
    }

    [Test]
    public void RemoveWrapperExceptions()
    {
      _client.RemoveWrapperExceptions(typeof(TargetInvocationException));

      TargetInvocationException wrapper = new TargetInvocationException(_exception);

      RaygunMessage message = _client.ExposeBuildMessage(wrapper);
      Assert.AreEqual("System.Reflection.TargetInvocationException", message.Details.Error.ClassName);
    }

    // Validation tests

    [Test]
    public void NoAPIKeyIsInvalid()
    {
      Assert.IsFalse(_client.ExposeValidateApiKey());
    }

    [Test]
    public void APIKeyIsValid()
    {
      FakeRaygunClient client = new FakeRaygunClient("MY_API_KEY");
      Assert.IsTrue(client.ExposeValidateApiKey());
    }

    // Tags and user custom data tests

    [Test]
    public void TagsAreNullByDefault()
    {
      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.IsNull(message.Details.Tags);
    }

    [Test]
    public void Tags()
    {
      IList<string> tags = new List<string>();
      tags.Add("Very Important");
      tags.Add("WPF");

      RaygunMessage message = _client.ExposeBuildMessage(_exception, tags);
      Assert.IsNotNull(message.Details.Tags);
      Assert.AreEqual(2, message.Details.Tags.Count);
      Assert.Contains("Very Important", (ICollection)message.Details.Tags);
      Assert.Contains("WPF", (ICollection)message.Details.Tags);
    }

    [Test]
    public void UserCustomDataIsNullByDefault()
    {
      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.IsNull(message.Details.UserCustomData);
    }

    [Test]
    public void UserCustomData()
    {
      IDictionary data = new Dictionary<string, string>();
      data.Add("x", "42");
      data.Add("obj", "NULL");

      RaygunMessage message = _client.ExposeBuildMessage(_exception, null, data);
      Assert.IsNotNull(message.Details.UserCustomData);
      Assert.AreEqual(2, message.Details.UserCustomData.Count);
      Assert.AreEqual("42", message.Details.UserCustomData["x"]);
      Assert.AreEqual("NULL", message.Details.UserCustomData["obj"]);
    }

    // Cancel send tests

    [Test]
    public void NoHandlerSendsAll()
    {
      Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
    }

    [Test]
    public void HandlerIsChecked()
    {
      bool filterCalled = false;
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        Assert.AreEqual("The thing is null", e.Message.Details.Error.Message);
        filterCalled = true;
        e.Cancel = true;
      };
      Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
      Assert.IsTrue(filterCalled);
    }

    [Test]
    public void HandlerCanAllowSend()
    {
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        // Allow send by not setting e.Cancel
      };
      Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
    }

    [Test]
    public void AllHandlersAreChecked()
    {
      bool filter1Called = false;
      bool filter2Called = false;
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        Assert.AreEqual("The thing is null", e.Message.Details.Error.Message);
        filter1Called = true;
        e.Cancel = true;
      };
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        Assert.AreEqual("The thing is null", e.Message.Details.Error.Message);
        filter2Called = true;
        e.Cancel = true;
      };
      Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
      Assert.IsTrue(filter1Called);
      Assert.IsTrue(filter2Called);
    }

    [Test]
    public void DontSendIfFirstHandlerCancels()
    {
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        e.Cancel = true;
      };
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        // Allow send by not setting e.Cancel
      };
      Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
    }

    [Test]
    public void DontSendIfSecondHandlerCancels()
    {
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        // Allow send by not setting e.Cancel
      };
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        e.Cancel = true;
      };
      Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
    }

    [Test]
    public void AllowSendIfNoHandlerCancels()
    {
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        // Allow send by not setting e.Cancel
      };
      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        // Allow send by not setting e.Cancel
      };
      Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
    }

    [Test]
    public void HandlerCanModifyMessage()
    {
      RaygunMessage message = _client.ExposeBuildMessage(_exception);
      Assert.AreEqual("The thing is null", message.Details.Error.Message);

      _client.SendingMessage += (object o, RaygunSendingMessageEventArgs e) =>
      {
        e.Message.Details.Error.Message = "Custom error message";
      };

      Assert.IsTrue(_client.ExposeOnSendingMessage(message));
      Assert.AreEqual("Custom error message", message.Details.Error.Message);
    }

    // CanSend tests

    [Test]
    public void CanSend()
    {
      Assert.IsTrue(_client.ExposeCanSend(_exception));
    }

    [Test]
    public void CannotSendSentException()
    {
      Exception exception = new InvalidOperationException("You cannot do that");
      _client.ExposeFlagAsSent(exception);
      Assert.IsFalse(_client.ExposeCanSend(exception));
    }

    [Test]
    public void CanSendIfExceptionIsUnknown()
    {
      Assert.IsTrue(_client.ExposeCanSend(null));
    }

    [Test]
    public void FlagNullAsSent()
    {
      Assert.DoesNotThrow(() => { _client.ExposeFlagAsSent(null); });
    }

    // WebProxy creation tests
    [Test]
    public void WebProxyPropertyPreferredOverDefaultWebProxy()
    {
      var theProxyWeDontWant = new WebProxy();
      var theProxyWeDoWant = new WebProxy();

      WebRequest.DefaultWebProxy = theProxyWeDontWant;
      _client.WebProxy = theProxyWeDoWant;

      var webClient = _client.ExposeCreateWebClient();

      Assert.AreSame(theProxyWeDoWant, webClient.Proxy);
    }
  }
}


text:
<?php
/**
 * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
 *
 * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
 */

namespace Lcobucci\JWT\Claim;

use Lcobucci\JWT\ValidationData;

/**
 * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
 * @since 2.0.0
 *
 * @coversDefaultClass Lcobucci\JWT\Claim\LesserOrEqualsTo
 */
class LesserOrEqualsToTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     *
     * @covers ::validate
     * @covers Lcobucci\JWT\Claim\Basic::__construct
     * @covers Lcobucci\JWT\Claim\Basic::getName
     * @covers Lcobucci\JWT\ValidationData::__construct
     * @covers Lcobucci\JWT\ValidationData::has
     */
    public function validateShouldReturnTrueWhenValidationDontHaveTheClaim()
    {
        $claim = new LesserOrEqualsTo('iss', 10);

        $this->assertTrue($claim->validate(new ValidationData()));
    }

    /**
     * @test
     *
     * @covers ::validate
     * @covers Lcobucci\JWT\Claim\Basic::__construct
     * @covers Lcobucci\JWT\Claim\Basic::getName
     * @covers Lcobucci\JWT\Claim\Basic::getValue
     * @covers Lcobucci\JWT\ValidationData::__construct
     * @covers Lcobucci\JWT\ValidationData::setIssuer
     * @covers Lcobucci\JWT\ValidationData::has
     * @covers Lcobucci\JWT\ValidationData::get
     */
    public function validateShouldReturnTrueWhenValueIsLesserThanValidationData()
    {
        $claim = new LesserOrEqualsTo('iss', 10);

        $data = new ValidationData();
        $data->setIssuer(11);

        $this->assertTrue($claim->validate($data));
    }

    /**
     * @test
     *
     * @covers ::validate
     * @covers Lcobucci\JWT\Claim\Basic::__construct
     * @covers Lcobucci\JWT\Claim\Basic::getName
     * @covers Lcobucci\JWT\Claim\Basic::getValue
     * @covers Lcobucci\JWT\ValidationData::__construct
     * @covers Lcobucci\JWT\ValidationData::setIssuer
     * @covers Lcobucci\JWT\ValidationData::has
     * @covers Lcobucci\JWT\ValidationData::get
     */
    public function validateShouldReturnTrueWhenValueIsEqualsToValidationData()
    {
        $claim = new LesserOrEqualsTo('iss', 10);

        $data = new ValidationData();
        $data->setIssuer(10);

        $this->assertTrue($claim->validate($data));
    }

    /**
     * @test
     *
     * @covers ::validate
     * @covers Lcobucci\JWT\Claim\Basic::__construct
     * @covers Lcobucci\JWT\Claim\Basic::getName
     * @covers Lcobucci\JWT\Claim\Basic::getValue
     * @covers Lcobucci\JWT\ValidationData::__construct
     * @covers Lcobucci\JWT\ValidationData::setIssuer
     * @covers Lcobucci\JWT\ValidationData::has
     * @covers Lcobucci\JWT\ValidationData::get
     */
    public function validateShouldReturnFalseWhenValueIsGreaterThanValidationData()
    {
        $claim = new LesserOrEqualsTo('iss', 11);

        $data = new ValidationData();
        $data->setIssuer(10);

        $this->assertFalse($claim->validate($data));
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>OPTRAJ: Référence de la classe src.optimisation.pythondeap.algo</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

OPTRAJ

Page principale

Paquetages

Classes

Fichiers

          <input type="text" id="MSearchField" value="Recherche" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Liste des classes

Index des classes

Hiérarchie des classes

Membres de classe

 Tout Classes Espaces de nommage Fichiers Fonctions Variables

src

optimisation

pythondeap

algo

Fonctions membres publiques |
Attributs publics |
Liste de tous les membres

Référence de la classe src.optimisation.pythondeap.algo

Classe algo qui définie toutes les fonctions utiles au déroulement de l'algorithme.
 Plus de détails...

Graphe de collaboration de src.optimisation.pythondeap.algo:

This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.

Fonctions membres publiques

def 	__init__

 	Constructeur d'une instance d'algo.  Plus de détails...

def 	createInd

 	Fonction qui permet de créer un individu valide pour l'algorithme.  Plus de détails...

def 	setWorkerInMust

 	Renvois l'ensemble des ouvriers devant impérativement être affecté à un site pour une date donnée.  Plus de détails...

def 	setWorkerInMustCraftQualif

 	Renvois l'ensemble des ouvriers devant impérativement être affecté à un site pour une date donnée et ayant un certain metier/qualification.  Plus de détails...

def 	TransformIndividualIntoAssignments

 	transforme un individu en un set(Assignments)  Plus de détails...

def 	lookingForWorkers

 	Récupère l'ensemble des workers de la base et les classe par métier puis par qualif.  Plus de détails...

def 	constructList

 	Trie un ensemble d'ouvriers en liste rangée du plus près au plus loin d'un chantier.  Plus de détails...

def 	evaluate

 	Évalue un individu.  Plus de détails...

def 	mutate

 	Fonction de mutation d'un individu.  Plus de détails...

def 	mate

 	Fontion de croisement entre deux individus en un point.  Plus de détails...

def 	crossMultiPoint

 	Fontion de croisement entre deux individus en multi points.  Plus de détails...

def 	selCustom

 	Opérateur de selection de K individus dans une population.  Plus de détails...

def 	equals

 	Fonction definissant l'égalité entre deux individus.  Plus de détails...

def 	distanceMax

 	Fonction retournant la distance maximale séparant un ouvrier d'un site.  Plus de détails...

def 	max

 	Évaluation du maximum dans une population.  Plus de détails...

def 	min

 	Évaluation du minimum dans une population.  Plus de détails...

def 	nbGen

 	Évaluation du nombre de génération déjà effectuées.  Plus de détails...

def 	main

 	Fonction principale de l'optimisation.  Plus de détails...

Attributs publics

 	system

 	weights

 	cxpb

 	mutpb

 	mu

 	lambda_

 	ngen

 	randpb

 	distanceMax

 	distanceMaxPassenger

 	must

 	issue

 	nbCurrentGen

Description détaillée

Classe algo qui définie toutes les fonctions utiles au déroulement de l'algorithme.

fonctionnement d'un algotithme génétique:

Attributs

system : le systeme utilisé dans l'aglorithme (System.System)

weights : les poids des différents critères d'évaluation, un triplet de float (distance des navettes, distance des ouvriers aux navettes, nombre de changement d'affectations)

cxpb : probalitité qu'un croissement entre deux individus se fasse durant une passe de l'algo (float)

mutpb : probalité qu'un individu mute durant une passe de l'algo (float)

mu : nombre d'individus sélectionnés à chaque itération (int)

lambda : nombre de nouveaux individus créés à chaque itération (int)

ngen : nombre d'itérations de l'algorithme (int)

randpb : pourcentage d'éléatoire dans la création d'un nouvel individu

distanceMax : la distance maximale en mètres du système entre un ouvrier et un chantier

distanceMaxPassenger : la distance maximale, en mètre, au delà de laquelle on considère qu'un ouvrier est trop loins du trajet pour être dans la navette

must : garde trace des ouvriers déjà affectés et qui doivent le rester

issue : stockent les information sur les problèmes rencontrés durant les calculs (par ex. pas assez d'ouvrier par rapport à la demande)

nbCurrentGen : le numéro de l'itération actuelle

Documentation des constructeurs et destructeur

          def src.optimisation.pythondeap.algo.__init__
          (

          self)

Constructeur d'une instance d'algo.

Initialise tous les attributs et récupère le système depuis la base de donnée

Documentation des fonctions membres

          def src.optimisation.pythondeap.algo.constructList
          (

          self,

          site,

          workers

          )

Trie un ensemble d'ouvriers en liste rangée du plus près au plus loin d'un chantier.

        site le numéro de chantier référence (int)
        workers l'ensemble des numéros ouvriers à trier (set(int))

Renvoie

workers sous forme de liste triée du plus proche de site au plus loin.

          def src.optimisation.pythondeap.algo.createInd
          (

          self,

          individual

          )

Fonction qui permet de créer un individu valide pour l'algorithme.

    forme d'un individu :

Paramètres

individual	la classe de l'objet retourné. Un creator.Individual

Renvoie

un Individu de la classe individual passée en paramètre.

          def src.optimisation.pythondeap.algo.crossMultiPoint
          (

          self,

          ind1,

          ind2

          )

Fontion de croisement entre deux individus en multi points.

    pour chaque semaine, on choisit aléatoirement les affectations de ind1 ou de ind2 à 50%

Paramètres

ind1	le premier individu présent dans le croisement (creator.Individual)

ind2	le deuxieme individu présent dans le croisement (creator.Individual)

Renvoie

un tuple des deux individus croisés

Examples

          def src.optimisation.pythondeap.algo.distanceMax
          (

          self)

Fonction retournant la distance maximale séparant un ouvrier d'un site.

Renvoie

la distance maximale

          def src.optimisation.pythondeap.algo.equals
          (

          self,

          ind1,

          ind2

          )

Fonction definissant l'égalité entre deux individus.

Paramètres

ind1	individu à tester

ind2	individu à tester

Renvoie

un booléen représentant l'égalité entre les deux individus. Ici, deux individus sont égaux si leurs valeurs de fitness sont égales

          def src.optimisation.pythondeap.algo.evaluate
          (

          self,

          individual

          )

Évalue un individu.

    A cause la la facon dont sont comparés les tuples par DEAP, seul le premier score du tuple retourné représente vraiment le score de l'individu
    les autres valeurs du tuples sont gardées pour ne pas perdre l'information mais sont déjà prises en compte dans le score

        individual l'individu à évaluer

Renvoie

un tuple de float donnant les scores de l'individu. Seul le premier élément représente le véritable score

          def src.optimisation.pythondeap.algo.lookingForWorkers
          (

          self,

          buildDotFile = False

          )

Récupère l'ensemble des workers de la base et les classe par métier puis par qualif.

    Si buildDotFile vaut True, on construit également une représentation dotty des ouvriers triés

Paramètres

buildDotFile	booleen definissant si on doit contruire un .dot du dictionaire retourné

Renvoie

dict(craft number, dict(qualif number, set(worker number))). Tous les éléments sont des ints

          def src.optimisation.pythondeap.algo.main
          (

          self)

Fonction principale de l'optimisation.

    enregistre les fonctions et types définis précédemment dans la toolbox et lance les calculs

Renvoie

le hall of fame des meilleurs individus

          def src.optimisation.pythondeap.algo.mate
          (

          self,

          ind1,

          ind2

          )

Fontion de croisement entre deux individus en un point.

    le croisement se fait en un point.

        ind1 le premier individu présent dans le croisement (creator.Individual)
        ind2 le deuxieme individu présent dans le croisement (creator.Individual)

Renvoie

un tuple des deux individus croisés

          def src.optimisation.pythondeap.algo.max
          (

          self,

          pop

          )

Évaluation du maximum dans une population.

Paramètres

pop	la population à évaluer

Renvoie

le score de l'individu dont l'évaluation est la plus haute dans pop

          def src.optimisation.pythondeap.algo.min
          (

          self,

          pop

          )

Évaluation du minimum dans une population.

Paramètres

pop	la population à évaluer

Renvoie

le score de l'individu dont l'évaluation est la plus basse dans pop

          def src.optimisation.pythondeap.algo.mutate
          (

          self,

          individual

          )

Fonction de mutation d'un individu.

    Une mutation consite à échanger aléatoirement au sein d'une semaines des affectations d'ouvrier.
    On n'échange que des ouvriers de même métier et qualification.
    L'échange est possible aussi bien entre 2 chantiers que entre un chantier et la liste des ouvriers non affectés.

Paramètres

individual	l'individu qui doit être muté

Renvoie

un tuple de l'individu passé en paramètre

Examples

          def src.optimisation.pythondeap.algo.nbGen
          (

          self,

          pop

          )

Évaluation du nombre de génération déjà effectuées.

Paramètres

pop	la population à évaluer

Renvoie

Le nombre de génération déjà effectuées dans l'algo

          def src.optimisation.pythondeap.algo.selCustom
          (

          self,

          individuals,

          k

          )

Opérateur de selection de K individus dans une population.

    k/2 meilleurs individus sont selectionnés en premier et le reste aléatoirement

Paramètres

individuals	une liste d'individu où ce fait la selection (list(creator.Individual))

k	Le nombre d'individus à selectionner. (int)

Returns	La liste contenant les k/2 meilleurs individus et k/2 random autres individus. (list(creator.Individual))

          def src.optimisation.pythondeap.algo.setWorkerInMust
          (

          self,

          year,

          week,

          site

          )

Renvois l'ensemble des ouvriers devant impérativement être affecté à un site pour une date donnée.

        year l'année (int)
        week le numéro de semaine (int)
        site int le numéro du chantier (int)

Renvoie

l'ensemble de tous les ouvriers devant être affectés au site pour cette semaine (set(Worker.num))

          def src.optimisation.pythondeap.algo.setWorkerInMustCraftQualif
          (

          self,

          year,

          week,

          site,

          craft,

          qualif

          )

Renvois l'ensemble des ouvriers devant impérativement être affecté à un site pour une date donnée et ayant un certain metier/qualification.

        year l'année (int)
        week le numéro de semaine (int)
        site le numéro du chantier (int)

Renvoie

l'ensemble des ouvriers du bon craft/qualif devant être affectés au site pour cette semaine (set(Worker.num))

          def src.optimisation.pythondeap.algo.TransformIndividualIntoAssignments
          (

          self,

          individual

          )

transforme un individu en un set(Assignments)

    L'individu n'est pas changé par l'opération

        individual l'individu en question

Paramètres

Return	toutes les affectations réprésentées par l'individu dans un set(Assignments)

Documentation des données membres

          src.optimisation.pythondeap.algo.cxpb

          src.optimisation.pythondeap.algo.distanceMax

          src.optimisation.pythondeap.algo.distanceMaxPassenger

          src.optimisation.pythondeap.algo.issue

          src.optimisation.pythondeap.algo.lambda_

          src.optimisation.pythondeap.algo.mu

          src.optimisation.pythondeap.algo.must

          src.optimisation.pythondeap.algo.mutpb

          src.optimisation.pythondeap.algo.nbCurrentGen

          src.optimisation.pythondeap.algo.ngen

          src.optimisation.pythondeap.algo.randpb

          src.optimisation.pythondeap.algo.system

          src.optimisation.pythondeap.algo.weights

La documentation de cette classe a été générée à partir du fichier suivant :

/home/sacapuces/optraj.istic.univ-rennes1.fr/vagrant/optraj.istic.univ-rennes1.fr/src/optimisation/pythondeap.py

<address class="footer">
Généré le Jeudi Avril 24 2014 13:03:21 pour OPTRAJ par

 1.8.4
</address>


text:
var assert = require('assert');

describe('node-quarium', function() {
    describe('serialProbe', function() {
        let serialProbe = require('../libs/serialProbe');

        describe('parseRawReadingFromFile', function() {
            it('should parse an int from the w1_slave file', function(done) {
                // Value is hard-code in dummy file w1_slave which reflects the format of the w1_slave file on a raspberry pi
                serialProbe.parseRawReadingFromFile('./tests/data/w1_slave', function(err, output) {
                    assert.equal(err, undefined);
                    assert.equal(output, 20687);
                    done();
                })
            })

            it('should return an error for the first line reads "NO"', function(done) {
                serialProbe.parseRawReadingFromFile('./tests/data/w1_slave_no', function(err, output) {
                    assert(err);
                    done();
                })
            })
        })
    })
})


text:
import { MessageKey, QueryKey, Type, EnumType, registerSymbol } from '../../../Framework/Signum.React/Scripts/Reflection'
import * as Entities from '../../../Framework/Signum.React/Scripts/Signum.Entities'
import * as Processes from '../Processes/Signum.Entities.Processes'
import * as Files from '../Files/Signum.Entities.Files'
import * as Authorization from '../Authorization/Signum.Entities.Authorization'
import * as Scheduler from '../Scheduler/Signum.Entities.Scheduler'

export const PrintLineEntity = new Type<PrintLineEntity>("PrintLine");
export interface PrintLineEntity extends Entities.Entity, Processes.IProcessLineDataEntity {
  Type: "PrintLine";
  creationDate: string;
  testFileType: Files.FileTypeSymbol | null;
  file: Files.FilePathEmbedded;
  package: Entities.Lite<PrintPackageEntity> | null;
  printedOn: string | null;
  referred: Entities.Lite<Entities.Entity>;
  state: PrintLineState;
}

export module PrintLineOperation {
  export const CreateTest : Entities.ConstructSymbol_Simple<PrintLineEntity> = registerSymbol("Operation", "PrintLineOperation.CreateTest");
  export const SaveTest : Entities.ExecuteSymbol<PrintLineEntity> = registerSymbol("Operation", "PrintLineOperation.SaveTest");
  export const Print : Entities.ExecuteSymbol<PrintLineEntity> = registerSymbol("Operation", "PrintLineOperation.Print");
  export const Retry : Entities.ExecuteSymbol<PrintLineEntity> = registerSymbol("Operation", "PrintLineOperation.Retry");
  export const Cancel : Entities.ExecuteSymbol<PrintLineEntity> = registerSymbol("Operation", "PrintLineOperation.Cancel");
}

export const PrintLineState = new EnumType<PrintLineState>("PrintLineState");
export type PrintLineState =
  "NewTest" |
  "ReadyToPrint" |
  "Enqueued" |
  "Printed" |
  "Cancelled" |
  "Error" |
  "PrintedAndDeleted";

export const PrintPackageEntity = new Type<PrintPackageEntity>("PrintPackage");
export interface PrintPackageEntity extends Entities.Entity, Processes.IProcessDataEntity {
  Type: "PrintPackage";
  name: string | null;
}

export module PrintPackageProcess {
  export const PrintPackage : Processes.ProcessAlgorithmSymbol = registerSymbol("ProcessAlgorithm", "PrintPackageProcess.PrintPackage");
}

export module PrintPermission {
  export const ViewPrintPanel : Authorization.PermissionSymbol = registerSymbol("Permission", "PrintPermission.ViewPrintPanel");
}

export module PrintTask {
  export const RemoveOldFiles : Scheduler.SimpleTaskSymbol = registerSymbol("SimpleTask", "PrintTask.RemoveOldFiles");
}


text:
package communityservice;

public class Activity {

    private String name;
    private int hours;
    private int capacity;
    private String description;
    private String date;
    private String supervisor;
    public String [] members;
    public int activityID;
    public boolean deleted;

    public Activity(){

    }

    public String getName() {
        return name;
    }

    public String[] getMembers() {
        return members;
    }

    public void setMembers(String[] members) {
        this.members = members;
    }

    public int getActivityID() {
        return activityID;
    }

    public void setActivityID(int activityID) {
        this.activityID = activityID;
    }

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

    public int getHours() {
        return hours;
    }

    public void setHours(int hours) {
        this.hours = hours;
    }

    public int getCapacity() {
        return capacity;
    }

    public void setCapacity(int capacity) {
        this.capacity = capacity;
        members = new String [capacity];
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getSupervisor() {
        return supervisor;
    }

    public void setSupervisor(String supervisor) {
        this.supervisor = supervisor;
    }

}


text:
.. _architecture:

Architecture
============

Velruse implements an API similar to `RPXNow`_ to standardize the
way a web application handles user authentication. The standard flow of using
Velruse looks like this:

.. image:: _static/overview.png
   :alt: Velruse Authentication flow
   :align: center

1. Website sends a POST to the :term:`auth provider`'s URL with an endpoint
   that the user should be redirected back to when authentication is complete
   and includes any additional parameters that the :term:`auth provider`
   requires.

2. When the :term:`auth provider` finishes the authentication, the user is
   redirected back to the endpoint specified with a POST, which includes the
   user's authentication data.

Auth Providers
--------------

Auth Providers implement all the messy details of authentication. Since they
listen to HTTP requests underneath their prefix, they can interact with other
systems that require redirects to authenticate. When the Auth Provider is done
it redirects back to the endpoint that it was provided with.

The Auth Provider is expected to respond to a POST to ``/login``, and then
proceed with the necessary calls and/or redirects necessary to complete
the authentication. Each provider is responsible for converting profile
data into a format compatible with `Portable Contacts`_.

Provider HTML Examples
----------------------

Every authentication provider that is available comes with a basic HTML
example illustrating the parameters it requires. The template generally
includes a logo when it's a third party :term:`identity provider` to help
a website user find the preferred authentication option.

.. note::

    While most websites will redirect to Velruse to handle the authentication
    for a user to login or register, the authentication can be done anytime
    for 'linking' an account to another provider as well.

.. _Portable Contacts: http://portablecontacts.net/draft-spec.html
.. _RPXNow: http://rpxnow.com/


text:
package com.moonlightpixels.jrpg.map.character;

import com.badlogic.gdx.ai.fsm.StackStateMachine;
import com.badlogic.gdx.ai.fsm.State;
import com.badlogic.gdx.ai.fsm.StateMachine;
import com.badlogic.gdx.ai.msg.Telegram;
import com.badlogic.gdx.math.Vector2;
import com.moonlightpixels.jrpg.map.Direction;
import com.moonlightpixels.jrpg.map.JRPGMap;
import com.moonlightpixels.jrpg.map.TileCoordinate;
import com.moonlightpixels.jrpg.map.character.internal.CharacterCommand;
import com.moonlightpixels.jrpg.map.character.internal.CharacterController;
import com.moonlightpixels.jrpg.map.internal.MapActor;
import com.moonlightpixels.jrpg.tween.Vector2Tween;
import lombok.Getter;
import lombok.Setter;

import java.util.Optional;

public class CharacterActor extends MapActor<CharacterAnimation> {
    private static final float DEFAULT_SPEED = 0.3f;

    private final StateMachine<CharacterActor, CharacterState> stateMachine;
    private CharacterController controller;
    private Direction direction;
    private final int tilesCoveredPerWalkCycle;
    private float x;
    private float y;
    @Getter
    @Setter
    private float timeToTraverseTile = DEFAULT_SPEED;
    @Getter
    private TileCoordinate destination;
    private Vector2Tween walkingTween;

    /**
     * Creates a new CharacterActor.
     *  @param position Position on the Map
     * @param map Reference to the Map this actor is being placed on.
     * @param animationSet AnimationSet used by ths actor
     * @param controller Controller for character
     * @param initialDirection Direction this character is initially facing
     */
    public CharacterActor(final TileCoordinate position, final JRPGMap map,
                          final CharacterAnimationSet animationSet,
                          final CharacterController controller,
                          final Direction initialDirection) {
        super(map, animationSet, position);
        this.controller = controller;
        direction = initialDirection;
        x = calculateXForCenteredOnTile(position);
        y = map.getTileCoordinateXY(position).y;
        tilesCoveredPerWalkCycle = animationSet.getTilesCoveredPerWalkCycle();
        stateMachine = new StackStateMachine<>(this);
        stateMachine.changeState(CharacterState.Standing);
    }

    @Override
    protected final float calculateX() {
        return x;
    }

    @Override
    protected final float calculateY() {
        return y;
    }

    @Override
    protected final void actInternal(final float delta) {
        getWalkingTween().ifPresent(tween -> tween.update(delta));
        stateMachine.update();
    }

    private float getWalkAnimationDuration() {
        return tilesCoveredPerWalkCycle * timeToTraverseTile;
    }

    private Optional<Vector2Tween> getWalkingTween() {
        return Optional.ofNullable(walkingTween);
    }

    private boolean nextDestination() {
        if (!getMap().isOpen(getPosition().getAdjacent(direction))) {
            return false;
        }
        destination = getPosition().getAdjacent(direction);
        walkingTween = Vector2Tween.builder()
            .start(
                new Vector2(
                    calculateXForCenteredOnTile(getPosition()),
                    getMap().getTileCoordinateXY(getPosition()).y
                )
            )
            .end(
                new Vector2(
                    calculateXForCenteredOnTile(destination),
                    getMap().getTileCoordinateXY(destination).y
                )
            )
            .totalTweenTime(timeToTraverseTile)
            .build();
        return true;
    }

    private void arriveAtDestination() {
        setPosition(destination);
        x = calculateXForCenteredOnTile(getPosition());
        y = getMap().getTileCoordinateXY(getPosition()).y;
        destination = null;
        walkingTween = null;
    }

    private enum CharacterState implements State<CharacterActor> {
        Standing {
            @Override
            public void enter(final CharacterActor entity) {
                entity.setAnimation(
                    CharacterAnimation.getStandingAnimation(entity.direction),
                    1.0f
                );
            }

            @Override
            public void update(final CharacterActor entity) {
                CharacterCommand command = entity.controller.getNextCommand(entity);
                if (command != CharacterCommand.Stand) {
                    entity.direction = CharacterCommand.getDirectionForWalkCommand(command);
                    entity.stateMachine.changeState(Walking);
                }
            }
        },
        Walking {
            @Override
            public void enter(final CharacterActor entity) {
                if (attemptNextTile(entity)) {
                    entity.setAnimation(
                        CharacterAnimation.getWalkingAnimation(entity.direction),
                        entity.getWalkAnimationDuration()
                    );
                }
            }

            @Override
            public void update(final CharacterActor entity) {
                if (entity.walkingTween.isComplete()) {
                    entity.arriveAtDestination();

                    CharacterCommand command = entity.controller.getNextCommand(entity);
                    if (command == CharacterCommand.Stand) {
                        entity.stateMachine.changeState(Standing);
                    } else if (command == CharacterCommand.getWalkByDirection(entity.direction)) {
                        attemptNextTile(entity);
                    } else {
                        entity.direction = CharacterCommand.getDirectionForWalkCommand(command);
                        entity.stateMachine.changeState(Walking);
                    }
                } else {
                    entity.x = entity.walkingTween.getValue().x;
                    entity.y = entity.walkingTween.getValue().y;
                }
            }

            private boolean attemptNextTile(final CharacterActor entity) {
                if (!entity.nextDestination()) {
                    entity.stateMachine.changeState(CharacterState.Standing);
                    return false;
                }
                return true;
            }
        };

        @Override
        public void enter(final CharacterActor entity) {

        }

        @Override
        public void update(final CharacterActor entity) {

        }

        @Override
        public void exit(final CharacterActor entity) {

        }

        @Override
        public boolean onMessage(final CharacterActor entity, final Telegram telegram) {
            return false;
        }
    }
}


text:
layout: post
title: End of second semester
---
Well as you may know I'm an engineering student at Chapingo University in Mexico. At the time I am finishing my second semester of the master degree. It has been a very exciting time and not so easy. Every engineering requires a very well understanding of math, particularly this program requires statistics and programming.

![calculadora]({{ site.baseurl }}/images/calculator1.jpg)

This semester I was taking classes like statistics, simulation of bio-systems, hydraulics and, a class of evolutionary and bio-inspired algorithms.

Software that was useful was Matlab (a lot), R, Mathematica and Epanet. A Voyage 200 or another Texas Instruments calculator is very useful for the statistic course.

One of my goals was to use (or at least try to) free and open source software. Until now, the only proprietary pieces software that I am using are Matlab and Mathematica, but I use them a lot. I think the Matlab-Simulink combo can be replaced easily by Scilab. There are a lot of replacements for Mathematica, but they are not as "good".
So, now on I will be focused in my research. First I have to study some evolutionary computing and select some evolutionary algorithms to use as part of my research. And that sounds exciting to me.