text:
package template

import (
	"bytes"
	"fmt"
	"io"
	"os"
	"reflect"
	"strings"
	"unicode"
	"url"
	"utf8"
)

// FuncMap is the type of the map defining the mapping from names to functions.
// Each function must have either a single return value, or two return values of
// which the second has type os.Error. If the second argument evaluates to non-nil
// during execution, execution terminates and Execute returns an error.
type FuncMap map[string]interface{}

var builtins = FuncMap{
	"and":      and,
	"html":     HTMLEscaper,
	"index":    index,
	"js":       JSEscaper,
	"len":      length,
	"not":      not,
	"or":       or,
	"print":    fmt.Sprint,
	"printf":   fmt.Sprintf,
	"println":  fmt.Sprintln,
	"urlquery": URLQueryEscaper,
}

var builtinFuncs = createValueFuncs(builtins)

// createValueFuncs turns a FuncMap into a map[string]reflect.Value
func createValueFuncs(funcMap FuncMap) map[string]reflect.Value {
	m := make(map[string]reflect.Value)
	addValueFuncs(m, funcMap)
	return m
}

// addValueFuncs adds to values the functions in funcs, converting them to reflect.Values.
func addValueFuncs(out map[string]reflect.Value, in FuncMap) {
	for name, fn := range in {
		v := reflect.ValueOf(fn)
		if v.Kind() != reflect.Func {
			panic("value for " + name + " not a function")
		}
		if !goodFunc(v.Type()) {
			panic(fmt.Errorf("can't handle multiple results from method/function %q", name))
		}
		out[name] = v
	}
}

// addFuncs adds to values the functions in funcs. It does no checking of the input -
// call addValueFuncs first.
func addFuncs(out, in FuncMap) {
	for name, fn := range in {
		out[name] = fn
	}
}

// goodFunc checks that the function or method has the right result signature.
func goodFunc(typ reflect.Type) bool {
	// We allow functions with 1 result or 2 results where the second is an os.Error.
	switch {
	case typ.NumOut() == 1:
		return true
	case typ.NumOut() == 2 && typ.Out(1) == osErrorType:
		return true
	}
	return false
}

// findFunction looks for a function in the template, set, and global map.
func findFunction(name string, tmpl *Template, set *Set) (reflect.Value, bool) {
	if tmpl != nil {
		if fn := tmpl.execFuncs[name]; fn.IsValid() {
			return fn, true
		}
	}
	if set != nil {
		if fn := set.execFuncs[name]; fn.IsValid() {
			return fn, true
		}
	}
	if fn := builtinFuncs[name]; fn.IsValid() {
		return fn, true
	}
	return reflect.Value{}, false
}

// Indexing.

// index returns the result of indexing its first argument by the following
// arguments.  Thus "index x 1 2 3" is, in Go syntax, x[1][2][3]. Each
// indexed item must be a map, slice, or array.
func index(item interface{}, indices ...interface{}) (interface{}, os.Error) {
	v := reflect.ValueOf(item)
	for _, i := range indices {
		index := reflect.ValueOf(i)
		var isNil bool
		if v, isNil = indirect(v); isNil {
			return nil, fmt.Errorf("index of nil pointer")
		}
		switch v.Kind() {
		case reflect.Array, reflect.Slice:
			var x int64
			switch index.Kind() {
			case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
				x = index.Int()
			case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
				x = int64(index.Uint())
			default:
				return nil, fmt.Errorf("cannot index slice/array with type %s", index.Type())
			}
			if x < 0 || x >= int64(v.Len()) {
				return nil, fmt.Errorf("index out of range: %d", x)
			}
			v = v.Index(int(x))
		case reflect.Map:
			if !index.Type().AssignableTo(v.Type().Key()) {
				return nil, fmt.Errorf("%s is not index type for %s", index.Type(), v.Type())
			}
			if x := v.MapIndex(index); x.IsValid() {
				v = x
			} else {
				v = reflect.Zero(v.Type().Key())
			}
		default:
			return nil, fmt.Errorf("can't index item of type %s", index.Type())
		}
	}
	return v.Interface(), nil
}

// Length

// length returns the length of the item, with an error if it has no defined length.
func length(item interface{}) (int, os.Error) {
	v, isNil := indirect(reflect.ValueOf(item))
	if isNil {
		return 0, fmt.Errorf("len of nil pointer")
	}
	switch v.Kind() {
	case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String:
		return v.Len(), nil
	}
	return 0, fmt.Errorf("len of type %s", v.Type())
}

// Boolean logic.

func truth(a interface{}) bool {
	t, _ := isTrue(reflect.ValueOf(a))
	return t
}

// and computes the Boolean AND of its arguments, returning
// the first false argument it encounters, or the last argument.
func and(arg0 interface{}, args ...interface{}) interface{} {
	if !truth(arg0) {
		return arg0
	}
	for i := range args {
		arg0 = args[i]
		if !truth(arg0) {
			break
		}
	}
	return arg0
}

// or computes the Boolean OR of its arguments, returning
// the first true argument it encounters, or the last argument.
func or(arg0 interface{}, args ...interface{}) interface{} {
	if truth(arg0) {
		return arg0
	}
	for i := range args {
		arg0 = args[i]
		if truth(arg0) {
			break
		}
	}
	return arg0
}

// not returns the Boolean negation of its argument.
func not(arg interface{}) (truth bool) {
	truth, _ = isTrue(reflect.ValueOf(arg))
	return !truth
}

// HTML escaping.

