text:
<?php include('about_header.php') ?>

Related Categories

<?php echo $CurrentCategory[0]["Name"] ?>

                <?php if ($side_categories): ?>
                  <?php foreach ($side_categories as $row): ?>

                <a href="<?php echo base_url('welcome/category/'.$SubCategory.'/'.$row["EncryptedId"]) ?>" >
<?php echo $row["Name"]; ?>

                <?php endforeach ?>
                <?php endif ?>

Refine

Price

                <input  type="checkbox" onclick="priceFilter()" id="pr1" />
                Under Rs 50

                <input  onclick="priceFilter()" type="checkbox" id="pr2" />
                Rs 50 to Rs 100

                <input  type="checkbox" id="pr3" onclick="priceFilter()" />
                Rs 100 to Rs 500

                <input  type="checkbox" id="pr4" onclick="priceFilter()" />
                Rs 500 to Rs 1000

                <input  type="checkbox" id="pr5" onclick="priceFilter()" />
                Above Rs 1000

                <?php if ($Side_Brands): ?>

Brands

                    <?php $count=1; foreach ($Side_Brands as $key => $value): ?>

                      <input  value="<?php echo $key ?>" onclick="priceFilter()" type="checkbox" id="br<?php echo $count; ?>" />
                      <label for="br<?php echo $count++; ?>"><?php echo $value['BrandName']; ?>

                    <?php endforeach ?>
                <?php endif ?>

             <img class="cbanner" src="<?php echo base_url('uploads/category/'.$CurrentCategory[0]['Image']) ?>">

            <?php if ($filterd){$count=0;
                $countlimit=4;
                if($this->session->userdata('width'))
                {
                    if($this->session->userdata('width')<992){
                        $countlimit=2;
                    }
                }
                 foreach ($filterd as $row){?>

                                              <div class="offer_tag" id="<?php echo $row['EncryptedId'];?>"  <?php if(isset($row["Units"][0]["OfferType"])) {?> style="height: 40px"<?php }else{?>style="height: 60px"<?php }?>>
                                                <?php if(isset($row["Units"][0]["OfferType"])) {

                                                  if($row["Units"][0]["OfferType"]=="Amount"){

                                                    echo "
Rs ".$row["Units"][0]['OfferAmount']." OFF

";

                                                  }else if($row["Units"][0]["OfferType"]=="Percent"){

                                                    echo "
".$row["Units"][0]['OfferAmount']." %
OFF

";
                                                  }
                                                }

                                                ?>

<img src="<?php echo base_url('uploads/product_images/'.$row["Image"]); ?>" style="width:150px;height:150px">

<?php echo $row["Name"] ?>

                                              <a target="_blank" href="<?php echo base_url('welcome/product/'.$row["EncryptedId"]); ?>"><button class="qview">QUICK VIEW</button>
                                              <?php
                                              if(count($row["Units"])==1){

                                                echo "
".$row['Units'][0]['Unit']."
";
                                              }
                                              else{ ?>

                                                <select class="new_arrivals_product qselect"  onchange="testing('<?php echo $row["EncryptedId"]; ?>',this)"  id="<?php echo $row["EncryptedId"]; ?>">
                                                  <?php

                                                  foreach ($row["Units"] as $units) { ?>

                                                    <option  data-offertype='<?php echo $units["OfferType"]; ?>' data-offeramount='<?php echo $units["OfferAmount"]; ?>' data-percentage="<?php echo $units["ID"]; ?>" data-discount="<?php echo $units["Discount"] ?>" value="<?php echo $units["Price"]; ?>"><?php echo $units["Unit"]; ?></option>
                                                    <?php
                                                  }
                                                  ?>

                                                </select>

                                                <?php }

                                                ?>

                                                <?php if($row["Units"][0]["Discount"]==0){ ?>
                                                <span class="rs1_tag" style="color:#A1DB09 !important" id="<?php echo $row["EncryptedId"]; ?>" >Rs
                                                  <span class="new_arrivals_price nprice" style="color:#6B953E !important;font-weight:bold"   data-discount="<?php echo $row["Units"][0]["Discount"] ?>"  data-percentage="<?php echo $row["Units"][0]["ID"]; ?>" id="<?php echo $row["EncryptedId"]; ?>" ><?php echo $row["Units"][0]["Price"]; ?>

                                                  <?php } else {    ?>
                                               <span class="rs_tag" id="<?php echo $row["EncryptedId"]; ?>" >Rs
                                                    <span class="new_arrivals_price oprice"  data-discount="<?php echo $row["Units"][0]["Discount"] ?>" data-percentage="<?php echo $row["Units"][0]["ID"]; ?>" id="<?php echo $row["EncryptedId"]; ?>" ><?php echo $row["Units"][0]["Price"]; ?>
                                                   Rs<span style="color:#A1DB09 !important" class="nprice new_arrivals_nprice" id="<?php echo $row["EncryptedId"]; ?>" > <?php echo round($row["Units"][0]["Price"]-$row["Units"][0]["Discount"]) ?>

                                                    <?php } ?>

<span id="<?php echo $row["EncryptedId"]; ?>"  class="new_arrivals_quantity qval">1

                                                    <button class="addbtn" onclick="add_data('<?php echo $row["EncryptedId"]; ?>',this)" ><img  class="btn_image" width="26" height="21" src="<?php echo base_url('assets/images/addbicon.png') ?>">Add</button>

            <?php  $count++;
            if($count==$countlimit)
            {?>

            <?php $count=0;
            }
            } // End of Foreach Loop ?>

            <?php } // End of If => No Product Check
              else {
                echo "
No Product Found
";
              }
             ?>

<input type="hidden" id="cat_type" value="<?php echo $URL_PARAMETER["TYPE"] ?>">
<input type="hidden" id="cat_id" value="<?php echo $URL_PARAMETER["ID"] ?>">

<?php include('about_footer.php') ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ********************************************************************
     *  TIF Workbench deployment ant script.                            *
     *  Version: $revision$                                             *
     *                                                                  *
     *   ant -f projectBuilder.xml deploy                               *
     *                                                                  *
     *                                                                  *
     ********************************************************************
-->

