text:
import {Cpu} from "./cpu/cpu";
import {Ppu} from "./ppu/ppu";
import {Memory} from "./memory/memory";
import {Cartridge} from "./cartridge/cartridge";
import {Registers} from "./cpu/registers"
import {Keyboard} from "./keyboard";
import {Joypad} from "./io/joypad";

export class GameBoy {

    public ppu: Ppu;
    public cpu: Cpu;
    public memory: Memory;
    public cartridge: Cartridge;
    public ticks: number = 0;
    public timeout: any;
    public keyboard: Keyboard;
    public switch :any = function(gameboy){
        let _val = false;
        return {
            on: function(){
                _val = true;
                $(".power").addClass("power-on");
                $(".power-border").addClass("power-border-on");
                gameboy.tickAnimation() },
            off: function () {
                _val = false;
                $(".power").removeClass("power-on");
                $(".power-border").removeClass("power-border-on");
            },
            stat: function () {return _val}
        }
    }(this);

    //Ticks per frame
    public tpf: number = 10000;

    private runConditions = new Map();

    constructor() {
        this.cartridge = null
        this.memory = new Memory();
        this.cpu = new Cpu(this.memory);
        this.ppu = new Ppu(this.memory);
        this.keyboard = new Keyboard(this.memory.joypad);
        this.keyboard.init();
    }

    public load(url: string): void {
        this.cartridge = Cartridge.load(url, this.memory);
        this.memory.cartridge = this.cartridge;
    }

    public reset(): void {
        this.cpu.reset();
        this.ticks = 0;
    }

    public checkRunConditions(): void {
        for(let cond of this.runConditions.values()){
            if(cond()){
                this.switch.off();
                break;
            }
        }
    }

    public step(): void{
        let cycles = this.cpu.tick();
        this.ticks++;
        this.ppu.renderscan(cycles);
        this.checkRunConditions();
    }

    /**
     * Tick until
     * @param pc
     */
    public tickAnimation(): void {
        let step = function(){
            for(let i = 0; i <= this.tpf; i++){
                if(!this.switch.stat()){return}
                this.step();
            }
            this.tickAnimation.bind(this)();
        }.bind(this);

        requestAnimationFrame(step);
    }

    /**
     * The pcBreak element is designed as such in order to make
     * the register element private within the runconditions array
     */
    public setPCBreak(pc : number):void {
        let element;
        let pcBreak = (function(pc : number, registers : Registers){
            let _pc = pc;
            let _registers = registers;
            return  ()=> {return (_registers.getPC() == _pc)};
        })(pc, this.cpu.registers);

        if(this.runConditions.has(pc)){ return }
        this.runConditions.set(pc, pcBreak);

        element = "
" + pc.toString(16).toUpperCase() +
        "<\li>";
        $("#listbreaks").append(element);
    }

    public removePCBreak(pc : number):void{
        if(!this.runConditions.delete(pc)){
            console.log(pc + " doesnt exist");
        };
    }

    public setMemBreak(addr: number, val: number):void{
        let element;
        let key = addr + ":" + val;
        let memBreak = (function(addr : number, val : number, memory : Memory){
            let _addr = addr;
            let _val = val;
            let _memory = memory;
            return () => {
                    let result = (_memory.lastChange.addr == addr &&
                        ((val)? (_memory.lastChange.val == val): true))
                    _memory.lastChange.addr = null;
                    _memory.lastChange.val = null;
                    return result;
            }
        })(addr, val, this.memory);
        if(this.runConditions.has(key)){ return }
        this.runConditions.set(key, memBreak)

        element = "
" + addr.toString(16).toUpperCase() + " : " +
        ((val)? val.toString(16).toUpperCase() : val) + "<\li>";
        $("#listmembreaks").append(element);
    }

    public removeMemBreak(addr: number, val : number):void {
        if(!this.runConditions.delete(addr + ":" + val)){
            console.log(addr + ":" + val + " doesnt exist")
        };
    }
}


text:
<?php
namespace Magento\Framework\Url\SecurityInfo\Proxy;

/**
 * Interceptor class for @see \Magento\Framework\Url\SecurityInfo\Proxy
 */
class Interceptor extends \Magento\Framework\Url\SecurityInfo\Proxy implements \Magento\Framework\Interception\InterceptorInterface
{
    use \Magento\Framework\Interception\Interceptor;

