text:
package com.emitrom.touch4j.charts.client.series;

import com.emitrom.touch4j.client.core.JsoHelper;
import com.google.gwt.core.client.JavaScriptObject;

public class RadarSeries extends BaseSeries {

    public RadarSeries() {
        jsObj = JsoHelper.createObject();
        setType("radar");
    }

    public native void setMarkerConfig(JavaScriptObject value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.markerConfig = value;
    }-*/;

    public native void showMarkers(boolean value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.showMarkers = value;
    }-*/;

    public native void setDonut(double value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.donut = value;
    }-*/;

    public native void setNeedle(boolean value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.needle = value;
    }-*/;

    public native void setStyle(Object value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.style = value;
    }-*/;

    public native <T> T getLegendColor()/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		return series.getLegendColor();
    }-*/;

    public native void setValue(Object value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.setValue(value);
    }-*/;

    public native void setXField(String value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.xField = value;
    }-*/;

    public native void setYField(String value)/*-{
		var series = this.@com.emitrom.touch4j.client.core.JsObject::getJsObj()();
		series.yField = value;
    }-*/;

}


text:
<?php
/**
 * Clean up the_excerpt()
 */
function roots_excerpt_more($more) {
  return ' … ' . __('Continued', 'roots') . '';
}
add_filter('excerpt_more', 'roots_excerpt_more');

/**
 * Manage output of wp_title()
 */
function roots_wp_title($title) {
  if (is_feed()) {
    return $title;
  }

  $title .= get_bloginfo('name');

  return $title;
}
add_filter('wp_title', 'roots_wp_title', 10);

/**
 *
 */
function roots_cordova_filter_content($content) {
	if(is_single()) {
		$doc = new DOMDocument();
		if($content){
  		$doc->loadHTML($content);
		}

		$imgs = $doc->getElementsByTagName('img');
		foreach ($imgs as $img) {
			$img->setAttribute('class', 'img-responsive blog-images');
		  if($img->getAttribute('height') > $img->getAttribute('width')){

        $after = $doc->createElement("div","");
        $after->setAttribute('class', 'row');

  			$img->setAttribute('class', 'img-responsive blog-images col-sm-6 col-sm-offset-3 col-xs-8 col-xs-offset-2');
  			$img->appendChild($after);
			}
		}
		$content = $doc->saveXML();
	}
	return $content;
}
add_filter('the_content', 'roots_cordova_filter_content');

redpajama_set_name: RedPajamaGithub


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

package com.google.devtools.build.lib.rules.java;

import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.NativeInfo;
import com.google.devtools.build.lib.packages.NativeProvider;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization;
import com.google.devtools.build.lib.syntax.Environment;
import com.google.devtools.build.lib.syntax.FunctionSignature;
import com.google.devtools.build.lib.syntax.SkylarkList;
import com.google.devtools.build.lib.syntax.SkylarkType;
import javax.annotation.Nullable;

/** Marks configured targets that are able to supply message bundles to their dependents. */
@AutoCodec
@Immutable
public final class MessageBundleInfo extends NativeInfo {

  public static final String SKYLARK_NAME = "MessageBundleInfo";

  private static final SkylarkType LIST_OF_ARTIFACTS =
      SkylarkType.Combination.of(SkylarkType.SEQUENCE, SkylarkType.of(Artifact.class));

  private static final FunctionSignature.WithValues<Object, SkylarkType> SIGNATURE =
      FunctionSignature.WithValues.create(
          FunctionSignature.namedOnly("messages"),
          /*defaultValues=*/ null,
          /*types=*/ ImmutableList.of(LIST_OF_ARTIFACTS));

  public static final NativeProvider<MessageBundleInfo> PROVIDER =
      new NativeProvider<MessageBundleInfo>(MessageBundleInfo.class, SKYLARK_NAME, SIGNATURE) {
        @Override
        @SuppressWarnings("unchecked")
        protected MessageBundleInfo createInstanceFromSkylark(
            Object[] args, Environment env, Location loc) {
          return new MessageBundleInfo(ImmutableList.copyOf((SkylarkList<Artifact>) args[0]), loc);
        }
      };

  private final ImmutableList<Artifact> messages;

  public static MessageBundleInfo create(ImmutableList<Artifact> messages) {
    return new MessageBundleInfo(messages, null);
  }

  @VisibleForSerialization
  @AutoCodec.Instantiator
  MessageBundleInfo(ImmutableList<Artifact> messages, Location location) {
    super(PROVIDER, location);
    this.messages = ImmutableList.copyOf(messages);
  }

  public Location getLocation() {
    return location;
  }

  public ImmutableList<Artifact> getMessages() {
    return messages;
  }

  @Nullable
  public static ImmutableList<Artifact> getMessages(TransitiveInfoCollection info) {
    MessageBundleInfo messageBundleInfo =
        (MessageBundleInfo) info.get(MessageBundleInfo.PROVIDER.getKey());
    if (messageBundleInfo != null) {
      return messageBundleInfo.getMessages();
    }
    return null;
  }
}


text:
set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..
SCRIPT_BASE=${SCRIPT_ROOT}/../..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo k8s.io/code-generator)}

if LANG=C sed --help 2>&1 | grep -q GNU; then
  SED="sed"
elif which gsed &>/dev/null; then
  SED="gsed"
else
  echo "Failed to find GNU sed as sed or gsed. If you are on Mac: brew install gnu-sed." >&2
  exit 1
fi

# Register function to be called on EXIT to remove generated binary.
function cleanup {
  rm -f "${CLIENTGEN:-}"
  rm -f "${listergen:-}"
  rm -f "${informergen:-}"
}
trap cleanup EXIT

echo "Building client-gen"
CLIENTGEN="${PWD}/client-gen-binary"

go build -o "${CLIENTGEN}" ${CODEGEN_PKG}/cmd/client-gen

PREFIX=k8s.io/kube-aggregator/pkg/apis
INPUT_BASE="--input-base ${PREFIX}"
INPUT_APIS=(
apiregistration/
apiregistration/v1beta1
apiregistration/v1
)
INPUT="--input ${INPUT_APIS[@]}"
CLIENTSET_PATH="--output-package k8s.io/kube-aggregator/pkg/client/clientset_generated"

${CLIENTGEN} ${INPUT_BASE} ${INPUT} ${CLIENTSET_PATH} --output-base ${SCRIPT_BASE}
${CLIENTGEN} --clientset-name="clientset" ${INPUT_BASE} --input apiregistration/v1beta1,apiregistration/v1 ${CLIENTSET_PATH}  --output-base ${SCRIPT_BASE}

echo "Building lister-gen"
listergen="${PWD}/lister-gen"
go build -o "${listergen}" ${CODEGEN_PKG}/cmd/lister-gen

LISTER_INPUT="--input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration --input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1,k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
LISTER_PATH="--output-package k8s.io/kube-aggregator/pkg/client/listers"
${listergen} ${LISTER_INPUT} ${LISTER_PATH} --output-base ${SCRIPT_BASE}

echo "Building informer-gen"
informergen="${PWD}/informer-gen"
go build -o "${informergen}" ${CODEGEN_PKG}/cmd/informer-gen

${informergen} \
  --output-base ${SCRIPT_BASE} \
  --input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration --input-dirs k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1,k8s.io/kube-aggregator/pkg/apis/apiregistration/v1 \
  --versioned-clientset-package k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset \
  --internal-clientset-package k8s.io/kube-aggregator/pkg/client/clientset_generated/internalclientset \
  --listers-package k8s.io/kube-aggregator/pkg/client/listers \
  --output-package k8s.io/kube-aggregator/pkg/client/informers
  "$@"


text:
powershell_script 'Install IIS' do
  code <<-EOH
  Add-WindowsFeature Web-Server, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-Http-Redirect, Web-Health, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Http-Tracing, Web-Performance, Web-Stat-Compression, Web-Security, Web-Filtering, Web-Basic-Auth, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext, Web-Net-Ext45, Web-Asp-Net, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-WebSockets, Web-Mgmt-Tools, Web-Mgmt-Console, Web-Mgmt-Compat, Web-Mgmt-Service
  EOH
  action :run
  not_if "(Get-WindowsFeature -Name Web-Server).Installed"
end

windows_service 'w3svc' do
  action [:start, :enable]
end


text:
title: IPv6 und IPsec
modulverantwortlich: Herr Prof. Dr. Hans L. Stahl
modulniveau:
kuezel: WPF62
untertitel:
studiensemester: 4
kategorie:
sprache:
zuordnung-zum-curriculum: Medieninformatik Bachelor
kreditpunkte: 5
voraussetzungen-nach-pruefungsordnung: KT, EBR
empfohlene-voraussetzungen:
published: true
---

## Lehrform/SWS:

## Arbeitsaufwand:

## Angestrebte Lernergebnisse:

## Inhalt:
Wird in diesem Semester nicht angeboten bzw. in Kombination mit WPF36 (Mobile IT Security) durchgeführt.

## Studien-/Prüfungsleistungen:

## Medienformen:

## Literatur:
(folgt)


text:
import pyDate
import Processing
import Resources
import os;

from multiprocessing import Pool;

def run(dt,outdir):

    #org  = ['g06'];
    #expt = ['glbl','glbf','glbd','anet','gnet','capp','swpp','tigg','glbk'];
    #expt = ['glbk'];
    #expt = ['anet','gnet'];
    expt = ['glbf'];
    org  = ['n08'];

    for e in expt:
        for o in org:

            # construct the AWS/S3 bucket path
            soln_bucket = Processing.solution_bucket(dt.year,dt.doy,'',e,o,None);

            # ok get the snx with this bucket prefix
            files = Resources.get_resources(soln_bucket, '.mat.gz', outdir);

            # blab about it ... maybe
            if len(files) > 0: print soln_bucket,len(files);

def action(dt):

    try:
        #run(dt,'/Volumes/PROMISE_PEGASUS/data/g06/data/');
        run(dt,'/Users/abelbrown/data/n08');
    except:
        print "Unexpected error:", os.sys.exc_info()[0];