<project name="TifWorkbench" default="all" basedir=".">
   <property file="nbproject/project.properties"/>
   <property file="build.properties" />

   <property name="deploy.dir" value="r:/projects/tifworkbench-whittle" />
   <property name="version.num" value="1.0.9a" />

   <property name="tif.zip" value="tif${version.num}.zip" />
   <property name="tif.source.zip" value="tif${version.num}-source.zip" />
   <property name="tif.template.zip" value="tif-template${version.num}.zip" />
   <property name="tif.jar" value="tif${version.num}.jar" />

   <property name="tif.transforms.dir" value="${deploy.dir}/transforms" />

   <property name="tif.samples" value="samples" />
   <property name="tif.samples.simple.domain" value="${tif.samples}/simple-domain" />
   <property name="tif.samples.simple.domain.diff" value="${tif.samples}/simple-domain-diff" />
   <property name="tif.samples.mde" value="${tif.samples}/mde" />
   <property name="tif.samples.tm"  value="${tif.samples}/SimpleTM" />
   <property name="tif.user.guide" value="TIF Workbench User and Admin Guide ${version.num}.pdf" />

    <target name="all">
        <!-- TODO define script. See Help menu or http://ant.apache.org/ -->
    </target>

    <target name="deploy" depends="makezip,deploy-docs,deploy-app" >

    </target>

     <target name="generate-sources">
          <taskdef name="xjc" classname="org.jvnet.jaxb2_commons.xjc.XJC2Task">
             <classpath>
                <fileset dir="C:/Program Files/NetBeans 7.2.1/ide/modules/ext/jaxb">
                   <include name="activation.jar"/>
                   <include name="jaxb-api.jar"/>
                   <include name="jaxb-impl.jar"/>
                   <include name="jsr173_1.0_api.jar"/>
                   <!--include name="stax-api-*.jar"/-->
                   <include name="jaxb-xjc.jar"/>
                </fileset>
                <fileset dir="C:/Java/jaxb2-basics-0.6.0">
                   <include name="jaxb2-basics-ant-*.jar"/>
                </fileset>
             </classpath>
          </taskdef>

        <!-- Generate the Java code for XSD -->
        <xjc destdir="${basedir}/jaxb-gen" extension="true" package="com.ptc.tifworkbench.jaxbbinding">
            <arg line="-Xequals -XhashCode -XtoString"/>
            <schema dir="${basedir}">
                <include name="schema/TIF.xsd"/>
            </schema>
            <!-- JAXB2 Plugins and Dependencies -->
            <classpath>
                <fileset dir="C:/Java/jaxb2-basics-dist-0.6.0/dist">
                    <include name="jaxb2-basics-0.6.0.jar"/>
                    <include name="jaxb2-basics-ant-0.6.0.jar"/>
                    <include name="jaxb2-basics-runtime-0.6.0.jar"/>
                    <include name="jaxb2-basics-tools-0.6.0.jar"/>
                    <include name="jaxb2-basics-testing-0.6.0.jar"/>
                    <include name="jaxb2-basics-annotate-0.6.0.jar"/>
                </fileset>
                <fileset dir="C:/Java/jaxb2-basics-dist-0.6.0/lib">
                    <include name="commons-beanutils-1.8.0.jar"/>
                    <include name="commons-lang-2.2.jar"/>
                    <include name="commons-logging-1.1.1.jar"/>
                    <include name="annox-0.5.0.jar"/>
                </fileset>
            </classpath>
        </xjc>
    </target>

   <target name="makejar" description="Make the TIF workbench jar file.">
       <delete file="deploy/${tif.jar}"></delete>
       <delete file="MANIFEST.MF"></delete>
       <buildnumber file="build.num" />

        <manifest file="MANIFEST.MF">
            <attribute name="Built-By" value="${user.name}"/>
            <attribute name="Main-Class" value="com.ptc.tifworkbench.TifWorkbenchApplication"/>
            <attribute name="Implementation-Version"
                       value="${version.num} build ${build.number}"/>
       </manifest>

       <jar jarfile="deploy/${tif.jar}" manifest="MANIFEST.MF">
          <fileset dir="build/classes" excludes="**/project.pj" />
       </jar>
   </target>

   <target name="makezip" description="Make the TIF workbench distributable zip file."
           depends="makejar,make-template-zip,zip-samples" >
       <delete file="deploy/${tif.zip}"></delete>
       <zip destfile="deploy/${tif.zip}" >
           <zipfileset dir="lib"       prefix="lib"        includes="mksapi.jar"   />
           <zipfileset dir="lib"       prefix="lib"        includes="commons-lang.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="guava-14.0.1.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="reflections-0.9.9-RC1-uberjar.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="commons-configuration-1.9.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="commons-io-2.4.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="commons-lang.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="zip4j_1.3.1.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="jaxb2-basics-0.6.0.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="jaxb2-basics-runtime-0.6.0.jar" />
           <zipfileset dir="lib"       prefix="lib"        includes="jaxb2-basics-tools-0.6.0.jar" />
           <zipfileset dir="deploy"    prefix=""           includes="${tif.jar}"          />
           <zipfileset dir="deploy"    prefix=""           includes="tif.bat"  />
           <zipfileset dir="resources" prefix="resources"  includes="*.zip,*.xml" />
           <zipfileset dir="documents" prefix="documents"  includes="*.xlsx" />
           <zipfileset dir="documents" prefix="documents"  includes="Release Notes.txt" />
           <zipfileset dir="documents" prefix="documents"  includes="${tif.user.guide}" />
       </zip>
       <echo>Created zip file ${tif.zip}</echo>
       <echo>User guide ${tif.user.guide}</echo>
   </target>

   <target name="make-source-zip" description="Zip up the source." depends="" >
       <delete file="deploy/${tif.souce.zip}"></delete>
       <zip destfile="deploy/${tif.source.zip}" >
           <zipfileset dir="schema" prefix="schema"   excludes="*.pj" />
           <zipfileset dir="lib" prefix="lib"   excludes="*.pj" />
           <zipfileset dir="nbproject" prefix="nbproject"   excludes="*.pj" />
           <zipfileset dir="src" prefix="src"  excludes="*.pj" />
           <zipfileset dir="." includes="projectBuilder.xml" />
           <zipfileset dir="." includes="gen-src.bat" />
       </zip>
       <echo>Created zip file ${tif.zip}</echo>
       <echo>User guide ${tif.user.guide}</echo>
   </target>

   <target name="make-template-zip" description="Make the TIF template distributable zip file." depends="" >
       <delete file="resources/${tif.template.zip}"></delete>
       <zip destfile="resources/${tif.template.zip}" >
           <zipfileset dir="tif-template"  excludes="*.pj" />
           <zipfileset dir="transforms"   includes="*.xsl"  prefix="xsl"/>
       </zip>
       <echo>Created zip file ${tif.template.zip}</echo>
   </target>

    <target name="deploy-docs">
        <copy todir="${deploy.dir}/documents" force="true" >
            <fileset dir="documents" excludes="*.pj" />
        </copy>

    </target>

    <target name="deploy-app" depends="makezip,deploy-docs">
        <copy file="deploy/${tif.jar}" tofile="${deploy.dir}/${tif.jar}"  force="true" overwrite="true"/>
        <copy file="deploy/${tif.zip}" tofile="${deploy.dir}/${tif.zip}"  force="true" overwrite="true"/>
        <copy file="deploy/tif.bat" tofile="${deploy.dir}/tif.bat"  force="true" overwrite="true"/>
        <copy file="schema/TIF.xsd" tofile="${deploy.dir}/TIF.xsd"  force="true" overwrite="true"/>

        <copy todir="${deploy.dir}/transforms"  force="true">
            <fileset dir="transforms" excludes="*.pj" />
        </copy>

        <copy file="resources/${tif.template.zip}" tofile="${deploy.dir}/resources/${tif.template.zip}"  force="true"/>
        <copy file="resources/simple-domain.zip"   tofile="${deploy.dir}/resources/simple-domain.zip"    force="true"/>
        <copy file="resources/mde-sample.zip"      tofile="${deploy.dir}/resources/mde-sample.zip"       force="true"/>
        <copy file="resources/SimpleTM.zip"        tofile="${deploy.dir}/resources/SimpleTM.zip"         force="true"/>

        <copy todir="${deploy.dir}/lib" >
            <fileset dir="lib" excludes="*.pj" />
        </copy>
    </target>

   <target name="zip-samples" description="Zip up the sample environments and put them in the resources directory.." depends="" >
       <delete file="resources/simple-domain.zip"></delete>
       <zip destfile="resources/simple-domain.zip" >
           <zipfileset dir="${tif.samples.simple.domain}"  />
       </zip>
       <delete file="resources/mde-sample.zip"></delete>
       <zip destfile="resources/mde-sample.zip" >
           <zipfileset dir="${tif.samples.mde}"  />
       </zip>
       <delete file="resources/SimpleTM.zip"></delete>
       <zip destfile="resources/SimpleTM.zip" >
           <zipfileset dir="${tif.samples.tm}"  />
       </zip>
   </target>

    <target name="sync-template" depends="deploy-docs" description="Sync all the significant files from the test environment into the template environment.">

        <copy todir="${deploy.dir}/transforms" >
            <fileset dir="${tif.samples.simple.domain}/xsl" excludes="*.pj" />
        </copy>

        <copy todir="${deploy.dir}/tif-template/external-scripts" >
            <fileset dir="${tif.samples.simple.domain}/external-scripts" excludes="*.pj" />
        </copy>

        <copy todir="${deploy.dir}/resources" >
            <fileset dir="resources" excludes="*.pj" />
        </copy>

        <copy todir="${deploy.dir}/lib" >
            <fileset dir="lib" excludes="*.pj" />
        </copy>
    </target>

    <!--target name="init">
       <mkdir dir="${build.generated.sources.dir}"/>
    </target-->

    <target name="diff-transforms">
        <!--exec executable="which">
            <arg value="diff.exe"/>
        </exec-->
        <delete file="tx-diff.out" />
        <apply executable="diff" force="yes" output="tx-diff.out" append="true" verbose="true">
            <arg line="-C 0"/>
            <fileset dir="${tif.transforms.dir}" />
            <srcfile />
            <targetfile />
            <mapper type="glob" from="*.xsl" to="${tif.samples.simple.domain.diff}/xsl/*.xsl" />
        </apply>

    </target>
</project>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Goog\Soy;

class SanitizedJsStrChars extends SanitizedContent
{
	protected $contentKind = ContentKind::JS_STR_CHARS;
}


text:
package handlers

import (
	"io"

	"github.com/authelia/authelia/v4/internal/authentication"
)

// MethodList is the list of available methods.
type MethodList = []string

type authorizationMatching int

// configurationBody the content returned by the configuration endpoint.
type configurationBody struct {
	AvailableMethods MethodList `json:"available_methods"`
}

// signTOTPRequestBody model of the request body received by TOTP authentication endpoint.
type signTOTPRequestBody struct {
	Token     string `json:"token" valid:"required"`
	TargetURL string `json:"targetURL"`
}

// signWebauthnRequestBody model of the request body of Webauthn authentication endpoint.
type signWebauthnRequestBody struct {
	TargetURL string `json:"targetURL"`
}

type signDuoRequestBody struct {
	TargetURL string `json:"targetURL"`
	Passcode  string `json:"passcode"`
}

// preferred2FAMethodBody the selected 2FA method.
type preferred2FAMethodBody struct {
	Method string `json:"method" valid:"required"`
}

// firstFactorRequestBody represents the JSON body received by the endpoint.
type firstFactorRequestBody struct {
	Username       string `json:"username" valid:"required"`
	Password       string `json:"password" valid:"required"`
	TargetURL      string `json:"targetURL"`
	RequestMethod  string `json:"requestMethod"`
	KeepMeLoggedIn *bool  `json:"keepMeLoggedIn"`
	// KeepMeLoggedIn: Cannot require this field because of https://github.com/asaskevich/govalidator/pull/329
	// TODO(c.michaud): add required validation once the above PR is merged.
}

// checkURIWithinDomainRequestBody represents the JSON body received by the endpoint checking if an URI is within
// the configured domain.
type checkURIWithinDomainRequestBody struct {
	URI string `json:"uri"`
}

type checkURIWithinDomainResponseBody struct {
	OK bool `json:"ok"`
}

// redirectResponse represent the response sent by the first factor endpoint
// when a redirection URL has been provided.
type redirectResponse struct {
	Redirect string `json:"redirect"`
}

// TOTPKeyResponse is the model of response that is sent to the client up successful identity verification.
type TOTPKeyResponse struct {
	Base32Secret string `json:"base32_secret"`
	OTPAuthURL   string `json:"otpauth_url"`
}

// DuoDeviceBody the selected Duo device and method.
type DuoDeviceBody struct {
	Device string `json:"device" valid:"required"`
	Method string `json:"method" valid:"required"`
}

// DuoDevice represents Duo devices and methods.
type DuoDevice struct {
	Device       string   `json:"device"`
	DisplayName  string   `json:"display_name"`
	Capabilities []string `json:"capabilities"`
}

// DuoDevicesResponse represents all available user devices and methods as well as an optional enrollment url.
type DuoDevicesResponse struct {
	Result    string      `json:"result" valid:"required"`
	Devices   []DuoDevice `json:"devices,omitempty"`
	EnrollURL string      `json:"enroll_url,omitempty"`
}

// DuoSignResponse represents a result of the preauth and or auth call with further optional info.
type DuoSignResponse struct {
	Result    string      `json:"result" valid:"required"`
	Devices   []DuoDevice `json:"devices,omitempty"`
	Redirect  string      `json:"redirect,omitempty"`
	EnrollURL string      `json:"enroll_url,omitempty"`
}

// StateResponse represents the response sent by the state endpoint.
type StateResponse struct {
	Username              string               `json:"username"`
	AuthenticationLevel   authentication.Level `json:"authentication_level"`
	DefaultRedirectionURL string               `json:"default_redirection_url"`
}

// resetPasswordStep1RequestBody model of the reset password (step1) request body.
type resetPasswordStep1RequestBody struct {
	Username string `json:"username"`
}

// resetPasswordStep2RequestBody model of the reset password (step2) request body.
type resetPasswordStep2RequestBody struct {
	Password string `json:"password"`
}

// PassworPolicyBody represents the response sent by the password reset step 2.
type PassworPolicyBody struct {
	Mode             string `json:"mode"`
	MinLength        int    `json:"min_length"`
	MaxLength        int    `json:"max_length"`
	MinScore         int    `json:"min_score"`
	RequireUppercase bool   `json:"require_uppercase"`
	RequireLowercase bool   `json:"require_lowercase"`
	RequireNumber    bool   `json:"require_number"`
	RequireSpecial   bool   `json:"require_special"`
}

type responseWriter interface {
	SetStatusCode(statusCode int)
	SetBodyString(body string)
	SetBody(body []byte)
	SetContentType(contentType string)
	SetContentTypeBytes(contentType []byte)
	SetBodyStream(bodyStream io.Reader, bodySize int)
}


text:
namespace vkDebug
{
	// Default validation layers
	extern int validationLayerCount;
	extern const char *validationLayerNames[];

	// Default debug callback
	VkBool32 messageCallback(
		VkDebugReportFlagsEXT flags,
		VkDebugReportObjectTypeEXT objType,
		uint64_t srcObject,
		size_t location,
		int32_t msgCode,
		const char* pLayerPrefix,
		const char* pMsg,
		void* pUserData);

