text:
import React from "react"
import { ThemeProvider, Styled } from "theme-ui"
import theme from "../theme"
import { Box } from "rebass"

import Introduction from "../components/Introduction"
import Currently from "../components/Currently"

export default () => (
  <ThemeProvider theme={theme}>
    <Box
      sx={{
        backgroundColor: "#f6f9f5",
        borderTopColor: "primary",
        borderTopWidth: "4px",
        borderTopStyle: "solid",
      }}
    >
      <Introduction />
      <Currently />
    </Box>
  </ThemeProvider>
)


text:
import pytest
from totalvoice.cliente import Cliente
from totalvoice.cliente.api import *

class TestCliente(object):

    def setup(self):
        self.cliente = Cliente("token", "host")

    def test_cliente(self):
        assert self.cliente.host is not None
        assert self.cliente.host == "https://host"
        assert self.cliente.access_token is not None
        assert self.cliente.access_token == "token"

    def test_api(self):
        assert self.cliente.access_token is not None
        assert isinstance(self.cliente.api, Api)

    def test_api_chamada(self):
        assert self.cliente.api.chamada is not None
        assert isinstance(self.cliente.api.chamada, Chamada)

    def test_api_tts(self):
        assert self.cliente.api.tts is not None
        assert isinstance(self.cliente.api.tts, Tts)

    def test_api_audio(self):
        assert self.cliente.api.audio is not None
        assert isinstance(self.cliente.api.audio, Audio)

    def test_api_sms(self):
        assert self.cliente.api.sms is not None
        assert isinstance(self.cliente.api.sms, Sms)

    def test_api_composto(self):
        assert self.cliente.api.composto is not None
        assert isinstance(self.cliente.api.composto, Composto)

    def test_api_conferencia(self):
        assert self.cliente.api.conferencia is not None
        assert isinstance(self.cliente.api.conferencia, Conferencia)

    def test_api_minhaconta(self):
        assert self.cliente.api.minha_conta is not None
        assert isinstance(self.cliente.api.minha_conta, MinhaConta)

    def test_api_conta(self):
        assert self.cliente.api.conta is not None
        assert isinstance(self.cliente.api.conta, Conta)

    def test_api_bina(self):
        assert self.cliente.api.bina is not None
        assert isinstance(self.cliente.api.bina, Bina)

    def test_api_webphone(self):
        assert self.cliente.api.webphone is not None
        assert isinstance(self.cliente.api.webphone, Webphone)

    def test_api_ramal(self):
        assert self.cliente.api.ramal is not None
        assert isinstance(self.cliente.api.ramal, Ramal)

    def test_api_ura(self):
        assert self.cliente.api.ura is not None
        assert isinstance(self.cliente.api.ura, Ura)

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright FUJITSU LIMITED 2017-->

<webservices xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  version="1.2" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.ibm.com/webservices/xsd/javaee_web_services_1_2.xsd">
  <webservice-description>
    <display-name>ProvisioningService</display-name>
    <webservice-description-name>ProvisioningService</webservice-description-name>
    <wsdl-file>ProvisioningService.wsdl</wsdl-file>
    <port-component>
      <port-component-name>AsynchronousProvisioningProxy</port-component-name>
      <wsdl-service xmlns:ns1="http://oscm.org/xsd">ns1:ProvisioningService</wsdl-service>
      <wsdl-port xmlns:ns1="http://oscm.org/xsd">ns1:ProvisioningServicePort</wsdl-port>
      <service-endpoint-interface>org.oscm.provisioning.intf.ProvisioningService</service-endpoint-interface>
      <service-impl-bean>
        <ejb-link>AsynchronousProvisioningProxy</ejb-link>
      </service-impl-bean>
    </port-component>
  </webservice-description>

  <webservice-description>
    <display-name>OperationService</display-name>
    <webservice-description-name>OperationService</webservice-description-name>
    <wsdl-file>OperationService.wsdl</wsdl-file>
    <port-component>
      <port-component-name>AsynchronousOperationProxy</port-component-name>
      <wsdl-service xmlns:ns1="http://oscm.org/xsd">ns1:OperationService</wsdl-service>
      <wsdl-port xmlns:ns1="http://oscm.org/xsd">ns1:OperationServicePort</wsdl-port>
      <service-endpoint-interface>org.oscm.operation.intf.OperationService</service-endpoint-interface>
      <service-impl-bean>
        <ejb-link>AsynchronousOperationProxy</ejb-link>
      </service-impl-bean>
    </port-component>
  </webservice-description>

</webservices>


text:
@echo off
rem #### #### DO NOT EDIT THIS FILE ##### ####
rem Copyright 2014-2015 Hendrik Saly
rem Licensed under the Apache License, Version 2.0

call "%~dp0config.cmd"
IF NOT DEFINED GENERATED_TOP_FOLDER (goto badenv)
echo.
echo *** Starting phase "DUPC" (Download Unzip Pre Config) for ESI-%ES_DIST_VERSION%.%ESI_VERSION%-j%JAVA_DIST_VERSION% ***
if NOT "%host%" == "" echo Will use proxy %host%:%port% for all downloads
echo.
rmdir /s /q "%~dp0%GENERATED_TOP_FOLDER%" >NUL 2>&1

if not defined ProgramFiles(x86) (

    echo 32-bit Windows is not supported. Please use a 64bit Operating System.
    goto:eof
)

rem 64bit powershell
set POWERSHELL_CMD="%windir%\System32\WindowsPowerShell\v1.0\powershell.exe"
%POWERSHELL_CMD% -version 2.0 .\build_installer.ps1

if not %errorlevel% == 0  (
    echo If you run into problems with powershell make sure "Unresticted" execution policy is set.
    echo You can do this by open %POWERSHELL_CMD% and enter 'Set-ExececutionPolicy Unrestricted'
    goto :eof
)

set OLD_PWD=%CD%
cd "%~dp0%PACKAGE_FOLDER%\%ES_DIST_NAME%\bin"

call "%~dp0esidist_plugininstall.bat" 1>NUL

cd %OLD_PWD%
echo.
echo Finished with phase "DUPC" (Download Unzip Pre Config)
echo You should now revise the stuff in folder
echo     "%~dp0%PACKAGE_FOLDER%\%ES_DIST_NAME%\bin"
echo     "%~dp0%PACKAGE_FOLDER%\%ES_DIST_NAME%\config"
echo.
echo Then run "MKMSI.cmd" to build the .msi package (Phase MKMSI - Make MSI)
echo.
rem pause
goto :eof

:badenv
echo Bad environment, check config.cmd
rem pause


text:
package courgette.runtime;

import java.util.UUID;

public class CourgetteSession {
    private final String sessionId;

    private static CourgetteSession instance;

    public static CourgetteSession current() {
        if (instance == null) {
            instance = new CourgetteSession(createSessionId());
        }
        return instance;
    }

    private CourgetteSession(String sessionId) {
        this.sessionId = sessionId;
    }

    public String sessionId() {
        return sessionId;
    }

    private static String createSessionId() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
}


text:
"use strict";

var _ = require('underscore');
var validators = require('./validators');
var runner = require('./runner');

var keywords = {};
var defaultInjector = function(name, fn, args) {
    fn.apply(null, args);
};
var injector = defaultInjector;

/**
    Take `keywordsToRun` and wrap the run command
    into a function, which can used as a new keyword

    Usage:

    ```
    keywords["Login"] = createKeywordWrapper(
        "Go To Page", ["http://mysite.com/login"],
        "Fill In Credentials", ["user", "pa55w0rd"]
        "Click Element", ["#login-button"]
    );
    ```

    Now you can use the new `Login` keywords like this:

    key.run("Login").then( ... )
*/
function createKeywordWrapper(keywordsToRun) {
    var wrapper = function(next) {
        var args = _.rest(arguments);
        runner.run(keywordsToRun, keywords, args).then(next);
    };
    return wrapper;
}

function suiteKeyword(keywordsToRun, name) {

    if(!validators.isRun(keywordsToRun)) {
        console.error("Illegal arguments to run(keywordName, [\"arguments\", \"=> $returnVariable\"])");
        console.error("run(keywordName, [\"arguments\", \"=> $returnVariable\"]) takes a serie of " +
            "keyword, arguments, return variable compinations, nothing else.");
        throw new Error("Illegal arguments to run() " + JSON.stringify(_.toArray(arguments)));
    }

    keywords[name] = createKeywordWrapper(keywordsToRun);
}

function suite(args) {
    var suiteDefinition = args[0];
    _.forEach(suiteDefinition, suiteKeyword);
}

function libKeyword(fn, name) {
    keywords[name] = function() {
        injector(name, fn, arguments);
    };
}

/**
    Takes keywords to run as arguments. The last arguments may
    optionally be the object of passed args

    Example:
    "Keyword1", "Keyword2", ["args for key2", $1], "=> $returnVariable", {args: ["jee"]}
*/
function keyRun() {
    var keywordsToRun = _.toArray(arguments);

    if(!validators.isRun(keywordsToRun)) {
        console.error("Illegal arguments to run(keywordName, [\"arguments\", \"=> $returnVariable\"])");
        console.error("run(keywordName, [\"arguments\", \"=> $returnVariable\"]) takes a serie of " +
            "keyword, arguments, return variable compinations, nothing else.");
        throw new Error("Illegal arguments to run() " + JSON.stringify(_.toArray(arguments)));
    }

    return runner.run(keywordsToRun, keywords);
}

function keySuite() {
    var args = _.toArray(arguments);
    if(!validators.isValidSuiteArgs(args)) {
        console.error("Illegal arguments passed to suite({object})");
        console.error("suite({object}) takes an object as an argument, nothing else");
        throw new Error("Illegal arguments to suite() " + JSON.stringify(_.toArray(arguments)));
    }

    if(!validators.isValidKeywordSyntax(args[0])) {
        console.error("Illegal keyword syntax");
        throw new Error("Illegal keyword syntax " + JSON.stringify(_.toArray(args[0])));
    }

    return suite(args);
}

function keyLib() {
    var args = _.toArray(arguments);

    if(validators.isLib(args)) {
        return libKeyword(args[1], args[0]);
    }
    else if(args.length === 1 && validators.isSetOfKeywords(args[0])) {
        var keywords = args[0];
        _.forEach(keywords, function(keywordDefinition, name) {
            if(validators.isLibKeyword(keywordDefinition, name)) {
                return libKeyword(keywordDefinition, name);
            } else if (validators.isSuiteKeyword(keywordDefinition, name)) {
                return suiteKeyword(keywordDefinition, name);
            } else {
                throw new Error("The keyword was not lib nor suite keyword. Btw... check the validator, you should never be here.");
            }
        });
    }
    else {
        console.error("Illegal arguments to lib(keywordName, definitionFn)");
        console.error("lib(keywordName, definitionFn) takes keyword name as the first argument " +
            "and definition function as second argument, nothing else.");
        console.error("Illegal arguments to lib(keywords)");
        console.error("lib(keywords) object of keyword names and function, nothing else.");
        throw new Error("Illegal arguments to lib() " + JSON.stringify(_.toArray(arguments)));
    }
}

function keyInjector(injectorFn) {
    injector = injectorFn;
}

var key = keyLib;
key.lib = keyLib;
key.run = keyRun;
key.suite = keySuite;

/**
    # Injector

    Injector function is called before each keyword call.

    It can be used for example to inject webdriver to each keyword

    Three params are passed to the injector:
    - name of the keyword
    - keyword function to run
    - arguments to the keyword (notice, that the first argument is the `next` function)

    ## Usage:

    If you want for example console.log before and after each keyword run, you
    can do following:

    ```javascript
    key.injector(function(name, fn, args)) {
        var next = _.head(args);
        var keywordArgs = _.rest(args);

        console.log("Start keyword " + name);

        var afterEach = function(retVal) {
            console.log("End keyword " + name);
            next(retVal);
        }

    }
    ```
*/
key.injector = keyInjector;

// Injectors
//key.webdriver  =  require('../injectors/webdriver');

// Testing only
key.__internal = {keywords: keywords};

module.exports = key;


text:
package handlers

import (
	"net/http"
	"os"

	"github.com/julienschmidt/httprouter"
)

// SetRoutes sets the routes
func SetRoutes() *httprouter.Router {
	user := []byte("user")
	pass := []byte("password")

	router := httprouter.New()
	router.POST("/deck", basicAuth(makeDeck, user, pass))
	router.GET("/deck/:id", basicAuth(getDeck, user, pass))
	router.GET("/sets", basicAuth(getSets, user, pass))
	// router.POST("/slack/deck", makeSlackDeck)

	dir, _ := os.Getwd()

	router.ServeFiles("/static/*filepath", http.Dir(dir+"/web/public"))
	router.GET("/", basicAuth(indexRoute, user, pass))
	return router
}


text:
id: 9281
title: Friday Links
date: 2013-11-15T08:08:39+00:00
author: Vicki
layout: post
guid: http://blog.vickiboykis.com/wlb/?p=9281
permalink: /2013/11/friday-links-118/
categories:
  - fridaylinks
---
(turn on closed captioning for subtitles)

  1. Oy.
  2. Lebanon’s potential space program
  3. Russia: Keepin’ it real! [:(]
  4. “I resorted to internet research, sometimes lazily landing on BuzzFeed-esque lists of the "weirdest magazines ever." This barely answered my questions, so I contacted the people involved, like Tim Brown from _The Mountain Astrologer.”_
  5. There is a whole Eastern European city in London.
  6. The robots are here


text:
import React from 'react'
import {Link} from 'react-router'
import * as auth from '../../api/auth'

const SignInOutButton = ({loggedIn = false}) => {
  if (loggedIn) {
    return (
       {
          e.preventDefault()
          auth.signOut()
        }}
      >
        Log out

    )
  }
  return (
     {
        e.preventDefault()
        auth.signInWithGithub()
      }}
    >
      Log In

  )
}
const Profile = ({loggedIn = false, currentUser = ''}) => {
  if (loggedIn) {
    return (
      <Link to={`/users/${currentUser}`} className="nav-item is-tab profile">
        Profile
      </Link>
    )
  }
  return null
}
const header = props => {
  return (

          <Link to="/" className="nav-item">
            Teamup
          </Link>
          <Link to="/projects/" className="nav-item is-tab is-hidden-mobile">
            Projects
          </Link>
          <Link
            to="/projects/new/"
            className="nav-item is-tab is-hidden-mobile"
          >
            Create New Project
          </Link>

          <Link to="/projects/" className="nav-item is-tab is-hidden-tablet">
            Projects
          </Link>
          <Link
            to="/projects/new/"
            className="nav-item is-tab is-hidden-tablet"
          >
            Create New Project
          </Link>
          <Profile {...props} />
          <SignInOutButton {...props} />

  )
}

const {
  bool,
  shape,
  func
} = React.PropTypes

header.propTypes = {
  loggedIn: bool.isRequired,
  actions: shape({
    signIn: func.isRequired,
    signOut: func.isRequired
  })
}

header.defaultProps = {}

export default header


text:
import sys

reload(sys)
sys.setdefaultencoding('utf8')

from rnn import RNN

# To load the model
rnn = RNN.load_model("model.json")
inputs, hidden, loss = rnn.step()

print rnn.generate(hidden, inputs[0], 140)


text:
package util

import "testing"

func TestSigns(t *testing.T) {
	tests := []struct {
		input  Sign
		output string
	}{
		{ClassSign("java.lang.Object"), "Ljava/lang/Object;"},
		{ClassSign("java.lang.String"), "Ljava/lang/String;"},
		{ArraySign(ObjectSign), "[Ljava/lang/Object;"},
		{ArraySign(StringSign), "[Ljava/lang/String;"},
		{ArraySign(IntSign), "[I"},
		{FuncSign(nil, IntSign), "()I"},
		{FuncSign([]Sign{}, IntSign), "()I"},
		{FuncSign([]Sign{BoolSign}, VoidSign), "(Z)V"},
		{FuncSign([]Sign{CharSign, ByteSign, ShortSign}, FloatSign), "(CBS)F"},
		{FuncSign([]Sign{ClassSign("io.v.core.vanadium.testing.misc")}, ClassSign("io.v.core.vanadium.ret")), "(Lio/v/core/vanadium/testing/misc;)Lio/v/core/vanadium/ret;"},
		{FuncSign([]Sign{ClassSign("io.v.core.vanadium.testing.misc"), ClassSign("other")}, ClassSign("io.v.core.vanadium.ret")), "(Lio/v/core/vanadium/testing/misc;Lother;)Lio/v/core/vanadium/ret;"},
	}
	for _, test := range tests {
		output := string(test.input)
		if output != test.output {
			t.Errorf("expected %v, got %v", test.output, output)
		}
	}
}


text:
#include "OGLESApplicationRunner.h"

#ifdef _WIN32
	#include "OGLESApplicationRunner_AMDEmulator.h"
#else
	#include "OGLESApplicationRunner_RaspberryPi.h"
#endif

#include <sstream>

namespace OGLESSandbox
{

ApplicationRunner::ApplicationRunner()
	: mApplicationContext()
{
}

void ApplicationRunner::splitString( const std::string& text, char delim, std::vector<std::string>& tokens )
{
	std::stringstream stream(text);
	std::string token;
	while ( std::getline(stream, token, delim) )
		tokens.push_back(token);
}

void ApplicationRunner::parseCommandLineParameters( int argc, char** argv, std::vector< std::pair<std::string, std::string> >& parameters )
{
	parameters.clear();
	for ( int i=0; i<argc; ++i )
	{
		std::vector<std::string> tokens;
		splitString( argv[i], '=', tokens );
		if ( tokens.size()==1 )
			parameters.push_back( std::make_pair( tokens[0], "" ) );
		else if ( tokens.size()>=2 )
			parameters.push_back( std::make_pair( tokens[0], tokens[1] ) );
	}
}

ApplicationRunner* ApplicationRunner::create()
{
	ApplicationRunner* runner = 0;
#ifdef _WIN32
	runner = new AMDEmulatorApplicationRunner();
#else
	runner = new RaspberryPiApplicationRunner();
#endif

	return runner;
};

}


text:
require 'versioneye/parsers/common_parser'

