text:
package vlabs

import "fmt"

// UpgradeContainerService API model
type UpgradeContainerService struct {
	OrchestratorProfile *OrchestratorProfile `json:"orchestratorProfile,omitempty"`
}

// Validate implements APIObject
func (ucs *UpgradeContainerService) Validate() error {
	switch ucs.OrchestratorProfile.OrchestratorType {
	case DCOS:
	case Swarm:
	case SwarmMode:
		return fmt.Errorf("Upgrade is not supported for orchestrator: %s", ucs.OrchestratorProfile.OrchestratorType)
	case Kubernetes:
		switch ucs.OrchestratorProfile.OrchestratorVersion {
		case Kubernetes162:
		case Kubernetes160:
		default:
			return fmt.Errorf("Invalid orchestrator version: %s", ucs.OrchestratorProfile.OrchestratorVersion)
		}
	}

	return nil
}


text:
<?php

namespace Symfony\Component\Validator;

use Psr\Container\ContainerInterface;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\ValidatorException;

/**
 * Uses a service container to create constraint validators.
 *
 * @author Kris Wallsmith <kris@symfony.com>
 */
class ContainerConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
{
    private ContainerInterface $container;
    private array $validators;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
        $this->validators = [];
    }

    /**
     * {@inheritdoc}
     *
     * @throws ValidatorException      When the validator class does not exist
     * @throws UnexpectedTypeException When the validator is not an instance of ConstraintValidatorInterface
     */
    public function getInstance(Constraint $constraint): ConstraintValidatorInterface
    {
        $name = $constraint->validatedBy();

        if (!isset($this->validators[$name])) {
            if ($this->container->has($name)) {
                $this->validators[$name] = $this->container->get($name);
            } else {
                if (!class_exists($name)) {
                    throw new ValidatorException(sprintf('Constraint validator "%s" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "%s".', $name, get_debug_type($constraint)));
                }

                $this->validators[$name] = new $name();
            }
        }

        if (!$this->validators[$name] instanceof ConstraintValidatorInterface) {
            throw new UnexpectedTypeException($this->validators[$name], ConstraintValidatorInterface::class);
        }

        return $this->validators[$name];
    }
}

redpajama_set_name: RedPajamaGithub


text:
package io.fintrospect.parameters

trait FormField[T]
  extends BodyParameter {
  override val example = None
  override val where = "form"
}

private object FormFieldExtractAndRebind extends ParameterExtractAndBind[Form, String, FormFieldBinding] {
  def newBinding(parameter: Parameter, value: String) = new FormFieldBinding(parameter, value)

  def valuesFrom(parameter: Parameter, form: Form): Option[Seq[String]] = form.fields.get(parameter.name).map(_.toSeq)
}

object FormField {

  type Mandatory[T] = MandatoryParameter[Form, T, FormFieldBinding]

  type MandatorySeq[T] = MandatoryParameter[Form, Seq[T], FormFieldBinding]

  type Optional[T] = OptionalParameter[Form, T, FormFieldBinding]

  type OptionalSeq[T] = OptionalParameter[Form, Seq[T], FormFieldBinding]

  type FSeq[T] = FormField[Seq[T]]

  trait WithFile[T] {
    def file(name: String, description: String = null): T
  }

  val required = new Parameters[FormField, Mandatory]
    with WithFile[FormFile.Mandatory]
    with MultiParameters[FSeq, MandatorySeq] {
    override def apply[T](spec: ParameterSpec[T], name: String, description: String = null) =
      new SingleMandatoryParameter(name, description, spec, FormFieldExtractAndRebind) with FormField[T] with Mandatory[T]

    def file(name: String, description: String = null) = new SingleMandatoryFormFile(name, description) with FormFile.Mandatory

    override def * = multi

    override val multi = new Parameters[FSeq, MandatorySeq]
      with WithFile[MultiMandatoryFormFile with FormFile.MandatorySeq] {

      override def apply[T](spec: ParameterSpec[T], name: String, description: String = null) =
        new MultiMandatoryParameter(name, description, spec, FormFieldExtractAndRebind) with FSeq[T] with MandatorySeq[T]

      def file(name: String, description: String = null) = new MultiMandatoryFormFile(name, description) with FormFile.MandatorySeq
    }
  }

  val optional = new Parameters[FormField, Optional]
    with WithFile[FormFile.Optional]
    with MultiParameters[FSeq, OptionalSeq] {

    override def apply[T](spec: ParameterSpec[T], name: String, description: String = null) =
      new SingleOptionalParameter(name, description, spec, FormFieldExtractAndRebind) with FormField[T] with Optional[T]

    def file(name: String, description: String = null) = new SingleOptionalFormFile(name, description) with FormFile.Optional

    override def * = multi

    override val multi = new Parameters[FSeq, OptionalSeq]
      with WithFile[MultiOptionalFormFile with FormFile.OptionalSeq] {
      override def apply[T](spec: ParameterSpec[T], name: String, description: String = null) =
        new MultiOptionalParameter(name, description, spec, FormFieldExtractAndRebind) with FSeq[T] with OptionalSeq[T]

      def file(inName: String, description: String = null) = new MultiOptionalFormFile(inName, description) with FormFile.OptionalSeq
    }
  }
}


text:
package com.blogspot.sontx.bottle.view.interfaces;

public interface LoadingView extends ViewBase {
    void onLoadSuccess();

    void navigateToErrorActivity(String message);

    boolean isServiceRunning(Class<?> serviceClass);
}


text:
var i;
var map;
var menu;
var out1;
var out;
var user_index;

var emptyDex = [];
var forts = [];
var info_windows = [];
var outArray = [];
var numTrainers = [
  177,
  109
];
var teams = [
  'TeamLess',
  'Mystic',
  'Valor',
  'Instinct'
];
var trainerSex = [
  'm',
  'f'
];

var pathcoords = {};
var bagCandy = {};
var bagItems = {};
var bagPokemon = {};
var inventory = {};
var playerInfo = {};
var pokedex = {};
var pokemonArray = {};
var stats = {};
var user_data = {};
var itemsArray = {
  '0': 'Unknown',
  '1': 'Pokeball',
  '2': 'Greatball',
  '3': 'Ultraball',
  '4': 'Masterball',
  '101': 'Potion',
  '102': 'Super Potion',
  '103': 'Hyper Potion',
  '104': 'Max Potion',
  '201': 'Revive',
  '202': 'Max Revive',
  '301': 'Lucky Egg',
  '401': 'Incense',
  '402': 'Spicy Incense',
  '403': 'Cool Incense',
  '404': 'Floral Incense',
  '501': 'Troy Disk',
  '602': 'X Attack',
  '603': 'X Defense',
  '604': 'X Miracle',
  '701': 'Razz Berry',
  '702': 'Bluk Berry',
  '703': 'Nanab Berry',
  '704': 'Wepar Berry',
  '705': 'Pinap Berry',
  '801': 'Special Camera',
  '901': 'Incubator (Unlimited)',
  '902': 'Incubator',
  '1001': 'Pokemon Storage Upgrade',
  '1002': 'Item Storage Upgrade'
};

var stats_at_start = {};

$(document).ready(function() {
  loadScript("https://maps.googleapis.com/maps/api/js?key=" + gMapsAPIKey + "&libraries=drawing&callback=initMap");

  $('select').material_select();
  $('.modal-trigger').leanModal();
  $(".side-info").sideNav({
    menuWidth: 300, // Default is 240
    edge: 'right', // Choose the horizontal origin
    closeOnClick: true // Closes side-nav on  clicks, useful for Angular/Meteor
  });
  $('.dropdown-button').dropdown({
    inDuration: 300,
    outDuration: 225,
    constrain_width: false, // Does not change width of dropdown to that of the activator
    hover: true, // Activate on hover
    gutter: 0, // Spacing from edge
    belowOrigin: true, // Displays dropdown below the button
    alignment: 'left' // Displays dropdown with edge aligned to the left of button
  });
  var ipcRenderer = require('electron').ipcRenderer;
  $('#logout').click(function() {
    ipcRenderer.send('logout');
  });
  ipcRenderer.on('pythonLog', function(evt, data) {
    var lines = data.msg.split("\n")
    for (var i = 0; i < lines.length; i++) {
        log(lines[i]);
    }
    console.log(data.msg);
  });
});

function loadScript(src) {
  var element = document.createElement("script");
  element.src = src;
  document.body.appendChild(element);
}

function initMap() {
  loadJSON('../resources/data/pokemondata.json', function(data, successData) {
    console.log('Loaded pokemon data..');
    pokemonArray = data;
  }, errorFunc, 'pokemonData');
  for (var i = 0; i < users.length; i++) {
    user_data[users[i]] = {};
    pathcoords[users[i]] = [];
  }
  map = new google.maps.Map(document.getElementById('map'), {
    center: {lat: 37.0902, lng: -95.7129},
    zoom: 3
  });

  document.getElementById('switchPan').checked = userFollow;
  document.getElementById('switchZoom').checked = userZoom;
  document.getElementById('imageType').checked = (imageExt != '.png');
  document.getElementById('strokeOn').checked = true;
  setTimeout(function(){
    placeTrainer();
    addCatchable();
    addInventory();
    setTimeout(function(){
      setInterval(updateTrainer, 1000);
      setInterval(updateData, 1000);
      setInterval(addCatchable, 1000);
      setInterval(addInventory,1000);
    }, 100);
  }, 1000);
}