var (
	htmlQuot = []byte(""") // shorter than """
	htmlApos = []byte("'") // shorter than "'"
	htmlAmp  = []byte("&")
	htmlLt   = []byte("<")
	htmlGt   = []byte(">")
)

// HTMLEscape writes to w the escaped HTML equivalent of the plain text data b.
func HTMLEscape(w io.Writer, b []byte) {
	last := 0
	for i, c := range b {
		var html []byte
		switch c {
		case '"':
			html = htmlQuot
		case '\'':
			html = htmlApos
		case '&':
			html = htmlAmp
		case '<':
			html = htmlLt
		case '>':
			html = htmlGt
		default:
			continue
		}
		w.Write(b[last:i])
		w.Write(html)
		last = i + 1
	}
	w.Write(b[last:])
}

// HTMLEscapeString returns the escaped HTML equivalent of the plain text data s.
func HTMLEscapeString(s string) string {
	// Avoid allocation if we can.
	if strings.IndexAny(s, `'"&<>`) < 0 {
		return s
	}
	var b bytes.Buffer
	HTMLEscape(&b, []byte(s))
	return b.String()
}

// HTMLEscaper returns the escaped HTML equivalent of the textual
// representation of its arguments.
func HTMLEscaper(args ...interface{}) string {
	ok := false
	var s string
	if len(args) == 1 {
		s, ok = args[0].(string)
	}
	if !ok {
		s = fmt.Sprint(args...)
	}
	return HTMLEscapeString(s)
}

// JavaScript escaping.

var (
	jsLowUni = []byte(`\u00`)
	hex      = []byte("0123456789ABCDEF")

	jsBackslash = []byte(`\\`)
	jsApos      = []byte(`\'`)
	jsQuot      = []byte(`\"`)
	jsLt        = []byte(`\x3C`)
	jsGt        = []byte(`\x3E`)
)

// JSEscape writes to w the escaped JavaScript equivalent of the plain text data b.
func JSEscape(w io.Writer, b []byte) {
	last := 0
	for i := 0; i < len(b); i++ {
		c := b[i]

		if !jsIsSpecial(int(c)) {
			// fast path: nothing to do
			continue
		}
		w.Write(b[last:i])

		if c < utf8.RuneSelf {
			// Quotes, slashes and angle brackets get quoted.
			// Control characters get written as \u00XX.
			switch c {
			case '\\':
				w.Write(jsBackslash)
			case '\'':
				w.Write(jsApos)
			case '"':
				w.Write(jsQuot)
			case '<':
				w.Write(jsLt)
			case '>':
				w.Write(jsGt)
			default:
				w.Write(jsLowUni)
				t, b := c>>4, c&0x0f
				w.Write(hex[t : t+1])
				w.Write(hex[b : b+1])
			}
		} else {
			// Unicode rune.
			rune, size := utf8.DecodeRune(b[i:])
			if unicode.IsPrint(rune) {
				w.Write(b[i : i+size])
			} else {
				// TODO(dsymonds): Do this without fmt?
				fmt.Fprintf(w, "\\u%04X", rune)
			}
			i += size - 1
		}
		last = i + 1
	}
	w.Write(b[last:])
}

// JSEscapeString returns the escaped JavaScript equivalent of the plain text data s.
func JSEscapeString(s string) string {
	// Avoid allocation if we can.
	if strings.IndexFunc(s, jsIsSpecial) < 0 {
		return s
	}
	var b bytes.Buffer
	JSEscape(&b, []byte(s))
	return b.String()
}

func jsIsSpecial(rune int) bool {
	switch rune {
	case '\\', '\'', '"', '<', '>':
		return true
	}
	return rune < ' ' || utf8.RuneSelf <= rune
}

// JSEscaper returns the escaped JavaScript equivalent of the textual
// representation of its arguments.
func JSEscaper(args ...interface{}) string {
	ok := false
	var s string
	if len(args) == 1 {
		s, ok = args[0].(string)
	}
	if !ok {
		s = fmt.Sprint(args...)
	}
	return JSEscapeString(s)
}

// URLQueryEscaper returns the escaped value of the textual representation of
// its arguments in a form suitable for embedding in a URL query.
func URLQueryEscaper(args ...interface{}) string {
	s, ok := "", false
	if len(args) == 1 {
		s, ok = args[0].(string)
	}
	if !ok {
		s = fmt.Sprint(args...)
	}
	return url.QueryEscape(s)
}


text:
class OAuth2::AccessToken
  # Fix bug introduced in https://github.com/intridea/oauth2/commit/607af1ca78fa20b796de6260aa143117bc712551
  def request(verb, path, params = {}, headers = {})
    params = params.merge token_param => @token
    headers = headers.merge 'Authorization' => "Token token=\"#{@token}\""
    @client.request(verb, path, params, headers)
  end
end

redpajama_set_name: RedPajamaGithub


text:
/*
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:
 *
 * http://www.opensource.org/licenses/gpl-license.html
 * http://www.gnu.org/copyleft/gpl.html
 */
////////////////////////////////////////////////////////////////////////////////
//
// WARNING!  THIS FILE IS AUTOMATICALLY GENERATED FROM XML.
//                DO NOT MODIFY THIS FILE DIRECTLY.
//
////////////////////////////////////////////////////////////////////////////////
//
// The following naming conventions are followed in this file.
//      XX_<module>_<regname>_<field>
//
// XX specifies the define / macro class
//      HW pertains to a register
//      BM indicates a Bit Mask
//      BF indicates a Bit Field macro
//
// <module> is the hardware module name which can be any of the following...
//      USB20 (Note when there is more than one copy of a given module, the
//      module name includes a number starting from 0 for the first instance
//      of that module)
//
// <regname> is the specific register within that module
//
// <field> is the specific bitfield within that <module>_<register>
//
// We also define the following...
//      hw_<module>_<regname>_t is typedef of anonymous union
//
////////////////////////////////////////////////////////////////////////////////

#ifndef _REGSSIMMEMSEL_H
#define _REGSSIMMEMSEL_H  1

#include "regs.h"

#ifndef REGS_SIMMEMSEL_BASE
#define REGS_SIMMEMSEL_BASE (REGS_BASE + 0x0003C070)
#endif

////////////////////////////////////////////////////////////////////////////////
//// multi-register-define name HW_SIMMEMSEL_CHANn_CFG : base 0x8003C070 : count 2 : offset 0x4
////////////////////////////////////////////////////////////////////////////////

#ifndef __LANGUAGE_ASM__
typedef union
{
    reg32_t  U;
    struct
    {
        reg16_t  DEV_CODE;
        unsigned DEV_CLASS  :  4;
        unsigned CE_SRC     :  4;
        reg8_t   WIDTH;
    } B;
} hw_simmemsel_chann_cfg_t;
#endif

//
// constants & macros for entire HW_SIMMEMSEL_CHANn_CFG multi-register
//

#define HW_SIMMEMSEL_CHANn_CFG_COUNT        2
#define HW_SIMMEMSEL_CHANn_CFG_ADDR(n)      (REGS_SIMMEMSEL_BASE + 0x00000000 + ((n) * 0x4))

#ifndef __LANGUAGE_ASM__
#define HW_SIMMEMSEL_CHANn_CFG(n)           (*(volatile hw_simmemsel_chann_cfg_t *) HW_SIMMEMSEL_CHANn_CFG_ADDR(n))
#define HW_SIMMEMSEL_CHANn_CFG_RD(n)        (HW_SIMMEMSEL_CHANn_CFG(n).U)
#define HW_SIMMEMSEL_CHANn_CFG_WR(n, v)     (HW_SIMMEMSEL_CHANn_CFG(n).U = (v))
#define HW_SIMMEMSEL_CHANn_CFG_SET(n, v)    (HW_SIMMEMSEL_CHANn_CFG_WR(n, HW_SIMMEMSEL_CHANn_CFG_RD(n) |  (v)))
#define HW_SIMMEMSEL_CHANn_CFG_CLR(n, v)    (HW_SIMMEMSEL_CHANn_CFG_WR(n, HW_SIMMEMSEL_CHANn_CFG_RD(n) & ~(v)))
#define HW_SIMMEMSEL_CHANn_CFG_TOG(n, v)    (HW_SIMMEMSEL_CHANn_CFG_WR(n, HW_SIMMEMSEL_CHANn_CFG_RD(n) ^  (v)))
#endif

//
// constants & macros for individual HW_SIMMEMSEL_CHANn_CFG multi-register bitfields
//

//--- Register HW_SIMMEMSEL_CHANn_CFG, field WIDTH

#define BP_SIMMEMSEL_CHANn_CFG_WIDTH      24
#define BM_SIMMEMSEL_CHANn_CFG_WIDTH      0xFF000000

#ifndef __LANGUAGE_ASM__
#define BF_SIMMEMSEL_CHANn_CFG_WIDTH(v)   ((((reg32_t) v) << 24) & BM_SIMMEMSEL_CHANn_CFG_WIDTH)
#else
#define BF_SIMMEMSEL_CHANn_CFG_WIDTH(v)   (((v) << 24) & BM_SIMMEMSEL_CHANn_CFG_WIDTH)
#endif

#ifndef __LANGUAGE_ASM__
#define BW_SIMMEMSEL_CHANn_CFG_WIDTH(n, v)  (HW_SIMMEMSEL_CHANn_CFG(n).B.WIDTH = (v))
#endif

//--- Register HW_SIMMEMSEL_CHANn_CFG, field CE_SRC

#define BP_SIMMEMSEL_CHANn_CFG_CE_SRC      20
#define BM_SIMMEMSEL_CHANn_CFG_CE_SRC      0x00F00000

#define BF_SIMMEMSEL_CHANn_CFG_CE_SRC(v)   (((v) << 20) & BM_SIMMEMSEL_CHANn_CFG_CE_SRC)

#ifndef __LANGUAGE_ASM__
#define BW_SIMMEMSEL_CHANn_CFG_CE_SRC(n, v)  BF_CS1n(SIMMEMSEL_CHANn_CFG, n, CE_SRC, v)
#endif

#define BV_SIMMEMSEL_CHANn_CFG_CE_SRC__PRIMARY  0x0

//--- Register HW_SIMMEMSEL_CHANn_CFG, field DEV_CLASS

#define BP_SIMMEMSEL_CHANn_CFG_DEV_CLASS      16
#define BM_SIMMEMSEL_CHANn_CFG_DEV_CLASS      0x000F0000

#define BF_SIMMEMSEL_CHANn_CFG_DEV_CLASS(v)   (((v) << 16) & BM_SIMMEMSEL_CHANn_CFG_DEV_CLASS)

#ifndef __LANGUAGE_ASM__
#define BW_SIMMEMSEL_CHANn_CFG_DEV_CLASS(n, v)  BF_CS1n(SIMMEMSEL_CHANn_CFG, n, DEV_CLASS, v)
#endif

#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__RSRVD      0x0
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__SDRAM_32   0x1
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__SDRAM_16   0x2
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__MSDRAM_32  0x3
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__MSDRAM_16  0x4
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__MDDR_32    0x5
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__MDDR_16    0x6
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CLASS__DDR_16     0x7

//--- Register HW_SIMMEMSEL_CHANn_CFG, field DEV_CODE

#define BP_SIMMEMSEL_CHANn_CFG_DEV_CODE      0
#define BM_SIMMEMSEL_CHANn_CFG_DEV_CODE      0x0000FFFF

#define BF_SIMMEMSEL_CHANn_CFG_DEV_CODE(v)   (((v) << 0) & BM_SIMMEMSEL_CHANn_CFG_DEV_CODE)

#ifndef __LANGUAGE_ASM__
#define BW_SIMMEMSEL_CHANn_CFG_DEV_CODE(n, v)  (HW_SIMMEMSEL_CHANn_CFG(n).B.DEV_CODE = (v))
#endif

#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__RSRVD                    0x0
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__SDRAM_16_MT48LC16M16A2   0x1
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__SDRAM_16_MT48LC4M16A2    0x2
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__SDRAM_32_K4S643232F_60   0x1
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MSDRAM_16_K4M28163LF_75  0x1
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MSDRAM_16_MT48H4M16LF_8  0x2
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MSDRAM_16_K4M56163PG_75  0x3
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MSDRAM_32_K4M28323LF_60  0x1
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MDDR_16_MT46H16M16LF_6   0x1
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MDDR_16_MT46H8M16_75     0x2
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MDDR_16_MT46H16M16LF_75  0x3
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MDDR_32_MT46H8M32LF_6    0x1
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__MDDR_32_MT46H8M32LF_75   0x2
#define BV_SIMMEMSEL_CHANn_CFG_DEV_CODE__DDR_16_MT46V8M16_6       0x1

////////////////////////////////////////////////////////////////////////////////
//// HW_OLD_SIMMEMSEL_REG - Old SIMMEMSEL register
////////////////////////////////////////////////////////////////////////////////

#ifndef __LANGUAGE_ASM__
typedef union
{
    reg32_t  U;
    struct
    {
        reg32_t  RSRVD1;
    } B;
} hw_old_simmemsel_reg_t;
#endif

//
// constants & macros for entire HW_OLD_SIMMEMSEL_REG register
//

#define HW_OLD_SIMMEMSEL_REG_ADDR      (REGS_SIMMEMSEL_BASE + 0x00000010)

#ifndef __LANGUAGE_ASM__
#define HW_OLD_SIMMEMSEL_REG           (*(volatile hw_old_simmemsel_reg_t *) HW_OLD_SIMMEMSEL_REG_ADDR)
#define HW_OLD_SIMMEMSEL_REG_RD()      (HW_OLD_SIMMEMSEL_REG.U)
#endif

//
// constants & macros for individual HW_OLD_SIMMEMSEL_REG bitfields
//

#endif // _REGSSIMMEMSEL_H

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


text:
This was an experiment made in the earlier days of Repsheet. There are much better ways to deal with this and this experiment has outlived its usefulness. The repo will live on for historical purposes.

# Repsheet Backend  [![Build Status](https://secure.travis-ci.org/repsheet/backend.png)](http://travis-ci.org/repsheet/backend?branch=master) ![Coverity Status](https://scan.coverity.com/projects/559/badge.svg?flat=1)

This is the backend infrastructure for
[Repsheet](https://github.com/repsheet/repsheet). It provides
automatic processing of the current state of actors and allows for
automatic blacklisting of repeat offenders. It is designed to be run
under cron.

## Compiling

You need the [hiredis](https://github.com/redis/hiredis),
[libcurl](http://curl.haxx.se/libcurl/), and
[libjson/json-c](https://github.com/json-c/json-c) libraries installed
for compilation and linking. You also need the standard autotools
packages. This includes `autoconf`, `automake`, and `libtool`.

```sh
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
```

## Usage

```
$ repsheet --version
Repsheet Backend Version 2.0.0
usage: repsheet [-srauv] [-h] [-p] [-e] [-t] [-o]
  --score                  -s score actors
  --report                 -r report top 10 offenders
  --analyze                -a analyze and act on offenders
  --publish                -u publish blacklist to upstream providers
  --host                   -h <redis host>
  --port                   -p <redis port>
  --expiry                 -e <redis expiry> blacklist expire time
  --modsecurity_threshold  -t <blacklist threshold>
  --ofdp_threshold         -o <ofdp threshold> score and blacklist actors against wafsec.com
  --version                -v print version and help
```

If you pass no arugments to the repsheet binary, it will default to
simply scoring the actors in a sorted set inside of Redis under the
offenders key.

```sh
$ repsheet
No options specified, performing score operation
```

The score `-s / --score` operation can be run on its own, but is also
run during the report and analyze operations.

Using the `-r / --report` option will print a report of the top ten
unblacklisted actors.

```sh
$ repsheet -r
Top 10 Suspsects (not yet blacklisted)
  1.1.1.1	20444 offenses
  1.1.1.215	996 offenses
  1.1.1.210	991 offenses
  1.1.1.55	986 offenses
  1.1.1.218	969 offenses
  1.1.1.156	964 offenses
  1.1.1.49	954 offenses
  1.1.1.200	948 offenses
  1.1.1.85	945 offenses
  1.1.1.21	943 offenses
  1.1.1.45	934 offenses
```

And the `-a / --analyze` option will analyze the offenders list and
blacklist any offenders that have an offense count higher than the
ModSecurity threshold `-t / --modsecurity_threshold` (default 200),
the OFDP threshold `-o / --ofdp_threshold` (default 50), or have been previously
blacklisted and have returned after their blacklist has expired.

```sh
$ repsheet --analyze --modsecurity_threshold 75 --ofdp_threshold 20
Actor 1.1.1.1 has been blacklisted: The actor has exceeded the ModSecurity blacklist threshold. [Score: 181]
```


text:
<?php

namespace Symfony\Component\CssSelector;

use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser;
use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser;
use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
use Symfony\Component\CssSelector\Parser\Shortcut\HashParser;
use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension;
use Symfony\Component\CssSelector\XPath\Translator;

/**
 * CssSelector is the main entry point of the component and can convert CSS
 * selectors to XPath expressions.
 *
 * $xpath = CssSelector::toXpath('h1.foo');
 *
 * This component is a port of the Python cssselector library,
 * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 *
 * @api
 */
class CssSelector
{
    private static $html = true;

    /**
     * Translates a CSS expression to its XPath equivalent.
     * Optionally, a prefix can be added to the resulting XPath
     * expression with the $prefix parameter.
     *
     * @param mixed  $cssExpr The CSS expression.
     * @param string $prefix  An optional prefix for the XPath expression.
     *
     * @return string
     *
     * @api
     */
    public static function toXPath($cssExpr, $prefix = 'descendant-or-self::')
    {
        $translator = new Translator();

        if (self::$html) {
            $translator->registerExtension(new HtmlExtension($translator));
        }

        $translator
            ->registerParserShortcut(new EmptyStringParser())
            ->registerParserShortcut(new ElementParser())
            ->registerParserShortcut(new ClassParser())
            ->registerParserShortcut(new HashParser())
        ;

        return $translator->cssToXPath($cssExpr, $prefix);
    }

    /**
     * Enables the HTML extension.
     */
    public static function enableHtmlExtension()
    {
        self::$html = true;
    }

    /**
     * Disables the HTML extension.
     */
    public static function disableHtmlExtension()
    {
        self::$html = false;
    }
}


text:
/// <reference path="../../typings/beanstalk/beanstalk.d.ts" />

class SplashScreensManager extends createjs.Container  {

	logo: createjs.Bitmap;

	showSplashScreens(completeCallback:()=>void)
	{
		this.logo = new createjs.Bitmap(null);
		this.addChild(this.logo);

		var oldBodyBG = document.body.style.backgroundImage;
		document.body.style.backgroundImage = "none";

		this.showLogo("MBG_logo",() => {
			this.showLogo("BHL_logo",() => {
				this.showLogo("TiltFactor_logo",() => {
					document.body.style.backgroundImage = oldBodyBG;
					completeCallback();
				});
			});
		});
	}

	private showLogo(name: string, completeCallback: () => void) {
		this.logo.image = beanstalk.resources.getResource(name);

		var r = beanstalk.config.width / this.logo.getBounds().width;
		this.logo.scaleX = this.logo.scaleY = r;

		this.logo.x = 0;
		this.logo.y = beanstalk.config.height / 2 - this.logo.getBounds().height / 2;

		// Start it off invisible, fade in then fade out
		this.logo.alpha = 0;
		createjs.Tween.get(this.logo)
			.to({ alpha: 1 }, 1000, createjs.Ease.linear)
			.wait(1000)
			.to({ alpha: 0 }, 1000, createjs.Ease.linear)
			.call(() => completeCallback());
	}
}


text:
"""Starts the queue server and runs forever.
A port will be busy as long as the server is running.

Manual operation: just start the script, manually close when finished.

Script operation: start with p=subprocess.Popen(...), call p.poll() to wait for
                  an actual start, terminate with p.terminate() which takes
                  around 20 seconds to actually close the process.

Created on Sat Apr  6 21:01:26 2013

@author: akusoka1
"""

from ibc_config import IBCConfig as cf
import socket
from multiprocessing.managers import SyncManager
import Queue
import os

def CreateDoubleQueueServer(host, port, key, queue_size):

    qtask = Queue.Queue(maxsize=queue_size)
    qresult = Queue.Queue(maxsize=queue_size)

    class QueueManager(SyncManager):
        pass

    QueueManager.register('qtask', callable=lambda:qtask)
    QueueManager.register('qresult', callable=lambda:qresult)
    manager = QueueManager(address=(host, port), authkey=key)
    #manager.start()  # actually start the server
    manager.get_server().serve_forever()
    return manager

if __name__ == "__main__":

    host_file = open(cf._host, "w")
    host_ip = socket.gethostbyname(socket.gethostname())
    host_file.write(host_ip)
    host_file.close()

    mng = CreateDoubleQueueServer(host_ip, cf._port, cf._key, cf._qsize)
    print "Started queue server at %s" % host_ip


text:
package com.github.e13mort.stf.model;

/**
 * payload object for adding device to user
 **/
public class AddUserDevicePayload {

    private String serial = null;

    private Integer timeout = null;

    /**
     * Device Serial
     **/
    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    /**
     * Device timeout in ms. If device is kept idle for this period, it will be automatically disconnected. Default is provider group timeout
     **/
    public Integer getTimeout() {
        return timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class AddUserDevicePayload {\n");

        sb.append("    serial: ").append(toIndentedString(serial)).append("\n");
        sb.append("    timeout: ").append(toIndentedString(timeout)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


text:
using content::BrowserThread;
using content::RenderViewHost;
using content::ResourceDispatcherHostLoginDelegate;
using content::ResourceRequestInfo;
using extensions::Extension;
using extensions::StreamsPrivateAPI;

#if defined(OS_ANDROID)
using navigation_interception::InterceptNavigationDelegate;
#endif

namespace {

void NotifyDownloadInitiatedOnUI(int render_process_id, int render_view_id) {
  RenderViewHost* rvh = RenderViewHost::FromID(render_process_id,
                                               render_view_id);
  if (!rvh)
    return;

  content::NotificationService::current()->Notify(
      chrome::NOTIFICATION_DOWNLOAD_INITIATED,
      content::Source<RenderViewHost>(rvh),
      content::NotificationService::NoDetails());
}

// Goes through the extension's file browser handlers and checks if there is one
// that can handle the |mime_type|.
// |extension| must not be NULL.
bool ExtensionCanHandleMimeType(const Extension* extension,
                                const std::string& mime_type) {
  MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension);
  if (!handler)
    return false;

  return handler->CanHandleMIMEType(mime_type);
}

void SendExecuteMimeTypeHandlerEvent(scoped_ptr<content::StreamHandle> stream,
                                     int64 expected_content_size,
                                     int render_process_id,
                                     int render_view_id,
                                     const std::string& extension_id) {
  DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));

  content::RenderViewHost* render_view_host =
      content::RenderViewHost::FromID(render_process_id, render_view_id);
  if (!render_view_host)
    return;

  content::WebContents* web_contents =
      content::WebContents::FromRenderViewHost(render_view_host);
  if (!web_contents)
    return;

  content::BrowserContext* browser_context = web_contents->GetBrowserContext();
  if (!browser_context)
    return;

  Profile* profile = Profile::FromBrowserContext(browser_context);
  if (!profile)
    return;

  StreamsPrivateAPI* streams_private = StreamsPrivateAPI::Get(profile);
  if (!streams_private)
    return;
  streams_private->ExecuteMimeTypeHandler(
      extension_id, web_contents, stream.Pass(), expected_content_size);
}

enum PrerenderSchemeCancelReason {
  PRERENDER_SCHEME_CANCEL_REASON_EXTERNAL_PROTOCOL,
  PRERENDER_SCHEME_CANCEL_REASON_DATA,
  PRERENDER_SCHEME_CANCEL_REASON_BLOB,
  PRERENDER_SCHEME_CANCEL_REASON_FILE,
  PRERENDER_SCHEME_CANCEL_REASON_FILESYSTEM,
  PRERENDER_SCHEME_CANCEL_REASON_WEBSOCKET,
  PRERENDER_SCHEME_CANCEL_REASON_FTP,
  PRERENDER_SCHEME_CANCEL_REASON_CHROME,
  PRERENDER_SCHEME_CANCEL_REASON_CHROME_EXTENSION,
  PRERENDER_SCHEME_CANCEL_REASON_ABOUT,
  PRERENDER_SCHEME_CANCEL_REASON_UNKNOWN,
  PRERENDER_SCHEME_CANCEL_REASON_MAX,
};

void ReportPrerenderSchemeCancelReason(PrerenderSchemeCancelReason reason) {
  UMA_HISTOGRAM_ENUMERATION(
      "Prerender.SchemeCancelReason", reason,
      PRERENDER_SCHEME_CANCEL_REASON_MAX);
}

void ReportUnsupportedPrerenderScheme(const GURL& url) {
  if (url.SchemeIs("data")) {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_DATA);
  } else if (url.SchemeIs("blob")) {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_BLOB);
  } else if (url.SchemeIsFile()) {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_FILE);
  } else if (url.SchemeIsFileSystem()) {
    ReportPrerenderSchemeCancelReason(
        PRERENDER_SCHEME_CANCEL_REASON_FILESYSTEM);
  } else if (url.SchemeIs("ws") || url.SchemeIs("wss")) {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_WEBSOCKET);
  } else if (url.SchemeIs("ftp")) {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_FTP);
  } else if (url.SchemeIs("chrome")) {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_CHROME);
  } else if (url.SchemeIs("chrome-extension")) {
    ReportPrerenderSchemeCancelReason(
        PRERENDER_SCHEME_CANCEL_REASON_CHROME_EXTENSION);
  } else if (url.SchemeIs("about")) {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_ABOUT);
  } else {
    ReportPrerenderSchemeCancelReason(PRERENDER_SCHEME_CANCEL_REASON_UNKNOWN);
  }
}

}  // end namespace

ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate(
    prerender::PrerenderTracker* prerender_tracker)
    : download_request_limiter_(g_browser_process->download_request_limiter()),
      safe_browsing_(g_browser_process->safe_browsing_service()),
      user_script_listener_(new extensions::UserScriptListener()),
      prerender_tracker_(prerender_tracker) {
}