def main():

    # create start and stop dates for the run
    start_date = pyDate.Date(year=2000,doy=1);
    end_date   = pyDate.Date(year=2017,doy=1);

    # init queue for dates
    dates = list();

    # init date
    dt = start_date;

    # populate the date queue
    while dt <= end_date :

        # add the date to the queue
        dates.append(dt);

        # increment the data
        dt += 1;

    # create a pool of worker threads
    pool = Pool(16);

    # map the action function to each date in the queue
    pool.map(action,dates);

if __name__ == '__main__':
    main();


text:
using System;
using Newtonsoft.Json;
using Xunit;

namespace GridDomain.Tests.Unit.Serialization
{
    public class Private_setters_without_parameter_in_constructor_deserialization
    {
        private class TestClass
        {
            public TestClass(string name)
            {
                Name = name;
                Value = "1";
            }

            private TestClass() {}

            public Guid Id { get; }
            public string Name { get; }
            public string Value { get; private set; }

            public void ChangeValue(string value)
            {
                Value = value;
            }
        }

        [Fact]
        public void Should_serialize_deserialize()
        {
            var testClass = new TestClass("123");
            var data = JsonConvert.SerializeObject(testClass);
            var restoredData = JsonConvert.DeserializeObject<TestClass>(data);
            Assert.Equal(testClass.Value, restoredData.Value);
        }
    }
}


text:
/* ----------------- sse-breaker ----------------- *\
 * Licensed under the Apache License, Version 2.0. *
 * Author: Spiros Tzavellas                        *
\* ----------------------------------------------- */
package com.tzavellas.sse.breaker

import org.junit.Test

import scala.util.{Failure, Success}

class CircuitBreakerAsyncTest extends AbstractCircuitBreakerTest with CircuitDriver {

  @Test
  def dummy_test(): Unit = { }

  // -- CircuitDriver implementation ------------------------------------------

  implicit val testExecutor = CircuitExecutor.currentThreadExecutor

  def makeNormalCall(circuitIsOpen: Boolean = false) = {
    val f = executor.async(normalOperation)
    f.value.get match {
      case Success(i)                  => i
      case Failure(e) if circuitIsOpen => throw e
      case Failure(e)                  => throw new AssertionError("Unexpected exception!", e)
    }
  }

  def makeCallWithNonLocalReturn(): Any = executor.async { return 43 }

  def generateFaults(numOfFaults: Int): Unit =
    for (_ <- 0 until numOfFaults) executor.async(faultyOperation)

  def normalOperation = 42
  def faultyOperation = throw new IllegalStateException
}


text:
ScinStart=$1
ScinStop=$2
Lay=$3
FileName=$4
Filepath=$5
NumFilStart=1
NumFilStop=$6
RunJson=$7
Tfile=$8
OutDir=$9
#FileExt="hld.xz"
#FileExt2="hits.root"
#
DetectorSetup="CalibrationFiles/${RunJson}_RUN/detectorSetupRun$RunJson.json"
UserParams="userParamsRun${RunJson}.json"
#
if [[ $RunJson -eq 61 ]];
then
DetectorSetup="CalibrationFiles/6_RUN/detectorSetupRun6A.json"
UserParams="userParamsRun6A.json"
fi
if [[ $RunJson -eq 62 ]];
then
DetectorSetup="CalibrationFiles/6_RUN/detectorSetupRun6B.json"
UserParams="userParamsRun6B.json"
fi
if [[ $RunJson -eq 63 ]];
then
DetectorSetup="CalibrationFiles/6_RUN/detectorSetupRun6C.json"
UserParams="userParamsRun6C.json"
fi
if [[ $RunJson -eq 64 ]];
then
DetectorSetup="CalibrationFiles/6_RUN/detectorSetupRun6D.json"
UserParams="userParamsRun6D.json"
fi
#
echo "##############################################################"
echo "--------------------------------------------------------------"
echo "Using the following userPams.json file: $UserParams "
echo "Using the following DetectorSetup file: $DetectorSetup "
echo "Using the following extension: $Tfile"
echo "--------------------------------------------------------------"
echo "Bash version ${BASH_VERSION}..."
pacan=`pwd`
echo $pacan
#
while read linia
    do
  i=`echo $linia | awk -F":" '{print $1}' | awk -F"_" '{print $2}'`
  dir=`echo $linia | awk -F":" '{print $2}'| awk '{print $1}'`
  j=`echo $linia | awk -F":" '{print $1}' | awk -F"_" '{print $1}'`
  if [[ ($i -ge $ScinStart) ]] && [[ ($i -le $ScinStop) ]] && [[ ($j -eq $Lay) ]];
  then
      s=$i
      PackedId=$(($((100*Lay)) + i))
      zonk=`grep TimeWindowCreator_MainStrip_int $UserParams | awk -F"\"" '{print $4}'`
      zonk1=`grep TimeWindowCreator_MainStrip_int $UserParams| awk -F"[ ]" '{print $2}'`
      echo $zonk
      echo $UserParams
      tekst="\"TimeWindowCreator_MainStrip_int\"":"\"${PackedId}\","
      echo $zonk1
      echo $tekst
#
      sed -i -e "s/$zonk1/$tekst/g" "$UserParams"
      echo "Packed slot ID= $PackedId"
      echo "--------------------------------------------------------------"
      echo "Submitting job for Slot $i Layer $j"
      echo "--------------------------------------------------------------"
     if [[ "$Tfile" == "hld" ]];
      then
	if [[ `ls -ltr $Filepath$dir/*.xz` ]];
        then
	    FileExt="hld.xz"
	    Unzipper=$(echo "xz -kd")
	else
	 if [[ `ls -ltr $Filepath$dir/*.bz2` ]];
         then
	  FileExt="hld.bz2"
	  Unzipper=$(echo "lbzip2 -k -d -c")
	 fi
	fi
       ile=`ls -ltr $Filepath$dir/*.$FileExt | wc -l`
       echo "Number of files per position=$ile"
       for ((ii=$NumFilStart; ii<=$NumFilStop; ii++)); do
#	   echo $ii
	if [[ ($ii > $ile) ]];
	then
	 break
	fi
	agh=$(($ii+1))
#      list=`echo ls -1 $Filepath$dir/*.${FileExt}| awk -F"dabc_" '{print $'"${ii}"'}' | awk '{print $1}'`
      FilN=`echo ls -1 $Filepath$dir/*.${FileExt}| awk -F"dabc_" '{print $'"${agh}"'}' | awk '{print $1}' |awk -F"." '{print $1}'`
       OldFileName="$Filepath$dir/dabc_$FilN.$FileExt"
#       echo $FilN
#       echo $OldFileName
#       echo $agh
       if [[ ($i -gt 9) ]];
	then
	 NewFileName="Layer${Lay}_slot${s}_${ii}"
       else
	 NewFileName="Layer${Lay}_slot0${s}_${ii}"
       fi
####
       if [[ -f " $NewFileName.$Tfile" ]];
	then
	 echo "$NewFileName.$Tfile exists we do not decompress the file"
       else
	  if [[ -f "$OldFileName" ]];
	  then
	   echo "Copy and unzip $OldFileName.$Tfile.xz to $NewFileName.$Tfile"
	   $Unzipper $OldFileName --stdout >> $NewFileName.$Tfile
	  fi
#
	fi
         echo "##############################################################"
	 echo "Start of analysis of File $NewFileName.$Tfile ($Filepath$dir/dabc_$FilN.$Tfile)"
	 echo "##############################################################"
         echo "./TimeCalibration_iter.x -t hld -f $NewFileName.$Tfile -i $RunJson -u $UserParams -b -o $OutDir -p conf_trb3.xml -l $DetectorSetup"
	 ./TimeCalibration_iter.x -t hld -f $NewFileName.$Tfile -i $RunJson -u $UserParams -b -o $OutDir p conf_trb3.xml -l $DetectorSetup
	 rm $NewFileName.hld
	 rm $NewFileName.hld.root
	 rm $OutDir$NewFileName.tslot.raw.root
	 rm $OutDir$NewFileName.raw.sig.root
	 rm $OutDir$NewFileName.phys.sig.root
#	 rm $OutDir$NewFileName.hits.root
#	 rm $OutDir$NewFileName.calib.root
       done
     else
#
#If we work with files already preselected
#
        ile=`ls -ltr $Filepath/Layer${Lay}_slot0${s}*${Tfile} | wc -l`
         echo "##############################################################"
         echo "I have found $ile files for Layer ${Lay} and slot ${s}"
         echo "##############################################################"
        for ((k=$NumFilStart; k<=$NumFilStop; k++)); do
          if [[ ($k -gt $ile) ]];
          then
           break
          fi
	 NewFileName="${Filepath}/Layer${Lay}_slot0${s}_${k}.${Tfile}"
         echo "##############################################################"
	 echo "Start of analysis of File $NewFileName"
	 echo "##############################################################"
         echo "./TimeCalibration_iterroot.x -t root -f $NewFileName -i $RunJson -u $UserParams -b -o $OutDir -p conf_trb3.xml -l $DetectorSetup"
	 ./TimeCalibration_iterroot.x -t root -f $NewFileName -i $RunJson -u $UserParams -b -o $OutDir -p conf_trb3.xml -l $DetectorSetup
	done
      fi
###
      echo "DONE WITH SLOT $i LAYER $j"
  fi
done < $FileName


text:
<?php

namespace NXP;

use NXP\Classes\Calculator;
use NXP\Classes\CustomFunction;
use NXP\Classes\Operator;
use NXP\Classes\Token;
use NXP\Classes\Tokenizer;
use NXP\Exception\DivisionByZeroException;
use NXP\Exception\MathExecutorException;
use NXP\Exception\UnknownVariableException;
use ReflectionException;

/**
 * Class MathExecutor
 * @package NXP
 */
class MathExecutor
{
    /**
     * Available variables
     *
     * @var array<string, float|string>
     */
    private $variables = [];

    /**
     * @var callable|null
     */
    private $onVarNotFound = null;

    /**
     * @var Operator[]
     */
    private $operators = [];

    /**
     * @var array<string, CustomFunction>
     */
    private $functions = [];

    /**
     * @var array<string, Token[]>
     */
    private $cache = [];

    /**
     * Base math operators
     */
    public function __construct()
    {
        $this->addDefaults();
    }