$('#switchPan').change(function(){
    if (this.checked) {
      userFollow = true;
    } else {
      userFollow = false;
    }
});

$('#switchZoom').change(function(){
    if (this.checked) {
      userZoom = true;
    } else {
      userZoom = false;
    }
});

$('#imageType').change(function(){
    if (this.checked) {
      imageExt = '.gif';
    } else {
      imageExt = '.png';
    }
});

$('#strokeOn').change(function(){
    for (var i = 0; i < users.length; i++) {
        user_data[users[i]].trainerPath.setOptions({strokeOpacity: this.checked ? 1.0 : 0.0})
    }
});

$('#btn-info').click(function(){
    fillInventory();
});

var updateData = function() {
  document.getElementById('username').innerHTML = users[0];
  document.getElementById('level').innerHTML = "Level "+stats[0].inventory_item_data.player_stats.level;
}

var errorFunc = function(xhr) {
  console.error(xhr);
};

var invSuccess = function(data, user_index) {
  bagCandy = filter(data, 'pokemon_family');
  bagItems = filter(data, 'item');
  bagPokemon = sortPokemonsByKey(filter(data, 'pokemon_data'), 'cp');
  pokedex = filter(data, 'pokedex_entry');
  stats = filter(data, 'player_stats');
  if(!stats_at_start.saved)
  {
      stats_at_start.bagCandy = filter(data, 'pokemon_family');
      stats_at_start.bagItems = filter(data, 'item');
      stats_at_start.bagPokemon = sortPokemonsByKey(filter(data, 'pokemon_data'), 'cp');
      stats_at_start.pokedex = filter(data, 'pokedex_entry');
      stats_at_start.stats = filter(data, 'player_stats');
      stats_at_start.saved = true;
  }
};

var trainerFunc = function(data, user_index) {
  for (var i = 0; i < data.cells.length; i++) {
    cell = data.cells[i];
    if (data.cells[i].forts != undefined) {
      for (var x = 0; x < data.cells[i].forts.length; x++) {
        var fort = cell.forts[x];
        if (!forts[fort.id]) {
          if (fort.type === 1 ) {
            forts[fort.id] = new google.maps.Marker({
              map: map,
              position: {
                lat: parseFloat(fort.latitude),
                lng: parseFloat(fort.longitude)
              },
              icon: '../resources/image/forts/img_pokestop.png'
            });
          } else {
            forts[fort.id] = new google.maps.Marker({
              map: map,
              position: {
                lat: parseFloat(fort.latitude),
                lng: parseFloat(fort.longitude)
              },
              icon: '../resources/image/forts/' + teams[fort.owned_by_team] + '.png'
            });
          }
          fortPoints = '';
          fortTeam = '';
          fortType = 'PokeStop';
          pokemonGuard = '';
          if (fort.guard_pokemon_id != undefined) {
            fortPoints = 'Points: ' + fort.gym_points;
            fortTeam = 'Team: ' + teams[fort.owned_by_team] + '
';
            fortType = 'Gym';
            pokemonGuard = 'Guard Pokemon: ' + pokemonArray[fort.guard_pokemon_id-1].Name + '
';
          }
          var contentString = 'Id: ' + fort.id + '
Type: ' + fortType + '
' + pokemonGuard + fortPoints;
          info_windows[fort.id] = new google.maps.InfoWindow({
            content: contentString
          });
          google.maps.event.addListener(forts[fort.id], 'click', (function(marker, content, infowindow) {
            return function() {
              infowindow.setContent(content);
              infowindow.open(map, marker);
            };
          })(forts[fort.id], contentString, info_windows[fort.id]));
        }
      }
    }
  }
  if (pathcoords[users[user_index]][pathcoords[users[user_index]].length] > 1) {
    var tempcoords = [{lat: parseFloat(data.lat), lng: parseFloat(data.lng)}];
    if (tempcoords.lat != pathcoords[users[user_index]][pathcoords[users[user_index]].length-1].lat && tempcoords.lng != pathcoords[users[user_index]][pathcoords[users[user_index]].length-1].lng || pathcoords[users[user_index]].length === 1) {
      pathcoords[users[user_index]].push({lat: parseFloat(data.lat), lng: parseFloat(data.lng)})
    }
  } else {
    pathcoords[users[user_index]].push({lat: parseFloat(data.lat), lng: parseFloat(data.lng)})
  }
  if (user_data[users[user_index]].hasOwnProperty('marker') === false) {
    randomSex = Math.floor(Math.random() * 1);
    user_data[users[user_index]].marker = new google.maps.Marker({
      map: map,
      position: {lat: parseFloat(data.lat), lng: parseFloat(data.lng)},
      icon: '../resources/image/trainer/' + trainerSex[randomSex] + Math.floor(Math.random() * numTrainers[randomSex]) + '.png',
      zIndex: 2,
      label: users[user_index]
    });
  } else {
    user_data[users[user_index]].marker.setPosition({lat: parseFloat(data.lat), lng: parseFloat(data.lng)});
    if (pathcoords[users[user_index]].length === 2) {
      user_data[users[user_index]].trainerPath = new google.maps.Polyline({
        map: map,
        path: pathcoords[users[user_index]],
        geodisc: true,
        strokeColor: '#FF0000',
        strokeOpacity: 0.7,
        strokeWeight: 2
      });
    } else {
      user_data[users[user_index]].trainerPath.setPath(pathcoords[users[user_index]]);
    }
  }
  if (users.length === 1 && userZoom === true) {
    map.setZoom(16);
  }
  if (users.length === 1 && userFollow === true) {
    map.panTo({
      lat: parseFloat(data.lat),
      lng: parseFloat(data.lng)
    });
  }
};

function placeTrainer() {
  for (var i = 0; i < users.length; i++) {
    loadJSON('../gofbot/web/location-' + users[i] + '.json', trainerFunc, errorFunc, i);
  }
}
function updateTrainer() {
  for (var i = 0; i < users.length; i++) {
    loadJSON('../gofbot/web/location-' + users[i] + '.json', trainerFunc, errorFunc, i);
  }
}

var catchSuccess = function(data, user_index) {
  if (data !== undefined && Object.keys(data).length > 0) {
    if (user_data[users[user_index]].catchables === undefined) {
      user_data[users[user_index]].catchables = {};
    }
    if (data.latitude !== undefined) {
      if (user_data[users[user_index]].catchables.hasOwnProperty(data.spawnpoint_id) === false) {
        poke_name = pokemonArray[data.pokemon_id-1].Name;
        user_data[users[user_index]].catchables[data.spawnpoint_id] = new google.maps.Marker({
          map: map,
          position: {lat: parseFloat(data.latitude), lng: parseFloat(data.longitude)},
          icon: '../resources/image/pokemon/' + pad_with_zeroes(data.pokemon_id, 3) + imageExt,
          zIndex: 4,
          optimized: false
        });
          if (userZoom === true) {
            map.setZoom(16);
          }
          if (userFollow === true) {
            map.panTo({
              lat: parseFloat(data.latitude),
              lng: parseFloat(data.longitude)
            });
          }
      } else {
        user_data[users[user_index]].catchables[data.spawnpoint_id].setPosition({
          lat: parseFloat(data.latitude),
          lng: parseFloat(data.longitude)
        });
        user_data[users[user_index]].catchables[data.spawnpoint_id].setIcon('../resources/image/pokemon/' + pad_with_zeroes(data.pokemon_id, 3) + imageExt);
      }
    }
  } else {
    if (user_data[users[user_index]].catchables !== undefined && Object.keys(user_data[users[user_index]].catchables).length > 0) {
      for (var key in user_data[users[user_index]].catchables) {
        user_data[users[user_index]].catchables[key].setMap(null);
      }
      user_data[users[user_index]].catchables = undefined;
    }
  }
};

function addCatchable() {
  for (var i = 0; i < users.length; i++) {
    loadJSON('../gofbot/web/catchable-' + users[i] + '.json', catchSuccess, errorFunc, i);
  }
}
function addInventory() {
  for (var i = 0; i < users.length; i++) {
    loadJSON('../gofbot/web/inventory-' + users[i] + '.json', invSuccess, errorFunc, i);
  }
}

function pad_with_zeroes(number, length) {
  var my_string = '' + number;
  while (my_string.length < length) {
      my_string = '0' + my_string;
  }
  return my_string;
}

function filter(arr, search) {
  var filtered = [];
  for(i=0; i < arr.length; i++) {
    if(arr[i].inventory_item_data[search] != undefined) {
      filtered.push(arr[i]);
    }
  }
  return filtered;
}

function loadJSON(path, success, error, successData) {
  var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function() {
    if (xhr.readyState === XMLHttpRequest.DONE) {
      if (xhr.status === 200) {
        if (success)
          success(JSON.parse(xhr.responseText.replace(/\bNaN\b/g, 'null')), successData);
      } else {
        if (error)
        error(xhr);
      }
    }
  };
xhr.open('GET', path, true);
xhr.send();
}

function sortPokemonsByKey(array, key) {
    return array.sort(function(a, b) {
        var x = a.inventory_item_data.pokemon_data[key]; var y = b.inventory_item_data.pokemon_data[key];
        return ((x < y) ? -1 : ((x > y) ? 1 : 0));
    }).reverse();
}