ChromeResourceDispatcherHostDelegate::~ChromeResourceDispatcherHostDelegate() {
}

bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest(
    int child_id,
    int route_id,
    const std::string& method,
    const GURL& url,
    ResourceType::Type resource_type,
    content::ResourceContext* resource_context) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));

  // Handle a PREFETCH resource type. If prefetch is disabled, squelch the
  // request.  Otherwise, do a normal request to warm the cache.
  if (resource_type == ResourceType::PREFETCH) {
    // All PREFETCH requests should be GETs, but be defensive about it.
    if (method != "GET")
      return false;

    // If prefetch is disabled, kill the request.
    if (!prerender::PrerenderManager::IsPrefetchEnabled())
      return false;
  }

  // Abort any prerenders that spawn requests that use invalid HTTP methods
  // or invalid schemes.
  if (prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) {
    if (!prerender::PrerenderManager::IsValidHttpMethod(method)) {
      prerender_tracker_->TryCancelOnIOThread(
          child_id, route_id, prerender::FINAL_STATUS_INVALID_HTTP_METHOD);
      return false;
    }
    if (!prerender::PrerenderManager::DoesSubresourceURLHaveValidScheme(url)) {
      ReportUnsupportedPrerenderScheme(url);
      prerender_tracker_->TryCancelOnIOThread(
          child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME);
      return false;
    }
  }

  return true;
}