	// Load debug function pointers and set debug callback
	// if callBack is NULL, default message callback will be used
	void setupDebugging(
		VkInstance instance,
		VkDebugReportFlagsEXT flags,
		VkDebugReportCallbackEXT callBack);
	// Clear debug callback
	void freeDebugCallback(VkInstance instance);
}


text:
/*
	Based on the FS Import classes:
	Copyright (C) 2005-2006 Feeling Software Inc
	Copyright (C) 2005-2006 Autodesk Media Entertainment
	MIT License: http://www.opensource.org/licenses/mit-license.php
*/
/**
	@file FCDEffectTools.h
	This file contains FCDEffectTools namespace.
*/

#ifndef _FCD_EFFECT_TOOLS_H_
#define _FCD_EFFECT_TOOLS_H_

#ifndef _FCD_PARAMETER_ANIMATABLE_H_
#include "FCDocument/FCDParameterAnimatable.h"
#endif // _FCD_PARAMETER_ANIMATABLE_H_

/** Contains functions to post-process parameters into a list from a specific instance of an effect.
	@ingroup FCDEffect */

class FCDMaterialInstance;
class FCDEffectStandard;
class FCDEffectTechnique;
class FCDGeometryInstance;

#if defined(WIN32)
template <class T, int Q>
class FCOLLADA_EXPORT FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
#elif defined(LINUX) || defined(__APPLE__)
template <class T, int Q>
class FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
#endif // LINUX
typedef FCDEffectParameterAnimatableT<FMVector4, 1> FCDEffectParameterColor4; /**< A RGBA color effect parameter. */
typedef FCDEffectParameterAnimatableT<float, 0> FCDEffectParameterFloat; /**< A floating-point value effect parameter. */

typedef fm::pvector<FCDEffectParameter> FCDEffectParameterList; /**< A dynamically-sized array of effect parameters. */