    public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName = '\\Magento\\Framework\\Url\\SecurityInfo', $shared = true)
    {
        $this->___init();
        parent::__construct($objectManager, $instanceName, $shared);
    }

    /**
     * {@inheritdoc}
     */
    public function isSecure($url)
    {
        $pluginInfo = $this->pluginList->getNext($this->subjectType, 'isSecure');
        if (!$pluginInfo) {
            return parent::isSecure($url);
        } else {
            return $this->___callPlugins('isSecure', func_get_args(), $pluginInfo);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package io.hawkcd.utilities;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import io.hawkcd.utilities.deserializers.TaskDefinitionAdapter;
import io.hawkcd.model.ExecTask;
import io.hawkcd.model.FetchArtifactTask;
import io.hawkcd.model.FetchMaterialTask;
import io.hawkcd.model.UploadArtifactTask;
import io.hawkcd.model.enums.MaterialType;
import io.hawkcd.model.enums.RunIf;
import io.hawkcd.model.enums.TaskType;

import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

public class TaskDefinitionDeserializerTests {

    private static TaskDefinitionAdapter mockedDeserializer;
    private static Gson jsonConverter;

    @Rule
    public ExpectedException expectedException = ExpectedException.none();

    @BeforeClass
    public static void setUp() {
        jsonConverter = new Gson();
        mockedDeserializer = new TaskDefinitionAdapter();
    }

    @Test
    public void deserializeExecTask_validJSON_correctObject() {
        String fakeId = "c93aeb3f-f818-4871-9729-7cebf3fcd517";

        //Arrange
        String jsonAsString = "{\n" +
                "\"type\": \"EXEC\",\n" +
                "\"name\": \"execTask\",\n" +
                "\"jobDefinitionId\": \""+ fakeId +"\",\n" +
                "\"stageDefinitionId\": \""+ fakeId +"\",\n" +
                "\"pipelineDefinitionId\": \""+ fakeId +"\",\n" +
                "\"command\": \"testMethod\",\n" +
                "\"lookUpCommands\": \"testLookUp\",\n" +
                "\"workingDirectory\": \"testDirectory\",\n" +
                "\"isIgnoringErrors\": \"true\",\n" +
                "\"runIfCondition\": \"PASSED\"\n" +
                "}";
        JsonElement jsonElement = jsonConverter.fromJson(jsonAsString, JsonElement.class);

        //Act
        ExecTask actualResult = (ExecTask) mockedDeserializer.deserialize(jsonElement,null,null);

        //Assert
        Assert.assertNotNull(actualResult);
        Assert.assertEquals(TaskType.EXEC, actualResult.getType());
        Assert.assertEquals("testMethod", actualResult.getCommand());
        Assert.assertEquals(fakeId, actualResult.getJobDefinitionId());
        Assert.assertEquals(fakeId, actualResult.getPipelineDefinitionId());
        Assert.assertEquals(fakeId, actualResult.getStageDefinitionId());
        Assert.assertEquals("testLookUp",actualResult.getLookUpCommands());
        Assert.assertEquals("testDirectory",actualResult.getWorkingDirectory());
        Assert.assertTrue(actualResult.isIgnoringErrors());
        Assert.assertEquals(RunIf.PASSED,actualResult.getRunIfCondition());
    }

    @Test
    public void deserializeFetchArtifactTask_validJSON_correctObject() {
        //Arrange
        String jsonAsString = "{\n" +
                "\"type\": \"FETCH_ARTIFACT\",\n" +
                "\"name\": \"fetchArtifact\",\n" +
                "\"designatedPipelineDefinitionName\": \"testPipe\",\n" +
                "\"designatedPipelineExecutionId\": 1,\n" +
                "\"source\": \"mySource\",\n" +
                "\"destination\": \"dist\"\n" +
                "}";
        JsonElement jsonElement = jsonConverter.fromJson(jsonAsString, JsonElement.class);

        //Act
        FetchArtifactTask actualResult = (FetchArtifactTask) mockedDeserializer.deserialize(jsonElement,null,null);

        //Assert
        Assert.assertNotNull(actualResult);
        Assert.assertEquals(TaskType.FETCH_ARTIFACT, actualResult.getType());
        Assert.assertEquals("fetchArtifact", actualResult.getName());
        Assert.assertEquals("testPipe",actualResult.getDesignatedPipelineDefinitionName());
        Assert.assertEquals("1" ,actualResult.getDesignatedPipelineExecutionId());
        Assert.assertEquals("mySource",actualResult.getSource());
    }

    @Test
    public void deserializeFetchMaterialTask_validJSON_correctObject() {
        //Arrange
        String jsonAsString = "{\n" +
                "\"type\": \"FETCH_MATERIAL\",\n" +
                "\"materialName\": \"fetchMaterial\",\n" +
                "\"pipelineName\": \"testPipe\",\n" +
                "\"source\": \"testSource\",\n" +
                "\"destination\": \"testDestination\",\n" +
                "\"materialType\": \"GIT\",\n" +
                "\"materialSpecificDetails\": {\"first\":{}}\n" +
                "}";
        JsonElement jsonElement = jsonConverter.fromJson(jsonAsString, JsonElement.class);

        //Act
        FetchMaterialTask actualResult = (FetchMaterialTask) mockedDeserializer.deserialize(jsonElement,null,null);

        //Assert
        Assert.assertNotNull(actualResult);
        Assert.assertEquals(TaskType.FETCH_MATERIAL, actualResult.getType());
        Assert.assertEquals("fetchMaterial",actualResult.getMaterialName());
        Assert.assertEquals("testPipe",actualResult.getPipelineName());
//        Assert.assertEquals("testSource",actualResult.getSource());
        Assert.assertEquals("testDestination",actualResult.getDestination());
        Assert.assertEquals(MaterialType.GIT,actualResult.getMaterialType());
       // Assert.assertEquals(HashMap.class,actualResult.getMaterialSpecificDetails().getClass());
    }

    @Test
    public void deserializeUploadArtifactTask_validJSON_correctObject() {
        //Arrange
        String jsonAsString = "{\n" +
                "\"type\": \"UPLOAD_ARTIFACT\",\n" +
                "\"source\": \"mySource\",\n" +
                "\"destination\": \"myDestination\"\n" +
                "}";
        JsonElement jsonElement = jsonConverter.fromJson(jsonAsString, JsonElement.class);

        //Act
        UploadArtifactTask actualResult = (UploadArtifactTask) mockedDeserializer.deserialize(jsonElement,null,null);

        //Assert
        Assert.assertNotNull(actualResult);
        Assert.assertEquals(TaskType.UPLOAD_ARTIFACT, actualResult.getType());
        Assert.assertEquals("mySource",actualResult.getSource());
        Assert.assertEquals("myDestination",actualResult.getDestination());
    }

    @Test
    public void deserialize_withInvalidTaskType_properExceptionAndMessage(){
        //Arrange
        String jsonAsString = "{\n" +
                "\"type\": \"nonExisting\"\n" +
                "}";
        JsonElement jsonElement = jsonConverter.fromJson(jsonAsString, JsonElement.class);

        //Act
        this.expectedException.expect(JsonParseException.class);
        this.expectedException.expectMessage("Invalid Task Definition type!");
        mockedDeserializer.deserialize(jsonElement,null,null);
    }

    @Test
    public void deserialize_nonExistingProperty_properExceptionAndMessage(){
        //Arrange
        String jsonAsString = "{\n" +
                "\"nonExisting\": \"nonExisting\"\n" +
                "}";
        JsonElement jsonElement = jsonConverter.fromJson(jsonAsString, JsonElement.class);

        //Act
        this.expectedException.expect(JsonParseException.class);
        this.expectedException.expectMessage("Field type is null!");
        mockedDeserializer.deserialize(jsonElement,null,null);
    }
}


text:
<?php

declare (strict_types=1);
namespace Rector\PHPUnit\Rector\ClassMethod;

use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Reflection\ClassMethodReflectionFactory;
use Rector\FileSystemRector\Parser\FileInfoParser;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use ReflectionMethod;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use Symplify\SmartFileSystem\SmartFileInfo;
/**
 * @see https://phpunit.readthedocs.io/en/7.3/annotations.html#doesnotperformassertions
 * @see https://github.com/sebastianbergmann/phpunit/issues/2484
 *
 * @see \Rector\PHPUnit\Tests\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector\AddDoesNotPerformAssertionToNonAssertingTestRectorTest
 */
final class AddDoesNotPerformAssertionToNonAssertingTestRector extends \Rector\Core\Rector\AbstractRector
{
    /**
     * @var int
     */
    private const MAX_LOOKING_FOR_ASSERT_METHOD_CALL_NESTING_LEVEL = 3;
    /**
     * This should prevent segfaults while going too deep into to parsed code. Without it, it might end-up with segfault
     *
     * @var int
     */
    private $classMethodNestingLevel = 0;
    /**
     * @var bool[]
     */
    private $containsAssertCallByClassMethod = [];
    /**
     * @var ClassMethod[][]|null[][]
     */
    private $analyzedMethodsInFileName = [];
    /**
     * @var \Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer
     */
    private $testsNodeAnalyzer;
    /**
     * @var \Rector\Core\Reflection\ClassMethodReflectionFactory
     */
    private $classMethodReflectionFactory;
    /**
     * @var \Rector\FileSystemRector\Parser\FileInfoParser
     */
    private $fileInfoParser;
    public function __construct(\Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer $testsNodeAnalyzer, \Rector\Core\Reflection\ClassMethodReflectionFactory $classMethodReflectionFactory, \Rector\FileSystemRector\Parser\FileInfoParser $fileInfoParser)
    {
        $this->testsNodeAnalyzer = $testsNodeAnalyzer;
        $this->classMethodReflectionFactory = $classMethodReflectionFactory;
        $this->fileInfoParser = $fileInfoParser;
    }
    public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
    {
        return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Tests without assertion will have @doesNotPerformAssertion', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
use PHPUnit\Framework\TestCase;

class SomeClass extends TestCase
{
    public function test()
    {
        $nothing = 5;
    }
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
use PHPUnit\Framework\TestCase;

class SomeClass extends TestCase
{
    /**
     * @doesNotPerformAssertions
     */
    public function test()
    {
        $nothing = 5;
    }
}
CODE_SAMPLE
)]);
    }
    /**
     * @return array<class-string<Node>>
     */
    public function getNodeTypes() : array
    {
        return [\PhpParser\Node\Stmt\ClassMethod::class];
    }
    /**
     * @param ClassMethod $node
     */
    public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
    {
        $this->classMethodNestingLevel = 0;
        if ($this->shouldSkipClassMethod($node)) {
            return null;
        }
        $this->addDoesNotPerformAssertions($node);
        return $node;
    }
    private function shouldSkipClassMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool
    {
        if (!$this->testsNodeAnalyzer->isInTestClass($classMethod)) {
            return \true;
        }
        if (!$this->testsNodeAnalyzer->isTestClassMethod($classMethod)) {
            return \true;
        }
        $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);
        if ($phpDocInfo->hasByNames(['doesNotPerformAssertions', 'expectedException'])) {
            return \true;
        }
        return $this->containsAssertCall($classMethod);
    }
    private function addDoesNotPerformAssertions(\PhpParser\Node\Stmt\ClassMethod $classMethod) : void
    {
        $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);
        $phpDocInfo->addPhpDocTagNode(new \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode('@doesNotPerformAssertions', new \PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode('')));
    }
    private function containsAssertCall(\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool
    {
        ++$this->classMethodNestingLevel;
        // probably no assert method in the end
        if ($this->classMethodNestingLevel > self::MAX_LOOKING_FOR_ASSERT_METHOD_CALL_NESTING_LEVEL) {
            return \false;
        }
        $cacheHash = \md5($this->print($classMethod));
        if (isset($this->containsAssertCallByClassMethod[$cacheHash])) {
            return $this->containsAssertCallByClassMethod[$cacheHash];
        }
        // A. try "->assert" shallow search first for performance
        $hasDirectAssertCall = $this->hasDirectAssertCall($classMethod);
        if ($hasDirectAssertCall) {
            $this->containsAssertCallByClassMethod[$cacheHash] = $hasDirectAssertCall;
            return \true;
        }
        // B. look for nested calls
        $hasNestedAssertCall = $this->hasNestedAssertCall($classMethod);
        $this->containsAssertCallByClassMethod[$cacheHash] = $hasNestedAssertCall;
        return $hasNestedAssertCall;
    }
    private function hasDirectAssertCall(\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool
    {
        return (bool) $this->betterNodeFinder->findFirst((array) $classMethod->stmts, function (\PhpParser\Node $node) : bool {
            if ($node instanceof \PhpParser\Node\Expr\MethodCall) {
                return $this->isNames($node->name, [
                    // phpunit
                    '*assert',
                    'assert*',
                    'expectException*',
                    'setExpectedException*',
                ]);
            }
            if ($node instanceof \PhpParser\Node\Expr\StaticCall) {
                return $this->isNames($node->name, [
                    // phpunit
                    '*assert',
                    'assert*',
                    'expectException*',
                    'setExpectedException*',
                ]);
            }
            return \false;
        });
    }
    private function hasNestedAssertCall(\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool
    {
        $currentClassMethod = $classMethod;
        // over and over the same method :/
        return (bool) $this->betterNodeFinder->findFirst((array) $classMethod->stmts, function (\PhpParser\Node $node) use($currentClassMethod) : bool {
            if (!$node instanceof \PhpParser\Node\Expr\MethodCall && !$node instanceof \PhpParser\Node\Expr\StaticCall) {
                return \false;
            }
            $classMethod = $this->findClassMethod($node);
            // skip circular self calls
            if ($currentClassMethod === $classMethod) {
                return \false;
            }
            if ($classMethod !== null) {
                return $this->containsAssertCall($classMethod);
            }
            return \false;
        });
    }
    /**
     * @param MethodCall|StaticCall $node
     */
    private function findClassMethod(\PhpParser\Node $node) : ?\PhpParser\Node\Stmt\ClassMethod
    {
        if ($node instanceof \PhpParser\Node\Expr\MethodCall) {
            $classMethod = $this->nodeRepository->findClassMethodByMethodCall($node);
            if ($classMethod !== null) {
                return $classMethod;
            }
        } elseif ($node instanceof \PhpParser\Node\Expr\StaticCall) {
            $classMethod = $this->nodeRepository->findClassMethodByStaticCall($node);
            if ($classMethod !== null) {
                return $classMethod;
            }
        }
        // in 3rd-party code
        return $this->findClassMethodByParsingReflection($node);
    }
    /**
     * @param MethodCall|StaticCall $node
     */
    private function findClassMethodByParsingReflection(\PhpParser\Node $node) : ?\PhpParser\Node\Stmt\ClassMethod
    {
        $methodName = $this->getName($node->name);
        if ($methodName === null) {
            return null;
        }
        if ($node instanceof \PhpParser\Node\Expr\MethodCall) {
            $objectType = $this->getObjectType($node->var);
        } else {
            // StaticCall
            $objectType = $this->getObjectType($node->class);
        }
        $reflectionMethod = $this->classMethodReflectionFactory->createFromPHPStanTypeAndMethodName($objectType, $methodName);
        if (!$reflectionMethod instanceof \ReflectionMethod) {
            return null;
        }
        $fileName = $reflectionMethod->getFileName();
        if (!$fileName) {
            return null;
        }
        if (!\file_exists($fileName)) {
            return null;
        }
        return $this->findClassMethodInFile($fileName, $methodName);
    }
    private function findClassMethodInFile(string $fileName, string $methodName) : ?\PhpParser\Node\Stmt\ClassMethod
    {
        // skip already anayzed method to prevent cycling
        if (isset($this->analyzedMethodsInFileName[$fileName][$methodName])) {
            return $this->analyzedMethodsInFileName[$fileName][$methodName];
        }
        $smartFileInfo = new \Symplify\SmartFileSystem\SmartFileInfo($fileName);
        $examinedMethodNodes = $this->fileInfoParser->parseFileInfoToNodesAndDecorate($smartFileInfo);
        /** @var ClassMethod|null $examinedClassMethod */
        $examinedClassMethod = $this->betterNodeFinder->findFirst($examinedMethodNodes, function (\PhpParser\Node $node) use($methodName) : bool {
            if (!$node instanceof \PhpParser\Node\Stmt\ClassMethod) {
                return \false;
            }
            return $this->isName($node, $methodName);
        });
        $this->analyzedMethodsInFileName[$fileName][$methodName] = $examinedClassMethod;
        return $examinedClassMethod;
    }
}


text:
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)

module Spree
  class << self
    def boot!
      unless booted?
        preinitialize
        pick_boot.run
      end
    end

    def booted?
      defined? Spree::Initializer
    end

    def pick_boot
      return VendorBoot.new if File.exist?("#{RAILS_ROOT}/vendor/spree")
      (File.exist?("#{RAILS_ROOT}/lib/spree.rb") ? AppBoot : GemBoot).new
    end

    def vendor_rails?
      File.exist?("#{RAILS_ROOT}/vendor/rails")
    end

    def preinitialize
      load(preinitializer_path) if File.exist?(preinitializer_path)
    end

    def preinitializer_path
      "#{RAILS_ROOT}/config/preinitializer.rb"
    end
  end

  module RubyGemsLoader
    def load_rubygems
      require 'rubygems'

      unless rubygems_version >= '1.3.6'
        $stderr.puts %(Spree requires RubyGems >= 1.3.6 (you have #{rubygems_version}). Please `gem update --system` and try again.)
        exit 1
      end

      # Temporary workaround for annoying RubyGems warning.  This can be removed once Rails 2.3.6 is released.
      # See http://railsdog.lighthouseapp.com/projects/31096-spree/tickets/1209
      Gem::Dependency.warned_version_requirement = true

    rescue LoadError
      $stderr.puts %(Spree requires RubyGems >= 1.3.6. Please install RubyGems and try again: http://rubygems.rubyforge.org)
      exit 1
    end

    def rubygems_version
      Gem::RubyGemsVersion.nil? ? '0.0' : Gem::RubyGemsVersion
    end
  end

  class Boot
    include Spree::RubyGemsLoader
    def run
      load_rails("2.3.5")  # note: spree requires this specific version of rails (change at your own risk)
      load_initializer
      Spree::Initializer.run(:set_load_path)
    end

    def load_initializer
      begin
        require 'spree'
        require 'spree/initializer'
      rescue LoadError => e
        $stderr.puts %(Spree could not be initialized. #{e})
        exit 1
      end
    end

    # since we're hijacking the initializer rails is no longer guaranteed to be available
    # (but we need it in the initializer)
    def load_rails(version)
      if File.exist?("#{RAILS_ROOT}/vendor/rails")
        $LOAD_PATH.unshift "#{RAILS_ROOT}/vendor/rails/railties/lib"
      else
        load_rubygems
        begin
          gem 'rails', version
        rescue Gem::LoadError => load_error
          $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`.)
          exit 1
        end
      end
    end
  end

  class VendorBoot < Boot
    def load_initializer
      $LOAD_PATH.unshift "#{RAILS_ROOT}/vendor/spree/lib"
      super
    end

    def load_error_message
      "Please verify that vendor/spree contains a complete copy of the Spree sources."
    end
  end

  class AppBoot < Boot
    def load_initializer
      $LOAD_PATH.unshift "#{RAILS_ROOT}/lib"
      super
    end

    def load_error_message
      "Please verify that you have a complete copy of the Spree sources."
    end
  end

  class GemBoot < Boot

    def load_initializer
      self.class.load_rubygems
      load_spree_gem
      super
    end

    def load_spree_gem
      if version = self.class.gem_version
        gem 'spree', version
      else
        gem 'spree'
      end
    rescue Gem::LoadError => load_error
      $stderr.puts %(Missing the Spree #{version} gem. Please `gem install -v=#{version} spree`, update your SPREE_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out SPREE_GEM_VERSION to use the latest version installed.)
      exit 1
    end

    class << self
      include Spree::RubyGemsLoader

      def gem_version
        if defined? SPREE_GEM_VERSION
          SPREE_GEM_VERSION
        elsif ENV.include?('SPREE_GEM_VERSION')
          ENV['SPREE_GEM_VERSION']
        else
          parse_gem_version(read_environment_rb)
        end
      end

      def parse_gem_version(text)
        $1 if text =~ /^[^#]*SPREE_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
      end

      private
        def read_environment_rb
          File.read("#{RAILS_ROOT}/config/environment.rb")
        end
    end
  end
end

# All that for this:
Spree.boot!


text:
package com.agilemods.materiamuto.common.command;

import com.agilemods.materiamuto.common.emc.EMCRegistry;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;

public class CommandEMC extends CommandBase {

    @Override
    public String getCommandName() {
        return "emc";
    }

    @Override
    public int getRequiredPermissionLevel() {
        return 2;
    }

    @Override
    public String getCommandUsage(ICommandSender sender) {
        return null;
    }

    @Override
    public void processCommand(ICommandSender sender, String[] args) {
        if (args.length == 1 && args[0].equals("reload")) {
            EMCRegistry.reset();
            EMCRegistry.initialize();
        }
    }
}


text:
import * as utils from 'src/utils';
import {registerBidder} from 'src/adapters/bidderFactory';
import { VIDEO } from 'src/mediaTypes';

const BIDDER_CODE = 'conversant';
const URL = '//media.msg.dotomi.com/s2s/header/24';
const SYNC_URL = '//media.msg.dotomi.com/w/user.sync';
const VERSION = '2.2.1';

export const spec = {
  code: BIDDER_CODE,
  aliases: ['cnvr'], // short code
  supportedMediaTypes: [VIDEO],

  /**
   * Determines whether or not the given bid request is valid.
   *
   * @param {BidRequest} bid - The bid params to validate.
   * @return {boolean} True if this is a valid bid, and false otherwise.
   */
  isBidRequestValid: function(bid) {
    if (!bid || !bid.params) {
      utils.logWarn(BIDDER_CODE + ': Missing bid parameters');
      return false;
    }

    if (!utils.isStr(bid.params.site_id)) {
      utils.logWarn(BIDDER_CODE + ': site_id must be specified as a string')
      return false;
    }

    if (isVideoRequest(bid)) {
      if (!bid.params.mimes) {
        // Give a warning but let it pass
        utils.logWarn(BIDDER_CODE + ': mimes should be specified for videos');
      } else if (!utils.isArray(bid.params.mimes) || !bid.params.mimes.every(s => utils.isStr(s))) {
        utils.logWarn(BIDDER_CODE + ': mimes must be an array of strings');
        return false;
      }
    }

    return true;
  },

  /**
   * Make a server request from the list of BidRequests.
   *
   * @param {BidRequest[]} validBidRequests - an array of bids
   * @return {ServerRequest} Info describing the request to the server.
   */
  buildRequests: function(validBidRequests) {
    const loc = utils.getTopWindowLocation();
    const page = loc.href;
    const isPageSecure = (loc.protocol === 'https:') ? 1 : 0;
    let siteId = '';
    let requestId = '';

    const conversantImps = validBidRequests.map(function(bid) {
      const bidfloor = utils.getBidIdParameter('bidfloor', bid.params);
      const secure = isPageSecure || (utils.getBidIdParameter('secure', bid.params) ? 1 : 0);

      siteId = utils.getBidIdParameter('site_id', bid.params);
      requestId = bid.requestId;

      const format = convertSizes(bid.sizes);

      const imp = {
        id: bid.bidId,
        secure: secure,
        bidfloor: bidfloor || 0,
        displaymanager: 'Prebid.js',
        displaymanagerver: VERSION
      };

      copyOptProperty(bid.params, 'tag_id', imp, 'tagid');

      if (isVideoRequest(bid)) {
        const video = {
          w: format[0].w,
          h: format[0].h
        };

        copyOptProperty(bid.params, 'position', video, 'pos');
        copyOptProperty(bid.params, 'mimes', video);
        copyOptProperty(bid.params, 'maxduration', video);
        copyOptProperty(bid.params, 'protocols', video);
        copyOptProperty(bid.params, 'api', video);

        imp.video = video;
      } else {
        const banner = {format: format};

        copyOptProperty(bid.params, 'position', banner, 'pos');

        imp.banner = banner;
      }

      return imp;
    });

    const payload = {
      id: requestId,
      imp: conversantImps,
      site: {
        id: siteId,
        mobile: document.querySelector('meta[name="viewport"][content*="width=device-width"]') !== null ? 1 : 0,
        page: page
      },
      device: getDevice(),
      at: 1
    };

    return {
      method: 'POST',
      url: URL,
      data: payload,
    };
  },
  /**
   * Unpack the response from the server into a list of bids.
   *
   * @param {*} serverResponse A successful response from the server.
   * @return {Bid[]} An array of bids which were nested inside the server.
   */
  interpretResponse: function(serverResponse, bidRequest) {
    const bidResponses = [];
    const requestMap = {};
    serverResponse = serverResponse.body;

    if (bidRequest && bidRequest.data && bidRequest.data.imp) {
      utils._each(bidRequest.data.imp, imp => requestMap[imp.id] = imp);
    }

    if (serverResponse && utils.isArray(serverResponse.seatbid)) {
      utils._each(serverResponse.seatbid, function(bidList) {
        utils._each(bidList.bid, function(conversantBid) {
          const responseCPM = parseFloat(conversantBid.price);
          if (responseCPM > 0.0 && conversantBid.impid) {
            const responseAd = conversantBid.adm || '';
            const responseNurl = conversantBid.nurl || '';
            const request = requestMap[conversantBid.impid];

            const bid = {
              requestId: conversantBid.impid,
              currency: serverResponse.cur || 'USD',
              cpm: responseCPM,
              creativeId: conversantBid.crid || '',
              ttl: 300,
              netRevenue: true
            };

            if (request.video) {
              bid.vastUrl = responseAd;
              bid.mediaType = 'video';
              bid.width = request.video.w;
              bid.height = request.video.h;
            } else {
              bid.ad = responseAd + '<img src="' + responseNurl + '" />';
              bid.width = conversantBid.w;
              bid.height = conversantBid.h;
            }

            bidResponses.push(bid);
          }
        })
      });
    }

    return bidResponses;
  },

  /**
   * Return use sync info
   *
   * @param {SyncOptions} syncOptions - Info about usersyncs that the adapter should obey
   * @return {UserSync} Adapter sync type and url
   */
  getUserSyncs: function(syncOptions) {
    if (syncOptions.pixelEnabled) {
      return [{
        type: 'image',
        url: SYNC_URL
      }];
    }
  }
};

/**
 * Determine do-not-track state
 *
 * @returns {boolean}
 */
function getDNT() {
  return navigator.doNotTrack === '1' || window.doNotTrack === '1' || navigator.msDoNoTrack === '1' || navigator.doNotTrack === 'yes';
}

/**
 * Return openrtb device object that includes ua, width, and height.
 *
 * @returns {Device} Openrtb device object
 */
function getDevice() {
  const language = navigator.language ? 'language' : 'userLanguage';
  return {
    h: screen.height,
    w: screen.width,
    dnt: getDNT() ? 1 : 0,
    language: navigator[language].split('-')[0],
    make: navigator.vendor ? navigator.vendor : '',
    ua: navigator.userAgent
  };
}

/**
 * Convert arrays of widths and heights to an array of objects with w and h properties.
 *
 * [[300, 250], [300, 600]] => [{w: 300, h: 250}, {w: 300, h: 600}]
 *
 * @param {number[2][]|number[2]} bidSizes - arrays of widths and heights
 * @returns {object[]} Array of objects with w and h
 */
function convertSizes(bidSizes) {
  let format;

  if (bidSizes.length === 2 && typeof bidSizes[0] === 'number' && typeof bidSizes[1] === 'number') {
    format = [{w: bidSizes[0], h: bidSizes[1]}];
  } else {
    format = utils._map(bidSizes, d => { return {w: d[0], h: d[1]}; });
  }

  return format;
}

/**
 * Check if it's a video bid request
 *
 * @param {BidRequest} bid - Bid request generated from ad slots
 * @returns {boolean} True if it's a video bid
 */
function isVideoRequest(bid) {
  return bid.mediaType === 'video' || !!utils.deepAccess(bid, 'mediaTypes.video');
}

/**
 * Copy property if exists from src to dst
 *
 * @param {object} src
 * @param {string} srcName
 * @param {object} dst
 * @param {string} [dstName] - Optional. If not specified then srcName is used.
 */
function copyOptProperty(src, srcName, dst, dstName) {
  dstName = dstName || srcName;
  const obj = utils.getBidIdParameter(srcName, src);
  if (obj !== '') {
    dst[dstName] = obj;
  }
}

registerBidder(spec);


text:
define({
  "serviceURL": "URL-Сервис",
  "defaultTitle": "Заголовок по умолчанию",
  "defaultAuthor": "Автор по умолчанию",
  "defaultCopyright": "Copyright по умолчанию",
  "defaultFormat": "Формат по умолчанию",
  "defaultLayout": "Компоновка по умолчанию",
  "warning": "Входные данные не корректны",
  "ok": "OK"
});


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EXE_Emulator_2000
{
    public partial class AboutForm : Form
    {
        public AboutForm()
        {
            InitializeComponent();
            this.BackgroundImage = EXE_Emulator_2000.Properties.Resources.tumblr_mmjq12jfl61r7nvj6o1_1280;
        }
    }
}


text:
<?php

?>
<?php eval('?>' . htmlspecialchars_decode($block->content));?>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Sydowia 3(1-6): 279 (1949)

#### Original name
Leptosphaeria shahvarica Petr.

### Remarks
null


text:
package golangci

import (
	"regexp"

	"github.com/golangci/errcheck/internal/errcheck"
	"golang.org/x/tools/go/loader"
)

var dotStar = regexp.MustCompile(".*")

type Issue errcheck.UncheckedError

func Run(program *loader.Program, checkBlank, checkAsserts bool) ([]Issue, error) {
	return RunWithConfig(program, &Config{
		Blank:   checkBlank,
		Asserts: checkAsserts,
	})
}

// Config is a copy of the `errcheck.Checker` with exported `Exclude` field.
type Config struct {
	// ignore is a map of package names to regular expressions. Identifiers from a package are
	// checked against its regular expressions and if any of the expressions match the call
	// is not checked.
	Ignore map[string]*regexp.Regexp

	// If blank is true then assignments to the blank identifier are also considered to be
	// ignored errors.
	Blank bool

	// If asserts is true then ignored type assertion results are also checked
	Asserts bool

	// build tags
	Tags []string

	Verbose bool

	// If true, checking of _test.go files is disabled
	WithoutTests bool

	// Excluded functions.
	Exclude map[string]bool
}

// RunWithConfig runs the `errchecker` linter with all its options.
func RunWithConfig(program *loader.Program, c *Config) ([]Issue, error) {
	checker := errcheck.NewChecker()
	checker.Tags = c.Tags
	checker.Blank = c.Blank
	checker.Asserts = c.Asserts
	checker.Verbose = c.Verbose
	checker.WithoutTests = c.WithoutTests

	checker.SetExclude(c.Exclude)

	checker.Ignore = map[string]*regexp.Regexp{}
	for pkg, re := range c.Ignore {
		checker.Ignore[pkg] = re
	}

	if err := checker.CheckProgram(program); err != nil {
		if e, ok := err.(*errcheck.UncheckedErrors); ok {
			return makeIssues(e), nil
		}
		if err == errcheck.ErrNoGoFiles {
			return nil, nil
		}

		return nil, err
	}

	// no issues
	return nil, nil
}

func makeIssues(e *errcheck.UncheckedErrors) []Issue {
	var ret []Issue
	for _, uncheckedError := range e.Errors {
		ret = append(ret, Issue(uncheckedError))
	}

	return ret
}


text:
//
//  GDataAtomCollection.h
//

#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_SERVICE_INTROSPECTION

// a collection in a service document for introspection,
// per http://tools.ietf.org/html/rfc5023#section-8.3.3
//
// For example,
//  <app:collection href="http://photos.googleapis.com/data/feed/api/user/user%40gmail.com?v=2">
//    <atom:title>gregrobbins</atom:title>
//    <app:accept>image/jpeg</app:accept>
//    <app:accept>video/*</app:accept>
//    <app:categories fixed="yes">
//      <atom:category scheme="http://example.org/extra-cats/" term="joke" />
//    </app:categories>
//  </app:collection>

#import "GDataObject.h"
#import "GDataValueConstruct.h"

@class GDataAtomCategoryGroup;
@class GDataTextConstruct;

@interface GDataAtomAccept : GDataValueElementConstruct <GDataExtension>
@end

@interface GDataAtomCollection : GDataObject <GDataExtension>

- (NSString *)href;
- (void)setHref:(NSString *)str;

- (GDataTextConstruct *)title;
- (void)setTitle:(GDataTextConstruct *)obj;

- (GDataAtomCategoryGroup *)categoryGroup;
- (void)setCategoryGroup:(GDataAtomCategoryGroup *)obj;

- (NSArray *)serviceAcceptStrings;
- (void)setServiceAcceptStrings:(NSArray *)array;
@end

#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_SERVICE_INTROSPECTION


text:
module SharedFilesystemStorage
  # represents share network
  class ShareNetwork < Core::ServiceLayer::Model
    def attributes_for_update
      {
        'name'              => read('name'),
        'description'       => read('description')
      }.delete_if { |_k, v| v.blank? }
    end

    def add_security_service(security_service_id)
      requires :id
      rescue_api_errors do
        service.add_security_service_to_share_network(
          security_service_id, id
        )
      end
    end

    def remove_security_service(security_service_id)
      requires :id
      rescue_api_errors do
        service.remove_security_service_from_share_network(
          security_service_id, id
        )
      end
    end
  end
end


text:
layout: post
date: 2017-06-23
title: "Moonlight Style T482"
category: Moonlight
tags: [Moonlight]
---
### Moonlight Style T482
Just **$279.99**
###

BRANDS	Moonlight

Buy it: [https://www.readybrides.com/en/moonlight/48237-moonlight-style-t482.html](https://www.readybrides.com/en/moonlight/48237-moonlight-style-t482.html)


text:
package boofcv.alg.filter.convolve.noborder;

import boofcv.struct.convolve.Kernel1D_F32;
import boofcv.struct.convolve.Kernel1D_I32;
import boofcv.struct.image.GrayF32;
import boofcv.struct.image.GrayS16;
import boofcv.struct.image.GrayU8;

/**
 *
 *

 * General implementation of {@link boofcv.alg.filter.convolve.ConvolveImageNoBorderSparse}.
 *

 *
 *

 * DO NOT MODIFY.  Auto generated by {@link GenerateConvolveStandardSparse}.
 *

 *
 * @author Peter Abeles
 */
public class ConvolveImageStandardSparse {

	public static float convolve(Kernel1D_F32 horizontal, Kernel1D_F32 vertical,
								 GrayF32 input, int c_x , int c_y, float storage[] )
	{
		int widthH = horizontal.getWidth();
		int widthV = vertical.getWidth();
		int offsetH = horizontal.getOffset();
		int offsetV = vertical.getOffset();

		// convolve horizontally first

		for( int i = 0; i < widthV; i++ ) {
			int indexImg = input.startIndex + (i+c_y-offsetV)*input.stride + c_x-offsetH;

			float total = 0;
			for( int j = 0; j < widthH; j++ ,indexImg++) {
				total += (input.data[indexImg])*horizontal.data[j];
			}
			storage[i] = total;
		}

		// convolve vertically
		float total = 0;
		for( int i = 0; i < widthV; i++ ) {
			total += storage[i]*vertical.data[i];
		}
		return total;
	}

	public static int convolve(Kernel1D_I32 horizontal, Kernel1D_I32 vertical,
							   GrayU8 input, int c_x , int c_y, int storage[] )
	{
		int widthH = horizontal.getWidth();
		int widthV = vertical.getWidth();
		int offsetH = horizontal.getOffset();
		int offsetV = vertical.getOffset();

		// convolve horizontally first

		for( int i = 0; i < widthV; i++ ) {
			int indexImg = input.startIndex + (i+c_y-offsetV)*input.stride + c_x-offsetH;

			int total = 0;
			for( int j = 0; j < widthH; j++ ,indexImg++) {
				total += (input.data[indexImg] & 0xFF)*horizontal.data[j];
			}
			storage[i] = total;
		}

		// convolve vertically
		int total = 0;
		for( int i = 0; i < widthV; i++ ) {
			total += storage[i]*vertical.data[i];
		}
		return total;
	}

	public static int convolve(Kernel1D_I32 horizontal, Kernel1D_I32 vertical,
							   GrayU8 input, int c_x , int c_y, int storage[] ,
							   int divisorHorizontal ,
							   int divisorVertical )
	{
		int widthH = horizontal.getWidth();
		int widthV = vertical.getWidth();
		int offsetH = horizontal.getOffset();
		int offsetV = vertical.getOffset();
		int halfHorizontal = divisorHorizontal/2;

		// convolve horizontally first

		for( int i = 0; i < widthV; i++ ) {
			int indexImg = input.startIndex + (i+c_y-offsetV)*input.stride + c_x-offsetH;

			int total = 0;
			for( int j = 0; j < widthH; j++ ,indexImg++) {
				total += (input.data[indexImg] & 0xFF)*horizontal.data[j];
			}
			storage[i] = (total + halfHorizontal)/divisorHorizontal;
		}

		// convolve vertically
		int total = 0;
		for( int i = 0; i < widthV; i++ ) {
			total += storage[i]*vertical.data[i];
		}
		return (total + divisorVertical/2)/divisorVertical;
	}

	public static int convolve(Kernel1D_I32 horizontal, Kernel1D_I32 vertical,
							   GrayS16 input, int c_x , int c_y, int storage[] )
	{
		int widthH = horizontal.getWidth();
		int widthV = vertical.getWidth();
		int offsetH = horizontal.getOffset();
		int offsetV = vertical.getOffset();

		// convolve horizontally first

		for( int i = 0; i < widthV; i++ ) {
			int indexImg = input.startIndex + (i+c_y-offsetV)*input.stride + c_x-offsetH;

			int total = 0;
			for( int j = 0; j < widthH; j++ ,indexImg++) {
				total += (input.data[indexImg])*horizontal.data[j];
			}
			storage[i] = total;
		}

		// convolve vertically
		int total = 0;
		for( int i = 0; i < widthV; i++ ) {
			total += storage[i]*vertical.data[i];
		}
		return total;
	}

	public static int convolve(Kernel1D_I32 horizontal, Kernel1D_I32 vertical,
							   GrayS16 input, int c_x , int c_y, int storage[] ,
							   int divisorHorizontal ,
							   int divisorVertical )
	{
		int widthH = horizontal.getWidth();
		int widthV = vertical.getWidth();
		int offsetH = horizontal.getOffset();
		int offsetV = vertical.getOffset();
		int halfHorizontal = divisorHorizontal/2;

		// convolve horizontally first

		for( int i = 0; i < widthV; i++ ) {
			int indexImg = input.startIndex + (i+c_y-offsetV)*input.stride + c_x-offsetH;

			int total = 0;
			for( int j = 0; j < widthH; j++ ,indexImg++) {
				total += (input.data[indexImg])*horizontal.data[j];
			}
			storage[i] = (total + halfHorizontal)/divisorHorizontal;
		}

		// convolve vertically
		int total = 0;
		for( int i = 0; i < widthV; i++ ) {
			total += storage[i]*vertical.data[i];
		}
		return (total + divisorVertical/2)/divisorVertical;
	}

}


text:
<?php

namespace Sylius\Behat\Page\Customer;

use Sylius\Behat\Page\ElementNotFoundException;
use Sylius\Behat\Page\PageInterface;

/**
 * @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
 */
interface CustomerShowPageInterface extends PageInterface
{
    /**
     * Checks if the customer on whose page we are currently on is registered,
     * if not throws an exception.
     *
     * @return bool
     *
     * @throws ElementNotFoundException
     */
    public function isRegistered();

    /**
     * Deletes the user on whose show page we are currently on.
     *
     * @throws ElementNotFoundException
     */
    public function deleteAccount();
}


text:
#include "pch.h"
#include "OpenGLESPage.xaml.h"

#include "WindowsStore/BasicTimer.h"

using namespace RubiksCubeXAMLApp;
using namespace Platform;
using namespace Concurrency;
using namespace Windows::Foundation;

OpenGLESPage::OpenGLESPage() :
	mAgnosticApp(nullptr)
{
	InitializeComponent();

	Windows::UI::Core::CoreWindow^ window = Windows::UI::Xaml::Window::Current->CoreWindow;

	window->VisibilityChanged +=
		ref new Windows::Foundation::TypedEventHandler<Windows::UI::Core::CoreWindow^, Windows::UI::Core::VisibilityChangedEventArgs^>(this, &OpenGLESPage::OnVisibilityChanged);

	this->Loaded +=
		ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded);

	swapChainPanel->SizeChanged +=
		ref new Windows::UI::Xaml::SizeChangedEventHandler(this, &OpenGLESPage::OnSwapChainPanelSizeChanged);

//	captureSolveButton->Click += ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::captureSolveButton_Click);
}

OpenGLESPage::~OpenGLESPage()
{
	StopRenderLoop();
	DestroyAgnosticApp();
}

void OpenGLESPage::OnSwapChainPanelSizeChanged(Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
{
	// Size change events occur outside of the render thread.  A lock is required when updating
	// the swapchainpanel size
	if (mAgnosticApp)
	{
		mAgnosticApp->UpdateForWindowSizeChange(e->NewSize.Width, e->NewSize.Height);
	}
}

void OpenGLESPage::OnPageLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
	CreateAgnosticApp();
	StartRenderLoop();
}

void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args)
{
	if (args->Visible && mAgnosticApp != nullptr)
	{
		StartRenderLoop();
	}
	else
	{
		StopRenderLoop();
	}
}

void OpenGLESPage::CreateAgnosticApp()
{
	if (mAgnosticApp == nullptr)
	{
		WindowWrapper windowWrapper;
		windowWrapper.swapChainPanel = reinterpret_cast<void*>(swapChainPanel);
		windowWrapper.cameraPreviewPane = reinterpret_cast<void*>(captureElement);
		windowWrapper.cameraErrorText = reinterpret_cast<void*>(progressText);

		mAgnosticApp = new AgnosticApp();
		mAgnosticApp->Initialize(&windowWrapper, swapChainPanel->ActualWidth, swapChainPanel->ActualHeight);
	}
}

void OpenGLESPage::DestroyAgnosticApp()
{
	if (mAgnosticApp != nullptr)
	{
		delete mAgnosticApp;
		mAgnosticApp = nullptr;
	}
}

void OpenGLESPage::StartRenderLoop()
{
	// If the render loop is already running then do not start another thread.
	if (mRenderLoopWorker != nullptr && mRenderLoopWorker->Status == Windows::Foundation::AsyncStatus::Started)
	{
		return;
	}

	// Create a task for rendering that will be run on a background thread.
	auto workItemHandler = ref new Windows::System::Threading::WorkItemHandler([this](Windows::Foundation::IAsyncAction ^ action)
	{
		BasicTimer^ timer = ref new BasicTimer();

		mAgnosticApp->MakeCurrent();

		while (action->Status == Windows::Foundation::AsyncStatus::Started)
		{
			timer->Update();
			mAgnosticApp->Update(timer->Total, timer->Delta);

			mAgnosticApp->Render();

			mAgnosticApp->Present();
		}
	});

	// Run task on a dedicated high priority background thread.
	mRenderLoopWorker = Windows::System::Threading::ThreadPool::RunAsync(workItemHandler, Windows::System::Threading::WorkItemPriority::High, Windows::System::Threading::WorkItemOptions::TimeSliced);
}

void OpenGLESPage::StopRenderLoop()
{
	if (mRenderLoopWorker)
	{
		mRenderLoopWorker->Cancel();
		mRenderLoopWorker = nullptr;
	}
}

void OpenGLESPage::captureSolveButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
	mAgnosticApp->HandleCaptureStartButtonPress();
}


text:
<component name="libraryTable">
  <library name="Maven: commons-codec:commons-codec:1.10">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.10/commons-codec-1.10.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.10/commons-codec-1.10-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text: update ACT_GE_PROPERTY set VALUE_ = '5.21.0.0' where NAME_ = 'schema.version';


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

/*
    Problem 8. Maximal sum

    Write a program that finds the sequence of maximal sum in given array.
    Example:

    input	                            result
    2, 3, -6, -1, 2, -1, 6, 4, -8, 8	2, -1, 6, 4
    Can you do it with only one loop (with single scan through the elements of the array)?
*/

class MaximalSum
{
    static void Main()
    {
        Console.WriteLine("Enter numbers: ");

        int[] numbers = Console.ReadLine()
                               .Split(new char[] { ' ', ',', '.' }, StringSplitOptions.RemoveEmptyEntries)
                               .Select(x => int.Parse(x))
                               .ToArray();

        int currentSum = 0;
        int maxSum = int.MinValue;
        List<int> currentSequence = new List<int>();
        List<int> maxSumSequence = new List<int>();
        string numbersString;

        // If all numbers are negative, the biggest sum is the biggest negative number
        if (numbers.Max() <= 0)
        {
            Console.WriteLine(numbers.Max());
        }
        // If all numbers are positive, the biggest sum is the sum of all of them
        else if (numbers.Min() >= 0)
        {
            numbersString = string.Join(" + ", numbers);
            maxSum = numbers.Sum();
            Console.WriteLine(numbersString + " = " + maxSum);
        }
        // There are positive and negative numbers
        // Use Kadane's Algorithm
        else
        {
            for (int i = 0; i < numbers.Length; i++)
            {
                currentSequence.Add(numbers[i]);
                currentSum += numbers[i];

                if (currentSum > maxSum)
                {
                    maxSum = currentSum;
                    maxSumSequence.Clear();
                    maxSumSequence.AddRange(currentSequence);
                }
                else if (currentSum <= 0)
                {
                    currentSequence.Clear();
                    currentSum = 0;
                }
            }
            numbersString = string.Join(" + ", maxSumSequence);
            numbersString += " = " + maxSum;
            Console.WriteLine(numbersString);
        }
    }
}


text:
<dom-module id="sia-network-peers-panel">
	<template>

<%=_T("Network Peers")%>

				<paper-tabs selected="{{tab}}" attr-for-selected="tab">
					<paper-tab tab="graph"><%=_T("Graph")%></paper-tab>
					<paper-tab tab="peers"><%=_T("Peers")%></paper-tab>
				</paper-tabs>

			<neon-animated-pages class="flex" selected="{{tab}}" attr-for-selected="page" entry-animation="fade-in-animation" exit-animation="fade-out-animation">
				<neon-animatable page="graph" class="fit layout vertical">
					<iris-d3-sunburst-chart
						id="chart"
						class="flex"
						data="[[chart.storage]]"
						no-legend
						margin-top="10"
						margin-bottom="10"
						margin-right="10"
						margin-left="10"
						skip-node-filtering
						info-formatter="[[chartInfoFormatter]]"
						on-in-active="onChartInactive"
						color="price"
					></iris-d3-sunburst-chart>
				</neon-animatable>
				<neon-animatable page="peers" class="fit layout vertical">
					<iris-grid class="flex" items="[[gridData]]" hide-footer>
						<grid-head class="flex-3" field="name"><%=_T("Peer")%></grid-head>
						<grid-head class="flex-2" field="free_total"><%=_T("Free / Total")%></grid-head>
						<grid-head class="flex-1" field="price"><%=_T("Price")%></grid-head>
						<template>
							<grid-row data-index="[[index]]">
								<grid-cell class="flex-3 center">
[[item.name]]
</grid-cell>
								<grid-cell class="flex-2 center">

[[_nodeSize(item.free, item.total)]]

[[_nodeSizeP(item.free, item.total)]]

								</grid-cell>
								<grid-cell class="flex-1 center padding-left">
[[_toSia(item.price)]]
</grid-cell>
							</grid-row>
						</template>
					</iris-grid>
				</neon-animatable>
			</neon-animated-pages>

	</template>

</dom-module>


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

urlpatterns = patterns('topo.views',
	url(r'^concept/(?P<concept_id>[\d]+)/resources$', 'get_resources'),

)


text:
package org.apache.camel.component.spring.ws;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.spring.ws.bean.CamelEndpointMapping;
import org.apache.camel.component.spring.ws.jaxb.QuoteRequest;
import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.model.dataformat.JaxbDataFormat;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.ws.client.core.WebServiceTemplate;

@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class ConsumerBreadcrumbIdTest extends CamelTestSupport {

    @Autowired
    private CamelEndpointMapping endpointMapping;

    @Autowired
    private WebServiceTemplate webServiceTemplate;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        context.setTracing(true);
    }

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();
        registry.bind("endpointMapping", this.endpointMapping);
        registry.bind("webServiceTemplate", this.webServiceTemplate);
        return registry;
    }

    @Test
    public void consumeWebServiceWithPojoRequestWhichIsWithBreadcrumb() throws Exception {
        QuoteRequest request = new QuoteRequest();
        request.setSymbol("GOOG");
        Object result = template.request("direct:webservice-marshall-asin", new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                assertNotNull(exchange.getIn().getHeader("breadcrumbId"));
                assertEquals(exchange.getIn().getHeader("breadcrumbId"), "ID-Ralfs-MacBook-Pro-local-50523-1423553069254-0-5");
            }
        });
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                JaxbDataFormat jaxb = new JaxbDataFormat(false);
                jaxb.setContextPath("org.apache.camel.component.spring.ws.jaxb");
                // request webservice
                from("direct:webservice-marshall-asin")
                        .marshal(jaxb)
                        .to("spring-ws:http://localhost/?soapAction=http://www.stockquotes.edu/GetQuoteAsIn&webServiceTemplate=#webServiceTemplate")
                        .convertBodyTo(String.class);
                // provide web service
                from("spring-ws:soapaction:http://www.stockquotes.edu/GetQuoteAsIn?endpointMapping=#endpointMapping").setHeader("setin", constant("true"))
                                                                                .process(new StockQuoteResponseProcessor());
            }
        };
    }

}