void ChromeResourceDispatcherHostDelegate::RequestBeginning(
    net::URLRequest* request,
    content::ResourceContext* resource_context,
    appcache::AppCacheService* appcache_service,
    ResourceType::Type resource_type,
    int child_id,
    int route_id,
    bool is_continuation_of_transferred_request,
    ScopedVector<content::ResourceThrottle>* throttles) {
  if (is_continuation_of_transferred_request)
    ChromeURLRequestUserData::Delete(request);

  ChromeURLRequestUserData* user_data =
      ChromeURLRequestUserData::Create(request);
  bool is_prerendering = prerender_tracker_->IsPrerenderingOnIOThread(
      child_id, route_id);
  if (is_prerendering) {
    user_data->set_is_prerender(true);
    request->SetPriority(net::IDLE);
  }

#if defined(OS_ANDROID)
  if (!is_prerendering && resource_type == ResourceType::MAIN_FRAME) {
    throttles->push_back(
        InterceptNavigationDelegate::CreateThrottleFor(request));
  }
#endif
#if defined(OS_CHROMEOS)
  if (resource_type == ResourceType::MAIN_FRAME) {
    // We check offline first, then check safe browsing so that we still can
    // block unsafe site after we remove offline page.
    throttles->push_back(new OfflineResourceThrottle(
        child_id, route_id, request, appcache_service));
    // Add interstitial page while merge session process (cookie
    // reconstruction from OAuth2 refresh token in ChromeOS login) is still in
    // progress while we are attempting to load a google property.
    throttles->push_back(new MergeSessionThrottle(
        child_id, route_id, request));
  }
#endif

  // Don't attempt to append headers to requests that have already started.
  // TODO(stevet): Remove this once the request ordering issues are resolved
  // in crbug.com/128048.
  if (!request->is_pending()) {
    net::HttpRequestHeaders headers;
    headers.CopyFrom(request->extra_request_headers());
    ProfileIOData* io_data = ProfileIOData::FromResourceContext(
        resource_context);
    bool incognito = io_data->is_incognito();
    chrome_variations::VariationsHttpHeaderProvider::GetInstance()->
        AppendHeaders(request->url(),
                      incognito,
                      !incognito && io_data->GetMetricsEnabledStateOnIOThread(),
                      &headers);
    request->SetExtraRequestHeaders(headers);
  }

#if defined(ENABLE_ONE_CLICK_SIGNIN)
  AppendChromeSyncGaiaHeader(request, resource_context);
#endif

  AppendStandardResourceThrottles(request,
                                  resource_context,
                                  child_id,
                                  route_id,
                                  resource_type,
                                  throttles);

  ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
  if (io_data->resource_prefetch_predictor_observer()) {
    io_data->resource_prefetch_predictor_observer()->OnRequestStarted(
        request, resource_type, child_id, route_id);
  }
}

void ChromeResourceDispatcherHostDelegate::DownloadStarting(
    net::URLRequest* request,
    content::ResourceContext* resource_context,
    int child_id,
    int route_id,
    int request_id,
    bool is_content_initiated,
    bool must_download,
    ScopedVector<content::ResourceThrottle>* throttles) {
  BrowserThread::PostTask(
      BrowserThread::UI, FROM_HERE,
      base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id));

  // If it's from the web, we don't trust it, so we push the throttle on.
  if (is_content_initiated) {
    throttles->push_back(
        new DownloadResourceThrottle(download_request_limiter_.get(),
                                     child_id,
                                     route_id,
                                     request_id,
                                     request->method()));
#if defined(OS_ANDROID)
    throttles->push_back(
        new chrome::InterceptDownloadResourceThrottle(
            request, child_id, route_id, request_id));
#endif
  }

  // If this isn't a new request, we've seen this before and added the standard
  //  resource throttles already so no need to add it again.
  if (!request->is_pending()) {
    AppendStandardResourceThrottles(request,
                                    resource_context,
                                    child_id,
                                    route_id,
                                    ResourceType::MAIN_FRAME,
                                    throttles);
  }
}

bool ChromeResourceDispatcherHostDelegate::AcceptSSLClientCertificateRequest(
    net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info) {
  if (request->load_flags() & net::LOAD_PREFETCH)
    return false;

  ChromeURLRequestUserData* user_data = ChromeURLRequestUserData::Get(request);
  if (user_data && user_data->is_prerender()) {
    int child_id, route_id;
    if (ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView(
            &child_id, &route_id)) {
      if (prerender_tracker_->TryCancel(
              child_id, route_id,
              prerender::FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED)) {
        return false;
      }
    }
  }

  return true;
}

bool ChromeResourceDispatcherHostDelegate::AcceptAuthRequest(
    net::URLRequest* request,
    net::AuthChallengeInfo* auth_info) {
  ChromeURLRequestUserData* user_data = ChromeURLRequestUserData::Get(request);
  if (!user_data || !user_data->is_prerender())
    return true;

  int child_id, route_id;
  if (!ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView(
          &child_id, &route_id)) {
    NOTREACHED();
    return true;
  }

  if (!prerender_tracker_->TryCancelOnIOThread(
          child_id, route_id, prerender::FINAL_STATUS_AUTH_NEEDED)) {
    return true;
  }

  return false;
}

ResourceDispatcherHostLoginDelegate*
    ChromeResourceDispatcherHostDelegate::CreateLoginDelegate(
        net::AuthChallengeInfo* auth_info, net::URLRequest* request) {
  return CreateLoginPrompt(auth_info, request);
}

bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol(
    const GURL& url, int child_id, int route_id) {
#if defined(OS_ANDROID)
  // Android use a resource throttle to handle external as well as internal
  // protocols.
  return false;
#else

  if (prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) {
    ReportPrerenderSchemeCancelReason(
        PRERENDER_SCHEME_CANCEL_REASON_EXTERNAL_PROTOCOL);
    prerender_tracker_->TryCancel(
        child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME);
    return false;
  }

  BrowserThread::PostTask(
      BrowserThread::UI, FROM_HERE,
      base::Bind(&ExternalProtocolHandler::LaunchUrl, url, child_id, route_id));
  return true;
#endif
}

void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles(
    net::URLRequest* request,
    content::ResourceContext* resource_context,
    int child_id,
    int route_id,
    ResourceType::Type resource_type,
    ScopedVector<content::ResourceThrottle>* throttles) {
  ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
#if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING)
  // Insert safe browsing at the front of the list, so it gets to decide on
  // policies first.
  if (io_data->safe_browsing_enabled()->GetValue()) {
    bool is_subresource_request = resource_type != ResourceType::MAIN_FRAME;
    content::ResourceThrottle* throttle =
        SafeBrowsingResourceThrottleFactory::Create(request,
                                                    child_id,
                                                    route_id,
                                                    is_subresource_request,
                                                    safe_browsing_.get());
    if (throttle)
      throttles->push_back(throttle);
  }
#endif

#if defined(ENABLE_MANAGED_USERS)
  bool is_subresource_request = resource_type != ResourceType::MAIN_FRAME;
  throttles->push_back(new ManagedModeResourceThrottle(
        request, child_id, route_id, !is_subresource_request,
        io_data->managed_mode_url_filter()));
#endif

  content::ResourceThrottle* throttle =
      user_script_listener_->CreateResourceThrottle(request->url(),
                                                    resource_type);
  if (throttle)
    throttles->push_back(throttle);
}

#if defined(ENABLE_ONE_CLICK_SIGNIN)
void ChromeResourceDispatcherHostDelegate::AppendChromeSyncGaiaHeader(
    net::URLRequest* request,
    content::ResourceContext* resource_context) {
  static const char kAllowChromeSignIn[] = "Allow-Chrome-SignIn";

  ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
  OneClickSigninHelper::Offer offer =
      OneClickSigninHelper::CanOfferOnIOThread(request, io_data);
  switch (offer) {
    case OneClickSigninHelper::CAN_OFFER:
      request->SetExtraRequestHeaderByName(kAllowChromeSignIn, "1", false);
      break;
    case OneClickSigninHelper::DONT_OFFER:
      request->RemoveRequestHeaderByName(kAllowChromeSignIn);
      break;
    case OneClickSigninHelper::IGNORE_REQUEST:
      break;
  }
}
#endif

bool ChromeResourceDispatcherHostDelegate::ShouldForceDownloadResource(
    const GURL& url, const std::string& mime_type) {
  // Special-case user scripts to get downloaded instead of viewed.
  return extensions::UserScript::IsURLUserScript(url, mime_type);
}

bool ChromeResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
    content::ResourceContext* resource_context,
    const GURL& url,
    const std::string& mime_type,
    GURL* origin,
    std::string* target_id) {
#if !defined(OS_ANDROID)
  ProfileIOData* io_data =
      ProfileIOData::FromResourceContext(resource_context);
  bool profile_is_incognito = io_data->is_incognito();
  const scoped_refptr<const ExtensionInfoMap> extension_info_map(
      io_data->GetExtensionInfoMap());
  std::vector<std::string> whitelist = MimeTypesHandler::GetMIMETypeWhitelist();
  // Go through the white-listed extensions and try to use them to intercept
  // the URL request.
  for (size_t i = 0; i < whitelist.size(); ++i) {
    const char* extension_id = whitelist[i].c_str();
    const Extension* extension =
        extension_info_map->extensions().GetByID(extension_id);
    // The white-listed extension may not be installed, so we have to NULL check
    // |extension|.
    if (!extension ||
        (profile_is_incognito &&
         !extension_info_map->IsIncognitoEnabled(extension_id))) {
      continue;
    }

    if (ExtensionCanHandleMimeType(extension, mime_type)) {
      *origin = Extension::GetBaseURLFromExtensionId(extension_id);
      *target_id = extension_id;
      return true;
    }
  }
#endif
  return false;
}

void ChromeResourceDispatcherHostDelegate::OnStreamCreated(
    content::ResourceContext* resource_context,
    int render_process_id,
    int render_view_id,
    const std::string& target_id,
    scoped_ptr<content::StreamHandle> stream,
    int64 expected_content_size) {
#if !defined(OS_ANDROID)
  content::BrowserThread::PostTask(
      content::BrowserThread::UI, FROM_HERE,
      base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream),
                 expected_content_size, render_process_id, render_view_id,
                 target_id));
#endif
}

void ChromeResourceDispatcherHostDelegate::OnResponseStarted(
    net::URLRequest* request,
    content::ResourceContext* resource_context,
    content::ResourceResponse* response,
    IPC::Sender* sender) {
  const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);

  if (request->url().SchemeIsSecure()) {
    const net::URLRequestContext* context = request->context();
    net::TransportSecurityState* state = context->transport_security_state();
    if (state) {
      net::TransportSecurityState::DomainState domain_state;
      bool has_sni = net::SSLConfigService::IsSNIAvailable(
          context->ssl_config_service());
      if (state->GetDomainState(request->url().host(), has_sni,
                                &domain_state) &&
          domain_state.ShouldUpgradeToSSL()) {
        sender->Send(new ChromeViewMsg_AddStrictSecurityHost(
            info->GetRouteID(), request->url().host()));
      }
    }
  }

  // See if the response contains the X-Auto-Login header.  If so, this was
  // a request for a login page, and the server is allowing the browser to
  // suggest auto-login, if available.
  AutoLoginPrompter::ShowInfoBarIfPossible(request, info->GetChildID(),
                                           info->GetRouteID());

  ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);

#if defined(ENABLE_ONE_CLICK_SIGNIN)
  // See if the response contains the Google-Accounts-SignIn header.  If so,
  // then the user has just finished signing in, and the server is allowing the
  // browser to suggest connecting the user's profile to the account.
  OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data,
                                              info->GetChildID(),
                                              info->GetRouteID());
#endif

  // Build in additional protection for the chrome web store origin.
  GURL webstore_url(extension_urls::GetWebstoreLaunchURL());
  if (request->url().DomainIs(webstore_url.host().c_str())) {
    net::HttpResponseHeaders* response_headers = request->response_headers();
    if (!response_headers->HasHeaderValue("x-frame-options", "deny") &&
        !response_headers->HasHeaderValue("x-frame-options", "sameorigin")) {
      response_headers->RemoveHeader("x-frame-options");
      response_headers->AddHeader("x-frame-options: sameorigin");
    }
  }

  if (io_data->resource_prefetch_predictor_observer())
    io_data->resource_prefetch_predictor_observer()->OnResponseStarted(request);

  prerender::URLRequestResponseStarted(request);
}