    /**
     * Set default operands and functions
     * @throws ReflectionException
     */
    protected function addDefaults() : void
    {
        foreach ($this->defaultOperators() as $name => $operator) {
            [$callable, $priority, $isRightAssoc] = $operator;
            $this->addOperator(new Operator($name, $isRightAssoc, $priority, $callable));
        }
        foreach ($this->defaultFunctions() as $name => $callable) {
            $this->addFunction($name, $callable);
        }
        $this->variables = $this->defaultVars();
    }

    /**
     * Get the default operators
     *
     * @return array<string, array{callable, int, bool}>
     */
    protected function defaultOperators() : array
    {
        return [
            '+'    => [
                function ($a, $b) {
                    return $a + $b;
                },
                170,
                false
            ],
            '-'    => [
                function ($a, $b) {
                    return $a - $b;
                },
                170,
                false
            ],
            'uPos' => [ // unary positive token
                        function ($a) {
                            return $a;
                        },
                        200,
                        false
            ],
            'uNeg' => [ // unary minus token
                        function ($a) {
                            return 0 - $a;
                        },
                        200,
                        false
            ],
            '*'    => [
                function ($a, $b) {
                    return $a * $b;
                },
                180,
                false
            ],
            '/'    => [
                function ($a, $b) {
                    if ($b == 0) {
                        throw new DivisionByZeroException();
                    }
                    return $a / $b;
                },
                180,
                false
            ],
            '^'    => [
                function ($a, $b) {
                    return pow($a, $b);
                },
                220,
                true
            ],
            '&&'   => [
                function ($a, $b) {
                    return $a && $b;
                },
                100,
                false
            ],
            '||'   => [
                function ($a, $b) {
                    return $a || $b;
                },
                90,
                false
            ],
            '=='   => [
                function ($a, $b) {
                    if (is_string($a) || is_string($b)) {
                        return strcmp($a, $b) == 0;
                    } else {
                        return $a == $b;
                    }
                },
                140,
                false
            ],
            '!='   => [
                function ($a, $b) {
                    if (is_string($a) || is_string($b)) {
                        return strcmp($a, $b) != 0;
                    } else {
                        return $a != $b;
                    }
                },
                140,
                false
            ],
            '>='   => [
                function ($a, $b) {
                    return $a >= $b;
                },
                150,
                false
            ],
            '>'    => [
                function ($a, $b) {
                    return $a > $b;
                },
                150,
                false
            ],
            '<='   => [
                function ($a, $b) {
                    return $a <= $b;
                },
                150,
                false
            ],
            '<'    => [
                function ($a, $b) {
                    return $a < $b;
                },
                150,
                false
            ],
        ];
    }

    /**
     * Add operator to executor
     *
     * @param Operator $operator
     * @return MathExecutor
     */
    public function addOperator(Operator $operator) : self
    {
        $this->operators[$operator->operator] = $operator;
        return $this;
    }

    /**
     * Gets the default functions as an array.  Key is function name
     * and value is the function as a closure.
     *
     * @return array<callable>
     */
    protected function defaultFunctions() : array
    {
        return [
            'abs' => function ($arg) {
                return abs($arg);
            },
            'acos' => function ($arg) {
                return acos($arg);
            },
            'acosh' => function ($arg) {
                return acosh($arg);
            },
            'arcsin' => function ($arg) {
                return asin($arg);
            },
            'arcctg' => function ($arg) {
                return M_PI/2 - atan($arg);
            },
            'arccot' => function ($arg) {
                return M_PI/2 - atan($arg);
            },
            'arccotan' => function ($arg) {
                return M_PI/2 - atan($arg);
            },
            'arcsec' => function ($arg) {
                return acos(1/$arg);
            },
            'arccosec' => function ($arg) {
                return asin(1/$arg);
            },
            'arccsc' => function ($arg) {
                return asin(1/$arg);
            },
            'arccos' => function ($arg) {
                return acos($arg);
            },
            'arctan' => function ($arg) {
                return atan($arg);
            },
            'arctg' => function ($arg) {
                return atan($arg);
            },
            'asin' => function ($arg) {
                return asin($arg);
            },
            'atan' => function ($arg) {
                return atan($arg);
            },
            'atan2' => function ($arg1, $arg2) {
                return atan2($arg1, $arg2);
            },
            'atanh' => function ($arg) {
                return atanh($arg);
            },
            'atn' => function ($arg) {
                return atan($arg);
            },
            'avg' => function ($arg1, $arg2) {
                return ($arg1 + $arg2) / 2;
            },
            'bindec' => function ($arg) {
                return bindec($arg);
            },
            'ceil' => function ($arg) {
                return ceil($arg);
            },
            'cos' => function ($arg) {
                return cos($arg);
            },
            'cosec' => function ($arg) {
                return 1 / sin($arg);
            },
            'csc' => function ($arg) {
                return 1 / sin($arg);
            },
            'cosh' => function ($arg) {
                return cosh($arg);
            },
            'ctg' => function ($arg) {
                return cos($arg) / sin($arg);
            },
            'cot' => function ($arg) {
                return cos($arg) / sin($arg);
            },
            'cotan' => function ($arg) {
                return cos($arg) / sin($arg);
            },
            'cotg' => function ($arg) {
                return cos($arg) / sin($arg);
            },
            'ctn' => function ($arg) {
                return cos($arg) / sin($arg);
            },
            'decbin' => function ($arg) {
                return decbin($arg);
            },
            'dechex' => function ($arg) {
                return dechex($arg);
            },
            'decoct' => function ($arg) {
                return decoct($arg);
            },
            'deg2rad' => function ($arg) {
                return deg2rad($arg);
            },
            'exp' => function ($arg) {
                return exp($arg);
            },
            'expm1' => function ($arg) {
                return expm1($arg);
            },
            'floor' => function ($arg) {
                return floor($arg);
            },
            'fmod' => function ($arg1, $arg2) {
                return fmod($arg1, $arg2);
            },
            'hexdec' => function ($arg) {
                return hexdec($arg);
            },
            'hypot' => function ($arg1, $arg2) {
                return hypot($arg1, $arg2);
            },
            'if' => function ($expr, $trueval, $falseval) {
                if ($expr === true || $expr === false) {
                    $exres = $expr;
                } else {
                    $exres = $this->execute($expr);
                }
                if ($exres) {
                    return $this->execute($trueval);
                } else {
                    return $this->execute($falseval);
                }
            },
            'intdiv' => function ($arg1, $arg2) {
                return intdiv($arg1, $arg2);
            },
            'ln' => function ($arg) {
                return log($arg);
            },
            'lg' => function ($arg) {
                return log10($arg);
            },
            'log' => function ($arg) {
                return log($arg);
            },
            'log10' => function ($arg) {
                return log10($arg);
            },
            'log1p' => function ($arg) {
                return log1p($arg);
            },
            'max' => function ($arg1, $arg2) {
                return max($arg1, $arg2);
            },
            'min' => function ($arg1, $arg2) {
                return min($arg1, $arg2);
            },
            'octdec' => function ($arg) {
                return octdec($arg);
            },
            'pi' => function () {
                return pi();
            },
            'pow' => function ($arg1, $arg2) {
                return $arg1 ** $arg2;
            },
            'rad2deg' => function ($arg) {
                return rad2deg($arg);
            },
            'round' => function ($arg) {
                return round($arg);
            },
            'sin' => function ($arg) {
                return sin($arg);
            },
            'sinh' => function ($arg) {
                return sinh($arg);
            },
            'sec' => function ($arg) {
                return 1 / cos($arg);
            },
            'sqrt' => function ($arg) {
                return sqrt($arg);
            },
            'tan' => function ($arg) {
                return tan($arg);
            },
            'tanh' => function ($arg) {
                return tanh($arg);
            },
            'tn' => function ($arg) {
                return tan($arg);
            },
            'tg' => function ($arg) {
                return tan($arg);
            }
        ];
    }

    /**
     * Execute expression
     *
     * @param string $expression
     * @param bool $cache
     * @return number
     * @throws Exception\IncorrectBracketsException
     * @throws Exception\IncorrectExpressionException
     * @throws Exception\UnknownOperatorException
     * @throws UnknownVariableException
     */
    public function execute(string $expression, bool $cache = true)
    {
        $cacheKey = $expression;
        if (!array_key_exists($cacheKey, $this->cache)) {
            $tokens = (new Tokenizer($expression, $this->operators))->tokenize()->buildReversePolishNotation();
            if ($cache) {
                $this->cache[$cacheKey] = $tokens;
            }
        } else {
            $tokens = $this->cache[$cacheKey];
        }

        $calculator = new Calculator($this->functions, $this->operators);
        return $calculator->calculate($tokens, $this->variables, $this->onVarNotFound);
    }

    /**
     * Add function to executor
     *
     * @param string $name Name of function
     * @param callable $function Function
     * @param int $places Count of arguments
     * @return MathExecutor
     * @throws ReflectionException
     */
    public function addFunction(string $name, ?callable $function = null, ?int $places = null) : self
    {
        $this->functions[$name] = new CustomFunction($name, $function, $places);
        return $this;
    }

    /**
     * Returns the default variables names as key/value pairs
     *
     * @return array<string, float>
     */
    protected function defaultVars() : array
    {
        return [
            'pi' => 3.14159265359,
            'e' => 2.71828182846
        ];
    }

    /**
     * Get all vars
     *
     * @return array<string, float|string>
     */
    public function getVars() : array
    {
        return $this->variables;
    }

    /**
     * Get a specific var
     *
     * @param  string $variable
     * @return integer|float
     * @throws UnknownVariableException
     */
    public function getVar(string $variable)
    {
        if (!array_key_exists($variable, $this->variables)) {
            throw new UnknownVariableException("Variable ({$variable}) not set");
        }
        return $this->variables[$variable];
    }

    /**
     * Add variable to executor
     *
     * @param  string $variable
     * @param  int|float $value
     * @return MathExecutor
     */
    public function setVar(string $variable, $value) : self
    {
        if (!is_scalar($value) && $value !== null) {
            $type = gettype($value);
            throw new MathExecutorException("Variable ({$variable}) type ({$type}) is not scalar");
        }

        $this->variables[$variable] = $value;
        return $this;
    }

    /**
     * Add variables to executor
     *
     * @param  array<string, float|int|string> $variables
     * @param  bool $clear Clear previous variables
     * @return MathExecutor
     * @throws \Exception
     */
    public function setVars(array $variables, bool $clear = true) : self
    {
        if ($clear) {
            $this->removeVars();
        }
        foreach ($variables as $name => $value) {
            $this->setVar($name, $value);
        }
        return $this;
    }