text:
class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception

  before_action :configure_permitted_parameters, if: :devise_controller?

  protected

	def configure_permitted_parameters
		devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
		devise_parameter_sanitizer.permit(:account_update, keys: [:name])
	end
end


text:
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;

namespace BasicallyMe.RobinhoodNet.Raw
{
    public partial class RawRobinhoodClient
    {
        public Task<JToken>
        DownloadPortfolio(string account)
        {
            string url = PORTFOLIOS_URL + account + "/";
            return doGet(url);
        }

        public Task<JToken>
        DownloadDayTrades(string account)
        {
            string url = ACCOUNTS_URL + account + "/recent_day_trades/";
            return doGet(url);
        }

        public Task<JToken>
        DownloadUserInfo()
        {
            string url = USER_URL;
            return doGet(url);
        }

        public Task<JToken>
        DownloadSplits(string splitsUrl = null)
        {
            string url = splitsUrl;
            return doGet(url);
        }

    }
}


text:
use strict;
use Test::More;
use File::Temp;

my $valgrind="";

if (exists $ENV{VALGRIND})
{
    $valgrind = "valgrind --log-file=VALGRIND-proxy-utils-test-\%p.log";
    if (exists $ENV{VALGRIND_OPTIONS})
    {
        $valgrind .= ' ' . $ENV{VALGRIND_OPTIONS};
    }
}