void ChromeResourceDispatcherHostDelegate::OnRequestRedirected(
    const GURL& redirect_url,
    net::URLRequest* request,
    content::ResourceContext* resource_context,
    content::ResourceResponse* response) {
  ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);

#if defined(ENABLE_ONE_CLICK_SIGNIN)
  const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);

  // See if the response contains the Google-Accounts-SignIn header.  If so,
  // then the user has just finished signing in, and the server is allowing the
  // browser to suggest connecting the user's profile to the account.
  OneClickSigninHelper::ShowInfoBarIfPossible(request, io_data,
                                              info->GetChildID(),
                                              info->GetRouteID());
  AppendChromeSyncGaiaHeader(request, resource_context);
#endif

  if (io_data->resource_prefetch_predictor_observer()) {
    io_data->resource_prefetch_predictor_observer()->OnRequestRedirected(
        redirect_url, request);
  }

  int child_id, route_id;
  if (!prerender::PrerenderManager::DoesURLHaveValidScheme(redirect_url) &&
      ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView(
          &child_id, &route_id) &&
      prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) {
    ReportUnsupportedPrerenderScheme(redirect_url);
    prerender_tracker_->TryCancel(
        child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME);
    request->Cancel();
  }
}


text:
{% for langTitle, langTemplate in languages %}

{{ langTitle }}

            {% include langTemplate %}

{% endfor %}


text:
require_dependency 'spree/calculator'

module Spree
  class Calculator::TieredPercent < Calculator
    preference :base_percent, :decimal, default: 0
    preference :tiers, :hash, default: {}

    before_validation do
      # Convert tier values to decimals. Strings don't do us much good.
      if preferred_tiers.is_a?(Hash)
        self.preferred_tiers = Hash[*preferred_tiers.flatten.map(&:to_f)]
      end
    end

    validates :preferred_base_percent, numericality: {
      greater_than_or_equal_to: 0,
      less_than_or_equal_to: 100
    }
    validate :preferred_tiers_content

    def self.description
      Spree.t(:tiered_percent)
    end

    def compute(object)
      base, percent = preferred_tiers.sort.reverse.detect{ |b,_| object.amount >= b }
      (object.amount * (percent || preferred_base_percent) / 100).round(2)
    end

    private
    def preferred_tiers_content
      if preferred_tiers.is_a? Hash
        unless preferred_tiers.keys.all?{ |k| k.is_a?(Numeric) && k > 0 }
          errors.add(:base, :keys_should_be_positive_number)
        end
        unless preferred_tiers.values.all?{ |k| k.is_a?(Numeric) && k >= 0 && k <= 100 }
          errors.add(:base, :values_should_be_percent)
        end
      else
        errors.add(:preferred_tiers, :should_be_hash)
      end
    end
  end
end


text:
require('ember-application');

/**
Ember

@module ember
*/


text:
@interface DockTopMenuViewController ()
@property (strong, nonatomic) UIAlertView* loadingAlert;
@end

@implementation DockTopMenuViewController

#pragma mark - Appearing
- (void)viewDidLoad
{
    [super viewDidLoad];
    NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
    NSString* dataVersion = [NSString stringWithFormat:@"Data Version: %@",[defaults stringForKey: kSpaceDockCurrentDataVersionKey]];
    UIRefreshControl *refresh = [[UIRefreshControl alloc] init];
    refresh.attributedTitle = [[NSAttributedString alloc] initWithString:dataVersion];
    [refresh addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
    self.refreshControl = refresh;
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear: animated];
    if (_managedObjectContext == nil) {
        _loadingAlert = [[UIAlertView alloc] initWithTitle:@"Loading Data" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
        [_loadingAlert show];
        UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
        indicator.center = CGPointMake(_loadingAlert.bounds.size.width / 2, _loadingAlert.bounds.size.height - 50);
        [_loadingAlert addSubview:indicator];
        [indicator startAnimating];
    }
}

-(void)setManagedObjectContext:(NSManagedObjectContext *)managedObjectContext
{
    _managedObjectContext = managedObjectContext;
    [_loadingAlert dismissWithClickedButtonIndex: 0 animated: YES];
    _loadingAlert = nil;
    NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
    NSString* dataVersion = [NSString stringWithFormat:@"Data Version: %@",[defaults stringForKey: kSpaceDockCurrentDataVersionKey]];
    self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:dataVersion];

    DockDataUpdater* updater = [[DockDataUpdater alloc] init];
    [updater checkForNewDataVersion:^(NSString *remoteVersion, NSData *downloadData, NSError *error) {
        NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
        NSString* currentVersion = [defaults stringForKey: kSpaceDockCurrentDataVersionKey];
        if ([currentVersion compare:remoteVersion] == NSOrderedAscending) {
            UIToolbar* toolbar = self.navigationController.toolbar;
            UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
            UIBarButtonItem* update = [[UIBarButtonItem alloc] initWithTitle:@"Game Data Update Available" style:UIBarButtonItemStylePlain target:self action:@selector(refresh:)];
            [toolbar setItems:[NSArray arrayWithObjects:spacer,update,spacer,nil] animated:YES];
        }
    }];

}

#pragma mark - Segue management

- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender
{
    return _managedObjectContext != nil;
}