$(document).ready(function(){
  $('.tooltipped').tooltip({delay: 50});
});

function fillInventory(){
  addInventory();
            var current_user_stats = stats[0].inventory_item_data.player_stats;
            var text = '
\

\

Info
\

Session
\

Items ('+bagItems.length+')
\

Pokemon (' + bagPokemon.length + ')
\

Pokedex
\

\

\

\

\

\

' +
              users[0]+
              '
Level ' +
              current_user_stats.level + '
' +current_user_stats.experience +" / "+ parseInt(current_user_stats.next_level_xp, 10) + "
"+
              '

Exp to level ' +
              ( parseInt(current_user_stats.level, 10) + 1 ) +
              '
 ' +
              (parseInt(current_user_stats.next_level_xp, 10) - current_user_stats.experience) +
              '

Pokemon Encountered
' +
              (current_user_stats.pokemons_encountered || 0) +
              '

Pokeballs Thrown
' +
              (current_user_stats.pokeballs_thrown || 0) +
              '

Pokemon Caught
' +
              (current_user_stats.pokemons_captured || 0) +
              '

Small Ratata Caught
' +
              (current_user_stats.small_rattata_caught || 0) +
              '

Pokemon Evolved
' +
              (current_user_stats.evolutions || 0) +
              '

Eggs Hatched
' +
              (current_user_stats.eggs_hatched || 0) +
              '

Unique Pokedex Entries
' +
              (current_user_stats.unique_pokedex_entries || 0) +
              '

PokeStops Visited
' +
              (current_user_stats.poke_stop_visits || 0) +
              '

Kilometers Walked
' +
              (parseFloat(current_user_stats.km_walked).toFixed(2) || 0) +
              '
\

\
    ';
  //items
  var current_user_bag_items = bagItems;
  text += '

';
    for (i = 0; i < current_user_bag_items.length; i++) {
      text += '

' +
              itemsArray[current_user_bag_items[i].inventory_item_data.item.item_id] +
              '
Count: ' +
              (current_user_bag_items[i].inventory_item_data.item.count || 0) +
              '
';
    }
  text += '

';
  //pokemon
  pkmnTotal = bagPokemon[0].length;

    text += '

<input type="text" placeholder="Search Pokemons" />

';
    bagPokemon.sort(function(a, b){return b.inventory_item_data.pokemon_data.cp - a.inventory_item_data.pokemon_data.cp;});
    for (i = 0; i < bagPokemon.length; i++) {
      var current_pokemon_data = bagPokemon[i].inventory_item_data.pokemon_data;
      if (current_pokemon_data.is_egg) {
        continue;
      } else {
        pkmnNum = current_pokemon_data.pokemon_id;
        pkmnImage = pad_with_zeroes(current_pokemon_data.pokemon_id, 3) + '.png';
        pkmnName = pokemonArray[pkmnNum-1].Name;
        pkmnCP = "CP "+current_pokemon_data.cp;
        pkmnIVA = current_pokemon_data.individual_attack || 0;
        pkmnIVD = current_pokemon_data.individual_defense || 0;
        pkmnIVS = current_pokemon_data.individual_stamina || 0;
        pkmnIV = ((pkmnIVA + pkmnIVD + pkmnIVS) / 45.0).toFixed(2);
      }
      text += '

' + pkmnName +
      '
' + pkmnCP + '
IV '+pkmnIV+'
';
    }
    text += '

';

  //pokedex
  var sortedPokedex = [];
  for (i = 0; i < pokedex.length; i++) {
    pkmID = pokedex[i].inventory_item_data.pokedex_entry.pokemon_id;
    pkmnName = pokemonArray[pkmID-1].Name;
    pkmEnc = pokedex[i].inventory_item_data.pokedex_entry.times_encountered;
    pkmCap = pokedex[i].inventory_item_data.pokedex_entry.times_captured;
    sortedPokedex.push({
      "name": pkmnName,
      "id": pkmID,
      "cap": (pkmEnc || 0),
      "enc": (pkmCap || 0)
    });
  }
  text += '
';
  for (var i = 0; i < sortedPokedex.length; i++) {
    pkmnNum = sortedPokedex[i].id;
    pkmnImage = pad_with_zeroes(pkmnNum, 3) +'.png';
    pkmnName = pokemonArray[pkmnNum-1].Name;
    pkmnName = pokemonArray[pkmnNum-1].Name;
    pkmnEnc = sortedPokedex[i].enc
    pkmnCap = sortedPokedex[i].cap
    text += '

 ' +
            pad_with_zeroes(pkmnNum, 3) +
            ' ' +
            pkmnName +
            '
Times Seen: ' +
            pkmnEnc +
            '
Times Caught: ' +
            pkmnCap +
            '
Candy: ' +
            pkmnCap +
            '
';
  }
  text += '
';

  //Session
  var exp_gained = stats[0].inventory_item_data.player_stats.experience - stats_at_start.stats[0].inventory_item_data.player_stats.experience;
  var km_walked = parseFloat(stats[0].inventory_item_data.player_stats.km_walked - stats_at_start.stats[0].inventory_item_data.player_stats.km_walked).toFixed(2);
  var pokemon_caught = bagPokemon.length - stats_at_start.bagPokemon.length;
  var eggs_hatched = stats[0].inventory_item_data.player_stats.eggs_hatched - stats_at_start.stats[0].inventory_item_data.player_stats.eggs_hatched;
  text += '
\

This session data
'+
          'Experience gained: '+exp_gained+'
'+
          'Distance walked: '+km_walked+' km'+'
'+
          'Pokemon caught: '+pokemon_caught+'
'+
          'Eggs hatched: '+eggs_hatched+'
'+
          '
';

  //Footer
  text += '

\

\
            Close\

';
            $('#modal-info').html(text);
            setTimeout(function(){$('.tabs').tabs();},1);
}

function log(message){
  if(message.length < 1)
  {
    return;
  }
  var log = {};

  var bracket_data = message.match(/\[(.*?)\]/g);
  if(!bracket_data || !bracket_data[0])
  {
    console.log("Error while parsing message: "+message);
    return;
  }
  log.worker = bracket_data[0].replace(/[\[\]]/g,"");
  log.type = bracket_data[1].replace(/[\[\]]/g,"");
  log.action = bracket_data[2].replace(/[\[\]]/g,"");
  log.message = message.split("["+log.action+"] ")[1];
  log.images = [];

  // Check for item words
  for (var key in itemsArray) {
    var item_name = itemsArray[key];
    if(log.message.indexOf(item_name)>-1)
    {
      log.images.push('')
    }
  }

  // Check for pokemon words
  for(var i = 0; i < pokemonArray.length; i++)
  {
    if(log.message.indexOf(pokemonArray[i].Name)>-1)
    {
      log.images.push('')
    }
  }
  log.date = new Date();
  if(log.worker == "MoveToFort")
  {
    $("#bot-indicator").html("

Bot Status
"+log.message);
    pingIndicator();
    return;
  }
  var log_item = "";
  if(log.images.length>0){
    log_item = '
\
                   '+ log.date.toTimeString().split(" ")[0] +"\

"+ log.message +"
\

" +log.images.join("")+"
\

";
  }else {
    log_item = '
\
                   '+ log.date.toTimeString().split(" ")[0] +"\

"+ log.message +"
\

";
  }
  $('#log').append(log_item);
  $('#log-text').animate({scrollTop: $('#log-text')[0].scrollHeight}, 100);
}

function pingIndicator() {
  $("#indicator").css("background-color","#0a0");
  setTimeout(function(){$("#indicator").css("background-color","#eee");},250);
}

  //filter pokemons
  function fuzzy_match(str,pattern){
    pattern = pattern.split("").reduce(function(a,b){ return a+".*"+b; });
    return (new RegExp(pattern)).test(str);
  };
  var pokemonFilterTimer;
  $('#pokemon .item-filter input').bind('change blur keyup mouseup', function (event) {
    if(pokemonFilterTimer) {
      clearTimeout(pokemonFilterTimer);
    }
    var searchTerm = $('#pokemon .item-filter input').val().toLowerCase();
    if (searchTerm != '') {
      pokemonFilterTimer = setTimeout(function () {
        $('#pokemon .pokemon-list-item').each(function (i, e) {
          pokemonName = $(e).find('.pokemon-name').text().toLowerCase();
          fuzzy_match(pokemonName, searchTerm) &&  $(e).show() || $(e).hide();
        });
      }, 100);
    } else {
      $('#pokemon .pokemon-list-item').each(function (i, e) {
          $(e).show();
      });
    }
  });


text:
namespace nt2 { namespace tag
  {
    struct legendre_ : ext::elementwise_<legendre_> { typedef ext::elementwise_<legendre_> parent; };
  }
  NT2_FUNCTION_IMPLEMENTATION(tag::legendre_, legendre, 2)
}

#endif

// modified by jt the 25/12/2010


text:
*> \brief \b CPOEQUB
*
*  =========== DOCUMENTATION ===========
*
* Online html documentation available at
*            http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CPOEQUB + dependencies
*>
*> [TGZ]
*>
*> [ZIP]
*>
*> [TXT]
*> \endhtmlonly
*
*  Definition:
*  ===========
*
*       SUBROUTINE CPOEQUB( N, A, LDA, S, SCOND, AMAX, INFO )
*
*       .. Scalar Arguments ..
*       INTEGER            INFO, LDA, N
*       REAL               AMAX, SCOND
*       ..
*       .. Array Arguments ..
*       COMPLEX            A( LDA, * )
*       REAL               S( * )
*       ..
*
*
*> \par Purpose:
*  =============
*>
*> \verbatim
*>
*> CPOEQUB computes row and column scalings intended to equilibrate a
*> Hermitian positive definite matrix A and reduce its condition number
*> (with respect to the two-norm).  S contains the scale factors,
*> S(i) = 1/sqrt(A(i,i)), chosen so that the scaled matrix B with
*> elements B(i,j) = S(i)*A(i,j)*S(j) has ones on the diagonal.  This
*> choice of S puts the condition number of B within a factor N of the
*> smallest possible condition number over all possible diagonal
*> scalings.
*>
*> This routine differs from CPOEQU by restricting the scaling factors
*> to a power of the radix.  Barring over- and underflow, scaling by
*> these factors introduces no additional rounding errors.  However, the
*> scaled diagonal entries are no longer approximately 1 but lie
*> between sqrt(radix) and 1/sqrt(radix).
*> \endverbatim
*
*  Arguments:
*  ==========
*
*> \param[in] N
*> \verbatim
*>          N is INTEGER
*>          The order of the matrix A.  N >= 0.
*> \endverbatim
*>
*> \param[in] A
*> \verbatim
*>          A is COMPLEX array, dimension (LDA,N)
*>          The N-by-N Hermitian positive definite matrix whose scaling
*>          factors are to be computed.  Only the diagonal elements of A
*>          are referenced.
*> \endverbatim
*>
*> \param[in] LDA
*> \verbatim
*>          LDA is INTEGER
*>          The leading dimension of the array A.  LDA >= max(1,N).
*> \endverbatim
*>
*> \param[out] S
*> \verbatim
*>          S is REAL array, dimension (N)
*>          If INFO = 0, S contains the scale factors for A.
*> \endverbatim
*>
*> \param[out] SCOND
*> \verbatim
*>          SCOND is REAL
*>          If INFO = 0, S contains the ratio of the smallest S(i) to
*>          the largest S(i).  If SCOND >= 0.1 and AMAX is neither too
*>          large nor too small, it is not worth scaling by S.
*> \endverbatim
*>
*> \param[out] AMAX
*> \verbatim
*>          AMAX is REAL
*>          Absolute value of largest matrix element.  If AMAX is very
*>          close to overflow or very close to underflow, the matrix
*>          should be scaled.
*> \endverbatim
*>
*> \param[out] INFO
*> \verbatim
*>          INFO is INTEGER
*>          = 0:  successful exit
*>          < 0:  if INFO = -i, the i-th argument had an illegal value
*>          > 0:  if INFO = i, the i-th diagonal element is nonpositive.
*> \endverbatim
*
*  Authors:
*  ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexPOcomputational
*
*  =====================================================================
      SUBROUTINE CPOEQUB( N, A, LDA, S, SCOND, AMAX, INFO )
*
*  -- LAPACK computational routine --
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*
*     .. Scalar Arguments ..
      INTEGER            INFO, LDA, N
      REAL               AMAX, SCOND
*     ..
*     .. Array Arguments ..
      COMPLEX            A( LDA, * )
      REAL               S( * )
*     ..
*
*  =====================================================================
*
*     .. Parameters ..
      REAL               ZERO, ONE
      PARAMETER          ( ZERO = 0.0E+0, ONE = 1.0E+0 )
*     ..
*     .. Local Scalars ..
      INTEGER            I
      REAL               SMIN, BASE, TMP
*     ..
*     .. External Functions ..
      REAL               SLAMCH
      EXTERNAL           SLAMCH
*     ..
*     .. External Subroutines ..
      EXTERNAL           XERBLA
*     ..
*     .. Intrinsic Functions ..
      INTRINSIC          MAX, MIN, SQRT, LOG, INT
*     ..
*     .. Executable Statements ..
*
*     Test the input parameters.
*
*     Positive definite only performs 1 pass of equilibration.
*
      INFO = 0
      IF( N.LT.0 ) THEN
         INFO = -1
      ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
         INFO = -3
      END IF
      IF( INFO.NE.0 ) THEN
         CALL XERBLA( 'CPOEQUB', -INFO )
         RETURN
      END IF
*
*     Quick return if possible.
*
      IF( N.EQ.0 ) THEN
         SCOND = ONE
         AMAX = ZERO
         RETURN
      END IF

      BASE = SLAMCH( 'B' )
      TMP = -0.5 / LOG ( BASE )
*
*     Find the minimum and maximum diagonal elements.
*
      S( 1 ) = REAL( A( 1, 1 ) )
      SMIN = S( 1 )
      AMAX = S( 1 )
      DO 10 I = 2, N
         S( I ) = REAL( A( I, I ) )
         SMIN = MIN( SMIN, S( I ) )
         AMAX = MAX( AMAX, S( I ) )
   10 CONTINUE
*
      IF( SMIN.LE.ZERO ) THEN
*
*        Find the first non-positive diagonal element and return.
*
         DO 20 I = 1, N
            IF( S( I ).LE.ZERO ) THEN
               INFO = I
               RETURN
            END IF
   20    CONTINUE
      ELSE
*
*        Set the scale factors to the reciprocals
*        of the diagonal elements.
*
         DO 30 I = 1, N
            S( I ) = BASE ** INT( TMP * LOG( S( I ) ) )
   30    CONTINUE
*
*        Compute SCOND = min(S(I)) / max(S(I)).
*
         SCOND = SQRT( SMIN ) / SQRT( AMAX )
      END IF
*
      RETURN
*
*     End of CPOEQUB
*
      END


text:
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>VA-CV</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <!-- Material Design fonts -->
  <link rel="stylesheet" type="text/css" href="assets/css/MDFonts.css">
  <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/icon?family=Material+Icons">

</head>
<body>
  <!-- Enable bootstrap 4 theme -->
  <script>window.__theme = 'bs4';</script>
  <app-root>Loading...</app-root>
</body>
<script>

</script>
</html>


text:
/*global Backbone */
var app = app || {};

(function () {
	'use strict';

	//Model for ODS text
	app.ODSText = Backbone.Model.extend({
		defaults: {
			text: ''
		},

		toggle: function () {
			this.save({
			});
		},

		/*
		 * loads ODS sample text from JSON file
		 */
		loadTestData: function() {
			var scope = this;
			$.ajax({
				  url: "data/sampleExams.txt"
				})
				  .done(function( data ) {
				    scope.set('text', data);
				    scope.trigger('changed');
			});
		},

		getGrades: function() {
			app.exams.reset();
			var lines = this.get('text').split("\n");

			//get text from ODS table and add exams to collection
			for(var i=0; i < lines.length; i++) {

				var fields = lines[i].split("\t");

				var tmpExam = new app.Exam();
				tmpExam.set('number', this.convertVal(fields[0]) );
				tmpExam.set('name', this.convertVal(fields[1]) );
				//TODO only include actual exams, not completed modules
				//tmpExam.set('type', this.convertVal(fields[2]) );
				tmpExam.set('date', this.convertVal(fields[3]) );
				tmpExam.set('examiner', this.convertVal(fields[4]) );
				tmpExam.set('grade', this.convertGrade(fields[5]) );
				tmpExam.set('ects', this.convertECTS(fields[6]) );
				tmpExam.set('status', this.convertVal(fields[7]) );
				tmpExam.set('remark', this.convertVal(fields[8]) );

				//set pass status manually
				if (tmpExam.get('status').startsWith('BE,') ) {
					tmpExam.set('passed', true);
				}

				if (tmpExam.isValid()) {
					app.exams.addExam(tmpExam);
				} else {
					console.log("exam invalid:", tmpExam)
				}

			}
		},

		convertVal: function(val) {
			return (val === undefined ? "" : val.trim());
		},

		convertGrade: function(grade) {
			//some Bachelor exams do not have a grade, thus treat them as 1,0
			//since they "just count as credit points"
			var grade = this.convertVal(grade);
			return (grade === "" ? "1,0" : grade);
		},

		convertECTS: function(points) {
			//converts "2,5" credit points to a proper Number
			return new Number(this.convertVal(points.replace(",",".")) );
		},

		change: function() {
		},

		save: function() {

		}
	});
})();


text:
<?php

namespace Google\Service\Forms;

class FormResponse extends \Google\Model
{
  protected $answersType = Answer::class;
  protected $answersDataType = 'map';
  /**
   * @var string
   */
  public $createTime;
  /**
   * @var string
   */
  public $formId;
  /**
   * @var string
   */
  public $lastSubmittedTime;
  /**
   * @var string
   */
  public $respondentEmail;
  /**
   * @var string
   */
  public $responseId;
  public $totalScore;

  /**
   * @param Answer[]
   */
  public function setAnswers($answers)
  {
    $this->answers = $answers;
  }
  /**
   * @return Answer[]
   */
  public function getAnswers()
  {
    return $this->answers;
  }
  /**
   * @param string
   */
  public function setCreateTime($createTime)
  {
    $this->createTime = $createTime;
  }
  /**
   * @return string
   */
  public function getCreateTime()
  {
    return $this->createTime;
  }
  /**
   * @param string
   */
  public function setFormId($formId)
  {
    $this->formId = $formId;
  }
  /**
   * @return string
   */
  public function getFormId()
  {
    return $this->formId;
  }
  /**
   * @param string
   */
  public function setLastSubmittedTime($lastSubmittedTime)
  {
    $this->lastSubmittedTime = $lastSubmittedTime;
  }
  /**
   * @return string
   */
  public function getLastSubmittedTime()
  {
    return $this->lastSubmittedTime;
  }
  /**
   * @param string
   */
  public function setRespondentEmail($respondentEmail)
  {
    $this->respondentEmail = $respondentEmail;
  }
  /**
   * @return string
   */
  public function getRespondentEmail()
  {
    return $this->respondentEmail;
  }
  /**
   * @param string
   */
  public function setResponseId($responseId)
  {
    $this->responseId = $responseId;
  }
  /**
   * @return string
   */
  public function getResponseId()
  {
    return $this->responseId;
  }
  public function setTotalScore($totalScore)
  {
    $this->totalScore = $totalScore;
  }
  public function getTotalScore()
  {
    return $this->totalScore;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(FormResponse::class, 'Google_Service_Forms_FormResponse');


text:
package org.lwjgl.demo.util.lz4;

import org.lwjgl.*;
import org.lwjgl.system.*;
import org.lwjgl.util.lz4.*;

import java.io.*;
import java.nio.*;
import java.util.zip.*;

import static org.lwjgl.demo.util.IOUtil.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.util.lz4.LZ4.*;
import static org.lwjgl.util.lz4.LZ4Frame.*;
import static org.lwjgl.util.lz4.LZ4HC.*;

public class HelloLZ4 {

    private static final int BENCH_WARMUP = 16;
    private static final int BENCH_ITERS  = 128;

    public static void main(String[] args) {
        ByteBuffer uncompressed;
        try {
            String filePath;
            if (args.length == 0) {
                System.out.println("Use 'ant demo -Dclass=org.lwjgl.demo.util.zstd.HelloLZ4 -Dargs=<path>' to test a different file.\n");
                filePath = "demo/FiraSans.ttf";
            } else {
                filePath = args[0];
            }

            uncompressed = ioResourceToByteBuffer(filePath, 512 * 1024);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        byte[] uncompressedArray = new byte[uncompressed.remaining()];
        uncompressed.get(uncompressedArray);
        uncompressed.clear();

        for (int i = 0; i < 128000; i++) {
            System.nanoTime();
        }

        ByteBuffer compressed   = memAlloc(LZ4_compressBound(uncompressed.remaining()));
        ByteBuffer compressedHC = memAlloc(compressed.capacity());

        long compressedSize = LZ4_compress_default(uncompressed, compressed);
        compressed.limit((int)compressedSize);
        compressed = compressed.slice();

        compressedSize = LZ4_compress_HC(uncompressed, compressedHC, LZ4HC_CLEVEL_DEFAULT);
        compressedHC.limit((int)compressedSize);
        compressedHC = compressedHC.slice();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try (GZIPOutputStream dos = new GZIPOutputStream(baos)) {
            dos.write(uncompressedArray);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        byte[] compressedArray = baos.toByteArray();

        System.out.format("Using LZ4 %s\n\n", LZ4_versionString());

        System.out.format("Uncompressed size: %d bytes\n", uncompressed.remaining());
        System.out.println("COMPRESSION RATIO:");
        System.out.format("\tLZ4     : %f (%d bytes)\n", (uncompressed.remaining() / (float)compressed.remaining()), compressed.remaining());
        System.out.format("\tLZ4(HC) : %f (%d bytes)\n", (uncompressed.remaining() / (float)compressedHC.remaining()), compressedHC.remaining());
        System.out.format("\tGZip    : %f (%d bytes)\n", (uncompressedArray.length / (float)compressedArray.length), compressedArray.length);

        long time = benchLZ4Compression(uncompressed);
        System.out.format("\nCompression   LZ4(simple): %d MB/s (%d us/file)\n", getThroughput(uncompressed.remaining(), time), time / 1_000);

        time = benchLZ4CompressionAdvanced(uncompressed);
        System.out.format("Compression LZ4(advanced): %d MB/s (%d us/file)\n", getThroughput(uncompressed.remaining(), time), time / 1_000);

        time = benchLZ4HCCompression(uncompressed);
        System.out.format("Compression       LZ4(HC): %d MB/s (%d us/file)\n", getThroughput(uncompressed.remaining(), time), time / 1_000);

        time = benchGZIPCompression(uncompressedArray);
        System.out.format("Compression          GZip: %d MB/s (%d us/file)\n", getThroughput(uncompressedArray.length, time), time / 1_000);

        time = benchLZ4Decompression(compressed, uncompressed);
        System.out.format("\nDecompression LZ4: %d MB/s (%d us/file)\n", getThroughput(uncompressed.remaining(), time), time / 1_000);

        time = benchGZIPDecompression(compressedArray, uncompressedArray);
        System.out.format("Decompression Gzip: %d MB/s (%d us/file)\n", getThroughput(uncompressedArray.length, time), time / 1_000);

        memFree(compressedHC);
        memFree(compressed);
    }

    private static int getThroughput(long size, long time) {
        return (int)Math.round(size * 1_000_000_000L / 1024L / 1024L / (double)time);
    }

    private static long checkLZ4F(long errorCode) {
        if (LZ4F_isError(errorCode)) {
            throw new IllegalStateException("LZ4 error: " + errorCode + " | " + LZ4F_getErrorName(errorCode));
        }
        return errorCode;
    }

    private static void verifyDecompressed(ByteBuffer uncompressed, ByteBuffer compressed) {
        ByteBuffer decompressed = memAlloc(uncompressed.remaining() + 1024);

        try {
            long decompressedSize = LZ4_decompress_safe(compressed, decompressed);

            if (decompressedSize != uncompressed.remaining()) {
                throw new IllegalStateException(String.format("Decompressed size %d != uncompressed size %d", decompressedSize, uncompressed.remaining()));
            }

            for (int i = 0; i < uncompressed.remaining(); i++) {
                if (decompressed.get(i) != uncompressed.get(i)) {
                    throw new IllegalStateException("Decompressed != uncompressed at: " + i);
                }
            }
        } finally {
            memFree(decompressed);
        }
    }

    // -----------------------------
    //          COMPRESSION
    // -----------------------------

    // LZ4 Simple API

    private static long benchLZ4Compression(ByteBuffer uncompressed) {
        ByteBuffer compressed = memAlloc(LZ4_compressBound(uncompressed.remaining()));
        try {
            // warmup
            long compressedSize = benchLZ4Compression(uncompressed, compressed, BENCH_WARMUP);

            compressed.limit((int)compressedSize);
            verifyDecompressed(uncompressed, compressed.slice());
            compressed.limit(compressed.capacity());

            long t = System.nanoTime();
            benchLZ4Compression(uncompressed, compressed, BENCH_ITERS);
            t = System.nanoTime() - t;

            return t / BENCH_ITERS;
        } finally {
            memFree(compressed);
        }
    }

    private static long benchLZ4Compression(ByteBuffer uncompressed, ByteBuffer compressed, int iterations) {
        long size = 0L;
        for (int i = 0; i < iterations; i++) {
            size |= LZ4_compress_default(uncompressed, compressed);
        }
        return size;
    }

    // LZ4 Advanced API

    private static long benchLZ4CompressionAdvanced(ByteBuffer uncompressed) {
        ByteBuffer compressed = memAlloc(LZ4_compressBound(uncompressed.remaining()));
        try {
            // warmup
            long compressedSize = benchLZ4CompressionAdvanced(uncompressed, compressed, BENCH_WARMUP);

            compressed.limit((int)compressedSize);
            //verifyDecompressed(uncompressed, compressed);
            compressed.limit(compressed.capacity());

            long t = System.nanoTime();
            benchLZ4CompressionAdvanced(uncompressed, compressed, BENCH_ITERS);
            t = System.nanoTime() - t;

            return t / BENCH_ITERS;
        } finally {
            memFree(compressed);
        }
    }

    private static ByteBuffer slice(ByteBuffer compressed, int offset) {
        return memSlice(compressed, offset, compressed.limit() - offset);
    }

    private static long benchLZ4CompressionAdvanced(ByteBuffer uncompressed, ByteBuffer compressed, int iterations) {
        int size = 0;

        long cctx = NULL;
        try (MemoryStack stack = stackPush()) {
            PointerBuffer pp = stack.mallocPointer(1);
            checkLZ4F(LZ4F_createCompressionContext(pp, LZ4F_VERSION));

            cctx = pp.get(0);
            for (int i = 0; i < iterations; i++) {
                size = (int)checkLZ4F(LZ4F_compressBegin(cctx, compressed, LZ4FPreferences.calloc(stack)
                    .frameInfo(LZ4FFrameInfo.calloc(stack)
                        .blockChecksumFlag(LZ4F_blockChecksumEnabled)
                        .contentChecksumFlag(LZ4F_contentChecksumEnabled)
                        .contentSize(uncompressed.remaining())
                    )));
                size += checkLZ4F(LZ4F_compressUpdate(cctx, slice(compressed, size), uncompressed, null));
                size += checkLZ4F(LZ4F_compressEnd(cctx, slice(compressed, size), null));
            }
        } finally {
            if (cctx != NULL) {
                checkLZ4F(LZ4F_freeCompressionContext(cctx));
            }
        }

        return size;
    }

    // LZ4HC

    private static long benchLZ4HCCompression(ByteBuffer uncompressed) {
        ByteBuffer compressed = memAlloc(LZ4_compressBound(uncompressed.remaining()));
        try {
            // warmup
            long compressedSize = benchLZ4HCCompression(uncompressed, compressed, BENCH_WARMUP);

            compressed.limit((int)compressedSize);
            verifyDecompressed(uncompressed, compressed.slice());
            compressed.limit(compressed.capacity());

            long t = System.nanoTime();
            benchLZ4HCCompression(uncompressed, compressed, BENCH_ITERS);
            t = System.nanoTime() - t;

            return t / BENCH_ITERS;
        } finally {
            memFree(compressed);
        }
    }

    private static long benchLZ4HCCompression(ByteBuffer uncompressed, ByteBuffer compressed, int iterations) {
        long size = 0L;
        for (int i = 0; i < iterations; i++) {
            size |= LZ4_compress_HC(uncompressed, compressed, LZ4HC_CLEVEL_DEFAULT);
        }
        return size;
    }

    // GZIP

    private static long benchGZIPCompression(byte[] uncompressed) {
        ByteArrayOutputStream compressed = new ByteArrayOutputStream();

        // warmup
        benchGZIPCompression(uncompressed, compressed, BENCH_WARMUP);

        long t = System.nanoTime();
        benchGZIPCompression(uncompressed, compressed, BENCH_ITERS);
        t = System.nanoTime() - t;

        return t / BENCH_ITERS;
    }

    private static void benchGZIPCompression(byte[] uncompressed, ByteArrayOutputStream compressed, int iterations) {
        for (int i = 0; i < iterations; i++) {
            try (GZIPOutputStream dos = new GZIPOutputStream(compressed)) {
                dos.write(uncompressed);
            } catch (IOException e) {
                throw new RuntimeException(e);
            } finally {
                compressed.reset();
            }
        }
    }

    // -----------------------------
    //         DECOMPRESSION
    // -----------------------------

    // LZ4

    private static long benchLZ4Decompression(ByteBuffer compressed, ByteBuffer decompressed) {
        // warmup
        benchLZ4Decompression(compressed, decompressed, BENCH_WARMUP);

        long t = System.nanoTime();
        benchLZ4Decompression(compressed, decompressed, BENCH_ITERS);
        t = System.nanoTime() - t;

        return t / BENCH_ITERS;
    }

    private static void benchLZ4Decompression(ByteBuffer compressed, ByteBuffer decompressed, int iterations) {
        //long dctx = LZ4_createDCtx();
        try {
            for (int i = 0; i < iterations; i++) {
                checkLZ4F(LZ4_decompress_safe(compressed, decompressed));
            }
        } finally {
            //checkLZ4(LZ4_freeDCtx(dctx));
        }
    }

    // GZIP

    private static long benchGZIPDecompression(byte[] compressed, byte[] decompressed) {
        // warmup
        benchGZIPDecompression(compressed, decompressed, BENCH_WARMUP);

        long t = System.nanoTime();
        benchGZIPDecompression(compressed, decompressed, BENCH_ITERS);
        t = System.nanoTime() - t;

        return t / BENCH_ITERS;
    }

    private static void benchGZIPDecompression(byte[] compressed, byte[] decompressed, int iterations) {
        ByteArrayInputStream bais = new ByteArrayInputStream(compressed);
        for (int i = 0; i < iterations; i++) {
            try (GZIPInputStream dis = new GZIPInputStream(bais)) {
                int bytes = 0;
                do {
                    bytes += dis.read(decompressed, bytes, decompressed.length - bytes);
                } while (bytes < decompressed.length);
            } catch (IOException e) {
                throw new RuntimeException(e);
            } finally {
                bais.reset();
            }
        }
    }
}


text:
module Edmunds
  module Vehicle
    module Specification
      module Transmission
        class Transmission
          attr_reader :id, :name, :equipment_type, :availability, :automatic_type, :transmission_type, :number_of_speeds

          def initialize(attributes)
            @id = attributes['id']
            @name = attributes['name']
            @equipment_type = attributes['equipmentType']
            @availability = attributes['availability']
            @automatic_type = attributes['automaticType']
            @transmission_type = attributes['transmissionType']
            @number_of_speeds = attributes['numberOfSpeeds']
          end
        end
      end
    end
  end
end


text:
from django.test import TestCase
from django.test import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile

# This is an abstract Standard Test case intended to perform various generic tests on every view
class StandardTest(TestCase):
    path = ''

    @classmethod
    def setUpClass(cls):
        pass

    # Test if we redirect when not logged in
    def test_redirect(self):
        client_obj = Client()
        response_obj = client_obj.get(self.path)
        code = response_obj.status_code

        self.assertEqual(code, 302, str(client_obj) + ' returned: ' + str(code) + ' expected: 302')

    # Test if we are successfull when logged in
    def test_access(self):
        client_obj = Client()
        test_user = User.objects.create(username='test', is_active=True, is_staff=True, is_superuser=True)
        test_user.set_password('pass')
        test_user.save()
        login = client_obj.login(username='test', password='pass')

        response_obj = client_obj.get(self.path)
        code = response_obj.status_code

        self.assertEqual(code, 200, str(client_obj) + ' returned: ' + str(code) + ' expected: 200')

class LandingTest(StandardTest):
    path = reverse('landing_page')

class ScoresTest(StandardTest):
    path = reverse('scores')

class ViewDecksTest(StandardTest):
    path = reverse('view_decks')

class AccountTest(StandardTest):
    path = reverse('account')

class ContactTest(StandardTest):
    path = reverse('contact')

class ImportTest(StandardTest):
    path = reverse('import_deck')
    myfile = '''
MyDeck1:
    card1:
        - q: 'What is the square root of 25?'
        - a: '5'
    card2:
        - q: 'What would you do for a klondike bar?'
        - a: 'Nothing'
'''

    def test_import_bad(self):
        client_obj = Client()
        file_data = {'deck': SimpleUploadedFile('testdeck.yml', self.myfile)}
        resp = client_obj.post(self.path, file_data)
        self.assertEqual(resp.status_code, 302, str(client_obj) + ' returned: ' + str(resp.status_code) + ' expected: 302')

    def test_import(self):
        client_obj = Client()
        test_user = User.objects.create(username='test', is_active=True, is_staff=True, is_superuser=True)
        test_user.set_password('pass')
        test_user.save()
        login = client_obj.login(username='test', password='pass')
        file_data = {'deck': SimpleUploadedFile('testdeck.yml', self.myfile)}
        resp = client_obj.post(self.path, file_data)
        self.assertEqual(resp.status_code, 200, str(client_obj) + ' returned: ' + str(resp.status_code) + ' expected: 200')

class SigninTest(StandardTest):
    path = reverse('signin')

    # Signin does not redirect!
    def test_redirect(self):
        pass

class PlayDeckTest(StandardTest):
    path = reverse('play_deck', args=('1',))

class WelcomeTest(StandardTest):
    path = reverse('welcome')

    # Welcome does not redirect!
    def test_redirect(self):
        pass


text:
package herddb.utils;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Extended version of DataInputStream
 *
 * @author enrico.olivelli
 * @author diego.salvi
 * @see ExtendedDataOutputStream
 */
public class ExtendedDataInputStream extends DataInputStream {

    public ExtendedDataInputStream(InputStream in) {
        super(in);
    }

    /**
     * Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes.
     * Negative numbers are not supported.
     *
     * @return
     * @throws java.io.IOException
     */
    public int readVInt() throws IOException {
        return readVInt(readByte());
    }

    protected int readVInt(byte first) throws IOException {
        byte b = first;
        int i = b & 0x7F;

        if ((b & 0x80) != 0) {
            b = readByte();
            i |= (b & 0x7F) << 7;

            if ((b & 0x80) != 0) {
                b = readByte();
                i |= (b & 0x7F) << 14;

                if ((b & 0x80) != 0) {
                    b = readByte();
                    i |= (b & 0x7F) << 21;

                    if ((b & 0x80) != 0) {
                        b = readByte();
                        i |= (b & 0x7F) << 28;
                    }
                }
            }
        }
        return i;
    }

    private boolean eof;

    /**
     * @return
     * @see #readVIntNoEOFException()
     */
    public boolean isEof() {
        return eof;
    }

    /**
     * Same as {@link  #readVInt() } but does not throw EOFException. Since throwing exceptions is very expensive for the
     * JVM this operation is preferred if you could hit and EOF
     *
     * @return
     * @throws IOException
     * @see #isEof()
     */
    public int readVIntNoEOFException() throws IOException {
        int ch = in.read();
        if (ch < 0) {
            eof = true;
            return -1;
        }

        return readVInt((byte) (ch));
    }

    /**
     * Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes.
     * Negative numbers are not supported.
     *
     * @return
     * @throws java.io.IOException
     */
    public long readVLong() throws IOException {
        return readVLong(false);
    }

    private long readVLong(boolean allowNegative) throws IOException {
        /* This is the original code of this method,
     * but a Hotspot bug (see LUCENE-2975) corrupts the for-loop if
     * readByte() is inlined. So the loop was unwinded!
    byte b = readByte();
    long i = b & 0x7F;
    for (int shift = 7; (b & 0x80) != 0; shift += 7) {
      b = readByte();
      i |= (b & 0x7FL) << shift;
    }
    return i;
         */
        byte b = readByte();
        if (b >= 0) {
            return b;
        }
        long i = b & 0x7FL;
        b = readByte();
        i |= (b & 0x7FL) << 7;
        if (b >= 0) {
            return i;
        }
        b = readByte();
        i |= (b & 0x7FL) << 14;
        if (b >= 0) {
            return i;
        }
        b = readByte();
        i |= (b & 0x7FL) << 21;
        if (b >= 0) {
            return i;
        }
        b = readByte();
        i |= (b & 0x7FL) << 28;
        if (b >= 0) {
            return i;
        }
        b = readByte();
        i |= (b & 0x7FL) << 35;
        if (b >= 0) {
            return i;
        }
        b = readByte();
        i |= (b & 0x7FL) << 42;
        if (b >= 0) {
            return i;
        }
        b = readByte();
        i |= (b & 0x7FL) << 49;
        if (b >= 0) {
            return i;
        }
        b = readByte();
        i |= (b & 0x7FL) << 56;
        if (b >= 0) {
            return i;
        }
        if (allowNegative) {
            b = readByte();
            i |= (b & 0x7FL) << 63;
            if (b == 0 || b == 1) {
                return i;
            }
            throw new IOException("Invalid vLong detected (more than 64 bits)");
        } else {
            throw new IOException("Invalid vLong detected (negative values disallowed)");
        }
    }

    public int readZInt() throws IOException {
        int i = ExtendedDataInputStream.this.readVInt();
        return (i >>> 1) ^ -(i & 1);
    }

    public long readZLong() throws IOException {
        long l = readVLong();
        return (l >>> 1) ^ -(l & 1);
    }

    private static final byte[] EMPTY_ARRAY = new byte[0];

    public Bytes readBytes() throws IOException {
        return Bytes.from_nullable_array(readArray());
    }

    public byte[] readArray() throws IOException {
        int len = ExtendedDataInputStream.this.readVInt();
        if (len == 0) {
            return EMPTY_ARRAY;
        } else if (len == -1) {
            /* NULL array */
            return null;
        }
        byte[] res = new byte[len];
        readFully(res);
        return res;
    }

    @SuppressFBWarnings(value = "SR_NOT_CHECKED")
    public void skipArray() throws IOException {
        int len = ExtendedDataInputStream.this.readVInt();
        if (len == 0) {
            return;
        }
        skip(len);
    }

    @SuppressFBWarnings(value = "SR_NOT_CHECKED")
    public void skipInt() throws IOException {
        skip(4);
    }

    @SuppressFBWarnings(value = "SR_NOT_CHECKED")
    public void skipLong() throws IOException {
        skip(8);
    }

    @SuppressFBWarnings(value = "SR_NOT_CHECKED")
    public void skipDouble() throws IOException {
        skip(8);
    }

    @SuppressFBWarnings(value = "SR_NOT_CHECKED")
    public void skipBoolean() throws IOException {
        skip(1);
    }

}


text:
@implementation WGOverHeightResetResponse

@end


text:
package com.google.cloud.bigtable.dataflow;

import static org.mockito.Mockito.when;

import java.io.IOException;

import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import com.google.bigtable.repackaged.com.google.cloud.bigtable.grpc.BigtableSession;
import com.google.bigtable.repackaged.com.google.cloud.bigtable.grpc.scanner.FlatRow;
import com.google.bigtable.repackaged.com.google.cloud.bigtable.grpc.scanner.ResultScanner;
import com.google.bigtable.repackaged.com.google.bigtable.v2.ReadRowsRequest;
import com.google.bigtable.repackaged.com.google.protobuf.ByteString;
import com.google.cloud.bigtable.dataflow.CloudBigtableIO.Reader;
import com.google.cloud.bigtable.dataflow.CloudBigtableIO.Source;
import com.google.cloud.bigtable.dataflow.CloudBigtableScanConfiguration.Builder;
import com.google.cloud.dataflow.sdk.io.BoundedSource;
import com.google.cloud.dataflow.sdk.io.range.ByteKey;
import com.google.cloud.dataflow.sdk.io.range.ByteKeyRange;
import com.google.cloud.dataflow.sdk.io.range.ByteKeyRangeTracker;

/**
 * Tests for {@link CloudBigtableIO.Reader}.
 * @author sduskis
 *
 */
public class CloudBigtableIOReaderTest {

  @Mock
  BigtableSession mockSession;

  @Mock
  ResultScanner<FlatRow> mockScanner;

  @Mock
  CloudBigtableIO.AbstractSource<Result> mockSource;

  @Before
  public void setup(){
    MockitoAnnotations.initMocks(this);
  }

  private Builder createDefaultConfig() {
    return new CloudBigtableScanConfiguration.Builder().withProjectId("test").withInstanceId("test")
        .withTableId("test").withRequest(ReadRowsRequest.getDefaultInstance())
        .withKeys(new byte[0], new byte[0]);
  }

  @Test
  public void testBasic() throws IOException {

    CloudBigtableIO.Reader<Result> underTest = initializeReader(createDefaultConfig().build());

    setRowKey("a");
    Assert.assertTrue(underTest.start());
    Assert.assertEquals(1, underTest.getRowsReadCount());

    when(mockScanner.next()).thenReturn(null);
    Assert.assertFalse(underTest.advance());
    Assert.assertEquals(1, underTest.getRowsReadCount());

    underTest.close();
  }

  private void setRowKey(String rowKey) throws IOException {
    ByteString rowKeyByteString = ByteString.copyFrom(Bytes.toBytes(rowKey));
    FlatRow row = FlatRow.newBuilder().withRowKey(rowKeyByteString).build();
    when(mockScanner.next()).thenReturn(row);
  }

  private CloudBigtableIO.Reader<Result> initializeReader(CloudBigtableScanConfiguration config) {
    when(mockSource.getConfiguration()).thenReturn(config);
    return new CloudBigtableIO.Reader<Result>(mockSource, CloudBigtableIO.RESULT_ADVANCER) {
      @Override
      void initializeScanner() throws IOException {
        setSession(mockSession);
        setScanner(mockScanner);
      }
    };
  }

  @Test
  public void testPercent() throws IOException{
    byte[] start = "aa".getBytes();
    byte[] end = "zz".getBytes();
    CloudBigtableScanConfiguration config = createDefaultConfig().withKeys(start, end).build();
    CloudBigtableIO.Reader<Result> underTest = initializeReader(config);
    ByteKeyRangeTracker tracker =
        ByteKeyRangeTracker.of(ByteKeyRange.of(ByteKey.copyFrom(start), ByteKey.copyFrom(end)));

    testTrackerAtKey(underTest, tracker, "dd", 1);
    testTrackerAtKey(underTest, tracker, "qq", 2);

    double splitAtFraction =
        (1 - tracker.getFractionConsumed()) * .5 + tracker.getFractionConsumed();
    ByteKey newSplitEnd = tracker.getRange().interpolateKey(splitAtFraction);

    underTest.splitAtFraction(splitAtFraction);
    tracker.trySplitAtPosition(newSplitEnd);

    Assert.assertEquals(tracker.getFractionConsumed(), underTest.getFractionConsumed(), 0.0001d);
  }

  private void testTrackerAtKey(CloudBigtableIO.Reader<Result> underTest, ByteKeyRangeTracker tracker,
      final String key, final int count) throws IOException {
    setRowKey(key);
    tracker.tryReturnRecordAt(true, ByteKey.copyFrom(key.getBytes()));
    Assert.assertTrue(underTest.start());
    Assert.assertEquals(count, underTest.getRowsReadCount());
    Assert.assertEquals(tracker.getFractionConsumed(),
      underTest.getFractionConsumed().doubleValue(), .001d);
  }

  @Test
  public void testSplits() throws IOException{
    byte[] startKey = "AAAAAAA".getBytes();
    byte[] stopKey = "ZZZZZZZ".getBytes();
    CloudBigtableScanConfiguration config = createDefaultConfig().withKeys(startKey, stopKey).build();
    CloudBigtableIO.Source<Result> source = (Source<Result>) CloudBigtableIO.read(config);
    BoundedSource<Result> sourceWithKeys = source.createSourceWithKeys(startKey, stopKey, 10);

    CloudBigtableIO.Reader<Result> reader = (Reader<Result>) sourceWithKeys.createReader(null);
    ByteKey startByteKey = ByteKey.copyFrom(startKey);
    ByteKey stopByteKey = ByteKey.copyFrom(stopKey);
    ByteKeyRangeTracker baseRangeTracker =
        ByteKeyRangeTracker.of(ByteKeyRange.of(startByteKey, stopByteKey));

    setKey(reader, baseRangeTracker, ByteKey.copyFrom("B".getBytes()));

    for (int i = 0; i < 20; i++) {
      compare(reader, baseRangeTracker);
      bisect(reader, baseRangeTracker);
      split(reader, baseRangeTracker);
    }
  }

  private void split(Reader<Result> reader, ByteKeyRangeTracker baseRangeTracker) {
    double halfway = bisectPercentage(baseRangeTracker);
    reader.splitAtFraction(halfway);
    ByteKey bisectedKey = baseRangeTracker.getRange().interpolateKey(halfway);
    baseRangeTracker.trySplitAtPosition(bisectedKey);
    compare(reader, baseRangeTracker);
  }

  private static void compare(CloudBigtableIO.Reader<Result> reader,
      ByteKeyRangeTracker baseRangeTracker) {
    Assert.assertEquals(baseRangeTracker.getFractionConsumed(), reader.getFractionConsumed(), 0.01);
  }

  private static void bisect(CloudBigtableIO.Reader<Result> reader, ByteKeyRangeTracker baseRangeTracker) {
    double halfway = bisectPercentage(baseRangeTracker);
    ByteKey bisectedKey = baseRangeTracker.getRange().interpolateKey(halfway);
    setKey(reader, baseRangeTracker, bisectedKey);
    compare(reader, baseRangeTracker);
  }

  private static void setKey(CloudBigtableIO.Reader<Result> reader,
      ByteKeyRangeTracker baseRangeTracker, ByteKey key) {
    reader.getRangeTracker().tryReturnRecordAt(true, key);
    baseRangeTracker.tryReturnRecordAt(true, key);
  }

  private static double bisectPercentage(ByteKeyRangeTracker baseRangeTracker) {
    double fractionConsumed = baseRangeTracker.getFractionConsumed();
    return (1.0 + fractionConsumed) / 2.0;
  }
}


text:
namespace app { namespace Fuse { namespace Controls { namespace Graphics { struct GraphicsStyle; } } } }
namespace app { namespace Fuse { namespace Controls { struct Ellipse; } } }

namespace app {
namespace Fuse {
namespace Controls {
namespace Graphics {

struct GraphicsStyle_Template4;

struct GraphicsStyle_Template4__uType : ::app::Uno::UX::Template__Fuse_Controls_Ellipse__uType
{
};

GraphicsStyle_Template4__uType* GraphicsStyle_Template4__typeof();

void GraphicsStyle_Template4___ObjInit_1(GraphicsStyle_Template4* __this, ::app::Fuse::Controls::Graphics::GraphicsStyle* parent);
GraphicsStyle_Template4* GraphicsStyle_Template4__New_1(::uStatic* __this, ::app::Fuse::Controls::Graphics::GraphicsStyle* parent);
void GraphicsStyle_Template4__OnApply(GraphicsStyle_Template4* __this, ::app::Fuse::Controls::Ellipse* self);

struct GraphicsStyle_Template4 : ::app::Uno::UX::Template__Fuse_Controls_Ellipse
{
    ::uStrong< ::app::Fuse::Controls::Graphics::GraphicsStyle*> __parent;

    void _ObjInit_1(::app::Fuse::Controls::Graphics::GraphicsStyle* parent) { GraphicsStyle_Template4___ObjInit_1(this, parent); }
};

}}}}

#endif


text:
package com.feiyu.classes;
/**
 *
 * @author feiyu
 *
 */

public class MovieWithCount implements java.io.Serializable {
  private static final long serialVersionUID = -7011806344559558554L;
  private Movie movie;
  private int count;

  public MovieWithCount() {

  }

  public Movie getMovie() {
    return movie;
  }

  public void setMovie(Movie movie) {
    this.movie = movie;
  }

  public int getCount() {
    return count;
  }

  public void setCount(int count) {
    this.count = count;
  }

  @Override
  public String toString() {
    return "MovieWithCount:{"
        +"Movie:"+ this.movie.toString()
        +",count:" + this.count
        + "}";
  }
}


text:
- [Basic](#basic)
- [Accessing the theme inside the styled component](#accessing-the-theme-inside-the-styled-component)
- [Accessing the theme without a styled component](#accessing-the-theme-without-a-styled-component)
- [The inner component](#the-inner-component)
- [The inner ref](#the-inner-ref)
- [Decorators](#decorators)
- [Injection order](#injection-order)
- [Usage with TypeScript](#usage-with-typescript)

## Usage

React-JSS wraps your component with a [higher-order component](https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750).
It injects a `classes` prop, which is a simple map of rule names and generated class names.

Try it out in the [playground](https://codesandbox.io/s/j3l06yyqpw).

## Basic

```javascript
import React from 'react'
import {render} from 'react-dom'
import withStyles from 'react-jss'

// Create your Styles. Remember, since React-JSS uses the default preset,
// most plugins are available without further configuration needed.
const styles = {
  myButton: {
    color: 'green',
    margin: {
      // jss-plugin-expand gives more readable syntax
      top: 5, // jss-plugin-default-unit makes this 5px
      right: 0,
      bottom: 0,
      left: '1rem'
    },
    '& span': {
      // jss-plugin-nested applies this to a child span
      fontWeight: 'bold' // jss-plugin-camel-case turns this into 'font-weight'
    }
  },
  myLabel: {
    fontStyle: 'italic'
  }
}

// Define the component using these styles and pass it the 'classes' prop.
// Use this to assign scoped class names.
const Button = ({classes, children}) => (
  <button className={classes.myButton}>
    <span className={classes.myLabel}>{children}</span>
  </button>
)

// Finally, inject the stylesheet into the component.
const StyledButton = withStyles(styles)(Button)
// You can also export the component with
// export default withStyles(styles)(Button)

const App = () => <StyledButton>Submit</StyledButton>

render(<App />, document.getElementById('root'))
```

The above code will compile to

```html
<div id="root">
  <button class="Button-myButton-1-25">
    <span class="Button-myLabel-1-26"> Submit </span>
  </button>
</div>
```

and

```css
.Button-myButton-1-25 {
  color: green;
  margin: 5px 0 0 1rem;
}
.Button-myButton-1-25 span {
  font-weight: bold;
}
.Button-myLabel-1-26 {
  font-style: italic;
}
```

## Accessing the theme inside the styled component

The theme will not be injecting into the wrapped component.
To inject the theme into the wrapped component, pass the `injectTheme` option to `withStyles`.

```javascript
import React from 'react'
import withStyles from 'react-jss'

const DeleteIcon = () => null

const Button = ({classes, children, theme}) => (
  <button className={classes.button}>
    <span className={classes.label}>{children}</span>

    {theme.useIconButtons && <DeleteIcon />}
  </button>
)

const styles = (theme) => ({
  button: {
    background: theme.colorPrimary
  },
  label: {
    fontWeight: 'bold'
  }
})

const StyledButton = withStyles(styles, {injectTheme: true})(Button)
```

## Accessing the theme without a styled component

In case you need to access the theme but not render any CSS, you can also use `withTheme`. It is a Higher-order Component factory which takes a `React.Component` and maps the theme object from context to props. [Read more about `withTheme` in `theming`'s documentation.](https://github.com/cssinjs/theming#withthemecomponent)

```javascript
import React from 'react'
import {withTheme} from 'react-jss'

const Button = withTheme(({theme}) => <button>I can access {theme.colorPrimary}</button>)
```

## The inner component

```javascript
import withStyles from 'react-jss'

const InnerComponent = () => null
const StyledComponent = withStyles({})(InnerComponent)
console.log(StyledComponent.InnerComponent) // Prints out the inner component.
```

## The inner ref

To get a `ref` to the inner element, use the `ref` prop.
We will forward the ref to the inner component.

```javascript
import React from 'react'
import withStyles from 'react-jss'

const InnerComponent = () => null
const StyledComponent = withStyles({})(InnerComponent)

const App = (
  <StyledComponent
    ref={(ref) => {
      console.log(ref)
    }}
  />
)
```

## Decorators

_Beware that [decorators are stage-2 proposal](https://tc39.github.io/proposal-decorators/), so there are [no guarantees that decorators will make its way into language specification](https://tc39.github.io/process-document/). Do not use it in production. Use it at your own risk and only if you know what you are doing._

You will need [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy).

```javascript
import React, {Component} from 'react'
import withStyles from 'react-jss'

const styles = {
  button: {
    backgroundColor: 'yellow'
  },
  label: {
    fontWeight: 'bold'
  }
}

@withStyles(styles)
class Button extends Component {
  render() {
    const {classes, children} = this.props
    return (
      <button className={classes.button}>
        <span className={classes.label}>{children}</span>
      </button>
    )
  }
}

export default Button
```

## Injection order

Injection of style tags happens in the same order as the `withStyles()` invocation.
Source order specificity is higher the lower style tag is in the tree. Therefore you should call `withStyles` of components you want to override first.

Example

```javascript
import React from 'react'
import withStyles from 'react-jss'

const labelStyles = {}
const buttonStyles = {}

// Will render labelStyles first.
const Label = withStyles(labelStyles)(({children}) => <label>{children}</label>)
const Button = withStyles(buttonStyles)(() => (
  <button>
    <Label>my button</Label>
  </button>
))
```

## Usage with TypeScript

React JSS includes first class support for TypeScript. React JSS provides
a `WithStyles` type which adds types for all of the injected props.
To use it, simply extend your existing props interface with
`WithStyles<typeof styles>`, where `styles` is your styles object.

> Note: To use WithStyles you must use react-jss version 10 or higher.

Example

```typescript
import * as React from 'react'
import withStyles, {WithStylesProps} from 'react-jss'

const styles = {
  button: {
    backgroundColor: 'yellow'
  },
  label: {
    fontWeight: 'bold'
  }
}

interface IProps extends WithStylesProps<typeof styles> {
  children: React.ReactNode
}

const Button: React.FunctionComponent<IProps> = ({classes, children}) => (
  <button className={classes.button}>
    <span className={classes.label}>{children}</span>
  </button>
)

export default withStyles(styles)(Button)
```