class GradleParser < CommonParser

  # Matches definitions like this;
  # project.ext.springVersion = '4.0.7.RELEASE'
  A_GLOBAL_VARS_MATCHER = /^\s*(\S*ext.\S*\s*\=\s*.*)/xi

  # Matches definitions like this;
  # def tomcatVersion = '7.0.54'
  A_GLOBAL_VARS_MATCHER_2 = /^\s*(def\s+\S+\s*=\s*["']\S*["']$)/xi

  A_GLOBAL_VARS_MATCHER_FINAL = /^\s*final\s*(\S+\s*=\s*["']\S*["']$)/xi

  # Matches this 'junit:junit-dep:4.0.0'
  A_DEP_SIMPLE_MATCHER = /["|']\s*([\w\.\-]+:[\w\.\-]+:[\w\.\-]+)\s*["|']/xi

  # (\w+) [\s|\(]?[\'|\"]+ ([\w|\.|\-|\_|\+]+)  :([\w|\.|\-|_|\+]+)  :([$\w|\.|\-|_|\+]+) [\@\S]* [\s|\(]?[\'|\"]+
  A_DEP_SHORT_MATCHER = /
      (\w+) #scope
      [\s|\(]?[\'|\"]+ #scope separator
        ([\w|\.|\-|\_|\+]+) #group_id
        :([\w|\.|\-|_|\+]+) #artifact
        :([$\w|\.|\-|_|\+]+) #version number
        [\@\S]*          #classifier
        [\s|\(]?[\'|\"]+ #separator
    /xi

  # ^[\s]* (\w+) [\s]* (\w+\:) [\s]*[\'|\"]+ ([\w|\d|\.|\-|\_]+) [\'|\"]+,[\s]* (\w+\:) [\s]*[\'|\"]+ ([\w|\d|\.|\-|\_]+) [\'|\"]+,[\s]* (\w+\:) [\s]*[\'|\"]+ ([\w|\d|\.|\-|\_]+)
  A_DEP_LONG_MATCHER = /
      ^[\s]*              #filter out comments
      (\w+)               #scope
      [\s]*               #scope separator
      (\w+\:)             #group
      [\s]*[\'|\"]+       #separator
      ([\w|\d|\.|\-|\_]+) #group_id
      [\'|\"]+,[\s]*      #separator
      (\w+\:)             #name
      [\s]*[\'|\"]+       #separator
      ([\w|\d|\.|\-|\_]+) #artifact_id
      [\'|\"]+,[\s]*      #separator
      (\w+\:)             #version
      [\s]*[\'|\"]+       #separator
      ([\w|\d|\.|\-|\_]+) #version_id
    /xi

  # (\[\w+\:)   [\s]*[\'|\"]+   ([\w|\d|\.|\-|\_]+)  [\'|\"]+,[\s]*  (\w+\:)  [\s]*[\'|\"]+   ([\w|\d|\.|\-|\_]+)  [\'|\"]+,[\s]*   (\w+\:)   [\s]*[\'|\"]*   ([\w|\d|\.|\-|\_]+)
  A_DEP_BR_MATCHER = /
      (\[\w+\:)             #separator
        [\s]*[\'|\"]+       #group
        ([\w|\d|\.|\-|\_]+) #group_id
        [\'|\"]+,[\s]*      #separator
        (\w+\:)             #name
        [\s]*[\'|\"]+       #separator
        ([\w|\d|\.|\-|\_]+) #artifact_id
        [\'|\"]+,[\s]*      #separator
        (\w+\:)             #version
        [\s]*[\'|\"]*       #separator
        ([\w|\d|\.|\-|\_]+) #version_id
    /xi

  def parse(url)
    return nil if url.nil?

    content = self.fetch_response(url).body
    parse_content( content )
  rescue => e
    log.error e.message
    log.error e.backtrace.join("\n")
    nil
  end

  def parse_content( content, token = nil )
    return nil if content.to_s.empty?
    return nil if content.to_s.strip.eql?('Not Found')

    content = content.gsub(/\/\*.*?\*\//mxi, "") # remove comments /* */
    content = content.gsub(/\A\/\/.*$/xi, "") # remove comments //
    content = content.gsub(/[^[https:][http:]]\/\/.*$/xi, "") # remove comments // without http[s]
    content = content.gsub(/.*classpath.*$/, "")

    vars = extract_vars content
    vars.keys.each do |key|
      val = vars[key]
      content = content.gsub("${#{key}}", val)
    end

    matches_long = content.scan( A_DEP_LONG_MATCHER )
    deps_long    = self.build_dependencies_extd(matches_long, vars)
    content = content.gsub(A_DEP_LONG_MATCHER, "")

    matches_br = content.scan( A_DEP_BR_MATCHER )
    deps_br    = self.build_dependencies_br( matches_br, vars )
    content = content.gsub(A_DEP_BR_MATCHER, "")

    matches_short = content.scan( A_DEP_SHORT_MATCHER )
    deps_short    = self.build_dependencies(matches_short, vars)
    content = content.gsub(A_DEP_SHORT_MATCHER, "")

    matches_simple = content.scan( A_DEP_SIMPLE_MATCHER )
    deps_simple = self.build_dependencies_simple(matches_simple, vars)
    content = content.gsub(A_DEP_SIMPLE_MATCHER, "")

    if deps_short[:projectdependencies] && !deps_short[:projectdependencies].empty?
      deps_short[:projectdependencies].each do |dep|
        deps_long[:projectdependencies] << dep
      end
    end
    if deps_br[:projectdependencies] && !deps_br[:projectdependencies].empty?
      deps_br[:projectdependencies].each do |dep|
        deps_long[:projectdependencies] << dep
      end
    end
    if deps_simple[:projectdependencies] && !deps_simple[:projectdependencies].empty?
      deps_simple[:projectdependencies].each do |dep|
        deps_long[:projectdependencies] << dep
      end
    end

    project              = Project.new deps_long
    project.project_type = Project::A_TYPE_GRADLE
    project.language     = Product::A_LANGUAGE_JAVA
    project.dep_number   = project.dependencies.size

    project.dependencies.each do |dependency|
      project.out_number     += 1 if ProjectdependencyService.outdated?( dependency )
      project.unknown_number += 1 if dependency.product.nil?
    end

    project
  rescue => e
    log.error e.message
    log.error e.backtrace.join("\n")
    nil
  end

  def extract_vars content
    vars = {}
    matches = content.scan(A_GLOBAL_VARS_MATCHER)
    if matches && !matches.empty?
      matches.each do |match|
        mat = match.first
        mat = mat.gsub("project.ext.", "")
        mat = mat.gsub("ext.", "")
        mat = mat.gsub(" ", "").strip
        sps = mat.split("=")
        var_key = sps[0]
        var_val = sps[1].gsub("\"", "").gsub("'", "")
        var_val = var_val.gsub("System.getenv(GROOVY_VERSION)?:", "").strip
        vars[var_key] = var_val
      end
    end

    matches = content.scan(A_GLOBAL_VARS_MATCHER_2)
    if matches && !matches.empty?
      matches.each do |match|
        mat = match.first
        mat.gsub!("def", "")
        sps = mat.split("=")
        var_key = sps[0].gsub(" ", "")
        var_val = sps[1].gsub(" ", "")
        var_val = var_val.gsub("\"", "").gsub("'", "")
        vars[var_key] = var_val
      end
    end

    matches = content.scan(A_GLOBAL_VARS_MATCHER_2)
    if matches && !matches.empty?
      matches.each do |match|
        mat = match.first
        sps = mat.split("=")
        var_key = sps[0].gsub(" ", "")
        var_val = sps[1].gsub(" ", "")
        var_val = var_val.gsub("\"", "").gsub("'", "")
        vars[var_key] = var_val
      end
    end
    vars
  end

  def build_dependencies( matches, vars )
    # build and initiliaze array of dependencies.
    # Arguments array of matches, should be [[scope, group_id, artifact_id, version],...]
    # Returns map {:unknowns => 0 , dependencies => []}
    data = []
    matches.each do |row|
      version = calc_version( row[3], vars )
      dependency = Projectdependency.new({
        :scope => row[0],
        :group_id => row[1],
        :artifact_id => row[2],
        :name => row[2],
        :language => Product::A_LANGUAGE_JAVA,
        :comperator => '='
      })

      process_dep version, dependency, data
    end

    {:projectdependencies => data}
  end

  def build_dependencies_simple( matches, vars )
    # build and initiliaze array of dependencies.
    # Arguments array of matches, should be [[scope, group_id, artifact_id, version],...]
    # Returns map {:unknowns => 0 , dependencies => []}
    data = []
    matches.each do |row|
      spliti = row.first.gsub("'", "").split(":")
      version = calc_version( spliti[2], vars )
      dependency = Projectdependency.new({
        :scope => 'compile',
        :group_id => spliti[0],
        :artifact_id => spliti[1],
        :name => spliti[1],
        :language => Product::A_LANGUAGE_JAVA,
        :comperator => '='
      })

      process_dep version, dependency, data
    end

    {:projectdependencies => data}
  end

  def build_dependencies_extd( matches, vars )
    data = []
    matches.each do |row|
      version = calc_version( row[6], vars )
      dependency = Projectdependency.new({
        :scope => row[0],
        :group_id => row[2],
        :artifact_id => row[4],
        :name => row[4],
        :language => Product::A_LANGUAGE_JAVA,
        :comperator => '='
      })

      process_dep version, dependency, data
    end

    {:projectdependencies => data}
  end

  def build_dependencies_br( matches, vars )
    data = []
    matches.each do |row|
      version = calc_version( row[5], vars )
      dependency = Projectdependency.new({
        :scope => nil,
        :group_id => row[1],
        :artifact_id => row[3],
        :name => row[3],
        :language => Product::A_LANGUAGE_JAVA,
        :comperator => '='
      })

      process_dep version, dependency, data
    end

    {:projectdependencies => data}
  end

  def calc_version( version_string, vars )
    return version_string if vars.nil? || vars.empty? || version_string.to_s.empty?

    version_string = version_string.gsub("$", "")
    version_string = version_string.gsub("{", "")
    version_string = version_string.gsub("}", "")
    version_string = version_string.gsub("\"", "")
    version_string = version_string.gsub(" ", "")
    if vars.keys.include?( version_string )
      version_string = vars[version_string]
    end
    version_string
  end

  def process_dep version, dependency, data
    product = Product.find_by_group_and_artifact(dependency.group_id, dependency.artifact_id)

    dependency.prod_key = product.prod_key if product
    parse_requested_version( version, dependency, product )

    dependency.stability = VersionTagRecognizer.stability_tag_for version
    VersionTagRecognizer.remove_minimum_stability version

    data << dependency
  end

  def parse_requested_version(version, dependency, product)
    if version.nil? || version.empty?
      self.update_requested_with_current(dependency, product)
      return
    end
    version = version.to_s.strip
    version = version.gsub('"', '')
    version = version.gsub("'", '')

    if product.nil?
      dependency.version_requested = version
      dependency.version_label = version

    elsif version.match(/\.\+\z/i) or version.match(/\.\z/i)
      # Newest available static version
      # http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:dependency_resolution
      ver = version.gsub('+', '')
      starter = ver.gsub(' ', '')
      versions        = VersionService.versions_start_with( product.versions, starter )
      highest_version = VersionService.newest_version_from( versions )
      if highest_version
        dependency.version_requested = highest_version.to_s
      else
        dependency.version_requested = ver
      end
      dependency.comperator = "="
      dependency.version_label = "#{ver}+"

    else
      dependency.version_requested = version
      dependency.version_label = version
      dependency.comperator = "="

    end
  end

end


text:
class QJsonObject;
class QProgressDialog;

class GithubDownloader : public QObject
{
    Q_OBJECT

public:
    GithubDownloader(QString sourceUrl, QWidget* parent);

    bool hasConnection() const;
    bool isBusy() const { return !downloadRequests.empty(); }
    SourceStatus check();
    SourceStatus status() const { return sourceStatus; }
    void updateInfo();

    struct Asset
    {
        QString name;
        QString url;
    };

    struct Release
    {
        QString sourcesUrl;
        QList<Asset> assets;
    };

    QList<Release> releases(QStringList versions);

    struct Request
    {
        QString url;
        QString dstPath;
        QByteArray format;
    };

    void download(const QList<Request>& requests, TaskMode mode);

signals:
    void broken();
    void cancelled();
    void finishedDownload();
    void errorDuringDownload();
    void finishedUpdate(QStringList);

private slots:
    void replyFinished(QNetworkReply* reply);
    void onDownload(qint64 bytesReceived, qint64 bytesTotal);
    void onCancel();

private:
    void reportBrokenSource();
    void processReleases(QNetworkReply* reply, const QByteArray& body);
    void processDownload(QNetworkReply* reply, const QByteArray& body);

    QString sourceUrl;
    SourceStatus sourceStatus;
    QNetworkAccessManager* networkManager;
    QString apiUrl;
    bool fatalError;
    QWidget* parent;

    QByteArray lastReleasesAnswer;

    struct DownloadDesc {
        DownloadDesc() {}
        DownloadDesc(QString resultFileName, QNetworkReply* reply)
            : resultFileName(resultFileName)
            , reply(reply)
            , bytesReceived(0)
            , bytesTotal(0)
            , isRunning(true)
        {}

        QString resultFileName;
        QNetworkReply* reply;
        qint64 bytesReceived;
        qint64 bytesTotal;
        bool isRunning;
    };

    QHash<QString, DownloadDesc> downloadRequests;
    QProgressDialog* progressDialog;
    TaskMode mode;
};

#endif // GITHUBDOWNLOADER_H


text:
'use strict';

var sourceFile = window.location.search.match(/[?&]sourceFile=([^&]+)/);

if (!sourceFile) {
  sourceFile = '../../dist/pouchdb.js';
} else {
  sourceFile = '../../dist/' + sourceFile[1];
}

// only running in Chrome and Firefox due to various bugs.
// IE: https://connect.microsoft.com/IE/feedback/details/866495
// Safari: doesn't have IndexedDB or WebSQL in a WW
// NodeWebkit: not sure what the issue is

var isNodeWebkit = typeof window !== 'undefined' &&
  typeof process !== 'undefined';

if (typeof window.Worker === 'function' &&
    !isNodeWebkit &&
    (window.chrome || /Firefox/.test(navigator.userAgent))) {
  runTests();
}

function runTests() {

  function workerPromise(message) {
    return new Promise(function (resolve, reject) {
      var worker = new Worker('worker.js');
      worker.addEventListener('error', function (e) {
        worker.terminate();
        reject(new Error(e.message + ": " + e.filename + ': ' + e.lineno));
      });
      worker.addEventListener('message', function (e) {
        worker.terminate();
        resolve(e.data);
      });
      worker.postMessage(['source', sourceFile]);
      worker.postMessage(message);
    });
  }

  describe('browser.worker.js', function () {

    var dbs = {};

    beforeEach(function (done) {
      dbs.name = testUtils.adapterUrl('local', 'testdb');
      dbs.remote = testUtils.adapterUrl('http', 'test_repl_remote');
      testUtils.cleanup([dbs.name, dbs.remote], done);
    });

    after(function (done) {
      testUtils.cleanup([dbs.name, dbs.remote], done);
    });

    it('create it', function () {
      return workerPromise('ping').then(function (data) {
        data.should.equal('pong');
      });
    });

    it('check pouch version', function () {
      return workerPromise('version').then(function (data) {
        PouchDB.version.should.equal(data);
      });
    });

    it('create remote db', function () {
      return workerPromise(['create', dbs.remote]).then(function (data) {
        data.should.equal('lala');
      });
    });

    it('create local db', function () {
      return workerPromise(['create', dbs.name]).then(function (data) {
        data.should.equal('lala');
      });
    });

    it('add doc with blob attachment', function () {
      return workerPromise(['allDocs', dbs.name]).then(function (data) {
        data.title.should.equal('lalaa');
      });
    });

    it('put an attachment', function () {
      var blob = new Blob(['foobar'], {type: 'text/plain'});
      var message = ['putAttachment', dbs.name, 'doc', 'att.txt', blob,
        'text/plain'];
      return workerPromise(message).then(function (blob) {
        blob.type.should.equal('text/plain');
        blob.size.should.equal(6);
      });
    });
  });
}


text:
class A {
    static #foo: number;
    static #bar: number;
    constructor () {
        A.#foo = 3;
        B.#foo; // Error
        B.#bar; // Error
    }
}

class B extends A {
    static #foo: string;
    constructor () {
        super();
        B.#foo = "some string";
    }
}

// We currently filter out static private identifier fields in `getUnmatchedProperties`.
// We will need a more robust solution when we support static fields
const willErrorSomeDay: typeof A = class {}; // OK for now

//// [privateNamesAndStaticFields.js]
"use strict";
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _a, _A_foo, _A_bar, _b, _B_foo;
class A {
    constructor() {
        __classPrivateFieldSet(A, _a, 3, "f", _A_foo);
        __classPrivateFieldGet(B, _a, "f", _A_foo); // Error
        __classPrivateFieldGet(B, _a, "f", _A_bar); // Error
    }
}
_a = A;
_A_foo = { value: void 0 };
_A_bar = { value: void 0 };
class B extends A {
    constructor() {
        super();
        __classPrivateFieldSet(B, _b, "some string", "f", _B_foo);
    }
}
_b = B;
_B_foo = { value: void 0 };
// We currently filter out static private identifier fields in `getUnmatchedProperties`.
// We will need a more robust solution when we support static fields
const willErrorSomeDay = class {
}; // OK for now


text:
package uk.gov.gds.ier.mustache

import uk.gov.gds.ier.validation.ErrorTransformForm
import play.api.templates.Html
import play.api.mvc.Call
import uk.gov.gds.ier.langs.Language
import uk.gov.gds.ier.guice.{WithRemoteAssets, WithConfig}

trait MustacheRendering[T] extends StepMustache with InheritedGovukMustache {
  self: WithRemoteAssets
    with WithConfig =>

  case class CheapHackInheritanceIntoSteps (
      mainContent: Html,
      override val lang: Lang,
      override val htmlLang: String,
      override val pageTitle: String,
      override val contentClasses: String,
      override val sourcePath: String
  ) extends InheritedMustachio("template/cheapHackInheritanceIntoSteps")

  class MustacheRenderer(
      template: MustacheTemplate[T],
      form: ErrorTransformForm[T],
      postUrl: Call,
      application: T
  ) {

    type Request[A] = play.api.mvc.Request[A]

    def html()(implicit request:Request[Any]):Html = {
      val lang = Language.getLang(request)
      val model = template.data(lang, form, postUrl, application)
      val content = Mustache.render(template.mustachePath, model)

      CheapHackInheritanceIntoSteps(
        mainContent = content,
        lang = lang,
        pageTitle = model.question.title,
        htmlLang = model.question.lang.language,
        contentClasses = model.question.contentClasses,
        sourcePath = model.question.postUrl
      ).render()
    }
  }

  implicit class MustacheTemplateWithRenderer(template:MustacheTemplate[T]) {
    def apply(
        form:ErrorTransformForm[T],
        postUrl:Call,
        application:T
    ):MustacheRenderer = {
      new MustacheRenderer(template, form, postUrl, application)
    }
  }
}


text:
var ws = null;

var client = {
    // Properties
    server: "ws://127.0.0.1:3050/",
    isOpen: false,
    onOpenCallback: null,
    onCloseCallback: null,
    onMessageCallback: null,

    // Methods
    connect: function(onOpenCallback, onCloseCallback, onMessageCallback)
    {
        ws = new WebSocket(client.server);
        ws.onopen = client.onOpen;
        ws.onclose = client.onClose;
        ws.onmessage = client.onMessage;
        client.onOpenCallback = onOpenCallback;
        client.onCloseCallback = onCloseCallback;
        client.onMessageCallback = onMessageCallback;
    },

    onOpen: function()
    {
        console.log("client onOpen");
        client.isOpen = true;
        client.onOpenCallback();
    },

    onClose: function()
    {
        console.log("client onClose");
        client.isOpen = false;
        client.onCloseCallback();
    },

    onMessage: function(evt)
    {
        console.log("client onMessage");
        client.onMessageCallback(evt);
    },

    send: function(data)
    {
        ws.send(JSON.stringify({
          data: data
        }));
    }
}


text:
using System;

namespace Inga.Tools
{
    public static class TimeStamp
    {
        private const string DateTimeFormat = "yyyyMMdd";

        /// <summary>
        /// Get easy timestamp string.
        /// </summary>
        public static string Stamp => DateTime.Now.ToString(DateTimeFormat);

        /// <summary>
        /// Get timestamp for a given date.
        /// </summary>
        public static string GetStamp(DateTime dt)
        {
            return dt.ToString(DateTimeFormat);
        }
    }
}


text:
namespace Geocrest.Data.Sources.Gis
{
    using Ninject.Modules;
    using Geocrest.Data.Contracts.Gis;
    using Geocrest.Model;
    using Geocrest.Model.ArcGIS.Tasks;

    /// <summary>
    /// Provides Ninject bindings for the various data sources.
    /// </summary>
    public class NinjectionModule:NinjectModule
    {
        /// <summary>
        /// Loads the module into the kernel.
        /// </summary>
        public override void Load()
        {
            Bind<IRestHelper>().To<RestHelper>();
            Bind<IWebHelper>().To<WrappedWebClient>();
            Bind<IArcGISServerFactory>().To<ArcGISServerFactory>();
            Bind<IArcGISServerCatalogCache>().To<ArcGISServerCatalogCache>();
        }
    }
}


text:
namespace FactoriesUnitTests.GameEngine
{
    using System;
    using Labyrinth.GameEngine;
    using Labyrinth.Interfaces;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class ConsoleRendererUnitTest
    {
        private readonly ConsoleRenderer consoleRenderer = new ConsoleRenderer();

        public void ConsoleRenderer_IsInstanceOfIRenderer()
        {
            Assert.IsTrue(this.consoleRenderer is IRenderer);
        }

        [TestMethod]
        public void ConsoleRenderer_IsNotNull()
        {
            Assert.IsTrue(this.consoleRenderer != null);
        }

        [TestMethod]
        [ExpectedException(typeof(NullReferenceException), "A null object was inappropriately supplied.")]
        public void ConsoleRenderer_OutputToConsoleIsSuppliedNullObject()
        {
            this.consoleRenderer.Render("Dummy command #1", null);
        }

        [TestMethod]
        public void ConsoleRenderer_Clear()
        {
            this.consoleRenderer.Clear();
        }

        [TestMethod]
        public void ConsoleRenderer_ReadCommand()
        {
            string dummyText = "Exit";
            //this.consoleRenderer.ReadCommand();
        }
    }
}


text:
<?php
namespace Chamilo\Core\Repository\ContentObject\Page\Form;

use Chamilo\Core\Repository\Form\ComplexContentObjectItemForm;

/**
 *
 * @package core\repository\content_object\page
 * @author Hans De Bisschop <hans.de.bisschop@ehb.be>
 * @author Magali Gillard <magali.gillard@ehb.be>
 * @author Eduard Vossen <eduard.vossen@ehb.be>
 */
class ComplexPageForm extends ComplexContentObjectItemForm
{
}


text:
package org.camunda.bpm.spring.boot.starter.event;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.context.event.ContextClosedEvent;

@RunWith(MockitoJUnitRunner.class)
public class ProcessApplicationEventPublisherTest {

  @InjectMocks
  private ProcessApplicationEventPublisher processApplicationEventPublisher;

  @Mock
  private ApplicationContext publisherMock;

  @Test
  public void handleApplicationReadyEventTest() {
    ApplicationReadyEvent applicationReadyEventMock = mock(ApplicationReadyEvent.class);
    processApplicationEventPublisher.handleApplicationReadyEvent(applicationReadyEventMock);
    verify(publisherMock).publishEvent(Mockito.any(ProcessApplicationStartedEvent.class));
  }

  @Test
  public void handleContextStoppedEventTest() {
    processApplicationEventPublisher.setApplicationContext(publisherMock);
    ContextClosedEvent contextClosedEventMock = mock(ContextClosedEvent.class);
    processApplicationEventPublisher.handleContextStoppedEvent(contextClosedEventMock);

    verify(publisherMock, never()).publishEvent(Mockito.any(ProcessApplicationStoppedEvent.class));

    when(contextClosedEventMock.getApplicationContext()).thenReturn(publisherMock);
    processApplicationEventPublisher.handleContextStoppedEvent(contextClosedEventMock);
    verify(publisherMock).publishEvent(Mockito.any(ProcessApplicationStoppedEvent.class));
  }

}


text:
$('#logo').hover(function(){
    $(this).addClass('fa-spin text-yellow-inverted');
}, function(){
    $(this).removeClass('fa-spin text-yellow-inverted');
});

// progress bar
$('#page-loading-progress').progress({
    total: 2,
    onSuccess: function() {
        $('#page-loading-progress').fadeOut(1000, function() {
            $('#page-loading-progress').remove();
        });
    }
});

// GitHub
function updateGitHub() {
    $('#github-watch img').attr('src', 'https://img.shields.io/github/watchers/ejinbu/BYR-Navi.svg?style=social&label=Watch');
    $('#github-star img').attr('src', 'https://img.shields.io/github/stars/ejinbu/BYR-Navi.svg?style=social&label=Star');
    $('#github-fork img').attr('src', 'https://img.shields.io/github/forks/ejinbu/BYR-Navi.svg?style=social&label=Fork');
};
updateGitHub();
setInterval(function() {
    updateGitHub();
}, 15000);

// version
moment.locale('zh-cn');
var pushedAt = 'loading';
$.getJSON('https://api.github.com/repos/ejinbu/BYR-Navi', function(data) {
    pushedAt = data.pushed_at;
    $('#page-loading-progress').progress('increment');
});
function updateVersion(timestamp) {
    if (timestamp !== 'loading') {
        $('#version img').attr('src', 'https://img.shields.io/badge/%E6%9B%B4%E6%96%B0%E4%BA%8E-' + encodeURIComponent(moment(timestamp).fromNow()) + '-brightgreen.svg');
    };
};
updateVersion(pushedAt);
setInterval(function() {
    updateVersion(pushedAt);
}, 15000);

// visit
function updateVisit(updateProgressBar) {
    $.getJSON(urlPrefix + '/json/analytics_data.json', function(data) {
        $.getJSON(data.analytics.api_url, {
            'module': 'API',
            'method': 'VisitsSummary.getUniqueVisitors',
            'idSite': '1',
            'period': 'day',
            'date': 'today',
            'format': 'JSON',
            'token_auth': data.analytics.token
        }, function(data) {
            $('#visit img').attr('src', 'https://img.shields.io/badge/%E4%BB%8A%E6%97%A5%E8%AE%BF%E5%AE%A2-' + encodeURIComponent(data.value) + '-brightgreen.svg');
            if (updateProgressBar) {
                $('#page-loading-progress').progress('increment');
            };
        });
    });
};
updateVisit(true);
setInterval(function() {
    updateVisit(false);
}, 15000);

// search
$('#search-services').dropdown();
if (Cookies.get('byr_navi_previous_search_service_option') == undefined || $('#' + Cookies.get('byr_navi_previous_search_service_option')).length === 0) {
    Cookies.set('byr_navi_previous_search_service_option', $('#search-services').val(), { expires: 365 });
} else {
    $('#search-services').dropdown('set selected', Cookies.get('byr_navi_previous_search_service_option'));
};

$('#search-button').click(function() {
    var service = $('#' + $('#search-services').val());
    var query = $('#search-query').val();
    query = encodeURIComponent(query);
    if (query) {
        Cookies.set('byr_navi_previous_search_service_option', $('#search-services').val(), { expires: 365 });
        window.open(service.attr('data-url') + query + service.attr('data-suffix'), '_blank');
    } else {
        $('#search-div').addClass('error');
        $('#search-query').attr('placeholder', '请输入搜索内容');
    };
});

$('#search-query').click(function() {
    $(this).select();
});

$(document).ready(function() {
    $('#search-query').focus();
});

$(window).keyup(function(event) {
    var windowTop = $(window).scrollTop();
    var windowHeight = $(window).innerHeight();
    var windowBottom = windowTop + windowHeight;
    var searchBoxTop = $('#search-div').offset().top;
    var searchBoxHeight = $('#search-div').innerHeight();
    var searchBoxBottom = searchBoxTop + searchBoxHeight;
    if (event.key == 'Enter' && searchBoxBottom > windowTop && searchBoxTop < windowBottom) {
        var service = $('#' + $('#search-services').val());
        var query = $('#search-query').val();
        query = encodeURIComponent(query);
        if (query) {
            if ($('#search-query:focus').length > 0) {
                Cookies.set('byr_navi_previous_search_service_option', $('#search-services').val(), { expires: 365 });
                window.open(service.attr('data-url') + query + service.attr('data-suffix'), '_blank');
            } else {
                $('#search-query').focus().select();
            };
        } else {
            $('#search-div').addClass('error');
            $('#search-query').attr('placeholder', '请输入搜索内容').focus();
        };
    };
});

$('#search-query').keyup(function(event) {
    if (event.key) {
        if ($('#search-query').val()) {
            $('#search-div').removeClass('error');
            $('#search-query').attr('placeholder', '立即搜索');
        };
    };
});

// query suggestions
var sugParams = {
    "XOffset": -3, //提示框位置横向偏移量,单位px
    "YOffset": -2, //提示框位置纵向偏移量,单位px
    // "width": $('#search-query').innerWidth(), //提示框宽度,单位px
    "fontColor": "rgba(0, 0, 0, 0.87)", //提示框文字颜色
    "fontColorHI": "rgba(0, 0, 0, 0.87)", //提示框高亮选择时文字颜色
    "fontSize": "14px", //文字大小
    "fontFamily": "Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif", //文字字体
    "borderColor": "rgba(34, 36, 38, 0.14902)", //提示框的边框颜色
    "bgcolorHI": "rgba(0, 0, 0, 0.05)", //提示框高亮选择的颜色
    "sugSubmit": false //选中提示框中词条时是否提交表单
};
BaiduSuggestion.bind('search-query', sugParams);


text:
package test.parameters;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import org.testng.Assert;
import org.testng.ITestNGListener;
import org.testng.TestListenerAdapter;
import org.testng.TestNG;
import org.testng.annotations.Test;
import test.SimpleBaseTest;

public class ParamInheritanceTest extends SimpleBaseTest {

  @Test(
      description =
          "When verbose is set to >1, TNG prints test results on CLI which are printed "
              + "using SuiteResultCounts.calculateResultCounts(). This method has been throwing NPE "
              + "because it's unable to find SuiteRunner in HashMap, because the list of parameters in "
              + "SuiteRunner changed"
              + " during execution. This test makes sure we dont run into any NPEs")
  public void noNPEInCountingResults() {
    TestNG tng = create();
    tng.setTestSuites(Arrays.asList(getPathToResource("param-inheritance/parent-suite.xml")));

    TestListenerAdapter tla = new TestListenerAdapter();
    tng.addListener((ITestNGListener) tla);

    OutputStream os = new ByteArrayOutputStream();
    PrintStream out = System.out;
    PrintStream err = System.err;
    try {
      /*
       * Changing system print streams so that exception or results stmt is not logged
       * while running test (avoid confusing person running tests)
       */
      System.setOut(new PrintStream(os));
      System.setErr(new PrintStream(os));

      tng.run();

      Assert.assertEquals(tla.getPassedTests().size(), 1);
    } finally {
      try {
        os.close();
      } catch (IOException e) {
        // no need to handle this
      }
      System.setOut(out);
      System.setErr(err);
    }
  }

  @Test(description = "Checks to make sure parameters are inherited and overridden properly")
  public void parameterInheritanceAndOverriding() {
    TestNG tng = create();
    tng.setTestSuites(Arrays.asList(getPathToResource("parametertest/parent-suite.xml")));

    TestListenerAdapter tla = new TestListenerAdapter();
    tng.addListener((ITestNGListener) tla);

    tng.run();

    Assert.assertEquals(tla.getPassedTests().size(), 3);
  }
}


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

  <!-- Log output directory is specified by system property/environment
       variable 'LOG_DIR'. If unspecified, a directory is used.-->
  <variable name="logdir" value="${LOG_DIR:-/tmp/elastisys/logs/kubernetespool}"/>

  <!-- captures everythin to file -->
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${logdir}/kubernetespool.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- daily rollover -->
      <fileNamePattern>${logdir}/kubernetespool.%d{yyyy-MM-dd}.log</fileNamePattern>
      <!-- keep 7 days' worth of history -->
      <maxHistory>7</maxHistory>
    </rollingPolicy>
    <encoder>
      <pattern>%date{ISO8601} [%thread] %-5level [%class{0}:%method:%line] - %msg%n</pattern>
    </encoder>
  </appender>

  <!-- captures everything to stdout -->
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <target>System.out</target>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>DEBUG</level>
    </filter>
    <encoder>
      <pattern>%date{ISO8601} [%thread] %-5level [%class{0}:%method:%line] - %msg%n</pattern>
    </encoder>
  </appender>

  <root>
    <level value="ERROR" />
    <appender-ref ref="FILE" />
    <appender-ref ref="STDOUT" />
  </root>

  <logger name="com.elastisys">
    <level value="DEBUG"/>
  </logger>

</configuration>


text:
package org.apache.beam.sdk.testing;

import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;
import static org.junit.Assert.fail;

import java.lang.reflect.Field;
import java.util.List;
import java.util.stream.Stream;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

/**
 * Tracks the threads created during a test method execution (or class using @ClassRule) and fails
 * if some still exists after the test method execution.
 */
public class ThreadLeakTracker implements TestRule {
  private final Field groupField;

  public ThreadLeakTracker() {
    try {
      groupField = Thread.class.getDeclaredField("group");
      if (!groupField.isAccessible()) {
        groupField.setAccessible(true);
      }
    } catch (final NoSuchFieldException e) {
      throw new IllegalStateException(e);
    }
  }

  @Override
  public Statement apply(final Statement base, final Description description) {
    return new Statement() {
      @Override
      public void evaluate() throws Throwable {
        final Thread thread = Thread.currentThread();
        final ThreadGroup threadGroup = thread.getThreadGroup();
        final ThreadGroup testGroup = new ThreadGroup(threadGroup, Long.toString(thread.getId()));
        groupField.set(thread, testGroup);
        try {
          base.evaluate();
        } finally {
          groupField.set(thread, threadGroup);
          final Thread[] threads = listThreads();
          final List<Thread> leaked =
              Stream.of(threads).filter(t -> t.getThreadGroup() == testGroup).collect(toList());
          if (!leaked.isEmpty()) {
            fail(
                "Some threads leaked: "
                    + leaked.stream().map(Thread::getName).collect(joining("\n- ", "\n- ", "")));
          }
        }
      }
    };
  }

  private Thread[] listThreads() {
    final int count = Thread.activeCount();
    final Thread[] threads = new Thread[Math.max(count * 2, 16)];
    final int threadCount = Thread.enumerate(threads);
    final Thread[] array = new Thread[threadCount];
    System.arraycopy(threads, 0, array, 0, threadCount);
    return array;
  }
}


text:
<!DOCTYPE html>

    <title>Spring Security Example</title>

 Home

 Logout

Title

Fake content

July 11, 2012 2:17:16 PM CDT

        <button type="button" onclick="click4('/boot/store')">Store Locator</button>

        <input id="storeNumber" type="text" name="storeNumber"></input>


text:
using namespace SPH;

Viscosity_XSPH::Viscosity_XSPH(FluidModel *model) :
	ViscosityBase(model)
{
}

Viscosity_XSPH::~Viscosity_XSPH(void)
{
}

void Viscosity_XSPH::step()
{
	const unsigned int numParticles = m_model->numParticles();

	const Real viscosity = m_model->getViscosity();
	const Real h = TimeManager::getCurrent()->getTimeStepSize();

	// Compute viscosity forces (XSPH)
	#pragma omp parallel default(shared)
	{
		#pragma omp for schedule(static)
		for (int i = 0; i < (int)numParticles; i++)
		{
			const Vector3r &xi = m_model->getPosition(0, i);
			const Vector3r &vi = m_model->getVelocity(0, i);
			Vector3r &ai = m_model->getAcceleration(i);
			const Real density_i = m_model->getDensity(i);
			for (unsigned int j = 0; j < m_model->numberOfNeighbors(i); j++)
			{
				const CompactNSearch::PointID &particleId = m_model->getNeighbor(i, j);
				const unsigned int &neighborIndex = particleId.point_id;
				const Vector3r &xj = m_model->getPosition(particleId.point_set_id, neighborIndex);
				const Vector3r &vj = m_model->getVelocity(particleId.point_set_id, neighborIndex);

				if (particleId.point_set_id == 0)		// Test if fluid particle
				{
					// Viscosity
					const Real density_j = m_model->getDensity(neighborIndex);
					ai -= (1.0/h) * viscosity * (m_model->getMass(neighborIndex) / density_j) * (vi - vj) * m_model->W(xi - xj);

				}
// 				else
// 				{
// 					ai -= (1.0/h) * viscosity * (m_model->getBoundaryPsi(pid, neighborIndex) / density_i) * (vi)* m_model->W(xi - xj);
// 				}
			}
		}
	}
}

void Viscosity_XSPH::reset()
{
}


text:
using System.IO;
using System.Runtime.Versioning;

namespace NuGet
{
    public interface IProjectSystem : IFileSystem, IPropertyProvider
    {
        FrameworkName TargetFramework { get; }
        string ProjectName { get; }

        /// <summary>
        /// Method called when adding a assembly reference to the project.
        /// </summary>
        /// <param name="referencePath">Physical path to the assembly file relative to the project root.</param>
        /// <param name="stream">Contents of the assembly file.</param>
        void AddReference(string referencePath, Stream stream);
        /// <summary>
        /// Adds an assembly reference to a framework assembly (one in the GAC).
        /// </summary>
        /// <param name="name">name of the assembly</param>
        void AddFrameworkReference(string name);
        bool ReferenceExists(string name);
        void RemoveReference(string name);
        bool IsProjectReference(string name);
        bool IsSupportedFile(string path);
        string ResolvePath(string path);
        bool IsBindingRedirectSupported { get; }
    }
}


text:
<?php

namespace PaymentSuite\StripeBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;

use PaymentSuite\PaymentCoreBundle\DependencyInjection\Abstracts\AbstractPaymentSuiteExtension;

/**
 * This is the class that loads and manages your bundle configuration.
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class StripeExtension extends AbstractPaymentSuiteExtension
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $this->addParameters(
            $container,
            'stripe',
            [
                'private_key' => $config['private_key'],
                'public_key' => $config['public_key'],
                'api_endpoint' => $config['api_endpoint'],
                'view_template' => $config['templates']['view_template'],
                'scripts_template' => $config['templates']['scripts_template'],
            ]
        );

        $this->registerRedirectRoutesDefinition(
            $container,
            'stripe',
            [
                'success' => $config['payment_success'],
                'failure' => $config['payment_failure'],
            ]
        );

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('controllers.yml');
        $loader->load('services.yml');
        $loader->load('twig.yml');
    }
}


text:
Rails.application.routes.draw do
  resources :joins, shallow: true

  resources :courses, shallow: true do
    post :publish, on: :member

    resources :chapters, shallow: true do
      member do
        put :move_up
        put :move_down
      end
      resources :wares, shallow: true do
        member do
          put :move_up
          put :move_down
        end
      end
    end
  end

  root 'home#index'

  mount KcCourses::Engine => '/', :as => 'kc_courses'
  FilePartUpload::Routing.mount "/file_part_upload", :as => :file_part_upload
  mount PlayAuth::Engine => '/auth', :as => :auth
end


text:
@interface RBIShadowLayer : CALayer

@end

@implementation RBIShadowLayer

- (void)setBounds:(CGRect)bounds
{
    [super setBounds:bounds];
    [self updateShadowPath];
}

- (void)updateShadowPath
{
    CGRect shadowPathRect = self.bounds;
    self.shadowPath = [[UIBezierPath bezierPathWithRect:shadowPathRect] CGPath];
}

@end

@implementation RBIShadowView

+ (Class)layerClass
{
    return [RBIShadowLayer class];
}

- (void)setShadowColor:(UIColor *)shadowColor
{
    self.layer.shadowColor = shadowColor.CGColor;
}

- (UIColor *)shadowColor
{
    return [UIColor colorWithCGColor:self.layer.shadowColor];
}

- (void)setShadowOpacity:(CGFloat)shadowOpacity
{
    self.layer.shadowOpacity = shadowOpacity;
}

- (CGFloat)shadowOpacity
{
    return self.layer.shadowOpacity;
}

- (void)setShadowRadius:(CGFloat)shadowRadius
{
    self.layer.shadowRadius = shadowRadius;
}

- (CGFloat)shadowRadius
{
    return self.layer.shadowRadius;
}

@end


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

namespace MalApi
{
    /// <summary>
    /// Generic exception for errors
    /// </summary>
    [Serializable]
    public class MalApiException : Exception
    {
        public MalApiException() { }
        public MalApiException(string message) : base(message) { }
        public MalApiException(string message, Exception inner) : base(message, inner) { }
        protected MalApiException(
          System.Runtime.Serialization.SerializationInfo info,
          System.Runtime.Serialization.StreamingContext context)
            : base(info, context) { }
    }
}


text:
package controllers

import lib.{Pagination, PaginatedCollection}
import scala.concurrent.Future
import com.bryzek.apidoc.api.v0.errors.UnitResponse

import javax.inject.Inject
import play.api._
import play.api.i18n.{MessagesApi, I18nSupport}
import play.api.mvc.{Action, Controller}

class HistoryController @Inject() (val messagesApi: MessagesApi) extends Controller with I18nSupport {

  implicit val context = scala.concurrent.ExecutionContext.Implicits.global

  def index(
    orgKey: Option[String],
    appKey: Option[String],
    from: Option[String],
    to: Option[String],
    `type`: Option[String],
    page: Int = 0
  ) = Anonymous.async { implicit request =>
    for {
      changes <- request.api.changes.get(
        orgKey = orgKey,
        applicationKey = appKey,
        from = from,
        to = to,
        `type` = `type`,
        limit = Pagination.DefaultLimit+1,
        offset = page * Pagination.DefaultLimit
      )
    } yield {
      Ok(views.html.history.index(
        request.mainTemplate().copy(title = Some("History")),
        changes = PaginatedCollection(page, changes),
        orgKey = orgKey,
        appKey = appKey,
        from = from,
        to = to
      ))
    }
  }

}


text:
#include "ICamera.h"
#include "../ThirdParty/glm-0.9.8.5/glm/gtc/matrix_transform.hpp"

namespace Crystal {
	namespace Graphics {

class PerspectiveCamera : public ICamera
{
public:
	PerspectiveCamera(){}

	PerspectiveCamera(const float fovy, const float aspect) :
		fovy(fovy),
		aspect(aspect)
	{}

	PerspectiveCamera(const float fovy, const float aspect, const glm::vec3& target, const glm::vec3& position, const float near, const float far) :
		fovy(fovy),
		aspect(aspect),
		ICamera(target, position, near_, far_)
	{}

	void setFovy(const float fovy) { this->fovy = fovy; }

	void setAspect(const float aspect) { this->aspect = aspect; }

	glm::mat4 getProjectionMatrix() const override {
		return glm::perspective(fovy, aspect, near_, far_);
	}

private:
	float fovy;
	float aspect;
};

	}
}

#endif


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

namespace Orchard.Security.Providers {
    /// <summary>
    /// Base implementation for providers that generate the UserData for Authentication Cookies.
    /// To use this, inherit from this abstract class calling the ctor(bool) as follows:
    ///
    /// public class MyImplementation : BaseUserDataProvider {
    ///     public MyImplementation (
    ///         // Inject any required IDependency
    ///         ) : base (true/false) {
    ///         // MyImplementation ctor body
    ///     }
    /// }
    ///
    /// That bool passed to the base ctor controls the behaviour when validating a UserData
    /// dictionary that does not contain the provider's key.
    /// On top of that, you will be required to implement the Value(IUser) method that computes
    /// the value provided by the implementation.
    /// </summary>
    public abstract class BaseUserDataProvider : IUserDataProvider {

        public BaseUserDataProvider(bool defaultValid) {
            DefaultValid = defaultValid;
        }

        /// <summary>
        /// Tells whether this provider should return true for validation when there is no
        /// element for it in the UserData dictionary. Setting this value to false means that
        /// if a new provider is added (e.g. if the feature that contains it is enabled) extant
        /// authentication cookies will be invalidated, because their UserData dictionary does
        /// not contain the element for the new provider.
        /// </summary>
        protected virtual bool DefaultValid { get; set; }

        /// <summary>
        /// This is the key that will be used in the UserData dictionary
        /// </summary>
        public virtual string Key {
            get { return GetType().FullName; }
        }

        /// <summary>
        /// This is the value that this provider will compute for the given user. This is
        /// used both to generate the element of the dictionary for this provider, and to
        /// validate a given dictionary, unless ComputeUserDataElement and IsValid are being
        /// overridden as well.
        /// </summary>
        protected abstract string Value(IUser user);

        public virtual string ComputeUserDataElement(IUser user) {
            return Value(user);
        }

        public virtual bool IsValid(IUser user, IDictionary<string, string> userData) {
            if (userData.ContainsKey(Key)) {
                return string.Equals(userData[Key], Value(user), StringComparison.Ordinal);
            }
            return DefaultValid;
        }
    }
}


text:
#include <aws/guardduty/model/DeleteFilterRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::GuardDuty::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

DeleteFilterRequest::DeleteFilterRequest() :
    m_detectorIdHasBeenSet(false),
    m_filterNameHasBeenSet(false)
{
}

Aws::String DeleteFilterRequest::SerializePayload() const
{
  return "";
}


text:
using System;
using System.Linq;

namespace Ragnar.Integration.UnitTesting.InterestV3
{
    public static class ScenarioHelper
    {
        public static Guid userId = new Guid("b04e4eb0-f7b2-408d-ac79-94ad886f4ffa");
        public static Guid bankId = new Guid("18d1122e-67a3-4c08-82f3-53566fe89ac0");
        public static Guid depositId = new Guid("644ada56-32ef-496a-854d-3dd5e12b375c");

        public static Integration.InterestV3.Model.Bank CreateBank(Guid? id = null, string name = null)
        {
            return new Integration.InterestV3.Model.Bank()
            {
                Id = id ?? Guid.NewGuid(),
                Name = name ?? "Bank with no name!"
            };
        }

        public static Integration.InterestV3.Model.BankInterestRate AddInterestRate(this Integration.InterestV3.Model.Bank bank, DateTime startDate, decimal value)
        {
            Integration.InterestV3.Model.BankInterestRate bankInterestRate = new Integration.InterestV3.Model.BankInterestRate()
            {
                StartDate = startDate,
                Value = value
            };

            bank.Rates = (bank.Rates ?? new Integration.InterestV3.Model.BankInterestRate[0]).Concat(new[] { bankInterestRate }).ToArray();

            return bankInterestRate;
        }

        public static Integration.InterestV3.Model.BankAccount AddBankAccount(this Integration.InterestV3.Model.Bank bank, Guid? id)
        {
            Integration.InterestV3.Model.BankAccount bankAccount = new Integration.InterestV3.Model.BankAccount()
            {
                ID = id ?? Guid.NewGuid()
            };

            bank.BankAccount = bankAccount;

            return bankAccount;
        }

        public static Integration.InterestV3.Model.TaxSystem AddTaxSystem(this Integration.InterestV3.Model.Bank bank, DateTime effectiveDate)
        {
            Integration.InterestV3.Model.TaxSystem taxSystem = new Integration.InterestV3.Model.TaxSystem()
            {
                StartDate = effectiveDate,
                TaxPolicies = new Integration.InterestV3.Model.TaxPolicy[0]
            };

            bank.TaxSystem = (bank.TaxSystem ?? new System.Collections.Generic.Dictionary<DateTime, Integration.InterestV3.Model.TaxSystem>());
            bank.TaxSystem.Add(effectiveDate, taxSystem);

            return taxSystem;
        }

        public static Integration.InterestV3.Model.TaxPolicy AddTaxPolicy(
            this Integration.InterestV3.Model.TaxSystem taxSystem,
            Integration.InterestV3.Model.PolicyType policyType,
            Integration.InterestV3.Model.ComparisonAction comparisonAction,
            object comparisonValue,
            decimal? taxValue = null,
            int? order = null)
        {
            Integration.InterestV3.Model.TaxPolicy taxPolicy = new Integration.InterestV3.Model.TaxPolicy()
            {
                PolicyType = policyType,
                ComparisonAction = comparisonAction,
                ComparisonValue = comparisonValue,
                TaxValue = taxValue ?? decimal.Zero,
                Order = order ?? 0,
            };

            taxSystem.TaxPolicies = (taxSystem.TaxPolicies ?? new Integration.InterestV3.Model.TaxPolicy[0]).Concat(new[] { taxPolicy }).ToArray();

            return taxPolicy;
        }

        public static Integration.InterestV3.Model.Deposit AddDeposit(this Integration.InterestV3.Model.BankAccount bank, DateTime startDate, DateTime endDate, Guid? id = null, decimal? amount = null)
        {
            Integration.InterestV3.Model.Deposit deposit = new Integration.InterestV3.Model.Deposit()
            {
                ID = id ?? ScenarioHelper.depositId,
                StartDate = startDate,
                EndDate = endDate,
                Amount = amount ?? decimal.Zero
            };

            bank.Deposits = (bank.Deposits ?? new Integration.InterestV3.Model.Deposit[0]).Concat(new[] { deposit }).ToArray();

            return deposit;
        }

        public static Integration.InterestV3.Calculator.Contract.DepositProjectionSummary CreateDepositProjectionSummary(Guid? depositId = null, DateTime? startDate = null, DateTime? endDate = null, decimal? initialAmount = null)
        {
            Integration.InterestV3.Calculator.Contract.DepositProjectionSummary summary = new Integration.InterestV3.Calculator.Contract.DepositProjectionSummary()
            {
                DepositID = depositId ?? ScenarioHelper.depositId,
                StartDate = startDate ?? DateTime.MinValue,
                EndDate = endDate ?? DateTime.MinValue,
                InitialAmount = initialAmount ?? decimal.Zero
            };

            return summary;
        }

        public static Integration.InterestV3.Calculator.Contract.Interest AddInterest(this Integration.InterestV3.Calculator.Contract.DepositProjectionSummary summary, decimal? asGross = null, decimal? asNet = null)
        {
            Integration.InterestV3.Calculator.Contract.Interest interest = new Integration.InterestV3.Calculator.Contract.Interest()
            {
                AsGross = asGross ?? decimal.Zero,
                AsNet = asNet ?? decimal.Zero
            };

            summary.Interest = interest;

            return interest;
        }

        public static Integration.InterestV3.Calculator.Contract.Tax AddTax(this Integration.InterestV3.Calculator.Contract.DepositProjectionSummary summary, decimal? asPercentage = null, decimal? asValue = null)
        {
            Integration.InterestV3.Calculator.Contract.Tax tax = new Integration.InterestV3.Calculator.Contract.Tax()
            {
                AsPercentage = asPercentage ?? decimal.Zero,
                AsValue = asValue ?? decimal.Zero
            };

            summary.Tax = tax;

            return tax;
        }
    }
}


text:
redirect_to:
- http://tech.hbc.com/2013-04-30-ade-trenaman-erlang-distributed-systems-and.html
layout:: post
title: ade trenaman erlang distributed systems and
date: '2013-04-30T20:28:19-04:00'
tags: []
tumblr_url: http://tech.gilt.com/post/49317644392/ade-trenaman-erlang-distributed-systems-and
---

ade-trenaman:

Erlang, Distributed Systems and Sierra Nevada Pale Ale

Found this photo on my phone - a real moment in time at Gilt New York! Steve Vinoski, who worked with Gregor and I back in the days of the seminal Irish tech startup IONA Technologies, came to Gilt one cold February night to give a talk on how Riak is implemented in Erlang - it's a great talk, and a super introduction to Erlang. From left to right: Eric Bowman, Steve Vinoski, Gregor Heine, me, and Mike Bryzek. Too. Much. Fun.


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

namespace M33.Layout.Services
{
    public interface ILayoutSelectorService : IDependency
    {
        IEnumerable<string> GetLayouts();
    }
}


text:
package jp.gr.java_conf.kgd.library.cool.jsfml.component.base;

import org.jsfml.graphics.Color;
import org.jsfml.graphics.ConstTexture;
import org.jsfml.graphics.IntRect;
import org.jsfml.system.Vector2f;

public class ConnectedShapeStates
implements IShapeState
{
	private IShapeState[] shapeStates;

	public ConnectedShapeStates(IShapeState... shapeStates)
	{
		this.shapeStates = shapeStates;
	}

	public void setFillColor(Color color)
	{
		for(IShapeState shapeState : shapeStates)
		{
			shapeState.setFillColor(color);
		}
	}

	public ConstTexture getTexture()
	{
		return shapeStates[0].getTexture();
	}

	public Color getFillColor()
	{
		return shapeStates[0].getFillColor();
	}

	public void setTexture(ConstTexture texture, boolean resetRect)
	{
		for(IShapeState shapeState : shapeStates)
		{
			shapeState.setTexture(texture, resetRect);
		}
	}

	public void setOutlineColor(Color color)
	{
		for(IShapeState shapeState : shapeStates)
		{
			shapeState.setOutlineColor(color);
		}
	}

	public IntRect getTextureRect()
	{
		return shapeStates[0].getTextureRect();
	}

	public Color getOutlineColor()
	{
		return shapeStates[0].getOutlineColor();
	}

	public void setOutlineThickness(float thickness)
	{
		for(IShapeState shapeState : shapeStates)
		{
			shapeState.setOutlineThickness(thickness);
		}
	}

	public float getOutlineThickness()
	{
		return shapeStates[0].getOutlineThickness();
	}

	public void setTexture(ConstTexture texture)
	{
		for(IShapeState shapeState : shapeStates)
		{
			shapeState.setTexture(texture, true);
		}
	}

	public Vector2f getPoint(int i)
	{
		return shapeStates[0].getPoint(i);
	}

	public void setTextureRect(IntRect rect)
	{
		for(IShapeState shapeState : shapeStates)
		{
			shapeState.setTextureRect(rect);
		}
	}

	public int getPointCount()
	{
		return shapeStates[0].getPointCount();
	}

	public Vector2f[] getPoints()
	{
		return shapeStates[0].getPoints();
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<set android:interpolator="@android:anim/linear_interpolator"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <alpha android:duration="600" android:startOffset="0" android:fromAlpha="1.0" android:toAlpha="0.8" />
    <scale android:duration="600" android:pivotX="50.0%" android:pivotY="50.0%" android:startOffset="0" android:fromXScale="1.0" android:toXScale="0.9" android:fromYScale="1.0" android:toYScale="0.9" />
</set>


text:
package org.springframework.boot.logging.logback;

import ch.qos.logback.classic.BasicConfigurator;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.joran.spi.JoranException;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.impl.StaticLoggerBinder;

import org.springframework.boot.logging.LoggingInitializationContext;
import org.springframework.boot.testutil.EnvironmentTestUtils;
import org.springframework.boot.testutil.OutputCapture;
import org.springframework.mock.env.MockEnvironment;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;

/**
 * Tests for {@link SpringBootJoranConfigurator}.
 *
 * @author Phillip Webb
 * @author Eddú Meléndez
 */
public class SpringBootJoranConfiguratorTests {

	@Rule
	public OutputCapture out = new OutputCapture();

	private MockEnvironment environment;

	private LoggingInitializationContext initializationContext;

	private JoranConfigurator configurator;

	private LoggerContext context;

	private Logger logger;

	@Before
	public void setup() {
		this.environment = new MockEnvironment();
		this.initializationContext = new LoggingInitializationContext(this.environment);
		this.configurator = new SpringBootJoranConfigurator(this.initializationContext);
		StaticLoggerBinder binder = StaticLoggerBinder.getSingleton();
		this.context = (LoggerContext) binder.getLoggerFactory();
		this.logger = this.context.getLogger(getClass());
	}

	@After
	public void reset() {
		this.context.stop();
		BasicConfigurator.configureDefaultContext();
	}

	@Test
	public void profileActive() throws Exception {
		this.environment.setActiveProfiles("production");
		initialize("production-profile.xml");
		this.logger.trace("Hello");
		this.out.expect(containsString("Hello"));
	}

	@Test
	public void multipleNamesFirstProfileActive() throws Exception {
		this.environment.setActiveProfiles("production");
		initialize("multi-profile-names.xml");
		this.logger.trace("Hello");
		this.out.expect(containsString("Hello"));
	}

	@Test
	public void multipleNamesSecondProfileActive() throws Exception {
		this.environment.setActiveProfiles("test");
		initialize("multi-profile-names.xml");
		this.logger.trace("Hello");
		this.out.expect(containsString("Hello"));
	}

	@Test
	public void profileNotActive() throws Exception {
		initialize("production-profile.xml");
		this.logger.trace("Hello");
		this.out.expect(not(containsString("Hello")));
	}

	@Test
	public void profileNestedActiveActive() throws Exception {
		doTestNestedProfile(true, "outer", "inner");
	}

	@Test
	public void profileNestedActiveNotActive() throws Exception {
		doTestNestedProfile(false, "outer");
	}

	@Test
	public void profileNestedNotActiveActive() throws Exception {
		doTestNestedProfile(false, "inner");
	}

	@Test
	public void profileNestedNotActiveNotActive() throws Exception {
		doTestNestedProfile(false);
	}

	@Test
	public void springProperty() throws Exception {
		EnvironmentTestUtils.addEnvironment(this.environment, "my.example-property:test");
		initialize("property.xml");
		assertThat(this.context.getProperty("MINE")).isEqualTo("test");
	}

	@Test
	public void relaxedSpringProperty() throws Exception {
		EnvironmentTestUtils.addEnvironment(this.environment, "my.EXAMPLE_PROPERTY:test");
		initialize("property.xml");
		assertThat(this.context.getProperty("MINE")).isEqualTo("test");
	}

	private void doTestNestedProfile(boolean expected, String... profiles)
			throws JoranException {
		this.environment.setActiveProfiles(profiles);
		initialize("nested.xml");
		this.logger.trace("Hello");
		if (expected) {
			this.out.expect(containsString("Hello"));
		}
		else {
			this.out.expect(not(containsString("Hello")));
		}

	}

	private void initialize(String config) throws JoranException {
		this.configurator.setContext(this.context);
		this.configurator.doConfigure(getClass().getResourceAsStream(config));
	}

}


text:
package amaethon;

import java.util.function.Consumer;

/**
 * Interface for an Auction House
 */
public interface Model
{
    // add an auction
    int add(final byte[] name, final int nameLength, final long expiration, final long reserveValue);
    // exercise 3: add a new auction type
    int add(final byte[] name, final int nameLength, final long expiration, final long price, final int quantity);

    // cancel an auction
    void cancel(final int auctionId);

    // bid on an auction. True if high bid, False if not
    boolean bid(final int auctionId, final long bidderId, final long value);

    // iterator over all non-inactive auctions (for activity feed and for advancing time on auctions)
    void forEach(final Consumer<Auction> consumer);

    // done to add a new bidding account to the system
    void addBidder(final byte[] name, final long bidderId, final long budget);
}