-(void)prepareForSegue:(UIStoryboardSegue*)segue sender:(id)sender
{

    if ([[segue identifier] isEqualToString: @"GoToShips"]) {
        id destination = [segue destinationViewController];
        DockShipsViewController* shipsViewController = (DockShipsViewController*)destination;
        shipsViewController.managedObjectContext = self.managedObjectContext;
        [shipsViewController clearTarget];
    } else if ([[segue identifier] isEqualToString: @"GoToSquads"]) {
        id destination = [segue destinationViewController];
        DockSquadsListController* controller = (DockSquadsListController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.targetSquad = _targetSquad;
    } else if ([[segue identifier] isEqualToString: @"GoToCaptains"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = @"Captain";
        controller.upgradeTypeName = @"Captains";
    } else if ([[segue identifier] isEqualToString: @"GoToCrew"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = @"Crew";
        controller.upgradeTypeName = @"Crew";
    } else if ([[segue identifier] isEqualToString: @"GoToTalents"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = @"Talent";
        controller.upgradeTypeName = @"Talents";
    } else if ([[segue identifier] isEqualToString: @"GoToBorg"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = @"Borg";
        controller.upgradeTypeName = @"Borg Upgrades";
    } else if ([[segue identifier] isEqualToString: @"GoToSquadron"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = @"Squadron";
        controller.upgradeTypeName = @"Squadron Upgrades";
    } else if ([[segue identifier] isEqualToString: @"GoToTech"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = @"Tech";
        controller.upgradeTypeName = @"Tech";
    } else if ([[segue identifier] isEqualToString: @"GoToWeapons"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = @"Weapon";
        controller.upgradeTypeName = @"Weapons";
    } else if ([[segue identifier] isEqualToString: @"GoToAdmirals"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = kAdmiralUpgradeType;
        controller.upgradeTypeName = @"Admirals";
    } else if ([[segue identifier] isEqualToString: @"GoToFleetCaptains"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = kFleetCaptainUpgradeType;
        controller.upgradeTypeName = @"Fleet Captains";
    } else if ([[segue identifier] isEqualToString: @"GoToOfficers"]) {
        id destination = [segue destinationViewController];
        DockUpgradesViewController* controller = (DockUpgradesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
        controller.upType = kOfficerUpgradeType;
        controller.upgradeTypeName = @"Officers";
    } else if ([[segue identifier] isEqualToString: @"GoToResources"]) {
        id destination = [segue destinationViewController];
        DockResourcesViewController* controller = (DockResourcesViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
    } else if ([[segue identifier] isEqualToString: @"GoToFlagships"]) {
        id destination = [segue destinationViewController];
        DockFlagshipsViewController* controller = (DockFlagshipsViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
    } else if ([[segue identifier] isEqualToString: @"GoToSets"]) {
        id destination = [segue destinationViewController];
        DockSetsListViewController* controller = (DockSetsListViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
    } else if ([[segue identifier] isEqualToString: @"GoToReference"]) {
        id destination = [segue destinationViewController];
        DockReferenceViewController* controller = (DockReferenceViewController*)destination;
        controller.managedObjectContext = self.managedObjectContext;
    }
    _targetSquad = nil;
}

-(void)showSquad:(DockSquad*)squad
{
    _targetSquad = squad;
    [self performSegueWithIdentifier: @"GoToSquads" sender: self];
}
-(void)refresh:(UIRefreshControl *)refresh
{
    DockDataUpdater* updater = [[DockDataUpdater alloc] init];
    UIToolbar* toolbar = self.navigationController.toolbar;
    UIProgressView* progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];
    UILabel* progressLabel = [[UILabel alloc] init];
    [progressLabel setText:@"Loading latest game data..."];
    [progressLabel setTextAlignment:NSTextAlignmentCenter];
    [progressView addSubview:progressLabel];
    [progressLabel setFrame:CGRectMake(0, 0, toolbar.frame.size.width, toolbar.frame.size.height/2)];
    [progressLabel setFont:[UIFont systemFontOfSize:[UIFont smallSystemFontSize]]];
    UIBarButtonItem *spacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
    UIBarButtonItem* update = [[UIBarButtonItem alloc] initWithCustomView:progressView];
    [progressView setFrame:CGRectMake(0, toolbar.frame.size.height/2, toolbar.frame.size.width*.9, toolbar.frame.size.height/2)];
    [toolbar setItems:[NSArray arrayWithObjects:spacer,update,spacer,nil] animated:YES];
    updater.progressBar = progressView;
    [updater checkForNewData:^(NSString *remoteVersion, NSData *downloadData, NSError *error) {
        [self handleNewData:remoteVersion path:downloadData error:error];
    }];
}
-(void)handleNewData:(NSString*)remoteVersion path:(NSData*)downloadData error:(NSError*)error
{
    NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
    NSString* currentVersion = [defaults stringForKey: kSpaceDockCurrentDataVersionKey];
    if ([currentVersion compare:remoteVersion] == NSOrderedAscending) {
        NSURL* url = [[[NSFileManager defaultManager] URLsForDirectory: NSDocumentDirectory inDomains: NSUserDomainMask] lastObject];
        NSString* appData = [url path];
        NSString* xmlFile = [appData stringByAppendingPathComponent: @"Data.xml"];
        [downloadData writeToFile:xmlFile atomically:NO];
        NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];

        DockDataLoader* loader = [[DockDataLoader alloc] initWithContext: self.managedObjectContext];
        NSError* err;
        [loader loadData: &err];
        [loader validateSpecials];
        [loader cleanupDatabase];

        NSString* dataVersion = [NSString stringWithFormat:@"Data Version: %@",[defaults stringForKey: kSpaceDockCurrentDataVersionKey]];
        self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:dataVersion];
    }
    UIToolbar* toolbar = self.navigationController.toolbar;
    [toolbar setItems:nil animated:YES];
    [self.refreshControl endRefreshing];
}

@end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Stapelia montana var. grossa L.C.Leach

### Remarks
null


text:
namespace base {
namespace {

const char kHomePage[] = "homepage";

class MockPrefStoreObserver : public PrefStore::Observer {
 public:
  MOCK_METHOD1(OnPrefValueChanged, void (const std::string&));
  MOCK_METHOD1(OnInitializationCompleted, void (bool));
};

class MockReadErrorDelegate : public PersistentPrefStore::ReadErrorDelegate {
 public:
  MOCK_METHOD1(OnError, void(PersistentPrefStore::PrefReadError));
};

}  // namespace

class JsonPrefStoreTest : public testing::Test {
 protected:
  virtual void SetUp() OVERRIDE {
    ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());

    ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir_));
    data_dir_ = data_dir_.AppendASCII("base");
    data_dir_ = data_dir_.AppendASCII("prefs");
    data_dir_ = data_dir_.AppendASCII("test");
    data_dir_ = data_dir_.AppendASCII("data");
    data_dir_ = data_dir_.AppendASCII("pref_service");
    LOG(WARNING) << data_dir_.value().c_str();
    ASSERT_TRUE(file_util::PathExists(data_dir_));
  }

  // The path to temporary directory used to contain the test operations.
  base::ScopedTempDir temp_dir_;
  // The path to the directory where the test data is stored.
  FilePath data_dir_;
  // A message loop that we can use as the file thread message loop.
  MessageLoop message_loop_;
};

// Test fallback behavior for a nonexistent file.
TEST_F(JsonPrefStoreTest, NonExistentFile) {
  FilePath bogus_input_file = data_dir_.AppendASCII("read.txt");
  ASSERT_FALSE(file_util::PathExists(bogus_input_file));
  scoped_refptr<JsonPrefStore> pref_store =
      new JsonPrefStore(
          bogus_input_file, message_loop_.message_loop_proxy());
  EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_NO_FILE,
            pref_store->ReadPrefs());
  EXPECT_FALSE(pref_store->ReadOnly());
}

// Test fallback behavior for an invalid file.
TEST_F(JsonPrefStoreTest, InvalidFile) {
  FilePath invalid_file_original = data_dir_.AppendASCII("invalid.json");
  FilePath invalid_file = temp_dir_.path().AppendASCII("invalid.json");
  ASSERT_TRUE(file_util::CopyFile(invalid_file_original, invalid_file));
  scoped_refptr<JsonPrefStore> pref_store =
      new JsonPrefStore(
          invalid_file, message_loop_.message_loop_proxy());
  EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_JSON_PARSE,
            pref_store->ReadPrefs());
  EXPECT_FALSE(pref_store->ReadOnly());

  // The file should have been moved aside.
  EXPECT_FALSE(file_util::PathExists(invalid_file));
  FilePath moved_aside = temp_dir_.path().AppendASCII("invalid.bad");
  EXPECT_TRUE(file_util::PathExists(moved_aside));
  EXPECT_TRUE(file_util::TextContentsEqual(invalid_file_original,
                                           moved_aside));
}

// This function is used to avoid code duplication while testing synchronous and
// asynchronous version of the JsonPrefStore loading.
void RunBasicJsonPrefStoreTest(JsonPrefStore* pref_store,
                               const FilePath& output_file,
                               const FilePath& golden_output_file) {
  const char kNewWindowsInTabs[] = "tabs.new_windows_in_tabs";
  const char kMaxTabs[] = "tabs.max_tabs";
  const char kLongIntPref[] = "long_int.pref";

  std::string cnn("http://www.cnn.com");

  const Value* actual;
  EXPECT_TRUE(pref_store->GetValue(kHomePage, &actual));
  std::string string_value;
  EXPECT_TRUE(actual->GetAsString(&string_value));
  EXPECT_EQ(cnn, string_value);

  const char kSomeDirectory[] = "some_directory";

  EXPECT_TRUE(pref_store->GetValue(kSomeDirectory, &actual));
  FilePath::StringType path;
  EXPECT_TRUE(actual->GetAsString(&path));
  EXPECT_EQ(FilePath::StringType(FILE_PATH_LITERAL("/usr/local/")), path);
  FilePath some_path(FILE_PATH_LITERAL("/usr/sbin/"));

  pref_store->SetValue(kSomeDirectory, new StringValue(some_path.value()));
  EXPECT_TRUE(pref_store->GetValue(kSomeDirectory, &actual));
  EXPECT_TRUE(actual->GetAsString(&path));
  EXPECT_EQ(some_path.value(), path);

  // Test reading some other data types from sub-dictionaries.
  EXPECT_TRUE(pref_store->GetValue(kNewWindowsInTabs, &actual));
  bool boolean = false;
  EXPECT_TRUE(actual->GetAsBoolean(&boolean));
  EXPECT_TRUE(boolean);

  pref_store->SetValue(kNewWindowsInTabs, new FundamentalValue(false));
  EXPECT_TRUE(pref_store->GetValue(kNewWindowsInTabs, &actual));
  EXPECT_TRUE(actual->GetAsBoolean(&boolean));
  EXPECT_FALSE(boolean);

  EXPECT_TRUE(pref_store->GetValue(kMaxTabs, &actual));
  int integer = 0;
  EXPECT_TRUE(actual->GetAsInteger(&integer));
  EXPECT_EQ(20, integer);
  pref_store->SetValue(kMaxTabs, new FundamentalValue(10));
  EXPECT_TRUE(pref_store->GetValue(kMaxTabs, &actual));
  EXPECT_TRUE(actual->GetAsInteger(&integer));
  EXPECT_EQ(10, integer);

  pref_store->SetValue(kLongIntPref,
                       new StringValue(base::Int64ToString(214748364842LL)));
  EXPECT_TRUE(pref_store->GetValue(kLongIntPref, &actual));
  EXPECT_TRUE(actual->GetAsString(&string_value));
  int64 value;
  base::StringToInt64(string_value, &value);
  EXPECT_EQ(214748364842LL, value);

  // Serialize and compare to expected output.
  ASSERT_TRUE(file_util::PathExists(golden_output_file));
  pref_store->CommitPendingWrite();
  MessageLoop::current()->RunUntilIdle();
  EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, output_file));
  ASSERT_TRUE(file_util::Delete(output_file, false));
}

TEST_F(JsonPrefStoreTest, Basic) {
  ASSERT_TRUE(file_util::CopyFile(data_dir_.AppendASCII("read.json"),
                                  temp_dir_.path().AppendASCII("write.json")));

  // Test that the persistent value can be loaded.
  FilePath input_file = temp_dir_.path().AppendASCII("write.json");
  ASSERT_TRUE(file_util::PathExists(input_file));
  scoped_refptr<JsonPrefStore> pref_store =
      new JsonPrefStore(
          input_file, message_loop_.message_loop_proxy());
  ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_NONE, pref_store->ReadPrefs());
  ASSERT_FALSE(pref_store->ReadOnly());

  // The JSON file looks like this:
  // {
  //   "homepage": "http://www.cnn.com",
  //   "some_directory": "/usr/local/",
  //   "tabs": {
  //     "new_windows_in_tabs": true,
  //     "max_tabs": 20
  //   }
  // }

  RunBasicJsonPrefStoreTest(pref_store,
                            input_file,
                            data_dir_.AppendASCII("write.golden.json"));
}

TEST_F(JsonPrefStoreTest, BasicAsync) {
  ASSERT_TRUE(file_util::CopyFile(data_dir_.AppendASCII("read.json"),
                                  temp_dir_.path().AppendASCII("write.json")));

  // Test that the persistent value can be loaded.
  FilePath input_file = temp_dir_.path().AppendASCII("write.json");
  ASSERT_TRUE(file_util::PathExists(input_file));
  scoped_refptr<JsonPrefStore> pref_store =
      new JsonPrefStore(
          input_file, message_loop_.message_loop_proxy());

  {
    MockPrefStoreObserver mock_observer;
    pref_store->AddObserver(&mock_observer);

    MockReadErrorDelegate* mock_error_delegate = new MockReadErrorDelegate;
    pref_store->ReadPrefsAsync(mock_error_delegate);

    EXPECT_CALL(mock_observer, OnInitializationCompleted(true)).Times(1);
    EXPECT_CALL(*mock_error_delegate,
                OnError(PersistentPrefStore::PREF_READ_ERROR_NONE)).Times(0);
    message_loop_.RunUntilIdle();
    pref_store->RemoveObserver(&mock_observer);

    ASSERT_FALSE(pref_store->ReadOnly());
  }

  // The JSON file looks like this:
  // {
  //   "homepage": "http://www.cnn.com",
  //   "some_directory": "/usr/local/",
  //   "tabs": {
  //     "new_windows_in_tabs": true,
  //     "max_tabs": 20
  //   }
  // }

  RunBasicJsonPrefStoreTest(pref_store,
                            input_file,
                            data_dir_.AppendASCII("write.golden.json"));
}

// Tests asynchronous reading of the file when there is no file.
TEST_F(JsonPrefStoreTest, AsyncNonExistingFile) {
  FilePath bogus_input_file = data_dir_.AppendASCII("read.txt");
  ASSERT_FALSE(file_util::PathExists(bogus_input_file));
  scoped_refptr<JsonPrefStore> pref_store =
      new JsonPrefStore(
          bogus_input_file, message_loop_.message_loop_proxy());
  MockPrefStoreObserver mock_observer;
  pref_store->AddObserver(&mock_observer);

  MockReadErrorDelegate *mock_error_delegate = new MockReadErrorDelegate;
  pref_store->ReadPrefsAsync(mock_error_delegate);

  EXPECT_CALL(mock_observer, OnInitializationCompleted(true)).Times(1);
  EXPECT_CALL(*mock_error_delegate,
              OnError(PersistentPrefStore::PREF_READ_ERROR_NO_FILE)).Times(1);
  message_loop_.RunUntilIdle();
  pref_store->RemoveObserver(&mock_observer);

  EXPECT_FALSE(pref_store->ReadOnly());
}

TEST_F(JsonPrefStoreTest, NeedsEmptyValue) {
  FilePath pref_file = temp_dir_.path().AppendASCII("write.json");

  ASSERT_TRUE(file_util::CopyFile(
      data_dir_.AppendASCII("read.need_empty_value.json"),
      pref_file));

  // Test that the persistent value can be loaded.
  ASSERT_TRUE(file_util::PathExists(pref_file));
  scoped_refptr<JsonPrefStore> pref_store =
      new JsonPrefStore(
          pref_file, message_loop_.message_loop_proxy());
  ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_NONE, pref_store->ReadPrefs());
  ASSERT_FALSE(pref_store->ReadOnly());

  // The JSON file looks like this:
  // {
  //   "list": [ 1 ],
  //   "list_needs_empty_value": [ 2 ],
  //   "dict": {
  //     "dummy": true,
  //   },
  //   "dict_needs_empty_value": {
  //     "dummy": true,
  //   },
  // }

  // Set flag to preserve empty values for the following keys.
  pref_store->MarkNeedsEmptyValue("list_needs_empty_value");
  pref_store->MarkNeedsEmptyValue("dict_needs_empty_value");

  // Set all keys to empty values.
  pref_store->SetValue("list", new base::ListValue);
  pref_store->SetValue("list_needs_empty_value", new base::ListValue);
  pref_store->SetValue("dict", new base::DictionaryValue);
  pref_store->SetValue("dict_needs_empty_value", new base::DictionaryValue);

  // Write to file.
  pref_store->CommitPendingWrite();
  MessageLoop::current()->RunUntilIdle();

  // Compare to expected output.
  FilePath golden_output_file =
      data_dir_.AppendASCII("write.golden.need_empty_value.json");
  ASSERT_TRUE(file_util::PathExists(golden_output_file));
  EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, pref_file));
}

}  // namespace base


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF">

    <include layout="@layout/activity_comment_header"></include>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_weight="1"
        android:layout_marginBottom="50dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <ImageView
                android:layout_marginLeft="10dp"
                android:layout_marginTop="5dp"
                android:clickable="true"
                android:src="@drawable/add"
                android:id="@+id/photo"
                android:layout_width="45dp"
                android:layout_height="45dp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@+id/comment_ID"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:layout_marginTop="5dp"
                        android:text="@string/question_ID"
                        android:textSize="15sp"
                        style="@style/home_interest"
                        android:paddingLeft="10dp"/>

                    <TextView
                        android:id="@+id/comment_date"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="5dp"
                        android:text="@string/date_comment"
                        android:textSize="15sp"
                        style="@style/home_interest"
                        android:paddingRight="10dp"/>

                </LinearLayout>

                <TextView
                    android:id="@+id/comment_response"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:text="@string/judge_comment"
                    android:textSize="13sp"
                    style="@style/home_interest"
                    android:paddingLeft="10dp"/>

            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <ImageView
                android:layout_marginRight="10dp"
                android:layout_marginLeft="245dp"
                android:clickable="true"
                android:src="@drawable/pressed_praise"
                android:id="@+id/turn_left"
                android:layout_width="23dp"
                android:layout_height="23dp" />

            <TextView
                android:id="@+id/praise_num"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:text="@string/praise_num"
                android:textSize="15sp"
                style="@style/home_interest"
                android:paddingRight="5dp"/>

            <TextView
                android:id="@+id/praise_comment"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:text="@string/praise_comment"
                android:textSize="15sp"
                style="@style/home_interest"
                android:paddingRight="10dp"/>

        </LinearLayout>

        <ImageView
            android:background="#EAEAEA"
            android:layout_width="match_parent"
            android:layout_height="1dp" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </LinearLayout>
    </LinearLayout>

    <include layout="@layout/activity_comment_bottom"></include>