print "# PATH = $ENV{PATH}\n";
print "# X509_CERT_DIR = $ENV{X509_CERT_DIR}\n";

sub test_proxy
{
    my $case = shift;
    my $proxy_format = $case->[0];
    my $proxy_type = $case->[1];
    my $expect = $case->[2];
    my $testname = $case->[3];
    my $result = '';
    my $proxy_created = 1;
    my $type_determined = 1;
    my $proxy_file = mktemp( "proxy-XXXXXXXX" );

    $ENV{X509_USER_PROXY}=$proxy_file;

    ok(system("$valgrind grid-proxy-init $proxy_format $proxy_type > /dev/null") == 0, "create_proxy $proxy_format $proxy_type");

    $result = `$valgrind grid-proxy-info -type`;
    ok($? == 0, "grid-proxy-info $proxy_format $proxy_type");
    $result =~ s/\s*$//;

    ok($result eq $expect, "grid-proxy-info type is $expect");

    unlink($proxy_file);
}

my @tests = (
    [ "", "", "RFC 3820 compliant impersonation proxy", "default_proxy_type" ],
    [ "-draft", "", "Proxy draft (pre-RFC) compliant impersonation proxy" ,
        "draft_proxy_type"],
    [ "-rfc", "", "RFC 3820 compliant impersonation proxy",
        "rfc_proxy_type"],
    [ "-old", "", "full legacy globus proxy",
        "legacy_proxy_type"],

    [ "", "-limited", "RFC 3820 compliant limited proxy",
        "default_limited_proxy_type"],
    [ "-draft", "-limited", "Proxy draft (pre-RFC) compliant limited proxy",
        "draft_limited_proxy_type"],
    [ "-rfc", "-limited", "RFC 3820 compliant limited proxy",
        "rfc_limited_proxy_type"],
    [ "-old", "-limited", "limited legacy globus proxy",
        "old_limited_proxy_type"],

    [ "", "-independent", "RFC 3820 compliant independent proxy",
        "independent_proxy_type"],
    [ "-draft", "-independent", "Proxy draft (pre-RFC) compliant independent proxy",
        "draft_independent_proxy_type"],
    [ "-rfc", "-independent", "RFC 3820 compliant independent proxy",
        "rfc_independent_proxy_type"]
);

plan tests => 3*scalar(@tests);

foreach (@tests)
{
    eval test_proxy($_);
}


text:
module Hydra #:nodoc:
  module Listener #:nodoc:
    # Output a textual report at the end of testing
    class ReportGenerator < Hydra::Listener::Abstract
      # Initialize a new report
      def testing_begin(files)
        @report = { }
      end

      # Log the start time of a file
      def file_begin(file)
        @report[file] ||= { }
        @report[file]['start'] = Time.now.to_f
      end

      # Log the end time of a file and compute the file's testing
      # duration
      def file_end(file, output)
        @report[file]['end'] = Time.now.to_f
        @report[file]['duration'] = @report[file]['end'] - @report[file]['start']
        @report[file]['all_tests_passed_last_run'] = (output == '.')
      end

      # output the report
      def testing_end
        YAML.dump(@report, @output)
        @output.close
      end
    end
  end
end


text:
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE pov SYSTEM "/usr/share/cgc-docs/replay.dtd">
<pov>
	<cbid>CROMU_00001</cbid>
	<replay>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>ffagkfx\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>hzqurnf\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>lntwvav\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>klvmgds\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>iujuqqm\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>tjzoeti\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>omvgdsu\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>adxtvhd\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Create User\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Login\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>2\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>username: </data></match></read>
		<write echo="ascii"><data>omvgdsu\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Login Success\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>1\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>To: </data></match></read>
		<write echo="ascii"><data>iujuqqm\n</data></write>
		<read echo="ascii"><delim> </delim><match><data>Message: </data></match></read>
		<write echo="ascii"><data>lcdzrup\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>1) Send Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>2) Read Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>3) List Messages\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>4) Delete Message\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>5) Logout\n</data></match></read>
		<read echo="ascii"><delim>\n</delim><match><data>6) Exit\n</data></match></read>
		<read echo="ascii"><delim> </delim><match><data>: </data></match></read>
		<write echo="ascii"><data>6\n</data></write>
		<read echo="ascii"><delim>\n</delim><match><data>Exiting...\n</data></match></read>
	</replay>
</pov>