    /**
     * Define a method that will be invoked when a variable is not found.
     * The first parameter will be the variable name, and the returned value will be used as the variable value.
     *
     * @param callable $handler
     *
     * @return MathExecutor
     */
    public function setVarNotFoundHandler(callable $handler): self
    {
        $this->onVarNotFound = $handler;
        return $this;
    }

    /**
     * Remove variable from executor
     *
     * @param  string $variable
     * @return MathExecutor
     */
    public function removeVar(string $variable) : self
    {
        unset($this->variables[$variable]);
        return $this;
    }

    /**
     * Remove all variables and the variable not found handler
     * @return MathExecutor
     */
    public function removeVars() : self
    {
        $this->variables = [];
        $this->onVarNotFound = null;
        return $this;
    }

    /**
     * Get all registered operators to executor
     *
     * @return array<Operator> of operator class names
     */
    public function getOperators()
    {
        return $this->operators;
    }

    /**
     * Get all registered functions
     *
     * @return array<string, CustomFunction> containing callback and places indexed by
     *         function name
     */
    public function getFunctions() : array
    {
        return $this->functions;
    }

    /**
     * Set division by zero returns zero instead of throwing DivisionByZeroException
     *
     * @return MathExecutor
     */
    public function setDivisionByZeroIsZero() : self
    {
        $this->addOperator(new Operator("/", false, 180, function ($a, $b) {
            if ($b == 0) {
                return 0;
            }
            return $a / $b;
        }));
        return $this;
    }

    /**
     * Get cache array with tokens
     * @return array<string, Token[]>
     */
    public function getCache() : array
    {
        return $this->cache;
    }

    /**
     * Clear token's cache
     */
    public function clearCache() : void
    {
        $this->cache = [];
    }

    public function __clone()
    {
        $this->addDefaults();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE locale SYSTEM "../../../../../lib/pkp/dtd/locale.dtd">

<!--
  * plugins/generic/coins/locale/eu_ES/locale.xml
  *
  * Copyright (c) 2003-2013 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * COinS plugin localization strings for the en_US (U.S. English) locale.
  *
  -->

<locale name="eu_ES" full_name="Euskara">
	<message key="plugins.generic.coins.displayName">COinS plugina</message>
	<message key="plugins.generic.coins.description">COinS pluginak OpenURL deskriptore bat gehitzen die artikuluen orrialdeei (laburpena eta HTML) gero aipamen-tresnetarako erauzteko eta horrelakoetarako erabili ahal izateko.</message>
</locale>


text:
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.PooledObjects;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pchp.CodeAnalysis.Symbols
{
    internal static class ExplicitInterfaceHelpers
    {
        public static ImmutableArray<T> SubstituteExplicitInterfaceImplementations<T>(ImmutableArray<T> unsubstitutedExplicitInterfaceImplementations, TypeMap map) where T : Symbol
        {
            var builder = ArrayBuilder<T>.GetInstance();
            foreach (var unsubstitutedPropertyImplemented in unsubstitutedExplicitInterfaceImplementations)
            {
                var unsubstitutedInterfaceType = unsubstitutedPropertyImplemented.ContainingType;
                Debug.Assert((object)unsubstitutedInterfaceType != null);
                var explicitInterfaceType = map.SubstituteNamedType(unsubstitutedInterfaceType);
                Debug.Assert((object)explicitInterfaceType != null);
                var name = unsubstitutedPropertyImplemented.Name; //should already be unqualified

                T substitutedMemberImplemented = null;
                foreach (var candidateMember in explicitInterfaceType.GetMembers(name))
                {
                    if (candidateMember.OriginalDefinition == unsubstitutedPropertyImplemented.OriginalDefinition)
                    {
                        substitutedMemberImplemented = (T)candidateMember;
                        break;
                    }
                }
                Debug.Assert((object)substitutedMemberImplemented != null); //if it was an explicit implementation before the substitution, it should still be after
                builder.Add(substitutedMemberImplemented);
            }

            return builder.ToImmutableAndFree();
        }
    }
}


text:
from __future__ import division, absolute_import, print_function

__all__ = ['logspace', 'linspace']

from . import numeric as _nx
from .numeric import array, result_type

def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
    """
    Return evenly spaced numbers over a specified interval.

    Returns `num` evenly spaced samples, calculated over the
    interval [`start`, `stop` ].

    The endpoint of the interval can optionally be excluded.

    Parameters
    ----------
    start : scalar
        The starting value of the sequence.
    stop : scalar
        The end value of the sequence, unless `endpoint` is set to False.
        In that case, the sequence consists of all but the last of ``num + 1``
        evenly spaced samples, so that `stop` is excluded.  Note that the step
        size changes when `endpoint` is False.
    num : int, optional
        Number of samples to generate. Default is 50.
    endpoint : bool, optional
        If True, `stop` is the last sample. Otherwise, it is not included.
        Default is True.
    retstep : bool, optional
        If True, return (`samples`, `step`), where `step` is the spacing
        between samples.
    dtype : dtype
        The type of the output array.  If `dtype` is not given, infer the data
        type from the other input arguments.

        .. versionadded:: 1.9.0

    Returns
    -------
    samples : ndarray
        There are `num` equally spaced samples in the closed interval
        ``[start, stop]`` or the half-open interval ``[start, stop)``
        (depending on whether `endpoint` is True or False).
    step : float (only if `retstep` is True)
        Size of spacing between samples.

    See Also
    --------
    arange : Similar to `linspace`, but uses a step size (instead of the
             number of samples).
    logspace : Samples uniformly distributed in log space.

    Examples
    --------
    >>> np.linspace(2.0, 3.0, num=5)
        array([ 2.  ,  2.25,  2.5 ,  2.75,  3.  ])
    >>> np.linspace(2.0, 3.0, num=5, endpoint=False)
        array([ 2. ,  2.2,  2.4,  2.6,  2.8])
    >>> np.linspace(2.0, 3.0, num=5, retstep=True)
        (array([ 2.  ,  2.25,  2.5 ,  2.75,  3.  ]), 0.25)

    Graphical illustration:

    >>> import matplotlib.pyplot as plt
    >>> N = 8
    >>> y = np.zeros(N)
    >>> x1 = np.linspace(0, 10, N, endpoint=True)
    >>> x2 = np.linspace(0, 10, N, endpoint=False)
    >>> plt.plot(x1, y, 'o')
    [<matplotlib.lines.Line2D object at 0x...>]
    >>> plt.plot(x2, y + 0.5, 'o')
    [<matplotlib.lines.Line2D object at 0x...>]
    >>> plt.ylim([-0.5, 1])
    (-0.5, 1)
    >>> plt.show()

    """
    num = int(num)

    # Convert float/complex array scalars to float, gh-3504
    start = start * 1.
    stop = stop * 1.

    if dtype is None:
        dtype = result_type(start, stop, float(num))

    if num <= 0:
        return array([], dtype)
    if endpoint:
        if num == 1:
            return array([start], dtype=dtype)
        step = (stop-start)/float((num-1))
        y = _nx.arange(0, num, dtype=dtype) * step + start
        y[-1] = stop
    else:
        step = (stop-start)/float(num)
        y = _nx.arange(0, num, dtype=dtype) * step + start
    if retstep:
        return y.astype(dtype), step
    else:
        return y.astype(dtype)

def logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None):
    """
    Return numbers spaced evenly on a log scale.

    In linear space, the sequence starts at ``base ** start``
    (`base` to the power of `start`) and ends with ``base ** stop``
    (see `endpoint` below).

    Parameters
    ----------
    start : float
        ``base ** start`` is the starting value of the sequence.
    stop : float
        ``base ** stop`` is the final value of the sequence, unless `endpoint`
        is False.  In that case, ``num + 1`` values are spaced over the
        interval in log-space, of which all but the last (a sequence of
        length ``num``) are returned.
    num : integer, optional
        Number of samples to generate.  Default is 50.
    endpoint : boolean, optional
        If true, `stop` is the last sample. Otherwise, it is not included.
        Default is True.
    base : float, optional
        The base of the log space. The step size between the elements in
        ``ln(samples) / ln(base)`` (or ``log_base(samples)``) is uniform.
        Default is 10.0.
    dtype : dtype
        The type of the output array.  If `dtype` is not given, infer the data
        type from the other input arguments.

    Returns
    -------
    samples : ndarray
        `num` samples, equally spaced on a log scale.

    See Also
    --------
    arange : Similar to linspace, with the step size specified instead of the
             number of samples. Note that, when used with a float endpoint, the
             endpoint may or may not be included.
    linspace : Similar to logspace, but with the samples uniformly distributed
               in linear space, instead of log space.

    Notes
    -----
    Logspace is equivalent to the code

    >>> y = np.linspace(start, stop, num=num, endpoint=endpoint)
    ... # doctest: +SKIP
    >>> power(base, y).astype(dtype)
    ... # doctest: +SKIP

    Examples
    --------
    >>> np.logspace(2.0, 3.0, num=4)
        array([  100.        ,   215.443469  ,   464.15888336,  1000.        ])
    >>> np.logspace(2.0, 3.0, num=4, endpoint=False)
        array([ 100.        ,  177.827941  ,  316.22776602,  562.34132519])
    >>> np.logspace(2.0, 3.0, num=4, base=2.0)
        array([ 4.        ,  5.0396842 ,  6.34960421,  8.        ])

    Graphical illustration:

    >>> import matplotlib.pyplot as plt
    >>> N = 10
    >>> x1 = np.logspace(0.1, 1, N, endpoint=True)
    >>> x2 = np.logspace(0.1, 1, N, endpoint=False)
    >>> y = np.zeros(N)
    >>> plt.plot(x1, y, 'o')
    [<matplotlib.lines.Line2D object at 0x...>]
    >>> plt.plot(x2, y + 0.5, 'o')
    [<matplotlib.lines.Line2D object at 0x...>]
    >>> plt.ylim([-0.5, 1])
    (-0.5, 1)
    >>> plt.show()

    """
    y = linspace(start, stop, num=num, endpoint=endpoint)
    if dtype is None:
        return _nx.power(base, y)
    return _nx.power(base, y).astype(dtype)


text:
using NetFusion.Azure.ServiceBus.Plugin.Configs;
using NetFusion.Azure.ServiceBus.Plugin.Modules;
using NetFusion.Azure.ServiceBus.Publisher.Internal;
using NetFusion.Bootstrap.Container;
using NetFusion.Bootstrap.Plugins;
using NetFusion.Messaging.Plugin;
using NetFusion.Messaging.Plugin.Configs;
using NetFusion.Settings.Plugin;

namespace NetFusion.Azure.ServiceBus.Plugin
{
    public class ServiceBusPlugin : PluginBase
    {
        public override string PluginId => "2E8CE828-146B-4383-9A02-DB838A72B6A5";
        public override PluginTypes PluginType => PluginTypes.CorePlugin;
        public override string Name => "NetFusion: Azure Service Bus";

        public ServiceBusPlugin()
        {
            AddConfig<ServiceBusConfig>();

            AddModule<NamespaceModule>();
            AddModule<PublisherModule>();
            AddModule<SubscriberModule>();

            SourceUrl = "https://github.com/grecosoft/NetFusion/tree/master/netfusion/src/Integration/NetFusion.Azure.ServiceBus";
            DocUrl = "https://github.com/grecosoft/NetFusion/wiki/integration.servicebus.overview#servicebus-overview";
        }
    }

    public static class CompositeBuilderExtensions
    {
        // Adds the Azure Service Bus plugin to the composite application.
        public static ICompositeContainerBuilder AddAzureServiceBus(this ICompositeContainerBuilder composite)
        {
            // Adds the dependent plugins to the composite application and registers
            // the Azure Service Bus publisher to the messaging pipeline.
            return composite
                .AddSettings()
                .AddMessaging()
                .AddPlugin<ServiceBusPlugin>()

                // Extend the base messaging pipeline by adding the ServiceBusPublisher.
                .InitPluginConfig<MessageDispatchConfig>(config =>
                    config.AddPublisher<ServiceBusPublisher>());
        }
    }
}


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package EnsEMBL::Web::Component::Tools::Down;

use strict;
use warnings;

use URI::Escape qw(uri_escape);

use EnsEMBL::Web::Utils::FileHandler qw(file_get_contents);
use EnsEMBL::Web::Exceptions;

use parent qw(EnsEMBL::Web::Component::Tools);

sub _init {
  my $self = shift;
  $self->SUPER::_init;
  $self->ajaxable(0);
}

sub content {
  my $self  = shift;
  my $sd    = $self->hub->species_defs;

  my $message;

  try {
    $message = file_get_contents($sd->TOOLS_UNAVAILABLE_MESSAGE_FILE);
  } catch {
    $message = $sd->TOOLS_UNAVAILABLE_MESSAGE;
  };

  return $self->_error('Temporarily Unavailable', sprintf '%s Please contact %2$s for more information.',
    $message || 'Web Tools are temporarily not available.',
    $sd->ENSEMBL_HELPDESK_EMAIL,
    uri_escape(sprintf 'Tools unavailable on %s', $sd->ENSEMBL_SERVERNAME)
  );
}

1;


text:
package lsd

import (
	"os"

	"github.com/ncw/rclone/cmd"
	"github.com/ncw/rclone/cmd/ls/lshelp"
	"github.com/ncw/rclone/fs"
	"github.com/ncw/rclone/fs/operations"
	"github.com/spf13/cobra"
)

var (
	recurse bool
)

func init() {
	cmd.Root.AddCommand(commandDefintion)
	commandDefintion.Flags().BoolVarP(&recurse, "recursive", "R", false, "Recurse into the listing.")
}

var commandDefintion = &cobra.Command{
	Use:   "lsd remote:path",
	Short: `List all directories/containers/buckets in the path.`,
	Long: `
Lists the directories in the source path to standard output. Does not
recurse by default.  Use the -R flag to recurse.

This command lists the total size of the directory (if known, -1 if
not), the modification time (if known, the current time if not), the
number of objects in the directory (if known, -1 if not) and the name
of the directory, Eg

    $ rclone lsd swift:
          494000 2018-04-26 08:43:20     10000 10000files
              65 2018-04-26 08:43:20         1 1File

Or

    $ rclone lsd drive:test
              -1 2016-10-17 17:41:53        -1 1000files
              -1 2017-01-03 14:40:54        -1 2500files
              -1 2017-07-08 14:39:28        -1 4000files

If you just want the directory names use "rclone lsf --dirs-only".

` + lshelp.Help,
	Run: func(command *cobra.Command, args []string) {
		cmd.CheckArgs(1, 1, command, args)
		if recurse {
			fs.Config.MaxDepth = 0
		}
		fsrc := cmd.NewFsSrc(args)
		cmd.Run(false, false, command, func() error {
			return operations.ListDir(fsrc, os.Stdout)
		})
	},
}


text:
package com.communote.plugins.core;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

/**
 * Activator.
 *
 * @author Communote GmbH - http://www.communote.com/
 *
 */
public class CommunoteCorePluginBundleActivator implements BundleActivator {

    /**
     * Does nothing.
     *
     * {@inheritDoc}
     */
    public void start(BundleContext context) throws Exception {
    }

    /**
     * Does nothing.
     *
     * {@inheritDoc}
     */
    public void stop(BundleContext context) throws Exception {
        // Do nothing.
    }
}


text:
const float SHOT_LENGTH = 10.f;

class Shot {
	public:
		Shot();
		Shot(float x, float y, const Vector2& speed);
		~Shot();

		void Update(int dt);
		void Draw();

		Vector2 GetDirection();

    public:
		Vector2 position;
		Vector2 speed;
		Vector2 dir;
};

#endif


text:
const HttpCache = require('./httpCache');

module.exports = HttpCache;


text:
extern crate uu_yes;

fn main() {
    std::process::exit(uu_yes::uumain(std::env::args().collect()));
}


text:
@implementation KMWordPress
+ (KMWordPress *)sharedInstance {
    static KMWordPress *_sharedClient = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedClient = [[KMWordPress alloc] init];
    });

    return _sharedClient;
}
@end


text:
'use strict';

// You'll need two modules to make this work, run:
// npm i babel-core es6-module-loader -S

var System = require('es6-module-loader').System;
System.transpiler = 'babel';

System.import('node_example/app').then(function(app) {
  app.run(__dirname);
}).catch(function(err) {
  console.log('err', err);
});


text:
package com.amazonaws.services.accessanalyzer.model.transform;