</LinearLayout>


text:
<?php

declare(strict_types=1);

namespace AspectMock\Proxy;

use AspectMock\Util\ArgumentsFormatter;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\ExpectationFailedException;

/**
 * Interface `Verifiable` defines methods to verify method calls.
 * Implementation may differ for class methods and instance methods.
 */
abstract class Verifier {

    /**
     *  Name of a class.
     */
    public $className;

    protected string $invokedFail = "Expected %s to be invoked but it never occurred. Got: %s";

    protected string $notInvokedMultipleTimesFail = "Expected %s to be invoked %s times but it never occurred.";

    protected string $invokedMultipleTimesFail = "Expected %s to be invoked but called %s times but called %s.";

    protected string $neverInvoked = "Expected %s not to be invoked but it was.";

    abstract public function getCallsForMethod($method);

    protected function callSyntax($method): string
    {
        return method_exists($this->className,$method)
            ? '::'
            : '->';
    }

    protected function onlyExpectedArguments($expectedParams, $passedArgs)
    {
        return empty($expectedParams) ?
            $passedArgs :
            array_slice($passedArgs, 0, count($expectedParams));
    }

    /**
     * Verifies a method was invoked at least once.
     * In second argument you can specify with which params method expected to be invoked;
     *
     * ``` php
     * <?php
     * $user->verifyInvoked('save');
     * $user->verifyInvoked('setName',['davert']);
     *
     * ```
     */
    public function verifyInvoked(string $name, $params = null)
    {
        $calls = $this->getCallsForMethod($name);
        $separator = $this->callSyntax($name);

        if (empty($calls)) throw new ExpectationFailedException(sprintf($this->invokedFail, $this->className.$separator.$name, ''));

        if (is_array($params)) {
            foreach ($calls as $args) {
                if ($this->onlyExpectedArguments($params, $args) === $params) return;
            }

            $params    = ArgumentsFormatter::toString($params);
            $gotParams = ArgumentsFormatter::toString($calls[0]);
            throw new ExpectationFailedException(sprintf($this->invokedFail, $this->className.$separator.$name.sprintf('(%s)', $params), $this->className.$separator.$name.sprintf('(%s)', $gotParams)));
        } elseif (is_callable($params)) {
            $params($calls);
        }
    }

    /**
     * Verifies that method was invoked only once.
     */
    public function verifyInvokedOnce(string $name, $params = null): void
    {
        $this->verifyInvokedMultipleTimes($name, 1, $params);
    }

    /**
     * Verifies that method was called exactly $times times.
     *
     * ``` php
     * <?php
     * $user->verifyInvokedMultipleTimes('save',2);
     * $user->verifyInvokedMultipleTimes('dispatchEvent',3,['before_validate']);
     * $user->verifyInvokedMultipleTimes('dispatchEvent',4,['after_save']);
     * ```
     *
     * @throws ExpectationFailedException
     */
    public function verifyInvokedMultipleTimes(string $name, int $times, $params = null)
    {
        if ($times == 0) return $this->verifyNeverInvoked($name, $params);

        $calls = $this->getCallsForMethod($name);
        $separator = $this->callSyntax($name);

        if (empty($calls)) throw new ExpectationFailedException(sprintf($this->notInvokedMultipleTimesFail, $this->className.$separator.$name, $times));

        if (is_array($params)) {
            $equals = 0;
            foreach ($calls as $args) {
                if ($this->onlyExpectedArguments($params, $args) === $params) {
                    ++$equals;
                }
            }

            if ($equals == $times) {
                Assert::assertTrue(true);
                return;
            }

            $params = ArgumentsFormatter::toString($params);
            throw new ExpectationFailedException(sprintf($this->invokedMultipleTimesFail, $this->className.$separator.$name.sprintf('(%s)', $params), $times, $equals));
        } elseif (is_callable($params)) {
            $params($calls);
        }

        $num_calls = count($calls);
        if ($num_calls != $times) throw new ExpectationFailedException(sprintf($this->invokedMultipleTimesFail, $this->className.$separator.$name, $times, $num_calls));

        Assert::assertTrue(true);
    }

    /**
     * Verifies that method was not called.
     * In second argument with which arguments is not expected to be called.
     *
     * ``` php
     * <?php
     * $user->setName('davert');
     * $user->verifyNeverInvoked('setName'); // fail
     * $user->verifyNeverInvoked('setName',['davert']); // fail
     * $user->verifyNeverInvoked('setName',['bob']); // success
     * $user->verifyNeverInvoked('setName',[]); // success
     * ```
     *
     * @throws ExpectationFailedException
     */
    public function verifyNeverInvoked(string $name, $params = null)
    {
        $calls = $this->getCallsForMethod($name);
        $separator = $this->callSyntax($name);

        if (is_array($params)) {
            if (empty($calls)) {
                Assert::assertTrue(true);
                return;
            }

            foreach ($calls as $args) {
                if ($this->onlyExpectedArguments($params, $args) === $params) {
                    throw new ExpectationFailedException(sprintf($this->neverInvoked, $this->className));
                }
            }

            Assert::assertTrue(true);
            return;
        }

        if (count($calls) > 0) {
            throw new ExpectationFailedException(sprintf($this->neverInvoked, $this->className.$separator.$name));
        }

        Assert::assertTrue(true);
    }
}


text:
module MultiTenancy
  module SubdomainTenantResolver
    extend ActiveSupport::Concern

    included do
    end

    module ClassMethods
      def resolve_tenant_by_subdomain
        helper_method :current_tenant

        include MultiTenancy::SubdomainTenantResolver::LocalInstanceMethods
      end
    end

    module LocalInstanceMethods
      def current_tenant
        @current_tenant ||= find_by_subdomain(request.subdomains.first)
      end

      def find_by_subdomain(subdomain)
        Tenant.find_by_subdomain(subdomain)
      end
    end
  end
end

ActionController::Base.send :include, MultiTenancy::SubdomainTenantResolver


text:
package com.example.administrator.bookcrossingapp.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.administrator.bookcrossingapp.R;
import com.example.administrator.bookcrossingapp.datamodel.Records;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2018/4/7.
 */

public class RecordsAdapter extends RecyclerView.Adapter<RecordsAdapter.ViewHolder> {

    private List<Records> mRecordsList;
    private Context context;

    static class ViewHolder extends RecyclerView.ViewHolder {
        ImageView img_pic;
        TextView tv_bookname;
        TextView tv_state;
        TextView tv_exchangeuser;
        TextView tv_time;

        public ViewHolder(View view) {
            super(view);
            img_pic = view.findViewById(R.id.records_pic);
            tv_bookname = view.findViewById(R.id.records_bookname);
            tv_state = view.findViewById(R.id.records_state);
            tv_exchangeuser = view.findViewById(R.id.records_exchange);
            tv_time = view.findViewById(R.id.records_time);
        }
    }

    public RecordsAdapter(List<Records> RecordsList) {
        mRecordsList = RecordsList;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        context = parent.getContext();
        //照书上的打会只有一条,改为null,原因可能是版本23以上的问题
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_records_item, parent, false);
        ViewHolder holder = new ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(RecordsAdapter.ViewHolder holder, int position) {
        Records records = mRecordsList.get(position);

        holder.tv_bookname.setText(records.getRecordsBookname());
        holder.tv_exchangeuser.setText("from: " + records.getRecordsExchangeUser());
        holder.tv_state.setText("已归还");
        String disTime = "From:" + new SimpleDateFormat("yyyy-MM-dd").format(new Date(records.getStartTime())) + " To:" + new SimpleDateFormat("yyyy-MM-dd").format(new Date(records.getRecordsTime()));
        holder.tv_time.setText(disTime);
        Glide.with(context).load("http://120.24.217.191/Book/img/bookImg/" + records.getRecordsBooknameURL()).into(holder.img_pic);

    }

    @Override
    public int getItemCount() {
        return mRecordsList.size();
    }
}


text:
var TimeCalcQueue = require('../util/TimeCalcQueue');

const DEFAULT_SAMPLE_FREQ = 50;
const DEFAULT_TIME_WINDOW = 10000;
const DEFAULT_TICK_BATCH = 1000;

function getReport(calcQueue, tickBatch) {
	var loopAvg = calcQueue.getAverage();
	return {
		avgMs: Math.floor(loopAvg * 1000) / 1000 || 0,
		maxMs: calcQueue.getMaximum() || 0,
		perSec: loopAvg ? Math.floor(1000 / (loopAvg / tickBatch)) : 0
	};
}

/**
 * Schedules a callback to be executed in a certain number of ticks.
 *
 * @param {Number} ticks The number of ticks that should execute before the
 *      callback is fired.
 * @param {Function} cb A callback argument to be fired after waiting the
 *      specified number of ticks.
 */
function inTicks(ticks, cb) {
	if (ticks > 0) {
		// As of Node.js v0.10.0, setImmediate fires on the next tick, while
		// process.nextTick executes immediately.  This is not a joke.
		var nextTick = setImmediate || process.nextTick;
		nextTick(function() {
			inTicks(ticks - 1, cb);
		});
	}
	else
		cb();
}

/**
 * Initialize the VitalSigns module.
 *
 * @param {{window, batch, freq}} options
 * @returns {{name: string, report: Function, destroy: Function}}
 */
module.exports = function(options) {
	if (!options)
		options = {};
	var running = true,
		loopTimes = new TimeCalcQueue(options.window || DEFAULT_TIME_WINDOW),
		tickBatch = options.batch || DEFAULT_TICK_BATCH;

	/**
	 * Starts an ongoing process that measures the amount of time the event
	 * loop takes to complete a full circuit.
	 */
	function startLoopMonitor() {
		setTimeout(function() {
			var loopStart = new Date().getTime();
			inTicks(tickBatch, function() {
				loopTimes.push(new Date().getTime() - loopStart);
				if (running)
					startLoopMonitor();
			});
		}, options.freq || DEFAULT_SAMPLE_FREQ);
	}
	startLoopMonitor();

	return {
		name: 'tick',
		report: getReport.bind(null, loopTimes, tickBatch),
		destroy: function() { running = false; }
	};
};