namespace FCDEffectTools
{
/** Synchronizes the standard effect parameters associated with
		a material instance. Does nothing if there is no profile_COMMON.
		@param instance The specific material instance to be synchronized. */
FCOLLADA_EXPORT void SynchronizeAnimatedParams(FCDGeometryInstance* geometryInstance, FCDMaterialInstance* materialInstance);

/** {INTERNAL] Synchronizes a standard effect's float parameter from the three
		lists that can affect it with newparam's and setparam's.
		@param semantic The FCDEffectStandard semantic for the specific parameter.
		@param param One of the FCDEffectStandard color parameters.
		@param materialList The parameters list from a material instance.
		@param effectList The parameters list from the effect.
		@param profileList The parameters list from the effect profile. Should be COMMON. */
FCOLLADA_EXPORT void LinkAnimatedParamCommonFloat(const fm::string& semantic, FCDEffectParameterFloat* param, FCDGeometryInstance* geometry, FCDMaterial* material, FCDEffect* effect, FCDEffectProfile* profile);

/** [INTERNAL] Synchronizes a standard effect's vector parameter from the three
		lists that can affect it with newparam's and setparam's.
		@param semantic The FCDEffectStandard semantic for the specific parameter.
		@param param One of the FCDEffectStandard color parameters.
		@param materialList The parameters list from a material instance.
		@param effectList The parameters list from the effect.
		@param profileList The parameters list from the effect profile. Should be COMMON. */
FCOLLADA_EXPORT void LinkAnimatedParamCommonVector(const fm::string& semantic, FCDEffectParameterColor4* param, FCDGeometryInstance* geometry, FCDMaterial* material, FCDEffect* effect, FCDEffectProfile* profile);

/** document.... */
FCOLLADA_EXPORT FCDParameterAnimatableColor4* GetAnimatedColor(FCDGeometryInstance* geometryInstance, FCDMaterial* material, const fm::string& semantic, bool* isFloat3);

/** document... */
FCOLLADA_EXPORT FCDParameterAnimatableFloat* GetAnimatedFloat(FCDGeometryInstance* geometryInstance, FCDMaterial* material, const fm::string& semantic);

/** document... */
FCOLLADA_EXPORT FMVector4* GetDefaultColor(FCDMaterial* material, const fm::string& semantic, bool* isFloat3);

/** document... */
FCOLLADA_EXPORT float* GetDefaultFloat(FCDMaterial* material, const fm::string& semantic);

/** Retrieves a common effect parameter. Looks for the common effect parameter with the correct
		semantic, in order to bind or override its value.
		This function searches through the given level of abstractions and the ones below.
		@todo Some iterator structure to replace all these functions.
		@param materialInstance The material instance being considered.
		@param semantic The effect parameter semantic to match.
		@param localOnly Whether to search below this level of abstraction.
		@return The first effect parameter that matches the semantic.
			This pointer will be NULL if no effect parameter matches the given semantic. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDMaterialInstance* materialInstance, const char* semantic, bool localOnly = false);
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDMaterialInstance* materialInstance, const char* semantic, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDMaterialInstance*>(materialInstance), semantic, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDGeometryInstance* geometryInstance, const char* semantic); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDGeometryInstance* geometryInstance, const char* semantic)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDGeometryInstance*>(geometryInstance), semantic));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDMaterial* material, const char* semantic, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDMaterial* material, const char* semantic, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDMaterial*>(material), semantic, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDEffect* effect, const char* semantic, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDEffect* effect, const char* semantic, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDEffect*>(effect), semantic, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDEffectProfile* profile, const char* semantic, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDEffectProfile* profile, const char* semantic, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDEffectProfile*>(profile), semantic, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterBySemantic(const FCDEffectTechnique* technique, const char* semantic, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterBySemantic(FCDEffectTechnique* technique, const char* semantic, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterBySemantic(const_cast<const FCDEffectTechnique*>(technique), semantic, localOnly));
} /**< See above. */

/** Retrieves a common effect parameter. Looks for the common effect parameter with the correct
		reference, in order to bind or override its value.
		This function searches through the given level of abstractions and the ones below.
		@todo Some iterator structure to replace all these functions.
		@param materialInstance The material instance being considered.
		@param reference The effect parameter reference to match.
		@return The first effect parameter that matches the reference.
			This pointer will be NULL if no effect parameter matches the given reference. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDMaterialInstance* materialInstance, const char* reference, bool localOnly = false);
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDMaterialInstance* materialInstance, const char* reference, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDMaterialInstance*>(materialInstance), reference, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDGeometryInstance* geometryInstance, const char* reference); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDGeometryInstance* geometryInstance, const char* reference)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDGeometryInstance*>(geometryInstance), reference));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDMaterial* material, const char* reference, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDMaterial* material, const char* reference, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDMaterial*>(material), reference, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDEffect* effect, const char* reference, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDEffect* effect, const char* reference, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDEffect*>(effect), reference, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDEffectProfile* profile, const char* reference, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDEffectProfile* profile, const char* reference, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDEffectProfile*>(profile), reference, localOnly));
} /**< See above. */
FCOLLADA_EXPORT const FCDEffectParameter* FindEffectParameterByReference(const FCDEffectTechnique* technique, const char* reference, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline FCDEffectParameter* FindEffectParameterByReference(FCDEffectTechnique* technique, const char* reference, bool localOnly = false)
{
    return const_cast<FCDEffectParameter*>(FindEffectParameterByReference(const_cast<const FCDEffectTechnique*>(technique), reference, localOnly));
} /**< See above. */

/** Retrieves a subset of the common effect parameter list.
		Look for the effect parameter generators with the correct semantic.
		This function searches through the geometry instance and the level of abstractions below.
		@todo Some iterator structure to replace all these functions.
		@param materialInstance The material instance being considered.
		@param semantic The effect parameter semantic to match.
		@param parameters The list of parameters to fill in. This list is not cleared. */
FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDMaterialInstance* materialInstance, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false);
FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDMaterialInstance* materialInstance, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersBySemantic(const_cast<const FCDMaterialInstance*>(materialInstance), semantic, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDMaterial* material, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDMaterial* material, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersBySemantic(const_cast<const FCDMaterial*>(material), semantic, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDEffect* effect, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDEffect* effect, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersBySemantic(const_cast<const FCDEffect*>(effect), semantic, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDEffectProfile* profile, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDEffectProfile* profile, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersBySemantic(const_cast<const FCDEffectProfile*>(profile), semantic, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersBySemantic(const FCDEffectTechnique* technique, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersBySemantic(FCDEffectTechnique* technique, const char* semantic, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersBySemantic(const_cast<const FCDEffectTechnique*>(technique), semantic, parameters, localOnly);
} /**< See above. */

/** Retrieves a subset of the common effect parameter list.
		Look for the effect parameter generators with the correct reference.
		This function searches through the geometry instance and the level of abstractions below.
		@todo Some iterator structure to replace all these functions.
		@param materialInstance The material instance being considered.
		@param reference The effect parameter reference to match. In the case of effect
			parameter generators, the reference is replaced by the sub-id.
		@param parameters The list of parameters to fill in. This list is not cleared. */
FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDMaterialInstance* materialInstance, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false);
FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDMaterialInstance* materialInstance, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersByReference(const_cast<const FCDMaterialInstance*>(materialInstance), reference, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDMaterial* material, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDMaterial* material, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersByReference(const_cast<const FCDMaterial*>(material), reference, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDEffect* effect, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDEffect* effect, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersByReference(const_cast<const FCDEffect*>(effect), reference, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDEffectProfile* profile, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDEffectProfile* profile, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersByReference(const_cast<const FCDEffectProfile*>(profile), reference, parameters, localOnly);
} /**< See above. */
FCOLLADA_EXPORT void FindEffectParametersByReference(const FCDEffectTechnique* technique, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false); /**< See above. */
FCOLLADA_EXPORT inline void FindEffectParametersByReference(FCDEffectTechnique* technique, const char* reference, FCDEffectParameterList& parameters, bool localOnly = false)
{
    FindEffectParametersByReference(const_cast<const FCDEffectTechnique*>(technique), reference, parameters, localOnly);
} /**< See above. */
};

#endif //_FCD_EFFECT_TOOLS_H_


text:
from django import template

register = template.Library()

@register.filter(name='get')
def get(d, k):
    return d.get(k, None)


text:
package com.kata.vending_machine;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.kata.vending_machine.exceptions.*;

/**
 * The {@code VendingMachine} class emulates the actions of the vending machine
 * as per the kata description.
 *
 * @author Hariharan
 */
public class VendingMachine {

	private List<Coin> returnTray;
	private BigDecimal currentAmountInserted;
	private HashMap<String, Product> mappedProducts;
	private List<String> dispenserTray;
	private HashMap<Coin, Integer> coinCounts;

	public String peekDisplayText() {
		return currentDisplay;
	}

	public HashMap<String, Product> getMappedProducts() {
		return mappedProducts;
	}

	/**
	 * Reads the Return Tray of coins for the vending machine
	 *
	 * @return the list of coins in the return tray of the vending machine
	 */
	public List<Coin> getReturnTray() {
		return returnTray;
	}

	public VendingMachine(List<Product> products, List<Coin> startingCoins) {
		resetVendingMachine();
		loadProducts(products);
		loadCoins(startingCoins);
	}

	/**
	 * Loads the vending machine with these products
	 *
	 * @param products
	 */
	private void loadProducts(List<Product> products) {
		for (int productIndex = 0; productIndex < products.size(); productIndex++) {
			mappedProducts.put("" + (productIndex + 1), products.get(productIndex));
		}
	}

	public List<String> getDispenserTray() {
		return dispenserTray;
	}

	/**
	 * Resets the vending machine to a pristine state
	 */
	private void resetVendingMachine() {
		// Empty return tray initialized
		returnTray = new ArrayList<>();
		// initialize current amount
		currentAmountInserted = BigDecimal.ZERO;
		currentAmountInserted.setScale(2);
		// initialize display
		setDisplay(Messages.INSERT_COIN);
		// initialize the product listing
		mappedProducts = new HashMap<>();
		// clear dispenser tray
		dispenserTray = new ArrayList<>();
		// clear coin counter
		coinCounts = new HashMap<>();
	}

	private String currentDisplay;

	/**
	 * Formats and sets the current display for the vending machine
	 *
	 * @param messageFormat
	 *            The formatting string of the message
	 * @param args
	 *            The arguments for substitution in the formatting
	 */
	private void setDisplay(String messageFormat, Object... args) {
		currentDisplay = String.format(messageFormat, args);
	}

	/**
	 * Adds a coin to the current amount held by the vending machine
	 *
	 * @param coin
	 *            The coin to be added to the current amount
	 */
	private void addCoinToAmount(Coin coin) {
		currentAmountInserted = currentAmountInserted.add(coin.Value());
	}

	/**
	 * Reads the current display of the vending machine
	 *
	 * @return The current message displayed by the vending machine
	 */
	public String readDisplay() {
		String currentMessage = currentDisplay;
		resetDisplay(); // resets display after each read
		return currentMessage;
	}

	private void resetDisplay() {
		// if coins in machine, display amount
		if (currentAmountInserted.doubleValue() > 0) {
			setDisplay(Messages.CURRENT_FORMAT, currentAmountInserted.doubleValue());
		} else if (coinCounts.get(Coin.Nickel) == 0 || coinCounts.get(Coin.Dime) == 0) {
			setDisplay(Messages.INSERT_COIN_EXACT);
		} else {
			// else display insert coin message
			setDisplay(Messages.INSERT_COIN);
		}
	}

	/**
	 * Handles a coin name being inserted into the vending machine
	 *
	 * @param coinName
	 *            The name of the coin being inserted
	 * @throws UnrecognizedCoinInserted
	 */
	public void insertCoin(String coinName) throws UnrecognizedCoinInserted {
		// Parse coin from the coin name
		Coin insertedCoin = readCoinFromName(coinName);
		switch (insertedCoin) {
		case Penny:
			// message changed to insert coin
			setDisplay(Messages.INSERT_COIN);
			// pennies are added to the return tray
			returnTray.add(insertedCoin);
			break;
		case Nickel:
			addCoinToAmount(insertedCoin);
			setDisplay(Messages.CURRENT_FORMAT, getCurrentAmount());
			coinCounts.replace(insertedCoin, coinCounts.get(insertedCoin) + 1);
			break;
		case Dime:
			addCoinToAmount(insertedCoin);
			setDisplay(Messages.CURRENT_FORMAT, getCurrentAmount());
			coinCounts.replace(insertedCoin, coinCounts.get(insertedCoin) + 1);
			break;

		case Quarter:
			addCoinToAmount(insertedCoin);
			setDisplay(Messages.CURRENT_FORMAT, getCurrentAmount());
			coinCounts.replace(insertedCoin, coinCounts.get(insertedCoin) + 1);
			break;

		case Unknown: // the default specific case
			throw new UnrecognizedCoinInserted(coinName);

		}

	}

	/**
	 * Select a product in the vending machine
	 *
	 * @param productNumber
	 *            The number of the product
	 */
	public void SelectProduct(String productNumber) {

		// read the product from the listing
		Product selectedProduct = mappedProducts.get(productNumber);

		// if item is sold out, show sold out message
		if (selectedProduct.getQuantity() == 0) {
			setDisplay(Messages.SOLD_OUT);
			return;
		}

		// check if enough money in machine
		if (currentAmountInserted.doubleValue() >= selectedProduct.getUnitPrice().doubleValue()) {
			// dispense the product
			dispenserTray.add(selectedProduct.getName());
			// display thanks
			setDisplay(Messages.THANK_YOU);
			// Dispense the change if needed
			BigDecimal changeAmount = currentAmountInserted.subtract(selectedProduct.getUnitPrice());
			// Convert the change to coins
			List<Coin> change = getChangeForAmount(changeAmount);
			// add coins to return tray
			returnTray.addAll(change);
			// remove coins from coins
			for (Coin coin : change) {
				coinCounts.replace(coin, coinCounts.get(coin) - 1);
			}

			// set amount in machine to 0
			currentAmountInserted = BigDecimal.ZERO;

			// remove item from inventory
			selectedProduct.setQuantity(selectedProduct.getQuantity() - 1);
		} else {
			// show the price
			setDisplay(Messages.PRICE_FORMAT, selectedProduct.getUnitPrice());
		}
	}

	/**
	 * Reads the current amount inserted into the vending machine
	 *
	 * @return The current amount inserted in the vending machine
	 */
	public BigDecimal getCurrentAmount() {
		return currentAmountInserted;
	}

	/**
	 * Converts a coin name into a {@link Coin}
	 *
	 * @param coinName
	 *            The name of the coin to be converted
	 * @return The particular {@link Coin} the coin name corresponds to
	 */
	private Coin readCoinFromName(String coinName) {
		// keeping all coin reading within vending machine logic
		if (coinName.equalsIgnoreCase("penny")) {
			return Coin.Penny;
		} else if (coinName.equalsIgnoreCase("dime")) {
			return Coin.Dime;
		} else if (coinName.equalsIgnoreCase("nickel")) {
			return Coin.Nickel;
		} else if (coinName.equalsIgnoreCase("quarter")) {
			return Coin.Quarter;
		}
		return Coin.Unknown;

	}

	public void returnMoney() {

		// change the current amount into coins and put into return tray
		List<Coin> returnCoins = getChangeForAmount(currentAmountInserted);
		returnTray.addAll(returnCoins);
		for (Coin returnCoin : returnCoins) {
			coinCounts.replace(returnCoin, coinCounts.get(returnCoin) - 1);
		}
		// reset the current amount and display
		currentAmountInserted = BigDecimal.ZERO;
		setDisplay(Messages.INSERT_COIN);
	}

	public void clearDispenserTray() {
		dispenserTray.clear();
	}

	public void clearReturnTray() {
		returnTray.clear();
	}

	/**
	 * Get the change in coins for the given amount
	 *
	 * @param changeAmount
	 * @return
	 */
	private List<Coin> getChangeForAmount(BigDecimal changeAmount) {
		List<Coin> change = new ArrayList<>();

		while (changeAmount.compareTo(BigDecimal.ZERO) > 0) {
			Coin coin = Coin.Unknown;
			if (changeAmount.doubleValue() >= 0.25 && coinCounts.get(Coin.Quarter) > 0) {
				coin = Coin.Quarter;
			} else if (changeAmount.doubleValue() >= 0.10 && coinCounts.get(Coin.Dime) > 0) {
				coin = Coin.Dime;
			} else if (changeAmount.doubleValue() >= 0.05 && coinCounts.get(Coin.Nickel) > 0) {
				coin = Coin.Nickel;
			}
			change.add(coin);
			changeAmount = changeAmount.subtract(coin.Value());
		}

		return change;
	}

	private void loadCoins(List<Coin> coins) {
		for (Coin coin : coins) {
			if (coinCounts.containsKey(coin)) {
				coinCounts.replace(coin, coinCounts.get(coin) + 1);
			} else {
				coinCounts.put(coin, 1);
			}
		}

	}

}


text:
/*************************************************************************/
/*  path.cpp                                                             */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)    */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/
#include "path.h"

#include "engine.h"
#include "scene/scene_string_names.h"

void Path::_notification(int p_what) {
}

void Path::_curve_changed() {

	if (is_inside_tree() && Engine::get_singleton()->is_editor_hint())
		update_gizmo();
}

void Path::set_curve(const Ref<Curve3D> &p_curve) {

	if (curve.is_valid()) {
		curve->disconnect("changed", this, "_curve_changed");
	}

	curve = p_curve;

	if (curve.is_valid()) {
		curve->connect("changed", this, "_curve_changed");
	}
	_curve_changed();
}

Ref<Curve3D> Path::get_curve() const {

	return curve;
}

void Path::_bind_methods() {

	ClassDB::bind_method(D_METHOD("set_curve", "curve"), &Path::set_curve);
	ClassDB::bind_method(D_METHOD("get_curve"), &Path::get_curve);
	ClassDB::bind_method(D_METHOD("_curve_changed"), &Path::_curve_changed);

	ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), "set_curve", "get_curve");
}

Path::Path() {

	set_curve(Ref<Curve3D>(memnew(Curve3D))); //create one by default
}

//////////////

void PathFollow::_update_transform() {

	if (!path)
		return;

	Ref<Curve3D> c = path->get_curve();
	if (!c.is_valid())
		return;

	float o = offset;
	if (loop)
		o = Math::fposmod(o, c->get_baked_length());

	Vector3 pos = c->interpolate_baked(o, cubic);
	Transform t = get_transform();

	t.origin = pos;
	Vector3 pos_offset = Vector3(h_offset, v_offset, 0);

	if (rotation_mode != ROTATION_NONE) {
		// perform parallel transport
		//
		// see C. Dougan, The Parallel Transport Frame, Game Programming Gems 2 for example
		// for a discussion about why not Frenet frame.

		Vector3 t_prev = pos - c->interpolate_baked(o - lookahead, cubic);
		Vector3 t_cur = c->interpolate_baked(o + lookahead, cubic) - pos;

		Vector3 axis = t_prev.cross(t_cur);
		float dot = t_prev.normalized().dot(t_cur.normalized());
		float angle = Math::acos(CLAMP(dot, -1, 1));

		if (axis.length() > CMP_EPSILON && angle > CMP_EPSILON) {
			if (rotation_mode == ROTATION_Y) {
				// assuming we're referring to global Y-axis. is this correct?
				axis.x = 0;
				axis.z = 0;
			} else if (rotation_mode == ROTATION_XY) {
				axis.z = 0;
			} else if (rotation_mode == ROTATION_XYZ) {
				// all components are OK
			}

			t.rotate_basis(axis.normalized(), angle);
		}

		// do the additional tilting
		float tilt_angle = c->interpolate_baked_tilt(o);
		Vector3 tilt_axis = t_cur; // is this correct??

		if (tilt_axis.length() > CMP_EPSILON && tilt_angle > CMP_EPSILON) {
			if (rotation_mode == ROTATION_Y) {
				tilt_axis.x = 0;
				tilt_axis.z = 0;
			} else if (rotation_mode == ROTATION_XY) {
				tilt_axis.z = 0;
			} else if (rotation_mode == ROTATION_XYZ) {
				// all components are OK
			}

			t.rotate_basis(tilt_axis.normalized(), tilt_angle);
		}

		t.translate(pos_offset);
	} else {
		t.origin += pos_offset;
	}

	set_transform(t);
}

void PathFollow::_notification(int p_what) {

	switch (p_what) {

		case NOTIFICATION_ENTER_TREE: {

			Node *parent = get_parent();
			if (parent) {
				path = Object::cast_to<Path>(parent);
				if (path) {
					_update_transform();
				}
			}

		} break;
		case NOTIFICATION_EXIT_TREE: {

			path = NULL;
		} break;
	}
}

void PathFollow::set_cubic_interpolation(bool p_enable) {

	cubic = p_enable;
}

bool PathFollow::get_cubic_interpolation() const {

	return cubic;
}

bool PathFollow::_set(const StringName &p_name, const Variant &p_value) {

	if (p_name == SceneStringNames::get_singleton()->offset) {
		set_offset(p_value);
	} else if (p_name == SceneStringNames::get_singleton()->unit_offset) {
		set_unit_offset(p_value);
	} else if (p_name == SceneStringNames::get_singleton()->rotation_mode) {
		set_rotation_mode(RotationMode(p_value.operator int()));
	} else if (p_name == SceneStringNames::get_singleton()->v_offset) {
		set_v_offset(p_value);
	} else if (p_name == SceneStringNames::get_singleton()->h_offset) {
		set_h_offset(p_value);
	} else if (String(p_name) == "cubic_interp") {
		set_cubic_interpolation(p_value);
	} else if (String(p_name) == "loop") {
		set_loop(p_value);
	} else if (String(p_name) == "lookahead") {
		set_lookahead(p_value);
	} else
		return false;

	return true;
}

bool PathFollow::_get(const StringName &p_name, Variant &r_ret) const {

	if (p_name == SceneStringNames::get_singleton()->offset) {
		r_ret = get_offset();
	} else if (p_name == SceneStringNames::get_singleton()->unit_offset) {
		r_ret = get_unit_offset();
	} else if (p_name == SceneStringNames::get_singleton()->rotation_mode) {
		r_ret = get_rotation_mode();
	} else if (p_name == SceneStringNames::get_singleton()->v_offset) {
		r_ret = get_v_offset();
	} else if (p_name == SceneStringNames::get_singleton()->h_offset) {
		r_ret = get_h_offset();
	} else if (String(p_name) == "cubic_interp") {
		r_ret = cubic;
	} else if (String(p_name) == "loop") {
		r_ret = loop;
	} else if (String(p_name) == "lookahead") {
		r_ret = lookahead;
	} else
		return false;

	return true;
}
void PathFollow::_get_property_list(List<PropertyInfo> *p_list) const {

	float max = 10000;
	if (path && path->get_curve().is_valid())
		max = path->get_curve()->get_baked_length();
	p_list->push_back(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0," + rtos(max) + ",0.01"));
	p_list->push_back(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001", PROPERTY_USAGE_EDITOR));
	p_list->push_back(PropertyInfo(Variant::REAL, "h_offset"));
	p_list->push_back(PropertyInfo(Variant::REAL, "v_offset"));
	p_list->push_back(PropertyInfo(Variant::INT, "rotation_mode", PROPERTY_HINT_ENUM, "None,Y,XY,XYZ"));
	p_list->push_back(PropertyInfo(Variant::BOOL, "cubic_interp"));
	p_list->push_back(PropertyInfo(Variant::BOOL, "loop"));
	p_list->push_back(PropertyInfo(Variant::REAL, "lookahead", PROPERTY_HINT_RANGE, "0.001,1024.0,0.001"));
}

void PathFollow::_bind_methods() {

	ClassDB::bind_method(D_METHOD("set_offset", "offset"), &PathFollow::set_offset);
	ClassDB::bind_method(D_METHOD("get_offset"), &PathFollow::get_offset);

	ClassDB::bind_method(D_METHOD("set_h_offset", "h_offset"), &PathFollow::set_h_offset);
	ClassDB::bind_method(D_METHOD("get_h_offset"), &PathFollow::get_h_offset);

	ClassDB::bind_method(D_METHOD("set_v_offset", "v_offset"), &PathFollow::set_v_offset);
	ClassDB::bind_method(D_METHOD("get_v_offset"), &PathFollow::get_v_offset);

	ClassDB::bind_method(D_METHOD("set_unit_offset", "unit_offset"), &PathFollow::set_unit_offset);
	ClassDB::bind_method(D_METHOD("get_unit_offset"), &PathFollow::get_unit_offset);

	ClassDB::bind_method(D_METHOD("set_rotation_mode", "rotation_mode"), &PathFollow::set_rotation_mode);
	ClassDB::bind_method(D_METHOD("get_rotation_mode"), &PathFollow::get_rotation_mode);

	ClassDB::bind_method(D_METHOD("set_cubic_interpolation", "enable"), &PathFollow::set_cubic_interpolation);
	ClassDB::bind_method(D_METHOD("get_cubic_interpolation"), &PathFollow::get_cubic_interpolation);

	ClassDB::bind_method(D_METHOD("set_loop", "loop"), &PathFollow::set_loop);
	ClassDB::bind_method(D_METHOD("has_loop"), &PathFollow::has_loop);

	BIND_ENUM_CONSTANT(ROTATION_NONE);
	BIND_ENUM_CONSTANT(ROTATION_Y);
	BIND_ENUM_CONSTANT(ROTATION_XY);
	BIND_ENUM_CONSTANT(ROTATION_XYZ);
}

void PathFollow::set_offset(float p_offset) {

	offset = p_offset;
	if (path)
		_update_transform();
	_change_notify("offset");
	_change_notify("unit_offset");
}

void PathFollow::set_h_offset(float p_h_offset) {

	h_offset = p_h_offset;
	if (path)
		_update_transform();
}

float PathFollow::get_h_offset() const {

	return h_offset;
}

void PathFollow::set_v_offset(float p_v_offset) {

	v_offset = p_v_offset;
	if (path)
		_update_transform();
}

float PathFollow::get_v_offset() const {

	return v_offset;
}

float PathFollow::get_offset() const {

	return offset;
}

void PathFollow::set_unit_offset(float p_unit_offset) {

	if (path && path->get_curve().is_valid() && path->get_curve()->get_baked_length())
		set_offset(p_unit_offset * path->get_curve()->get_baked_length());
}

float PathFollow::get_unit_offset() const {

	if (path && path->get_curve().is_valid() && path->get_curve()->get_baked_length())
		return get_offset() / path->get_curve()->get_baked_length();
	else
		return 0;
}

void PathFollow::set_lookahead(float p_lookahead) {

	lookahead = p_lookahead;
}

float PathFollow::get_lookahead() const {

	return lookahead;
}

void PathFollow::set_rotation_mode(RotationMode p_rotation_mode) {

	rotation_mode = p_rotation_mode;
	_update_transform();
}

PathFollow::RotationMode PathFollow::get_rotation_mode() const {

	return rotation_mode;
}

void PathFollow::set_loop(bool p_loop) {

	loop = p_loop;
}

bool PathFollow::has_loop() const {

	return loop;
}

PathFollow::PathFollow() {

	offset = 0;
	h_offset = 0;
	v_offset = 0;
	path = NULL;
	rotation_mode = ROTATION_XYZ;
	cubic = true;
	loop = true;
	lookahead = 0.1;
}


text:
natas 13
========

Description:


text:
package org.quality.gates.sonar.api;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.quality.gates.jenkins.plugin.QGException;

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

public class QualityGateResponseParser {

    public QualityGatesStatus getQualityGateResultFromJSON(String jsonString) throws QGException {

        JSONObject qualityGatesProjectStatus = createJSONObjectFromString(jsonString);

        String qualityGatesStatusResult = getStatusFromJSONObject(qualityGatesProjectStatus);

        if (qualityGatesStatusResult.startsWith("OK")) {
            return new QualityGatesStatus("OK");
        }

        return new QualityGatesStatus("ERROR");
    }

    protected JSONObject getLatestEventResult(JSONArray jsonArray) throws QGException {

        List<JSONObject> jsonObjects = new ArrayList<>();
        JSONObject returnObject;

        int jsonArrayLength = jsonArray.length();

        if (jsonArrayLength == 0) {
            jsonObjects.add(createObjectWithStatusGreen());
        } else {
            for (int i = 0; i < jsonArrayLength; i++) {
                jsonObjects.add(getJSONObjectFromArray(jsonArray, i));
            }
        }

        String mostRecentAlertID = getValueForJSONKey(jsonObjects, 0, "id");
        returnObject = jsonObjects.get(0);

        for (int i = 0; i < jsonObjects.size(); i++) {
            String alertId = getValueForJSONKey(jsonObjects, i, "id");
            if (Integer.parseInt(alertId) > Integer.parseInt(mostRecentAlertID)) {
                returnObject = jsonObjects.get(i);
            }
        }

        return returnObject;
    }

    protected JSONObject createObjectWithStatusGreen() {

        try {
            JSONObject returnObject = new JSONObject();
            returnObject.put("id", "1");
            returnObject.put("dt", "2000-01-01T12:00:00+0100");
            returnObject.put("n", "Green");

            return returnObject;
        } catch (JSONException e) {
            throw new QGException(e);
        }
    }

    protected JSONObject getJSONObjectFromArray(JSONArray array, int index) throws QGException {

        try {
            return array.getJSONObject(index);
        } catch (JSONException e) {
            throw new QGException("The request returned an empty array", e);
        }
    }

    protected String getValueForJSONKey(List<JSONObject> array, int index, String key) throws QGException {

        try {
            return array.get(index).getString(key);
        } catch (JSONException e) {
            throw new QGException("JSON Key was not found", e);
        }
    }

    protected String getStatusFromJSONObject(JSONObject jsonObject) throws QGException {

        try {
            return ((JSONObject) jsonObject.get("projectStatus")).get("status").toString();
        } catch (JSONException e) {
            throw new QGException("JSON Key was not found ", e);
        }
    }

    protected JSONArray createJSONArrayFromString(String jsonString) throws QGException {

        try {
            return new JSONArray(jsonString);
        } catch (JSONException e) {
            throw new QGException("There was a problem handling the JSON response " + jsonString, e);
        }
    }

    protected JSONObject createJSONObjectFromString(String jsonString) throws QGException {

        try {
            return new JSONObject(jsonString);
        } catch (JSONException e) {
            throw new QGException("There was a problem handling the JSON response " + jsonString, e);
        }
    }
}


text:
require 'test/unit'
require './src-gen-umple/student_'
require './src-gen-umple/mentor_'
require './src-gen-umple/program_'

module CruiseAssociations
class SimpleStateMachineTest < Test::Unit::TestCase

  function test_OneStateNoEvents
  end
    course = new CourseB
    assert_equal("StatusOpen",course.getStatus)
  end
end


text:
package org.kairus.api;

public interface constants {
	public static float SCALE = 3f;
	public static float FIELD_WIDTH = 220f;
	public static float FIELD_HEIGHT = 180f;

	public static float SCREEN_WIDTH = FIELD_WIDTH*SCALE;
	public static float SCREEN_HEIGHT = FIELD_HEIGHT*SCALE;

	public static float ROBOT_WIDTH = 7.5f;
	public static float GOAL_WIDTH = 35f;
	public static float BALL_DIAMETER = 3.267f; // should be 0.04267f ideally

	//robot general stats
	public static float ROBOT_DRAG = 0.95f;
	//private float spinDrag = 0.98f;

	public static double ROBOT_SPEED = 200;//0.3
	public static float ROBOT_ACCELERATION = 15f;
	public static float ROBOT_LINEAR_DAMPING = 1f;

	public static float ROBOT_SPIN_SPEED = 300f;
	public static float ROBOT_SPIN_ACCELERATION = 3f;
	public static float ROBOT_SPIN_DAMPING = 5f;
}


text:
using System;
using System.Collections.Generic;
using SharpTask.Task;

namespace SharTaskTest.SharpTaskExecuterTest.TestHelpers
{
    public class TaskRepeatDailyTriggerMoFr1215 : ISharpTask
    {
        public string Description => "SharTaskTest.SharpTaskExecuterTest.TestHelpers";

        public string Name => "SharTaskTest.SharpTaskExecuterTest.TestHelpers";

        public string Owner => "SharTaskTest.SharpTaskExecuterTest.TestHelpers";

        public List<ITriggerInterface> RunTrigger
        {
            get
            {
                var res = new List<ITriggerInterface>();
                var dtr = new List<DayOfWeek>
                {
                    DayOfWeek.Monday,
                    DayOfWeek.Friday
                };
                res.Add(new TriggerRepeatDaily(new StDate(2017, 1, 1), dtr, new StTime(12, 0, 0)));
                res.Add(new TriggerRepeatDaily(new StDate(2017, 1, 1), dtr, new StTime(15, 0, 0)));
                return res;
            }
        }

        public RunResult RunTask(TaskParameters taskParameters)
        {
            return new RunResult(true, true);
        }
    }
}


text:
namespace mozc {
namespace chromeos {

ChromeOsUserPosManager *ChromeOsUserPosManager::GetUserPosManager() {
  return Singleton<ChromeOsUserPosManager>::get();
}

namespace {

// The following header file is automatically generated and contains the
// definition of variable, kPOSToken, of type UserPOSImpl::POSToken.
#include "data_manager/chromeos/user_pos_data.h"

}  // namespace

const UserPOS::POSToken *ChromeOsUserPosManager::GetUserPOSData() const {
  DCHECK(kPOSToken != NULL);
  return kPOSToken;
}

namespace {
// This header file is autogenerated by gen_pos_matcher_code.py and contains
// kRuleIdTable[] and kRangeTable[].
#include "data_manager/chromeos/pos_matcher_data.h"

class ChromeOsPOSMatcher : public POSMatcher {
 public:
  ChromeOsPOSMatcher() : POSMatcher(kRuleIdTable, kRangeTables) {}
};
}  // namespace

const POSMatcher *ChromeOsUserPosManager::GetPOSMatcher() const {
  return Singleton<ChromeOsPOSMatcher>::get();
}

}  // namespace chromeos
}  // namespace mozc


text:
package com.googlecode.cqengine.persistence.support.sqlite;

import com.googlecode.cqengine.attribute.SimpleAttribute;
import com.googlecode.cqengine.index.Index;
import com.googlecode.cqengine.index.sqlite.SQLiteIdentityIndex;
import com.googlecode.cqengine.index.support.indextype.OffHeapTypeIndex;

/**
 * A subclass of {@link SQLiteIdentityIndex} intended for use with off-heap persistence.
 * This subclass does not override any behaviour, and exists only so that CQEngine can distinguish between
 * disk-based and off-heap configurations of the superclass index.
 *
 * @author niall.gallagher
 */
public class SQLiteOffHeapIdentityIndex<A extends Comparable<A>, O> extends SQLiteIdentityIndex<A, O> implements OffHeapTypeIndex {

    public SQLiteOffHeapIdentityIndex(SimpleAttribute<O, A> primaryKeyAttribute) {
        super(primaryKeyAttribute);
    }

    @Override
    public Index<O> getEffectiveIndex() {
        return this;
    }

    /**
     * Creates a new {@link SQLiteOffHeapIdentityIndex} for the given primary key attribute.
     *
     * @param primaryKeyAttribute The {@link SimpleAttribute} representing a primary key on which the index will be built.
     * @param <A> The type of the attribute.
     * @param <O> The type of the object containing the attributes.
     * @return a new instance of {@link SQLiteOffHeapIdentityIndex}
     */
    public static <A extends Comparable<A>, O> SQLiteOffHeapIdentityIndex<A, O> onAttribute(final SimpleAttribute<O, A> primaryKeyAttribute) {
        return new SQLiteOffHeapIdentityIndex<A, O>(primaryKeyAttribute);
    }
}


text:
import * as FileLoader from "../glTF/glTFFileLoader";
import * as Validation from "../glTF/glTFValidation";

/**
 * This is the entry point for the UMD module.
 * The entry point for a future ESM package should be index.ts
 */
var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
if (typeof globalObject !== "undefined") {
    (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};
    for (var key in FileLoader) {
        (<any>globalObject).BABYLON[key] = (<any>FileLoader)[key];
    }
    for (var key in Validation) {
        (<any>globalObject).BABYLON[key] = (<any>Validation)[key];
    }
}

export * from "../glTF/glTFFileLoader";
export * from "../glTF/glTFValidation";


text:
package com.cezarykluczynski.stapi.etl.template.starship_class.dto;

public class StarshipClassTemplateParameter {

	public static final String NAME = "name";
	public static final String OWNER = "owner";
	public static final String T1OWNER = "t1owner";
	public static final String T2OWNER = "t2owner";
	public static final String T3OWNER = "t3owner";
	public static final String T4OWNER = "t4owner";
	public static final String T5OWNER = "t5owner";
	public static final String OPERATOR = "operator";
	public static final String T1OPERATOR = "t1operator";
	public static final String T2OPERATOR = "t2operator";
	public static final String T3OPERATOR = "t3operator";
	public static final String T4OPERATOR = "t4operator";
	public static final String T5OPERATOR = "t5operator";
	public static final String AFFILIATION = "affiliation";
	public static final String T1AFFILIATION = "t1affiliation";
	public static final String T2AFFILIATION = "t2affiliation";
	public static final String T3AFFILIATION = "t3affiliation";
	public static final String T4AFFILIATION = "t4affiliation";
	public static final String T5AFFILIATION = "t5affiliation";
	public static final String DECKS = "decks";
	public static final String T1DECKS = "t1decks";
	public static final String T2DECKS = "t2decks";
	public static final String T3DECKS = "t3decks";
	public static final String T4DECKS = "t4decks";
	public static final String T5DECKS = "t5decks";
	public static final String SPEED = "speed";
	public static final String T1SPEED = "t1speed";
	public static final String T2SPEED = "t2speed";
	public static final String T3SPEED = "t3speed";
	public static final String T4SPEED = "t4speed";
	public static final String T5SPEED = "t5speed";
	public static final String TYPE = "type";
	public static final String T1TYPE = "t1type";
	public static final String T2TYPE = "t2type";
	public static final String T3TYPE = "t3type";
	public static final String T4TYPE = "t4type";
	public static final String T5TYPE = "t5type";
	public static final String ACTIVE = "active";
	public static final String T1ACTIVE = "t1active";
	public static final String T2ACTIVE = "t2active";
	public static final String T3ACTIVE = "t3active";
	public static final String T4ACTIVE = "t4active";
	public static final String T5ACTIVE = "t5active";

}


text:
package de.lessvoid.nifty.controls.listbox;

import de.lessvoid.nifty.controls.ListBoxSelectionChangedEvent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

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

import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.isA;
import static org.easymock.classextension.EasyMock.*;
import static org.junit.Assert.assertEquals;

public class ListBoxItemRemoveTest {
  private static final int WIDTH_100 = 100;
  private ListBoxImpl<TestItem> listBox = new ListBoxImpl<TestItem>(null);
  private TestItem o1 = new TestItem("o1");
  private TestItem o2 = new TestItem("o2");
  private ListBoxView<TestItem> viewMock;

  @Before
  public void before() {
    listBox.addItem(o1);
    listBox.addItem(o2);
    viewMock = createMock(ListBoxView.class);
    listBox.bindToView(viewMock, 2);
  }

  @After
  public void after() {
    verify(viewMock);
  }

  @Test
  public void testClear() {
    viewMock.updateTotalCount(0);
    viewMock.updateTotalWidth(0);
    viewMock.display(ListBoxTestTool.buildValues(null, null), -1, ListBoxTestTool.buildValuesSelection());
    viewMock.publish(isA(ListBoxSelectionChangedEvent.class));
    replay(viewMock);

    listBox.clear();
    assertListBoxCount(0);
  }

  @Test
  public void testRemoveItemByIndex() {
    viewMock.updateTotalCount(1);
    viewMock.display(ListBoxTestTool.buildValues(o2, null), 0, ListBoxTestTool.buildValuesSelection());
    viewMock.publish(isA(ListBoxSelectionChangedEvent.class));
    viewMock.scrollTo(0);
    replay(viewMock);

    listBox.removeItemByIndex(0);
    assertListBoxCount(1);
  }

  @Test
  public void testRemoveItemByNegativeIndex() {
    replay(viewMock);

    listBox.removeItemByIndex(-1);
    assertListBoxCount(2);
  }

  @Test
  public void testRemoveItemByIndexTooLarge() {
    replay(viewMock);

    listBox.removeItemByIndex(4);
    assertListBoxCount(2);
  }

  @Test
  public void testRemoveAllItemManual() {
    viewMock.updateTotalCount(1);
    viewMock.display(ListBoxTestTool.buildValues(o2, null), 0, ListBoxTestTool.buildValuesSelection());
    viewMock.scrollTo(0);
    viewMock.updateTotalCount(0);
    viewMock.display(ListBoxTestTool.buildValues(null, null), -1, ListBoxTestTool.buildValuesSelection());
    viewMock.publish(isA(ListBoxSelectionChangedEvent.class));
    viewMock.publish(isA(ListBoxSelectionChangedEvent.class));
    replay(viewMock);

    listBox.removeItem(o1);
    listBox.removeItem(o2);
    assertListBoxCount(0);
  }

  @Test
  public void testRemoveAllItems() {
    viewMock.updateTotalCount(0);
    viewMock.display(ListBoxTestTool.buildValues(null, null), -1, ListBoxTestTool.buildValuesSelection());
    viewMock.publish(isA(ListBoxSelectionChangedEvent.class));
    replay(viewMock);

    List<TestItem> itemsToRemove = new ArrayList<TestItem>();
    itemsToRemove.add(o1);
    itemsToRemove.add(o2);
    listBox.removeAllItems(itemsToRemove);

    assertListBoxCount(0);
  }

  @Test
  public void testRemoveAllItemsAtBackOfList() {
    TestItem o3 = new TestItem("o3");
    TestItem o4 = new TestItem("o4");

    expect(viewMock.getWidth(o3)).andReturn(WIDTH_100);
    viewMock.updateTotalWidth(WIDTH_100);
    viewMock.updateTotalCount(3);
    viewMock.display(ListBoxTestTool.buildValues(o1, o2), 0, ListBoxTestTool.buildValuesSelection());
    viewMock.scrollTo(0);
    viewMock.display(ListBoxTestTool.buildValues(o1, o2), 0, ListBoxTestTool.buildValuesSelection());

    expect(viewMock.getWidth(o4)).andReturn(WIDTH_100);
    viewMock.updateTotalCount(4);
    viewMock.display(ListBoxTestTool.buildValues(o1, o2), 0, ListBoxTestTool.buildValuesSelection());
    viewMock.scrollTo(0);
    viewMock.display(ListBoxTestTool.buildValues(o1, o2), 0, ListBoxTestTool.buildValuesSelection());

    viewMock.scrollTo(2);
    viewMock.display(ListBoxTestTool.buildValues(o3, o4), -1, ListBoxTestTool.buildValuesSelection());
    viewMock.updateTotalCount(2);
    viewMock.scrollTo(0);
    viewMock.display(ListBoxTestTool.buildValues(o1, o2), 0, ListBoxTestTool.buildValuesSelection());
    viewMock.publish(isA(ListBoxSelectionChangedEvent.class));
    viewMock.updateTotalWidth(0);
    replay(viewMock);

    listBox.addItem(o3);
    listBox.addItem(o4);
    listBox.showItem(o3);

    List<TestItem> itemsToRemove = new ArrayList<TestItem>();
    itemsToRemove.add(o3);
    itemsToRemove.add(o4);
    listBox.removeAllItems(itemsToRemove);
  }

  @Test
  public void testRemoveItemWithAnItemNotPartOfTheList() {
    replay(viewMock);

    listBox.removeItem(new TestItem("another"));
    assertListBoxCount(2);
  }

  private void assertListBoxCount(final int expected) {
    assertEquals(expected, listBox.itemCount());
  }
}


text:
'use strict';
const path = require('path'),
	fs = require('fs');
module.exports = function readCommands() {

	const result = {};
	fs.readdirSync(path.join(__dirname, '../commands')).forEach(fileName => {
		const cmdName = path.basename(fileName, '.js');
		result[cmdName] = require('../commands/' + cmdName);
		result[cmdName].command = cmdName;
	});
	return result;
};


text:
const react = require('react');
// Resolution for requestAnimationFrame not supported in jest error :
// https://github.com/facebook/react/issues/9102#issuecomment-283873039
global.window = global;
window.addEventListener = () => {};
window.requestAnimationFrame = () => {
  throw new Error('requestAnimationFrame is not supported in Node');
};

module.exports = react;


text:
package tron;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Toolkit;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.ArrayList;

import javax.swing.ImageIcon;

public class MainMenu extends TronScreen
{
	private int selected;
	private String[] imageFile = new String[4];

	public MainMenu()
	{
		addKeyListener(new TAdapter());
		setFocusable(true);
		setBackground(Color.BLACK);
		setDoubleBuffered(true);
		selected = 1;
		imageNames();
	}

	public void imageNames()
	{
		imageFile[0] = "images/NewGame1.png";
		imageFile[1] = "images/Options1.png";
		imageFile[2] = "images/Controls1.png";
		imageFile[3] = "images/Exit1.png";
	}

	public void paint(Graphics g)
	{
		super.paint(g);

		Graphics2D g2d = (Graphics2D) g;

		drawMenu(g2d);

		Toolkit.getDefaultToolkit().sync();
		g.dispose();
	}

	public void drawMenu(Graphics2D g2d)
	{
		ImageIcon Tron = new ImageIcon(this.getClass().getResource("images/Tron.png"));
		ImageIcon Background = new ImageIcon(this.getClass().getResource("images/Background.png"));

		switch (selected)
		{
			case 1:		imageFile[0] = "images/NewGame.png"; break;
			case 2:		imageFile[1] = "images/Options.png"; break;
			case 3:		imageFile[2] = "images/Controls.png"; break;
			case 4: 	imageFile[3] = "images/Exit.png"; break;
		}

		ImageIcon[] icons = new ImageIcon[4];

		for (int x = 0; x < 4; x++)
			icons[x] = new ImageIcon(this.getClass().getResource(imageFile[x]));

		g2d.drawImage(Background.getImage(), 0, 0, this);
		g2d.drawImage(Tron.getImage(), 500, 180, this);
		for (int x = 0; x < 4; x++)
			g2d.drawImage(icons[x].getImage(), 630, 440 + 80 * x, this);
	}

	private class TAdapter extends KeyAdapter
	{
		public void keyPressed(KeyEvent e)
		{
			int key = e.getKeyCode();

			if (key == KeyEvent.VK_DOWN)
				selected = Math.min(selected + 1, 4);
			if (key == KeyEvent.VK_UP)
				selected = Math.max(selected - 1, 1);
			if (key == KeyEvent.VK_ENTER)
			{
				if (selected == 1)
				{
					TronFrame.pushScreen(new GameStart());
				}
				else if (selected == 2)
				{
					TronFrame.pushScreen(new OptionsMenu(false));
				}
				else if (selected == 3)
				{
					TronFrame.pushScreen(new ControlsMenu());
				}
				else if (selected == 4)
				{
					System.exit(1);
				}
			}
			if(key == KeyEvent.VK_ESCAPE)
			{
				System.exit(1);
			}
			else
			{
				imageNames();
				repaint();
			}
		}
	}
}


text:
namespace facebook {
namespace memcache {

namespace {
template <class UpdateType>
void updateHelper(TypedThriftRequest<UpdateType>&& treq,
                  McRequestWithMcOp<mc_op_lease_get>& req) {
  req.setLeaseToken(treq->leaseToken);
}

template <class UpdateType>
void updateHelper(TypedThriftRequest<UpdateType>&& treq,
                  McRequestWithMcOp<mc_op_cas>& req) {
  req.setCas(treq->casToken);
}

template <class UpdateType, class Operation>
void updateHelper(TypedThriftRequest<UpdateType>&& treq,
                  McRequestWithOp<Operation>& req) {
  // no-op
}
} // anonymous

template <class GetType>
McRequestWithMcOp<OpFromType<GetType, RequestOpMapping>::value>
convertToMcRequest(TypedThriftRequest<GetType>&& treq,
                   GetLikeT<TypedThriftRequest<GetType>>) {
  constexpr mc_op_t op = OpFromType<GetType, RequestOpMapping>::value;
  McRequestWithMcOp<op> req;
  req.setKey(std::move(treq->key));
  return req;
}

template <class UpdateType>
McRequestWithMcOp<OpFromType<UpdateType, RequestOpMapping>::value>
convertToMcRequest(TypedThriftRequest<UpdateType>&& treq,
                   UpdateLikeT<TypedThriftRequest<UpdateType>>) {
  constexpr mc_op_t op = OpFromType<UpdateType, RequestOpMapping>::value;
  McRequestWithMcOp<op> req;
  req.setKey(std::move(treq->key));
  req.setExptime(treq->exptime);
  req.setFlags(treq->flags);
  req.setValue(std::move(treq->value));
  updateHelper(std::move(treq), req);
  return req;
}

template <class DeleteType>
McRequestWithMcOp<OpFromType<DeleteType, RequestOpMapping>::value>
convertToMcRequest(TypedThriftRequest<DeleteType>&& treq,
                   DeleteLikeT<TypedThriftRequest<DeleteType>>) {
  constexpr mc_op_t op = OpFromType<DeleteType, RequestOpMapping>::value;
  McRequestWithMcOp<op> req;
  req.setKey(std::move(treq->key));
  if (treq->__isset.exptime) {
    req.setExptime(treq->exptime);
  }
  return req;
}

template <class ArithType>
McRequestWithMcOp<OpFromType<ArithType, RequestOpMapping>::value>
convertToMcRequest(TypedThriftRequest<ArithType>&& treq,
                   ArithmeticLikeT<TypedThriftRequest<ArithType>>) {
  constexpr mc_op_t op = OpFromType<ArithType, RequestOpMapping>::value;
  McRequestWithMcOp<op> req;
  req.setKey(std::move(treq->key));
  req.setDelta(treq->delta);
  return req;
}

inline McRequestWithMcOp<mc_op_version> convertToMcRequest(
    TypedThriftRequest<cpp2::McVersionRequest>&& treq) {
  return {};
}

} // memcache
} // facebook


text:
var searchData=
[
  ['ql_20factorization',['QL factorization',['../group__magma__geqlf__comp.html',1,'']]],
  ['qr_20with_20pivoting_3a_20auxiliary',['QR with pivoting: auxiliary',['../group__magma__geqp3__aux.html',1,'']]],
  ['qr_20with_20pivoting',['QR with pivoting',['../group__magma__geqp3__comp.html',1,'']]],
  ['qr_20factorization',['QR factorization',['../group__magma__geqrf.html',1,'']]],
  ['qr_20factorization_3a_20auxiliary',['QR factorization: auxiliary',['../group__magma__geqrf__aux.html',1,'']]],
  ['qr_20factorization_3a_20computational',['QR factorization: computational',['../group__magma__geqrf__comp.html',1,'']]],
  ['quit',['quit',['../classmagma__thread__queue.html#a289689493610414cfa716dce2561e6cf',1,'magma_thread_queue']]]
];


text:
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Messages;
using NServiceBus.Config;
using NServiceBus.Config.ConfigurationSource;
using NServiceBus.Logging;

namespace NServiceBus.SqlServerPerf
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = @"FILL IN HERE";
            int numberOfMessages = 5000;
            int messageSize = 1024;
            int concurrency = 1;

            for (int i = 0; i < 9; i++)
            {
                int originalMessageSize = messageSize;
                for (int j = 0; j < 9; j++)
                {
                    SingleSendRun(connectionString, messageSize, numberOfMessages, concurrency);

                    SingleReceiveRun(connectionString, messageSize, numberOfMessages, concurrency);

                    messageSize *= 4;
                }

                messageSize = originalMessageSize;
                concurrency *= 2;
            }

            Console.WriteLine("done.");
            Console.ReadLine();
        }

        private static void SingleSendRun(string connectionString, int messageSize, int numberOfMessages,
            int concurrencyForSends)
        {

            DefaultFactory defaultFactory = LogManager.Use<DefaultFactory>();
            defaultFactory.Level(LogLevel.Error);

            var configuration = new BusConfiguration();
            configuration.EndpointName("NServiceBus.SqlServerPerf.Source");
            configuration.EnableInstallers();
            configuration.UseSerialization<JsonSerializer>();
            configuration.UseTransport<SqlServerTransport>().ConnectionString(connectionString);

            configuration.UsePersistence<InMemoryPersistence>();

            var bus = Bus.CreateSendOnly(configuration);

            var destination = "NServiceBus.SqlServerPerf.Destination";
            QueueHelper.CreateQueue(connectionString, destination);

            using (ProduceChocolateBar.Initialize(messageSize))
            {
                var stopWatch = Stopwatch.StartNew();

                Parallel.For(0, numberOfMessages, new ParallelOptions {MaxDegreeOfParallelism = concurrencyForSends},
                    i =>
                    {
                        bus.Send(destination,
                            new ProduceChocolateBar(true) {LotNumber = i, MaxLotNumber = numberOfMessages});
                    });

                stopWatch.Stop();

                bus.Dispose();

                Console.WriteLine(
                    $"Send: NumberOfMessages {numberOfMessages}, MessageSize {messageSize}, Concurrency {concurrencyForSends}, TimeInMs {stopWatch.ElapsedMilliseconds}");
            }
        }

        private static void SingleReceiveRun(string connectionString, int messageSize, int numberOfMessages, int concurrencyForReceives)
        {

            DefaultFactory defaultFactory = LogManager.Use<DefaultFactory>();
            defaultFactory.Level(LogLevel.Error);

            var configuration = new BusConfiguration();
            configuration.EndpointName("NServiceBus.SqlServerPerf.Destination");
            configuration.EnableInstallers();
            configuration.UseSerialization<JsonSerializer>();
            configuration.UseTransport<SqlServerTransport>().ConnectionString(connectionString);

            configuration.UsePersistence<InMemoryPersistence>();

            ProvideTransportConfiguration.Concurrency = concurrencyForReceives;
            Syncher.SyncEvent = new CountdownEvent(numberOfMessages);

            var stopWatch = Stopwatch.StartNew();

            var bus = Bus.Create(configuration).Start();

            Syncher.SyncEvent.Wait();

            stopWatch.Stop();

            bus.Dispose();
            Syncher.SyncEvent.Dispose();

            Console.WriteLine($"Receive: NumberOfMessages {numberOfMessages}, MessageSize {messageSize}, Concurrency { concurrencyForReceives}, TimeInMs { stopWatch.ElapsedMilliseconds }");
        }
    }

    public class Handler : IHandleMessages<ProduceChocolateBar>
    {
        public void Handle(ProduceChocolateBar message)
        {
            Syncher.SyncEvent.Signal();
        }
    }

    public class ProvideTransportConfiguration : IProvideConfiguration<TransportConfig>
    {
        public static int Concurrency;

        public TransportConfig GetConfiguration()
        {
            return new TransportConfig { MaximumConcurrencyLevel = Concurrency };
        }
    }

    public class ErrorConfigurationProvider : IProvideConfiguration<MessageForwardingInCaseOfFaultConfig>
    {
        public MessageForwardingInCaseOfFaultConfig GetConfiguration()
        {
            return new MessageForwardingInCaseOfFaultConfig { ErrorQueue = "error" };
        }
    }
}


text:
FPSText::FPSText(QQuickItem *parent): QQuickPaintedItem(parent), _currentFPS(0), _cacheCount(0)
{
    _times.clear();
    setFlag(QQuickItem::ItemHasContents);
}

FPSText::~FPSText()
{
}

void FPSText::recalculateFPS()
{
    qint64 currentTime = QDateTime::currentDateTime().toMSecsSinceEpoch();
    _times.push_back(currentTime);

    while (_times[0] < currentTime - 1000) {
        _times.pop_front();
    }

    int currentCount = _times.length();
    _currentFPS = (currentCount + _cacheCount) / 2;
    //qDebug() << _currentFPS;

    if (currentCount != _cacheCount) fpsChanged(_currentFPS);

    _cacheCount = currentCount;
}

int FPSText::fps()const
{
    return _currentFPS;
}

void FPSText::paint(QPainter *painter)
{
    recalculateFPS();
    //qDebug() << __FUNCTION__;
    QBrush brush(Qt::yellow);

    painter->setBrush(brush);
    painter->setPen(Qt::NoPen);
    painter->setRenderHint(QPainter::Antialiasing);
    painter->drawRoundedRect(0, 0, boundingRect().width(), boundingRect().height(), 0, 0);
    update();
}


text:
package io.primeval.saga.core.test.rules;

import java.util.Optional;
import java.util.concurrent.TimeUnit;

import org.osgi.util.promise.Promise;

import com.google.common.collect.ImmutableList;

import io.primeval.codex.publisher.UnicastPublisher;
import io.primeval.codex.scheduler.Scheduler;
import io.primeval.common.type.TypeTag;
import io.primeval.saga.action.Result;
import io.primeval.saga.annotations.Body;
import io.primeval.saga.annotations.QueryParameter;
import io.primeval.saga.annotations.Route;
import io.primeval.saga.controller.Controller;
import io.primeval.saga.guava.ImmutableResult;
import io.primeval.saga.http.protocol.HttpMethod;
import io.primeval.saga.http.protocol.HttpRequest;
import io.primeval.saga.http.shared.Payload;
import io.primeval.saga.renderer.MimeTypes;
import io.primeval.saga.websocket.WebSocket;
import io.primeval.saga.websocket.WebSocketManager;
import io.primeval.saga.websocket.message.WebSocketMessage;
import io.primeval.saga.websocket.message.WebSocketMessage.Visitor;
import reactor.core.publisher.Flux;

@Controller
public final class TestController {

    private WebSocketManager webSocketManager;
    private Scheduler scheduler;

    @Route(method = HttpMethod.GET, uri = "simpleGet")
    public Result<String> simpleGet() {
        return ImmutableResult.ok("Hello World").contentType(MimeTypes.JSON)
                .withHeader("X-Test", "Foobar").build();
    }

    @Route(method = HttpMethod.POST, uri = "uppercase")
    public String uppercase(@Body String s) {
        return s.toUpperCase();
    }

    @Route(method = HttpMethod.GET, uri = "plainText")
    public String plainText() {
        return "HELLO!";
    }

    @Route(method = HttpMethod.GET, uri = "hello")
    public Result<String> hello(@QueryParameter String who) {
        return ImmutableResult.ok("Hello " + who).contentType(MimeTypes.TEXT).build();
    }

    @Route(method = HttpMethod.GET, uri = "helloOptional")
    public Result<String> hello(@QueryParameter Optional<String> who) {
        return ImmutableResult.ok("Hello " + who.orElse("unknown person")).contentType(MimeTypes.TEXT).build();
    }

    @Route(method = HttpMethod.POST, uri = "intOptional")
    public Result<Integer> inttt(@Body Integer i) {
        return ImmutableResult.ok(i * 2).contentType(MimeTypes.JSON).build();
    }

    @Route(method = HttpMethod.GET, uri = "ws")
    public Promise<Result<Payload>> ws(HttpRequest request, @Body Payload payload) {
        UnicastPublisher<WebSocketMessage<Object>> publisher = webSocketManager.publisher();
        WebSocket<Object> webSocket = webSocketManager.createWebSocket(request, payload, publisher,
                TypeTag.of(Object.class));

        Flux.from(webSocket.incoming()).doOnNext(message -> message.visit(new Visitor<Object>() {

            @Override
            public void visitObject(Object object) {
                System.out.println(object);
            }

            @Override
            public void visitText(String text) {
                System.out.println(text);

            }
        })).subscribe();

        publisher.next(WebSocketMessage.text("Hello world"));

        publisher.next(WebSocketMessage.object(ImmutableList.of("Hello", "world")));

        scheduler.schedule(() -> {
            System.out.println("closing WS");
            publisher.complete();
        }, 9, TimeUnit.SECONDS);

        return webSocket.result();

    }

    public void setWebSocketManager(WebSocketManager webSocketManager) {
        this.webSocketManager = webSocketManager;
    }

    public void setScheduler(Scheduler scheduler) {
        this.scheduler = scheduler;
    }
}


text:
import os
import re
import shutil
import sys
from io import open

from setuptools import setup

def read(f):
    return open(f, "r", encoding="utf-8").read()

def get_version(package):
    """
    Return package version as listed in `__version__` in `init.py`.
    """
    init_py = open(os.path.join(package, "__init__.py")).read()
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)

version = get_version("request_logging")

if sys.argv[-1] == "publish":
    if os.system("pip freeze | grep twine"):
        print("twine not installed.\nUse `pip install twine`.\nExiting.")
        sys.exit()
    os.system("python setup.py sdist bdist_wheel")
    os.system("twine upload dist/*")
    print("You probably want to also tag the version now:")
    print("  git tag -a %s -m 'version %s'" % (version, version))
    print("  git push --tags")
    shutil.rmtree("dist")
    shutil.rmtree("build")
    sys.exit()

setup(
    name="django-request-logging",
    version=version,
    description="Django middleware that logs http request body.",
    long_description=read("README.md"),
    long_description_content_type="text/markdown",
    url="https://github.com/Rhumbix/django-request-logging.git",
    author="Rhumbix",
    author_email="dev@rhumbix.com",
    license="MIT",
    packages=["request_logging"],
    install_requires=["Django"],
    zip_safe=False,
)