import java.util.Map;
import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.accessanalyzer.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * AccessPreviewFindingMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AccessPreviewFindingMarshaller {

    private static final MarshallingInfo<String> ID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("id").build();
    private static final MarshallingInfo<String> EXISTINGFINDINGID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("existingFindingId").build();
    private static final MarshallingInfo<String> EXISTINGFINDINGSTATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("existingFindingStatus").build();
    private static final MarshallingInfo<Map> PRINCIPAL_BINDING = MarshallingInfo.builder(MarshallingType.MAP).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("principal").build();
    private static final MarshallingInfo<List> ACTION_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("action").build();
    private static final MarshallingInfo<Map> CONDITION_BINDING = MarshallingInfo.builder(MarshallingType.MAP).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("condition").build();
    private static final MarshallingInfo<String> RESOURCE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("resource").build();
    private static final MarshallingInfo<Boolean> ISPUBLIC_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("isPublic").build();
    private static final MarshallingInfo<String> RESOURCETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("resourceType").build();
    private static final MarshallingInfo<java.util.Date> CREATEDAT_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("createdAt").timestampFormat("iso8601").build();
    private static final MarshallingInfo<String> CHANGETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("changeType").build();
    private static final MarshallingInfo<String> STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("status").build();
    private static final MarshallingInfo<String> RESOURCEOWNERACCOUNT_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("resourceOwnerAccount").build();
    private static final MarshallingInfo<String> ERROR_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("error").build();
    private static final MarshallingInfo<List> SOURCES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("sources").build();

    private static final AccessPreviewFindingMarshaller instance = new AccessPreviewFindingMarshaller();

    public static AccessPreviewFindingMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(AccessPreviewFinding accessPreviewFinding, ProtocolMarshaller protocolMarshaller) {

        if (accessPreviewFinding == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(accessPreviewFinding.getId(), ID_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getExistingFindingId(), EXISTINGFINDINGID_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getExistingFindingStatus(), EXISTINGFINDINGSTATUS_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getPrincipal(), PRINCIPAL_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getAction(), ACTION_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getCondition(), CONDITION_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getResource(), RESOURCE_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getIsPublic(), ISPUBLIC_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getResourceType(), RESOURCETYPE_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getCreatedAt(), CREATEDAT_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getChangeType(), CHANGETYPE_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getStatus(), STATUS_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getResourceOwnerAccount(), RESOURCEOWNERACCOUNT_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getError(), ERROR_BINDING);
            protocolMarshaller.marshall(accessPreviewFinding.getSources(), SOURCES_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package org.semanticweb.elk.reasoner.indexing.classes;

import org.semanticweb.elk.owl.interfaces.ElkAxiom;
import org.semanticweb.elk.reasoner.indexing.model.ModifiableIndexedDeclarationAxiom;
import org.semanticweb.elk.reasoner.indexing.model.ModifiableIndexedEntity;
import org.semanticweb.elk.reasoner.indexing.model.ModifiableOntologyIndex;

/**
 * Implements {@link ModifiableIndexedDeclarationAxiom}
 *
 * @author "Yevgeny Kazakov"
 *
 * @param <A>
 *            the type of the {@link ElkAxiom} from which this axiom originates
 *
 */
class ModifiableIndexedDeclarationAxiomImpl<A extends ElkAxiom>
		extends
			IndexedDeclarationAxiomImpl<A, ModifiableIndexedEntity>
		implements
			ModifiableIndexedDeclarationAxiom {

	ModifiableIndexedDeclarationAxiomImpl(A originalAxiom,
			ModifiableIndexedEntity entity) {
		super(originalAxiom, entity);
	}

	/*
	 * declarations do not have any semantic meaning, they just make sure that
	 * the entity occurs in the ontology (corresponding number of times)
	 */

	@Override
	public boolean addOccurrence(ModifiableOntologyIndex index) {
		return true;
	}

	@Override
	public boolean removeOccurrence(ModifiableOntologyIndex index) {
		return true;
	}

}


text:
class Command {

protected:
    MavState* _state;
    MavState* _comm;
    exec::task* _actualTask;
    bool _newTask;

public:
    Command(){}
    Command(MavState *_state, MavState *_comm,exec::task *_actualTask) : _state(_state), _comm(_comm),
                                                                         _actualTask(_actualTask), _newTask(true) {}

    virtual ~Command() {}

    virtual void execute() = 0;
    void init(MavState* s, MavState* c){
        this->_state = s;
        this->_comm = c;
    }

};

#endif //MOCAP2MAV_COMMAND_HPP


text:
package com.blog.common;

import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;

import org.springframework.web.context.request.ServletRequestAttributes;

import com.blog.entity.User;
import com.blog.service.UserService;

import com.blog.common.DataResult;

@Service
public class Authorize {
    private final UserService userService;

    @Autowired
    public Authorize (UserService userService) {
        this.userService = userService;
    }

    public synchronized boolean check (String username, String password, Boolean reAuthorize) {
        User user = this.getUser();

        if(user == null || reAuthorize) {
            if (username != null && password != null) {
                user = userService.queryByUsername(username);

                if (user != null) {
                    String user_password = user.getPassword();

                    if (password.equals(user_password)) {
                        RequestAttributes ras = RequestContextHolder.getRequestAttributes();
                        HttpServletRequest request = ((ServletRequestAttributes)ras).getRequest();

                        request.getSession().setAttribute("user", user);

                        return true;
                    } else {
                        return false;
                    }
                } else {
                    return false;
                }
            } else {
                return false;
            }
        } else {
            return true;
        }
    }

    public User getUser () {
        RequestAttributes ras = RequestContextHolder.getRequestAttributes();
        HttpServletRequest request = ((ServletRequestAttributes)ras).getRequest();

        return ((User)request.getSession().getAttribute("user"));
    }

    public DataResult getResponse () {
        User user = this.getUser();

        if (user != null) {
            return new DataResult("login success", user);
        } else {
            return new DataResult("username or password is not correct");
        }
    }
}


text:
	Player Profile

? Help Topics

The page is empty (and an error message on the top of page)

You will need to play the game with the Admiral "F12" Panel open. Remember that DO NOT let game start before "KanColle" tab panel has been actived (In fact game will be started automatically when panel active). That is the only way we can know of your in-game data. Use the Gold Heart icon on your Chrome to start playing. Once game master data gets, all Strategy Room tabs are functional. And you may play game without panel opened next time (not recommend this anyway).

The rate percentages under statistics are wrong

Visit the in-game admiral profile screen to get the exact rates. The game has a special formula for it, not just basic percentage between the counts.

What is "Profile Data"?

It refers to data that can be sourced from the game: ship list, equipment list, fleet arrangement, quests, map gauges, etc.

What encompasses "Histories"?

It refers to logs saved onto the computer such as sortie history, resouce history, crafting history, etc. Clearing Histories will delete records for all accounts that played on this browser profile.

How will this affect my game account?

All of this does not affect your game account, only the records and logs saved by on your computer by this extension.

How to make my changed in-game "Profile Data" affect pages of this tab?

Not necessary to use "Reload Button" of your Chrome, just click the "Heart Logo" on the top left side to reload latest data at any time.

Can I export my whole history (not just profile data) and move it to another device?

Go to "Data Backup" page.

The bug fixes not working for me?

Try to close your game tab first, some data modifications require the game closed to avoid conflicts.

		First Time Hints: Welcome to KC3改 Strategy Room!

If this is your first time here, you need to play game once with "KanColle" panel of devtools opened.

If you just wanna import your backup data, remember to close your game tab first.

Generally "Refresh/Reload" page means to click on the ↖"Heart Logo", NOT the ⟳"Reload button" of browser without specified instruction.

More FAQ could be found at ↗"Help Topics" of every pages.

This message will be dismissed by one clicking.

Admiral Info

ID

Name

Comment

Server

Rank

Level

Exp

News Feed

			[ Translate messages ]

Statistics

Sortie

Win Rate

0%

Win Count

0

Lose Count

0

PvP

Win Rate

0%

Win Count

0

Lose Count

0

Expedition

Success Rate

0%

Success Count

0

Total Count

0

Rank Points

Amount earned on previous cut-off

0

Cut-off EXP from last interval

0

Accumulated points on this interval

0

			[ Make a cut-off now ]

Profile Data

		Export

Validate a KC3 File <input type="file" class="import_file" name="import_file"  accept=".kc3" />

Export Basic Profile (player info, fleets, ships, equipment, config)

Export Expedition History to CSV

Export Construction History to CSV

Export Development History to CSV

Export LSC History to CSV

		Clear

Clear Profile Data

Clear Histories

Reset Dismissed Messages

Clear Ship Remodel Information

		Bug fixes

Clear FCF Bugged States

Clear errorneous entries on encounter tab

Fix bad data on Resources, Consumables and Ledger


text:
import scapi from "./scapi";
import * as constants from "./neume/constants";
import * as musicAPI from "./neume/music";
import * as patternAPI from "./neume/pattern";

import NeuContext from "./neume/core/NeuContext";
import NeuObject from "./neume/core/NeuObject";

const defaultOpts = {};

export default function(selectServerClass) {
  function neume(opts) {
    const context = createContext(opts, selectServerClass);
    const api = createAPI(context);

    context.on("api-emit", ({ event, payload }) => {
      api.emit(event, payload);
    });

    // FIXME: access to a private member..
    context._.timeline.start();

    return api;
  }

  return neume;
}

function createContext(opts, selectServerClass) {
  opts = Object.assign({}, defaultOpts, opts);

  if (opts.ServerClass == null) {
    opts.ServerClass = selectServerClass(opts);
  }

  return new NeuContext(opts);
}

function createAPI(context) {
  return Object.assign(new NeuObject(null),
    constants, context.createAPI(), musicAPI, patternAPI, { scapi }
  );
}


text:
define([
    'react',
    'lodash'
], function (React, _) {
    'use strict';
    return function () {
        function scopeActiveUsers1() {
            var activeUsers = this.activeUsers;
            return React.createElement('div', { 'key': 'active-users' }, React.createElement('span', {}, 'some text'));
        }
        return this.activeUsers ? scopeActiveUsers1.apply(this, []) : null;
    };
});


text:
<?xml version="1.0"?>
<overviews>
	<packages>
		<package name="org.igniterealtime.xiff">
			<shortDescription>
			   <![CDATA[ XMPP Instant Messaging Library written in Actionscript 3 (Flash Player 9+) ]]>
			</shortDescription>
			<description>
				<![CDATA[  ]]>
			</description>
		</package>
		<package name="org.igniterealtime.xiff.auth">
			<shortDescription>
				<![CDATA[ Authentication ]]>
			</shortDescription>
			<description>
				<![CDATA[  ]]>
			</description>
		</package>
		<package name="org.igniterealtime.xiff.bookmark">
			<shortDescription>
				<![CDATA[ Bookmark management for URLs and Group Chats ]]>
			</shortDescription>
			<description>
				<![CDATA[  ]]>
			</description>
		</package>
		<package name="org.igniterealtime.xiff.collections">
				<shortDescription>
				<![CDATA[ Lightweight implementation of ArrayCollection ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.collections.events">
				<shortDescription>
				<![CDATA[ XIFF Events ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.conference">
				<shortDescription>
				<![CDATA[ Multi User Chat related ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.core">
				<shortDescription>
				<![CDATA[ Connections ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data">
				<shortDescription>
				<![CDATA[ XML things, such as XMPP Stanzas, Extensions, etc.. ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.auth">
				<shortDescription>
				<![CDATA[ SASL Authentication types ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.bind">
				<shortDescription>
				<![CDATA[ Binding Resource identifier for the connection ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.browse">
				<shortDescription>
				<![CDATA[ OBSOLETE Jabber Browsing ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.disco">
				<shortDescription>
				<![CDATA[ Service Discovery ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.feature">
				<shortDescription>
				<![CDATA[ XEP-0020: Feature Negotiation ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.forms">
				<shortDescription>
				<![CDATA[ Forms ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.forms.enum">
				<shortDescription>
				<![CDATA[ Static constants related to Forms ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.id">
				<shortDescription>
				<![CDATA[ Unique Identifier generation ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.im">
				<shortDescription>
				<![CDATA[ Instant Messaging ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.message">
				<shortDescription>
				<![CDATA[ Message related XEP extensions ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.muc">
				<shortDescription>
				<![CDATA[ Multi User Chat ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.ping">
				<shortDescription>
				<![CDATA[ Keeping the connection alive with ping ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.pubsub">
				<shortDescription>
				<![CDATA[ Publish and Subscribe ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.privatedata">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.register">
				<shortDescription>
				<![CDATA[ User registration ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.rpc">
				<shortDescription>
				<![CDATA[ XML-RPC ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.search">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.session">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.sharedgroups">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.si">
				<shortDescription>
				<![CDATA[ Stream Initiation (XEP-0095) and SI File Transfer ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.vcard">
				<shortDescription>
				<![CDATA[ vCard ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.version">
				<shortDescription>
				<![CDATA[ Software Version of the Client ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.whiteboard">
				<shortDescription>
				<![CDATA[ XIFF Whiteboard ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.data.xhtml">
				<shortDescription>
				<![CDATA[ XHTML in Message. TODO: Move to 'message' group since only used for ... ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.events">
				<shortDescription>
				<![CDATA[ XIFF Events ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.exception">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.filter">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.im">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.message">
				<shortDescription>
				<![CDATA[ Message related XEP tools ]]>
				</shortDescription>
				<description>
				<![CDATA[ Message Archiving ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.namespaces">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.privatedata">
				<shortDescription>
				<![CDATA[  ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.util">
				<shortDescription>
				<![CDATA[ Utilities that are not available natively, such as Base64 and Zlib ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
		<package name="org.igniterealtime.xiff.vcard">
				<shortDescription>
				<![CDATA[ vCard data structure ]]>
				</shortDescription>
				<description>
				<![CDATA[  ]]>
				</description>
		</package>
	</packages>
</overviews>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

/*
 * Contains definition for PSSenderInfo, PSPrincipal, PSIdentity which are
 * used to provide remote user information to different plugin snapins
 * like Exchange.
 */

using System;
using System.Security.Principal;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using Microsoft.PowerShell;

namespace System.Management.Automation.Remoting
{
    /// <summary>
    /// This class is used in the server side remoting scenarios. This class
    /// holds information about the incoming connection like:
    /// (a) Client's TimeZone
    /// (b) Connecting User information
    /// (c) Connection String used by the user to connect to the server.
    /// </summary>
    [Serializable]
    public sealed class PSSenderInfo : ISerializable
    {
        #region Private Data

        private PSPrimitiveDictionary _applicationArguments;

        #endregion

        #region Serialization

        /// <summary>
        /// Serialization.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            PSObject psObject = PSObject.AsPSObject(this);
            psObject.GetObjectData(info, context);
        }

        /// <summary>
        /// Deserialization constructor.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        private PSSenderInfo(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
            {
                return;
            }

            string serializedData = null;

            try
            {
                serializedData = info.GetValue("CliXml", typeof(string)) as string;
            }
            catch (Exception)
            {
                // When a workflow is run locally, there won't be PSSenderInfo
                return;
            }

            if (serializedData == null)
            {
                return;
            }

            try
            {
                PSObject result = PSObject.AsPSObject(PSSerializer.Deserialize(serializedData));
                PSSenderInfo senderInfo = DeserializingTypeConverter.RehydratePSSenderInfo(result);

                UserInfo = senderInfo.UserInfo;
                ConnectionString = senderInfo.ConnectionString;
                _applicationArguments = senderInfo._applicationArguments;

                ClientTimeZone = senderInfo.ClientTimeZone;
            }
            catch (Exception)
            {
                // Ignore conversion errors
                return;
            }
        }

        #endregion

        #region Public Constructors

        /// <summary>
        /// Constructs PSPrincipal using PSIdentity and a token (used to construct WindowsIdentity)
        /// </summary>
        /// <param name="userPrincipal">
        /// Connecting User Information
        /// </param>
        /// <param name="httpUrl">
        /// httpUrl element (from WSMAN_SENDER_DETAILS struct).
        /// </param>
        [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "1#")]
        public PSSenderInfo(PSPrincipal userPrincipal, string httpUrl)
        {
            UserInfo = userPrincipal;
            ConnectionString = httpUrl;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Contains information related to the user connecting to the server.
        /// </summary>
        public PSPrincipal UserInfo { get;
            // No public set because PSSenderInfo/PSPrincipal is used by PSSessionConfiguration's
            // and usually they dont cache this data internally..so did not want to give
            // cmdlets/scripts a chance to modify these.
        }

        /// <summary>
        /// Contains the TimeZone information from the client machine.
        /// </summary>
        public TimeZoneInfo ClientTimeZone
        {
            get;
            internal set;
        }

        /// <summary>
        /// Connection string used by the client to connect to the server. This is
        /// directly taken from WSMAN_SENDER_DETAILS struct (from wsman.h)
        /// </summary>
        public string ConnectionString { get;
            // No public set because PSSenderInfo/PSPrincipal is used by PSSessionConfiguration's
            // and usually they dont cache this data internally..so did not want to give
            // cmdlets/scripts a chance to modify these.
        }

        /// <summary>
        /// Application arguments (i.e. specified in New-PSSessionOptions -ApplicationArguments)
        /// </summary>
        public PSPrimitiveDictionary ApplicationArguments
        {
            get { return _applicationArguments; }

            internal set { _applicationArguments = value; }
        }

        /// <summary>
        /// "ConfigurationName" from the sever remote session.
        /// </summary>
        public string ConfigurationName { get; internal set; }

        #endregion
    }

    /// <summary>
    /// Defines the basic functionality of a PSPrincipal object.
    /// </summary>
    public sealed class PSPrincipal : IPrincipal
    {
        #region Private Data

        #endregion

        /// <summary>
        /// Gets the identity of the current user principal.
        /// </summary>
        public PSIdentity Identity { get;
            // No public set because PSSenderInfo/PSPrincipal is used by PSSessionConfiguration's
            // and usually they dont cache this data internally..so did not want to give
            // cmdlets/scripts a chance to modify these.
        }

        /// <summary>
        /// Gets the WindowsIdentity (if possible) representation of the current Identity.
        /// PSPrincipal can represent any user for example a LiveID user, network user within
        /// a domain etc. This property tries to convert the Identity to WindowsIdentity
        /// using the user token supplied.
        /// </summary>
        public WindowsIdentity WindowsIdentity { get;
            // No public set because PSSenderInfo/PSPrincipal is used by PSSessionConfiguration's
            // and usually they dont cache this data internally..so did not want to give
            // cmdlets/scripts a chance to modify these.
        }

        /// <summary>
        /// Gets the identity of the current principal.
        /// </summary>
        IIdentity IPrincipal.Identity
        {
            get { return this.Identity; }
        }

        /// <summary>
        /// Determines if the current principal belongs to a specified rule.
        /// If we were able to get a WindowsIdentity then this will perform the
        /// check using the WindowsIdentity otherwise this will return false.
        /// </summary>
        /// <param name="role"></param>
        /// <returns>
        /// If we were able to get a WindowsIdentity then this will perform the
        /// check using the WindowsIdentity otherwise this will return false.
        /// </returns>
        public bool IsInRole(string role)
        {
            if (WindowsIdentity != null)
            {
                // Get Windows Principal for this identity
                WindowsPrincipal windowsPrincipal = new WindowsPrincipal(WindowsIdentity);
                return windowsPrincipal.IsInRole(role);
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// Internal overload of IsInRole() taking a WindowsBuiltInRole enum value.
        /// </summary>
        internal bool IsInRole(WindowsBuiltInRole role)
        {
            if (WindowsIdentity != null)
            {
                // Get Windows Principal for this identity
                WindowsPrincipal windowsPrincipal = new WindowsPrincipal(WindowsIdentity);
                return windowsPrincipal.IsInRole(role);
            }
            else
            {
                return false;
            }
        }

        #region Constructor

        /// <summary>
        /// Constructs PSPrincipal using PSIdentity and a WindowsIdentity.
        /// </summary>
        /// <param name="identity">
        /// An instance of PSIdentity
        /// </param>
        /// <param name="windowsIdentity">
        /// An instance of WindowsIdentity, if psIdentity represents a windows user. This can be
        /// null.
        /// </param>
        public PSPrincipal(PSIdentity identity, WindowsIdentity windowsIdentity)
        {
            Identity = identity;
            WindowsIdentity = windowsIdentity;
        }

        #endregion
    }

    /// <summary>
    /// Defines the basic functionality of a PSIdentity object.
    /// </summary>
    public sealed class PSIdentity : IIdentity
    {
        #region Private Data

        #endregion

        /// <summary>
        /// Gets the type of authentication used.
        /// For a WSMan service authenticated user this will be one of the following:
        ///  WSMAN_DEFAULT_AUTHENTICATION
        ///  WSMAN_NO_AUTHENTICATION
        ///  WSMAN_AUTH_DIGEST
        ///  WSMAN_AUTH_NEGOTIATE
        ///  WSMAN_AUTH_BASIC
        ///  WSMAN_AUTH_KERBEROS
        ///  WSMAN_AUTH_CLIENT_CERTIFICATE
        ///  WSMAN_AUTH_LIVEID.
        /// </summary>
        public string AuthenticationType { get; }

        /// <summary>
        /// Gets a value that indicates whether the user has been authenticated.
        /// </summary>
        public bool IsAuthenticated { get; }

        /// <summary>
        /// Gets the name of the user.
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// Gets the certificate details of the user if supported, null otherwise.
        /// </summary>
        public PSCertificateDetails CertificateDetails { get; }

        #region Public Constructor

        /// <summary>
        /// Constructor used to construct a PSIdentity object.
        /// </summary>
        /// <param name="authType">
        /// Type of authentication used to authenticate this user.
        /// For a WSMan service authenticated user this will be one of the following:
        ///  WSMAN_DEFAULT_AUTHENTICATION
        ///  WSMAN_NO_AUTHENTICATION
        ///  WSMAN_AUTH_DIGEST
        ///  WSMAN_AUTH_NEGOTIATE
        ///  WSMAN_AUTH_BASIC
        ///  WSMAN_AUTH_KERBEROS
        ///  WSMAN_AUTH_CLIENT_CERTIFICATE
        ///  WSMAN_AUTH_LIVEID
        /// </param>
        /// <param name="isAuthenticated">
        /// true if this user is authenticated.
        /// </param>
        /// <param name="userName">
        /// Name of the user
        /// </param>
        /// <param name="cert">
        /// Certificate details if Certificate authentication is used.
        /// </param>
        public PSIdentity(string authType, bool isAuthenticated, string userName, PSCertificateDetails cert)
        {
            AuthenticationType = authType;
            IsAuthenticated = isAuthenticated;
            Name = userName;
            CertificateDetails = cert;
        }

        #endregion
    }

    /// <summary>
    /// Represents the certificate of a user.
    /// </summary>
    public sealed class PSCertificateDetails
    {
        #region Private Data

        #endregion

        /// <summary>
        /// Gets Subject of the certificate.
        /// </summary>
        public string Subject { get; }

        /// <summary>
        /// Gets the issuer name of the certificate.
        /// </summary>
        public string IssuerName { get; }

        /// <summary>
        /// Gets the issuer thumb print.
        /// </summary>
        public string IssuerThumbprint { get; }

        #region Constructor

        /// <summary>
        /// Constructor used to construct a PSCertificateDetails object.
        /// </summary>
        /// <param name="subject">
        /// Subject of the certificate.
        /// </param>
        /// <param name="issuerName">
        /// Issuer name of the certificate.
        /// </param>
        /// <param name="issuerThumbprint">
        /// Issuer thumb print of the certificate.
        /// </param>
        public PSCertificateDetails(string subject, string issuerName, string issuerThumbprint)
        {
            Subject = subject;
            IssuerName = issuerName;
            IssuerThumbprint = issuerThumbprint;
        }

        #endregion
    }
}


text:
/**
 * The app mdule controls the application lifecycle
 */

'use strict';

var app = require('app'),
    BrowserWindow = require('browser-window'), //allows window creation
    configuration = require('./configuration'), // custom module that wraps nconf (a node module)
    globalShortcut = require('global-shortcut'), // allows the use of accelerators (keyboard combinations)
    // adding inter-process-communication (to communicate render processes and main process through chanels)
    ipc = require('ipc'),
    // main applicaiton window, null because the window would otherwise be closed
    // once JS's garbage collection kicks in.
    mainWindow = null,
    settingsWindow = null;

app.on('ready', function () { //reacting to the ready state of the application

    // reading if there is any configuration stored yet,
    // if not, adding an initial value
    if (!configuration.readSettings('shortcutKeys')) {
        configuration.saveSettings('shortcutKeys', ['ctrl', 'shift']);
    }

    setGlobalShortcuts();

    // this window's renderer process will render index.html
    mainWindow = new BrowserWindow({
        frame: false,
        heihgt: 700,
        resizable: false,
        width: 368
    });

    mainWindow.loadUrl('file://' + __dirname + '/app/index.html');
});

function setGlobalShortcuts() {
    // resets the global shortcuts so that we can set new ones
    globalShortcut.unregisterAll();

    var shortcutKeysSetting = configuration.readSettings('shortcutKeys'),
        // transforming the settings into an accelerator compatible string
        shortcutPrefix = shortcutKeysSetting.length === 0 ? '' : shortcutKeysSetting.join('+') + '+';

    globalShortcut.register(shortcutPrefix + '1', function () {
        mainWindow.webContents.send('global-shortcut', 0);
    });

    globalShortcut.register(shortcutPrefix + '2', function () {
        mainWindow.webContents.send('global-shortcut', 1);
    });
}

// listening on the close-main-window channel
ipc.on('close-main-window', function () {
    app.quit();
});

ipc.on('open-settings-window', function () {
    if (settingsWindow) {
        return;
    }

    settingsWindow = new BrowserWindow({
        frame: false,
        height: 200,
        resizable: false,
        width: 200
    });

    settingsWindow.loadUrl('file://' + __dirname + '/app/settings.html');

    settingsWindow.on('closed', function () {
        settingsWindow = null;
    });
});

ipc.on('close-settings-window', function () {
    if (settingsWindow) {
        settingsWindow.close();
    }
});

ipc.on('set-global-shortcuts', function () {
    setGlobalShortcuts();
});


text:
/*
 * File:   math.h
 * Author: Przemysław Bągard
 *
 * Created on 14 wrzesień 2010, 10:21
 */

#ifndef GEOMETRY_MATH_H
#define	GEOMETRY_MATH_H

#include <cstdlib>
#include <cmath>
#include "const.h"

/// math functions
namespace EnvelopeGeometry {

/// conversion: degrees to radians
inline double degToRad(const double& k);

/// conversion: radians to degrees
inline double radToDeg(const double& k);

/// sets 'k' angle to equivalent in the range [0,360) degrees (parameter and result in degrees!)
inline double normalizeAngle(double k);

/// swap min and max if the 'min' parameter is greater from 'max'
template <typename T>
inline void setMinMax(T& min, T& max);

/// if parameter 'value' is beyond the interval ['min', 'max'], it sets it to closer value from those two parameters
template <typename T>
inline void setInRange(T min, T& value, T max);

/// absolute value
inline float abs(const float& value);

/// returns minimal value from given parameters
template <typename T>
inline T min(const T& a, const T& b);

/// returns maximal value from given parameters
template <typename T>
inline T max(const T& a, const T& b);

/// returns true if parameter 'value' is negative (including epsilon)
template <typename T>
inline bool isNegative(const T& value);

/// returns true if parameter 'value' equals zero (including epsilon)
template <typename T>
inline bool isZero(const T& value);

/// returns true if parameter 'value' is positive (including epsilon)
template <typename T>
inline bool isPositive(const T& value);

/// approximate parameter 'value' to closest multiple of the parameter 'step'
template <typename T>
inline T approximate(const T& value, const T& step);
}

/******************************* implementation *******************************/

namespace EnvelopeGeometry {

inline double degToRad(const double& k) { return ((k*M_PI)/180.0); }
inline double radToDeg(const double& k) { return ((k/M_PI)*180.0); }

inline double normalizeAngle(double k) {
    k = fmod(k, 360);

    if (k < 0) {
        k = fmod(k + 360, 360);
    }

    return k;
}

template <typename T>
inline void setMinMax(T& min, T& max)
{
    if(max < min)
    {
        T temp = min;
        min = max;
        max = temp;
    }
}

template <typename T>
inline void setInRange(T min, T& value, T max) {
    if (value < min) {
        value = min;
    } else if (max < value) {
        value = max;
    }
}

inline float abs(const float& value) {
    return fabs(value);
}

template <typename T>
inline T min(const T& a, const T& b) {
    if (a < b)
        return a;
    else
        return b;
}

template <typename T>
inline T max(const T& a, const T& b) {
    if (a > b)
        return a;
    else
        return b;
}

template <>
inline bool isNegative(const float& value) {
    return value < -GEOMETRY_FLOAT_EPSILON;
}

template <>
inline bool isZero(const float& value) {
    return abs(value) <= GEOMETRY_FLOAT_EPSILON;
}

template <>
inline bool isPositive(const float& value) {
    return value > GEOMETRY_FLOAT_EPSILON;
}

template <>
inline bool isNegative(const int& value) {
    return value < 0;
}

template <>
inline bool isZero(const int& value) {
    return value == 0;
}

template <>
inline bool isPositive(const int& value) {
    return value > 0;
}

template <typename T>
inline T approximate(const T& value, const T& step)
{
    T r = fmod(value, step);
    T v = (int)(value / step);
    v = v*step;
    if(value >= 0)
    {
        if(r >= step/2) v += step;
    }
    else
    {
        if(r <= -step/2) v -= step;
    }
    return v;
}

}

#endif	/* GEOMETRY_MATH_H */


text:
import tkinter as tk
from tkinter import ttk
import sys

class GUI(object):
    def __init__(self, master, cmd):
        object.__init__(self)
        self.master = master
        self.cmd = cmd

        # Create elements
        self.frame = ttk.Frame(self.master)
        self.button = ttk.Button(self.frame, text='Test', command=self.cmd['button'])

        # If you need to pass arguments to the function, use lambda
        # self.button = ttk.Button(self.frame, text='Test', command=lambda: self.cmd['nothing'](5))

        # Pack elements
        self.frame.pack()
        self.button.pack()

def cmd_button():
    print('Button command')

def cmd_nothing(number):
    print('What? Nothing! Or maybe {}!'.format(number))

def main():
    root = tk.Tk()

    # Assign functions to dictionary
    commands = {'button': cmd_button,
                'nothing': cmd_nothing}

    gui = GUI(root, commands)
    root.mainloop()

if __name__ == '__main__':
    sys.exit(main())


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>Hofstra Noyce Scholars Program</AwardTitle>
    <AwardEffectiveDate>01/01/2010</AwardEffectiveDate>
    <AwardExpirationDate>06/30/2016</AwardExpirationDate>
    <AwardAmount>898976</AwardAmount>
    <AwardInstrument>
      <Value>Standard Grant</Value>
    </AwardInstrument>
    <Organization>
      11040100
      <Directorate>
        <LongName>Direct For Education and Human Resources</LongName>
      </Directorate>
      <Division>
        <LongName>Division Of Undergraduate Education</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Teri Murphy</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>Two cohorts of eight junior mathematics majors each are being awarded two year scholarships of $20,000 annually while completing an undergraduate mathematics degree and meeting the requirements for New York State teacher certification in mathematics. The project focuses on how preparation in an inquiry-based and culturally relevant mathematics teaching and academic program can enhance teacher quality in high needs school districts. Formative and summative evaluation from an external evaluator guides the development of the program. <br/><br/>The extensive induction program for the new teachers is supported by the Westbury, Uniondale, Roosevelt, and Brentwood School Districts in cooperation with university faculty in both mathematics and mathematics education programs. This program provides Scholars with: (1) an in-depth summer institute; (2) a year long classroom experience; and (3) an extensive two-year induction program.</AbstractNarration>
    <MinAmdLetterDate>08/15/2009</MinAmdLetterDate>
    <MaxAmdLetterDate>12/15/2015</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>0934766</AwardID>
    <Investigator>
      <FirstName>Behailu</FirstName>
      <LastName>Mammo</LastName>
      <EmailAddress>behailu.mammo@hofstra.edu</EmailAddress>
      <StartDate>12/15/2015</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Blidi</FirstName>
      <LastName>Stemn</LastName>
      <EmailAddress>Blidi.S.Stemn@hofstra.edu</EmailAddress>
      <StartDate>08/15/2009</StartDate>
      <EndDate>09/02/2014</EndDate>
      <RoleCode>Former Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Jacqueline</FirstName>
      <LastName>Grennon Brooks</LastName>
      <EmailAddress>catjgb@hofstra.edu</EmailAddress>
      <StartDate>09/02/2014</StartDate>
      <EndDate/>
      <RoleCode>Co-Principal Investigator</RoleCode>
    </Investigator>
    <Investigator>
      <FirstName>Behailu</FirstName>
      <LastName>Mammo</LastName>
      <EmailAddress>behailu.mammo@hofstra.edu</EmailAddress>
      <StartDate>08/15/2009</StartDate>
      <EndDate>09/02/2014</EndDate>
      <RoleCode>Former Co-Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Hofstra University</Name>
      <CityName>Hempstead</CityName>
      <ZipCode>115491440</ZipCode>
      <PhoneNumber>5164636810</PhoneNumber>
      <StreetAddress>Office of the Provost</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>New York</StateName>
      <StateCode>NY</StateCode>
    </Institution>
    <FoaInformation>
      0116000
      <Name>Human Subjects</Name>
    </FoaInformation>
    <ProgramElement>
      1795
      <Text>ROBERT NOYCE SCHOLARSHIP PGM</Text>
    </ProgramElement>
    <ProgramReference>
      1795
      <Text>ROBERT NOYCE SCHOLARSHIP PGM</Text>
    </ProgramReference>
    <ProgramReference>
      9178
      <Text>UNDERGRADUATE EDUCATION</Text>
    </ProgramReference>
    <ProgramReference>
      SMET
      <Text>SCIENCE, MATH, ENG & TECH EDUCATION</Text>
    </ProgramReference>
  </Award>
</rootTag>