text:
package com.google.api.codegen.config;

import com.google.api.codegen.util.Name;
import com.google.api.tools.framework.model.ProtoFile;
import javax.annotation.Nullable;

/**
 * AnyResourceNameConfig is a singleton configuration indicating acceptance of any resource name
 * format.
 */
public class AnyResourceNameConfig implements ResourceNameConfig {

  public static final String ENTITY_NAME = "resource_name";

  public static final String GAPIC_CONFIG_ANY_VALUE = "*";

  private static AnyResourceNameConfig instance = new AnyResourceNameConfig();

  public static AnyResourceNameConfig instance() {
    return instance;
  }

  private AnyResourceNameConfig() {}

  @Override
  public ResourceNameType getResourceNameType() {
    return ResourceNameType.ANY;
  }

  @Override
  public String getEntityId() {
    return ENTITY_NAME;
  }

  @Override
  public Name getEntityName() {
    return Name.from(ENTITY_NAME);
  }

  @Override
  @Nullable
  public String getCommonResourceName() {
    return null;
  }

  @Override
  public ProtoFile getAssignedProtoFile() {
    return null;
  }
}


text:
Providers
=========

When using Moya, you make all API requests through a `MoyaProvider` instance,
passing in a value of your enum that specifies which endpoint you want to call.
After setting up your [Endpoint](Endpoints.md), you're basically all set for
basic usage:

```swift
let GitHubProvider = MoyaProvider<GitHub>()
```

After that simple setup, you're off to the races:

```swift
provider.request(.Zen) { (data, statusCode, response, error) in
    if let data = data {
        // do something with the data
    }
}
```

That's it! The `request()` method returns a `Cancellable`, which has
only one public function, `cancel()`, which you can use to cancel the
request.

Remember, *where* you put your target and the provider, are completely up
to you. You can check out [Artsy's implementation](https://github.com/artsy/eidolon/blob/master/Kiosk/App/Networking/ArtsyAPI.swift)
for an example.

Advanced Use
------------

The first (optional) parameter for the `MoyaProvider` initializer is an
endpoints closure, which is responsible for mapping a value of your enum to a
concrete `Endpoint` instance. Let's take a look at what one might look like.

```swift
let endpointClosure = { (target: MyTarget) -> Endpoint<MyTarget> in
    let url = target.baseURL.URLByAppendingPathComponent(target.path).absoluteString
    return Endpoint(URL: url, sampleResponseClosure: {.NetworkResponse(200, target.sampleData)}, method: target.method, parameters: target.parameters)
}
let provider = MoyaProvider(endpointClosure: endpointClosure)
```

Notice that we don't have to specify the generic type in the `MoyaProvider`
initializer anymore, since Swift will infer it from the type of our
`endpointClosure`. Neat!

This `endpointClosure` is about as simple as you can get. It's actually the
default implementation, too, stored in `MoyaProvider.DefaultEndpointMapping`.
Check out the [Endpoints](Endpoints.md) documentation for more on _why_ you
might want to customize this.

The next optional initializer parameter is `requestClosure`, which resolves
an `Endpoint` to an actual `NSURLRequest`. Again, check out the [Endpoints](Endpoints.md)
documentation for how and why you'd do this.

The next option is to provide a `stubClosure`. This returns one of either `.Never` (the
default), `.Immediate` or `.Delayed(seconds)`, where you can delay the stubbed
request by a certain number of seconds. For example, `.Delayed(0.2)` would delay
every stubbed request. This can be good for simulating network delays in unit tests.

What's nice is that if you need to stub some requests differently than others,
you can use your own closure.

```swift
let provider = MoyaProvider<MyTarget>(stubClosure: { target: MyTarget -> Moya.StubBehavior in
	switch target {
		/* Return something different based on the target. */
	}
})
```

But usually you want the same stubbing behaviour for all your targets. There are
three class methods on `MoyaProvider` you can use instead.

```swift
MoyaProvider.NeverStub
MoyaProvider.ImmediatelyStub
MoyaProvider.DelayedStub(seconds)
```

So, in the above example, if you wanted immediate stubbing behaviour for all
targets, either of the following would work.

```swift
let provider = MoyaProvider<MyTarget>(stubClosure: { (_: MyTarget) -> Moya.StubBehavior in return .Immediate })
let provider = MoyaProvider<MyTarget>(stubBehavior: MoyaProvider.ImmediatelyStub)
```

Next, there's the `manager` parameter. By default you'll get `Alamofire.Manager.sharedinstance`.
If you'd like to customize the manager, for example, to add SSL pinning, create one and pass it in,
all requests will route through the custom configured manager.

```swift
let policies: [String: ServerTrustPolicy] = [
    "example.com": .PinPublicKeys(
        publicKeys: ServerTrustPolicy.publicKeysInBundle(),
        validateCertificateChain: true,
        validateHost: true
    )
]

let manager = Manager(
    configuration: NSURLSessionConfiguration.defaultSessionConfiguration(),
    serverTrustPolicyManager: ServerTrustPolicyManager(policies: policies)
)

let provider = MoyaProvider<MyTarget>(manager: manager)
```

Finally, you may also provide an array of `plugins` to the provider. These receive callbacks
before a request is sent and after a response is received. There are a few plugins
included already: one for network activity (`NetworkActivityPlugin`), one for logging
all network activity (`NetworkLoggerPlugin`), and another for [HTTP Authentication](Authentication.md).

```
public final class NetworkActivityPlugin: PluginType {

    public typealias NetworkActivityClosure = (change: NetworkActivityChangeType) -> ()
    let networkActivityClosure: NetworkActivityClosure

    public init(networkActivityClosure: NetworkActivityClosure) {
        self.networkActivityClosure = networkActivityClosure
    }

    // MARK: Plugin

    /// Called by the provider as soon as the request is about to start
    public func willSendRequest(request: RequestType, target: TargetType) {
        networkActivityClosure(change: .Began)
    }

    /// Called by the provider as soon as a response arrives
    public func didReceiveResponse(data: NSData?, statusCode: Int?, response: NSURLResponse?, error: ErrorType?, target: TargetType) {
        networkActivityClosure(change: .Ended)
    }
}
```

For instance, if you want to add a `NetworkActivityPlugin`, it requires a `networkActivityClosure` parameter.
This is a closure that you can provide to be notified whenever a network request begins or
ends. This is useful for working with the [network activitiy indicator](https://github.com/thoughtbot/BOTNetworkActivityIndicator).
Note that signature of this closure is `(change: NetworkActivityChangeType) -> ()`,
so you will only be notified when a request has `.Began` or `.Ended` –
you aren't provided any other details about the request itself.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>S-Index</title>
<meta name="date" content="2017-05-10">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A C D G H I L M N O P R S T U W

S

Screen1Controller - Class in screenSwapTesting

Screen1Controller() - Constructor for class screenSwapTesting.Screen1Controller

screen1File - Static variable in class screenSwapTesting.ScreensFramework

screen1File - Static variable in class template.ScreensFramework

screen1ID - Static variable in class screenSwapTesting.ScreensFramework

screen1ID - Static variable in class template.ScreensFramework

Screen2Controller - Class in screenSwapTesting

Screen2Controller() - Constructor for class screenSwapTesting.Screen2Controller

screen2File - Static variable in class screenSwapTesting.ScreensFramework

screen2File - Static variable in class template.ScreensFramework

screen2ID - Static variable in class screenSwapTesting.ScreensFramework

screen2ID - Static variable in class template.ScreensFramework

screen3File - Static variable in class template.ScreensFramework

screen3ID - Static variable in class template.ScreensFramework

screen4File - Static variable in class template.ScreensFramework

screen4ID - Static variable in class template.ScreensFramework

screens - Variable in class screenSwapTesting.ScreensController

screens - Variable in class template.ScreensController

ScreensController - Class in screenSwapTesting

ScreensController() - Constructor for class screenSwapTesting.ScreensController

ScreensController - Class in template

by Jack and Ben

ScreensController() - Constructor for class template.ScreensController

ScreensFramework - Class in screenSwapTesting

ScreensFramework() - Constructor for class screenSwapTesting.ScreensFramework

ScreensFramework - Class in template

ScreensFramework() - Constructor for class template.ScreensFramework

screenSwapTesting - package screenSwapTesting

searchFilesByType(String, String) - Method in class Rename.Controller

sender - Variable in class template.optionsController

setCopyCMD(String) - Method in class Rename.Controller

setDate(String, String, String) - Method in class options.ControlOptions

setDate() - Method in class template.optionsController

setDate(String) - Method in class textfile.textFileController

setDirectory() - Method in class template.optionsController

setFirstLaunch(String) - Method in class textfile.textFileController

setInput(String) - Method in class options.ControlOptions

setInput() - Method in class template.optionsController

setInput(String) - Method in class textfile.textFileController

setMoveCMD(String) - Method in class Rename.Controller

setOperatingSystem() - Method in class template.optionsController

setOperatingSystem() - Method in class template.splashController

This function double checks the selected radio button, then loads the operatingSystemSelected string into the options text file

setOperatingSystemMac() - Method in class screenSwapTesting.Screen1Controller

setOperatingSystemMac() - Method in class screenSwapTesting.Screen2Controller

setOperatingSystemMac() - Method in class splash.Controller

setOperatingSystemWindows() - Method in class screenSwapTesting.Screen1Controller

setOperatingSystemWindows() - Method in class screenSwapTesting.Screen2Controller

setOperatingSystemWindows() - Method in class splash.Controller

setOptions(textFileController) - Method in class Rename.Controller

setOS() - Method in class options.ControlOptions

setOS() - Method in class Rename.Controller

setOS(String) - Method in class textfile.textFileController

setOSMac() - Method in class template.splashController

setOSWindows() - Method in class template.splashController

setOutput(String) - Method in class options.ControlOptions

setOutput() - Method in class template.optionsController

setOutput(String) - Method in class textfile.textFileController

setPath(String) - Method in class textfile.textFileController

setScreen(String) - Method in class screenSwapTesting.ScreensController

setScreen(String) - Method in class template.ScreensController

setScreenParent(ScreensController) - Method in interface screenSwapTesting.ControlledScreen

setScreenParent(ScreensController) - Method in class screenSwapTesting.Screen1Controller

setScreenParent(ScreensController) - Method in class screenSwapTesting.Screen2Controller

setScreenParent(ScreensController) - Method in interface template.ControlledScreen

setScreenParent(ScreensController) - Method in class template.deleteController

setScreenParent(ScreensController) - Method in class template.optionsController

setScreenParent(ScreensController) - Method in class template.renameController

setScreenParent(ScreensController) - Method in class template.splashController

This function injects the screen and controller into a screenParent node

splash - package splash

splashController - Class in template

splashController() - Constructor for class template.splashController

start(Stage) - Method in class Rename.Main

start(Stage) - Method in class screenSwapTesting.ScreensFramework

start(Stage) - Method in class splash.Main

start(Stage) - Method in class template.main

start(Stage) - Method in class template.ScreensFramework

suggestDelete() - Method in class template.deleteController

Suggests files for deletion

A C D G H I L M N O P R S T U W

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes