text:
const xtend = require('xtend')
const AbstractIterator = require('./abstract-iterator')
const AbstractChainedBatch = require('./abstract-chained-batch')
const hasOwnProperty = Object.prototype.hasOwnProperty
const rangeOptions = 'start end gt gte lt lte'.split(' ')

function AbstractLevelDOWN (location) {
  if (!arguments.length || location === undefined) {
    throw new Error('constructor requires at least a location argument')
  }

  if (typeof location !== 'string') {
    throw new Error('constructor requires a location string argument')
  }

  this.location = location
  this.status = 'new'
}

AbstractLevelDOWN.prototype.open = function (options, callback) {
  var self = this
  var oldStatus = this.status

  if (typeof options === 'function') { callback = options }

  if (typeof callback !== 'function') {
    throw new Error('open() requires a callback argument')
  }

  if (typeof options !== 'object') { options = {} }

  options.createIfMissing = options.createIfMissing !== false
  options.errorIfExists = !!options.errorIfExists

  this.status = 'opening'
  this._open(options, function (err) {
    if (err) {
      self.status = oldStatus
      return callback(err)
    }
    self.status = 'open'
    callback()
  })
}

AbstractLevelDOWN.prototype._open = function (options, callback) {
  process.nextTick(callback)
}

AbstractLevelDOWN.prototype.close = function (callback) {
  var self = this
  var oldStatus = this.status

  if (typeof callback !== 'function') {
    throw new Error('close() requires a callback argument')
  }

  this.status = 'closing'
  this._close(function (err) {
    if (err) {
      self.status = oldStatus
      return callback(err)
    }
    self.status = 'closed'
    callback()
  })
}

AbstractLevelDOWN.prototype._close = function (callback) {
  process.nextTick(callback)
}

AbstractLevelDOWN.prototype.get = function (key, options, callback) {
  if (typeof options === 'function') { callback = options }

  if (typeof callback !== 'function') {
    throw new Error('get() requires a callback argument')
  }

  var err = this._checkKey(key, 'key')
  if (err) return process.nextTick(callback, err)

  key = this._serializeKey(key)

  if (typeof options !== 'object') { options = {} }

  options.asBuffer = options.asBuffer !== false

  this._get(key, options, callback)
}

AbstractLevelDOWN.prototype._get = function (key, options, callback) {
  process.nextTick(function () { callback(new Error('NotFound')) })
}

AbstractLevelDOWN.prototype.put = function (key, value, options, callback) {
  if (typeof options === 'function') { callback = options }

  if (typeof callback !== 'function') {
    throw new Error('put() requires a callback argument')
  }

  var err = this._checkKey(key, 'key')
  if (err) return process.nextTick(callback, err)

  key = this._serializeKey(key)
  value = this._serializeValue(value)

  if (typeof options !== 'object') { options = {} }

  this._put(key, value, options, callback)
}

AbstractLevelDOWN.prototype._put = function (key, value, options, callback) {
  process.nextTick(callback)
}

AbstractLevelDOWN.prototype.del = function (key, options, callback) {
  if (typeof options === 'function') { callback = options }

  if (typeof callback !== 'function') {
    throw new Error('del() requires a callback argument')
  }

  var err = this._checkKey(key, 'key')
  if (err) return process.nextTick(callback, err)

  key = this._serializeKey(key)

  if (typeof options !== 'object') { options = {} }

  this._del(key, options, callback)
}

AbstractLevelDOWN.prototype._del = function (key, options, callback) {
  process.nextTick(callback)
}

AbstractLevelDOWN.prototype.batch = function (array, options, callback) {
  if (!arguments.length) { return this._chainedBatch() }

  if (typeof options === 'function') { callback = options }

  if (typeof array === 'function') { callback = array }

  if (typeof callback !== 'function') {
    throw new Error('batch(array) requires a callback argument')
  }

  if (!Array.isArray(array)) {
    return process.nextTick(callback, new Error('batch(array) requires an array argument'))
  }

  if (!options || typeof options !== 'object') { options = {} }

  var serialized = new Array(array.length)

  for (var i = 0; i < array.length; i++) {
    if (typeof array[i] !== 'object' || array[i] === null) {
      return process.nextTick(callback, new Error('batch(array) element must be an object and not `null`'))
    }

    var e = xtend(array[i])

    if (e.type !== 'put' && e.type !== 'del') {
      return process.nextTick(callback, new Error("`type` must be 'put' or 'del'"))
    }

    var err = this._checkKey(e.key, 'key')
    if (err) return process.nextTick(callback, err)

    e.key = this._serializeKey(e.key)

    if (e.type === 'put') { e.value = this._serializeValue(e.value) }

    serialized[i] = e
  }

  this._batch(serialized, options, callback)
}

AbstractLevelDOWN.prototype._batch = function (array, options, callback) {
  process.nextTick(callback)
}

AbstractLevelDOWN.prototype._setupIteratorOptions = function (options) {
  options = cleanRangeOptions(options)

  options.reverse = !!options.reverse
  options.keys = options.keys !== false
  options.values = options.values !== false
  options.limit = 'limit' in options ? options.limit : -1
  options.keyAsBuffer = options.keyAsBuffer !== false
  options.valueAsBuffer = options.valueAsBuffer !== false

  return options
}

function cleanRangeOptions (options) {
  var result = {}

  for (var k in options) {
    if (!hasOwnProperty.call(options, k)) continue
    if (isRangeOption(k) && isEmptyRangeOption(options[k])) continue

    result[k] = options[k]
  }

  return result
}

function isRangeOption (k) {
  return rangeOptions.indexOf(k) !== -1
}

function isEmptyRangeOption (v) {
  return v === '' || v == null || isEmptyBuffer(v)
}

function isEmptyBuffer (v) {
  return Buffer.isBuffer(v) && v.length === 0
}

AbstractLevelDOWN.prototype.iterator = function (options) {
  if (typeof options !== 'object') { options = {} }
  options = this._setupIteratorOptions(options)
  return this._iterator(options)
}

AbstractLevelDOWN.prototype._iterator = function (options) {
  return new AbstractIterator(this)
}

AbstractLevelDOWN.prototype._chainedBatch = function () {
  return new AbstractChainedBatch(this)
}

AbstractLevelDOWN.prototype._serializeKey = function (key) {
  return Buffer.isBuffer(key) ? key : String(key)
}

AbstractLevelDOWN.prototype._serializeValue = function (value) {
  if (value == null) return ''
  return Buffer.isBuffer(value) || process.browser ? value : String(value)
}

AbstractLevelDOWN.prototype._checkKey = function (obj, type) {
  if (obj === null || obj === undefined) {
    return new Error(type + ' cannot be `null` or `undefined`')
  }

  if (Buffer.isBuffer(obj) && obj.length === 0) {
    return new Error(type + ' cannot be an empty Buffer')
  }

  if (String(obj) === '') {
    return new Error(type + ' cannot be an empty String')
  }
}

module.exports = AbstractLevelDOWN

redpajama_set_name: RedPajamaGithub


text:
package org.kuali.kra.irb.actions.submit;

import org.kuali.kra.drools.brms.FactBean;
import org.kuali.kra.irb.Protocol;
import org.kuali.kra.irb.actions.ProtocolAction;

/*
 * This is the post condition attributes for a protocol action
 */
public class ProtocolUndoActionMapping implements FactBean {

    String actionTypeCode;
    String submissionTypeCode;
    String protocolStatusCode;

    boolean protocolSubmissionToBeDeleted = false;

    Protocol protocol;

    ProtocolSubmission protocolSubmission;

    ProtocolAction protocolAction;

    public ProtocolUndoActionMapping(String actionTypeCode, String submissionTypeCode, String protocolStatusCode) {
        super();
        this.actionTypeCode=actionTypeCode;
        this.submissionTypeCode = submissionTypeCode;
        this.protocolStatusCode = protocolStatusCode;
    }

    public ProtocolSubmission getProtocolSubmission() {
        return protocolSubmission;
    }

    public void setProtocolSubmission(ProtocolSubmission protocolSubmission) {
        this.protocolSubmission = protocolSubmission;
    }

    public String getActionTypeCode() {
        return actionTypeCode;
    }

    public void setActionTypeCode(String actionTypeCode) {
        this.actionTypeCode = actionTypeCode;
    }

    public String getSubmissionTypeCode() {
        return submissionTypeCode;
    }

    public void setSubmissionTypeCode(String submissionTypeCode) {
        this.submissionTypeCode = submissionTypeCode;
    }

    public String getProtocolStatusCode() {
        return protocolStatusCode;
    }

    public void setProtocolStatusCode(String protocolStatusCode) {
        this.protocolStatusCode = protocolStatusCode;
    }

    public Protocol getProtocol() {
        return protocol;
    }

    public void setProtocol(Protocol protocol) {
        this.protocol = protocol;
    }

    public ProtocolAction getProtocolAction() {
        return protocolAction;
    }

    public void setProtocolAction(ProtocolAction protocolAction) {
        this.protocolAction = protocolAction;
    }

    public boolean isProtocolSubmissionToBeDeleted() {
        return protocolSubmissionToBeDeleted;
    }

    public void setProtocolSubmissionToBeDeleted(boolean protocolSubmissionToBeDeleted) {
        this.protocolSubmissionToBeDeleted = protocolSubmissionToBeDeleted;
    }

}


text:
require 'active_model'
require 'builder'
require 'logger'
require 'httparty'
require 'json'

module MyMoip
  class << self
    attr_accessor :production_key, :production_token,
                  :sandbox_key, :sandbox_token,
                  :environment, :logger, :default_referer_url

    def api_url
      if environment == "sandbox"
        "https://desenvolvedor.moip.com.br/sandbox"
      else
        "https://www.moip.com.br"
      end
    end

    def key=(value)
      warn "[DEPRECATION] `key=` is deprecated. Please use `sandbox_key` or `production_key` instead."
      @production_key = @sandbox_key = value
    end

    def token=(value)
      warn "[DEPRECATION] `token=` is deprecated. Please use `sandbox_token` or `production_token` instead."
      @production_token = @sandbox_token = value
    end

    def key
      send(:"#{environment}_key")
    end

    def token
      send(:"#{environment}_token")
    end

    def ensure_key_and_token_set!
      if MyMoip.key.blank?
        raise StandardError, "Invalid MyMoip.#{environment}_key set."
      elsif MyMoip.token.blank?
        raise StandardError, "Invalid MyMoip.#{environment}_token set."
      end
    end
  end
end

$LOAD_PATH << "./lib/mymoip"

require File.dirname(__FILE__) + "/mymoip/validators.rb"

files = Dir[File.dirname(__FILE__) + "/mymoip/*.rb"]
files.each { |f| require f }

MyMoip.environment = "sandbox"
MyMoip.logger      = Logger.new(STDOUT)


text:
require 'singleton'
require 'yaml'

class Figure < Hash

  include Singleton

  include DepartmentStore
  include Store

  class << self

    attr_accessor :env

    def initializers
      @initializers ||= []
    end

    def config_directories
      @config_directories ||= []
    end

    def responders
      @responders ||= []
    end

    def stores
      @stores ||= {}
    end

    def configure
      yield self
    end

    def method_missing(*args, m)
      if @instantiated
        super
      else
        @instantiated = instance
        send m
      end
    end

  end

  CONFIG_GLOBS = %w|**/*figure.yml **/figure/*.yml **/gaston/*.yml|

  def initialize
    self.class.initializers.each &:initialize!
    @config_directories = self.class.config_directories.map { |path| Pathname.new path }
    store!
  end

  def store!
    config_files do |name, conf|
      self[name.to_sym] = new_store name, YAML.load(conf.read)
    end
  end

  def []=(k, v)
    super.tap do |value|
      self.class.define_singleton_method k.to_sym do
        instance.send k
      end
    end
  end

  def config_files
    Dir[ *all_config_directories_globs ].map do |file|
      path = Pathname.new file
      name = path.basename.to_s.sub('.yml', '').sub('.figure', '')

      yield name, path if block_given?
    end
  end

  private

  def config_directories
    @config_directories ||= [ ascend_path ]
  end

  def all_config_directories_globs
    config_directories.map do |dir|
      CONFIG_GLOBS.map do |glob|
        dir.join glob
      end
    end.flatten
  end

  def ascend_path
    Pathname.new(__FILE__).ascend do |path|
      @config_directories << path.join('config') if path.join('config').exist?
      @config_directories << path if path.join('figure.yml').exist?
    end
  end

end


text:
package ficha2_LI41N_14_15;

import org.junit.BeforeClass;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

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

/**
 * Created by Ruben Gomes on 24/06/2015.
 */
public class TestImplementations {

    static final Implementations  _implementations = new Implementations();
    static List<Classroom> classrooms;

    @BeforeClass
    public static void setClassRooms(){
        classrooms = Arrays.asList(
                new Classroom("LS",getStudentsForLS),
                new Classroom("MPD",getStudentsForMPD),
                new Classroom("PI",getStudentsForPI),
                new Classroom("PC",getStudentsForPC)
        );
    }

    static  List<Student> getStudentsForPC =
        Arrays.asList(
                    new Student(39367,"Rúben",4000000,1992),
                    new Student(23984,"Sílvio",10000000,1973)

                );

    static  List<Student> getStudentsForLS =
            Arrays.asList(
                    new Student(39367,"Filipe",4000000,1992),
                    new Student(23984,"Humberto",10000000,1973)

            );

    static  List<Student> getStudentsForMPD =
        Arrays.asList(
                new Student(39367,"João Pedro",4000000,1992),
                new Student(23984,"Manuel",10000000,1973),
                new Student(12345,"Zé Carlos",300000,1994)
        );

    static  List<Student> getStudentsForPI =
        Arrays.asList(
                new Student(39367,"Rúben Gomes",4000000,1992),
                new Student(23984,"Roberto",10000000,1973),
                new Student(12345,"Zé Manel",305000,1994),
                new Student(45632,"Diogo",4500000,1990)
        );

    //a
    @Test
    public void testShouldGetClassPI(){

        int maxNrOfStudents = 3;

        Stream<Classroom> classPi = _implementations.overCrowdedClass(classrooms.stream(),maxNrOfStudents);

        Classroom pi = classPi.findFirst().get();

        assertEquals("PI", pi.id);
    }

    @Test
    public void testShouldGetClassMPDandPI(){
        int maxNrOfStudents = 2;

        Stream<Classroom> classes = _implementations.overCrowdedClass(classrooms.stream(),maxNrOfStudents);

        List<Classroom> classesList = classes.collect(toList());

        assertEquals("MPD", classesList.get(0).id);
        assertEquals("PI", classesList.get(1).id);
    }

    //b

    @Test
    public void testShouldGetPI_biggestClass(){

        Classroom biggest = _implementations.biggestClass(classrooms.stream());

        assertEquals("PI",biggest.id);
    }

    @Test
    public void testShouldGetPI_biggestClassWithReduce(){
        Classroom biggest = _implementations.biggestClassWithReduce(classrooms.stream());

        assertEquals("PI", biggest.id);
    }

    @Test
    public void testShouldGetPI_biggestClassWithMax(){
        Classroom biggest = _implementations.biggestClassWithMax(classrooms.stream());

        assertEquals("PI", biggest.id);
    }

    //c

    @Test
    public void testShouldGetYoungestStudent(){
        String youngest = _implementations.youngestStudent(classrooms.stream());

        assertEquals("Zé Carlos",youngest);
    }

    //d
    @Test
    public void testClassesByNrOfStudents(){

        Map<Integer,List<Classroom>> classesByNrOfStudents =
                _implementations.classesByNrOfStudents(classrooms.stream());

        //System.out.println(classesByNrOfStudents);
        classesByNrOfStudents.entrySet().stream()
                .forEach((entrySet)->{
                    System.out.printf("Classes with nr of Students = %d \n", entrySet.getKey());
                    entrySet.getValue().stream()
                            .forEach(System.out::println);
                });
    }

    @Test
    public void testClassesByNrOfStudentsWithMapping(){
        Map<Integer,List<Classroom>> classesByNrOfStudents =
                _implementations.classesByNrOfStudentsWithMapping(classrooms.stream());

        //System.out.println(classesByNrOfStudents);
        classesByNrOfStudents.entrySet().stream()
                .forEach((entrySet)->{
                    System.out.printf("Classes with nr of Students = %d \n", entrySet.getKey());
                    entrySet.getValue().stream()
                            .forEach(System.out::println);
                });
    }

    //e
    @Test
    public void classesIdByNrOfStudents(){
        Map<Integer,List<String>> classesIdByNrOfStudents =
                _implementations.classesIdByNrOfStudents(classrooms.stream());

        //System.out.println(classesIdByNrOfStudents);
        classesIdByNrOfStudents.entrySet().stream()
                .forEach((entrySet)->{
                    System.out.printf("Classes with nr of Students = %d \n", entrySet.getKey());
                    entrySet.getValue().stream()
                            .forEach(System.out::println);
                });
    }

    //f

    @Test
    public void studentsNameByBirthYears(){
        Map<Integer,List<String>> studentsNameByBirthYear =
                _implementations.studentsNameByBirthYear(classrooms.stream());

        System.out.println(studentsNameByBirthYear);
        /*studentsNameByBirthYear.entrySet().stream()
                .forEach((entrySet)->{
                    System.out.printf("Students birth -> %d \n", entrySet.getKey());
                    entrySet.getValue().stream()
                            .forEach(System.out::println);
                });
                */
    }

    //4
    @Test
    public void testServiceWrapper(){

        ServiceWrapper<String> serv = new ServiceWrapper<>(new PureService<>());

        serv.addSubscriber(
                elem -> System.out.println("Succeeded with " + elem),
                excep -> System.out.println("bhaaaa")
        );
        serv.start();

    }

}


text:
package com.vmware.vim25;

/**
 * @author Steve Jin (http://www.doublecloud.org)
 * @version 5.1
 */

public enum CustomizationSysprepRebootOption {
    reboot("reboot"),
    noreboot("noreboot"),
    shutdown("shutdown");

    @SuppressWarnings("unused")
    private final String val;

    private CustomizationSysprepRebootOption(String val) {
        this.val = val;
    }
}


text:
package org.apereo.cas.mgmt.services.web.beans;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Defines the service bean that is produced by the webapp
 * and passed down.
 * @author Misagh Moayyed
 * @since 4.1
 */
public class RegisteredServiceViewBean implements Serializable {

    private static final long serialVersionUID = 4882440567964605644L;

    private int evalOrder = Integer.MIN_VALUE;
    private String assignedId;
    private boolean sasCASEnabled;
    private String serviceId;
    private String name;
    private String description;
    private String logoUrl;
    private RegisteredServiceProxyPolicyBean proxyPolicy = new RegisteredServiceProxyPolicyBean();
    private RegisteredServiceAttributeReleasePolicyViewBean attrRelease = new RegisteredServiceAttributeReleasePolicyViewBean();
    private Map<String, Map<String, ?>> customComponent = new HashMap<>();

    public int getEvalOrder() {
        return this.evalOrder;
    }

    public void setEvalOrder(final int evalOrder) {
        this.evalOrder = evalOrder;
    }

    public String getAssignedId() {
        return this.assignedId;
    }

    public void setAssignedId(final String assignedId) {
        this.assignedId = assignedId;
    }

    public boolean isSasCASEnabled() {
        return this.sasCASEnabled;
    }

    public void setSasCASEnabled(final boolean sasCASEnabled) {
        this.sasCASEnabled = sasCASEnabled;
    }

    public String getServiceId() {
        return this.serviceId;
    }

    public void setServiceId(final String serviceId) {
        this.serviceId = serviceId;
    }

    public String getName() {
        return this.name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    public String getLogoUrl() {
        return this.logoUrl;
    }

    public void setLogoUrl(final String logoUrl) {
        this.logoUrl = logoUrl;
    }

    public RegisteredServiceProxyPolicyBean getProxyPolicy() {
        return this.proxyPolicy;
    }

    public void setProxyPolicy(final RegisteredServiceProxyPolicyBean proxyPolicy) {
        this.proxyPolicy = proxyPolicy;
    }

    public RegisteredServiceAttributeReleasePolicyViewBean getAttrRelease() {
        return this.attrRelease;
    }

    public void setAttrRelease(final RegisteredServiceAttributeReleasePolicyViewBean attrRelease) {
        this.attrRelease = attrRelease;
    }

    /**
     * Visible for serialization only. Use {@link RegisteredServiceViewBean#getCustomComponent(String)} instead.
     *
     * @return all the custom components
     */
    public Map<String, Map<String, ?>> getCustomComponent() {
        return this.customComponent;
    }

    /**
     * Get the current properties for the specified custom component. The returned {@link Map} should only contain
     * nested Maps, Arrays, and simple objects.
     *
     * @param componentName name of the component to get the properties for (this should be unique for each component)
     * @return current custom component properties
     */
    public Map<String, ?> getCustomComponent(final String componentName) {
        return this.customComponent.get(componentName);
    }

    /**
     * This is reserved for usage by any custom components that need to present their config to the management UI. The
     * provided {@link Map} should only contain nested Maps, Arrays, and simple objects.
     *
     * @param componentName name of the component to store the properties for (this should be unique for each component)
     * @param properties    custom component properties
     */
    public void setCustomComponent(final String componentName, final Map<String, ?> properties) {
        this.customComponent.put(componentName, properties);
    }
}


text:
MIME-Version: 1.0
Server: CERN/3.0
Date: Wednesday, 20-Nov-96 18:58:32 GMT
Content-Type: text/html
Content-Length: 6596
Last-Modified: Tuesday, 09-Jul-96 14:51:12 GMT

<title>David Gries -Home Page</title>

<!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0>
<!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1>

David Gries

William L. Lewis Professor of Engineering

Dr. rer. nat., Munich Institute of Technology, 1966

My interests are in programming methodology, in particular the formal
development of programs, and in related areas such as programming
languages, programming language semantics, and logic. I am as
interested in the teaching of these topics as I am in further research
in them.  In fact, understanding how logic and formalism can be taught
as a useful tool at the freshman/sophomore college level has been an
overriding concern of mine in the 1990's.

Click on any of the following items for more information.

 <!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2>Teaching logic as a tool

 <!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3>Curriculum Vita

 <!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4>Short biography

 <!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5>Texts written by Gries

 <!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6>The programming language Polya

 <!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7>Announcement of DIMACS Symposium on teaching logic

       <!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8>Links to papers for the symposium.

 <!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9>Cornell CS Department Home Page

<ADDRESS>
Computer Science, Upson Hall

Cornell University

Ithaca, NY 14853

(607) 255-9207  gries@cs.cornell.edu
</ADDRESS>

Short biography of David Gries

I was born in Flushing, New York, and spent 21 years there before I
escaped.  I received a B.S. Queens College in 1960 and went to work
for the U.S. Naval Weapons laboratory (as a civilian) as a
mathematician-programmer. I met my wife-to-be, Elaine, a few
months later, and we were married in November 1961.

We went to Illinois for more education. I received a Masters degree
in math from Illinois in 1963. My assistantship was to help two
Germans, Manfred Paul and Ruediger Wiehle, write a full Algol compiler
for the IBM 7090 computer --it was fun, figuring out how to implement
recursion efficiently before there were many papers on the topic.

This ended up in my wife and I going to Munich for almost three years.
I received my doctorate under F.L. Bauer and Joseph Stoer from MIT
(the Munich Institute of Technology, Germany) in June 1966. This was
in math, or numerical analysis, since computer science theses were not
yet kosher.

I was an assistant professor of Computer Science at Stanford from
1966 to 1969. While at Stanford, our twins Paul and Susan were born.
What made it more exciting than usual was that they were born on the
birthday of myself and my twin --26 April. So, when my twin is in
town, Elaine makes four birthday cakes.

We left Stanford because it had no weather. We moved to Cornell, which
has weather, in 1969 and have been snowed in ever since. I was
Department Chair in 1982-87, and I became the William L. Lewis
Professor of Engineering in 1992.  I had a Guggenheim Fellowship in
1984-85.

<!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10>Return to table of contents

I am better known for my
<!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11>text writing
and my contributions to education than on the
wonderfulness of my research.  Do what you are good at; bloom where
you are planted. I have received a number of awards for contributions
to education: the 1994 IEEE Taylor L. Booth Award, the ACM SIGCSE
award in 1991, a Cornell Outstanding Educator Award in 1990, the Clark
Award from Cornell's College of Arts & Sciences in 1986, and the
American Federation of Information Processing Societies' (AFIPS)
education award in 1985.

I am proud of all my Ph.D. advisees, but two stand out. Susan
Owicki's thesis laid the foundation for proofs of correctness of
parallel programs, with the notion of interference-freeness.
A paper co-authored by us on the topic won the 1977 ACM Award for best
paper in programming langauges and systems. And
<!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12>T.V. Raman's
thesis just won the ACM best-dissertation award for 1993-94. Raman designed
and implemented a system for "speaking" any tex/latex document,
including technical articles and books. The same document can be printed
or spoken. Being able to speak
mathematics in an effective manner was an important goal of his work.
Reading for the Blind is already using his system to produce audio
cassettes.

I served as Chair of the Computing Research Association (then the
Computer Science Board) in the late 1980's when it opened its office
in Washington and began seriously to represent computing research
interests. I also conducted the Taulbee Surveys in the period
1984-1991 and am proud of obtaining essentially complete responses
from PhD-granting computer science departments during that period. No
other comparable survey has had such a response rate.  One year, it
required only 256 telephone calls to get the 150 departments to send
in their questionnaires.  I received the Computing Research
Association's 1991 Service Award for this work on the Surveys and for
chairing the Association during its move toward respectability and
responsibility.

I am currently editor for IPL, Acta Informatica,
Formal Aspects of Computing, and Software Concepts and
Tools.  This editing keeps me busy, but I enjoy it. I try to take
an interest in individual papers, when I know the area, and will
suggest substantial rewrites myself when I believe it will help. Serve
where you can best serve. Fred
B. Schneider and I are co-editors of Springer Verlag Texts and
Monographs in Computer Science.

What do I do in my spare time? It used to be sports like golf,
softball, volleyball, swimming and table tennis. (Once, in China, I
split my pants playing ping pong. An hour later, while giving a
lecture, I mentioned that the audience should not laugh when I turned
around, and I explained why. The interpreter spoke, and everyone
laughed.  However, I don't know whether he told the truth or just
said, "Gries made a joke, laugh.".) I also used to sing barbershop and
Gilbert and Sullivan. And working around the house --carpentry,
wiring, remodeling-- has taken a lot of time and yielded considerable
satisfaction.

<!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13>Return to table of contents


text:
define(function (require) {
	var Backbone = require('backbone')

	return Backbone.Model.extend({
		defaults: function () {
			return {
				index: '',
				order: '',
				settings: ''
			}
		}
	})
})


text:
/*
 * Copyright (C) 2004-2011
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.sun.xml.internal.rngom.xml.sax;

import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

/**
 * A factory for XMLReaders.  Thread-safety is determined by each particular
 * implementation of this interface.
 *
 * @author James Clark
 */
public interface XMLReaderCreator {
  /**
   * Creates a new XMLReader.
   *
   * @return a new XMLReader; never null
   * @throws org.xml.sax.SAXException If an XMLReader cannot be created for any reason
   */
  XMLReader createXMLReader() throws SAXException;
}


text:
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.telemetry.metrics;

import com.snowplowanalytics.snowplow.tracker.events.Unstructured;
import com.snowplowanalytics.snowplow.tracker.payload.SelfDescribingJson;
import org.reflections.ReflectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.engine.config.facade.TelemetryConfiguration;
import org.terasology.engine.context.Context;
import org.terasology.engine.core.subsystem.DisplayDevice;
import org.terasology.gestalt.module.sandbox.API;
import org.terasology.engine.registry.CoreRegistry;
import org.terasology.engine.telemetry.Metrics;
import org.terasology.engine.telemetry.TelemetryCategory;
import org.terasology.engine.telemetry.TelemetryField;

import java.lang.reflect.Field;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/**
 * An abstract class for a telemetry metric.
 * A new metric should extends this class, with annotation {@link org.terasology.engine.telemetry.TelemetryCategory}.
 * All metric fields should be annotated {@link org.terasology.engine.telemetry.TelemetryField}.
 * An example is {@link org.terasology.engine.telemetry.metrics.SystemContextMetric}.
 * The metric will be instantiated automatically in {@link org.terasology.engine.telemetry.Metrics}
 * By convention, a new Metric can have only one constructor and constructor will need no arguments
 * or only {@link org.terasology.engine.context.Context}.
 * If a Metric Constructor needs some specific arguments other than {@link org.terasology.engine.context.Context},
 * it should be instantiated and added to {@link org.terasology.engine.telemetry.Metrics} manually.
 */
@API
public abstract class Metric {

    private static final Logger logger = LoggerFactory.getLogger(Metric.class);

    /**
     * The map contains telemetry field name as key and field value as value.
     * If the telemetry field is a map, then this map equals to that.
     */
    protected Map<String, Object> telemetryFieldToValue = new HashMap<>();

    /**
     * Generates a snowplow unstructured event that the snowplow tracker can track.
     * @return an snowplow unstructured event.
     */
    public abstract Optional<Unstructured> getUnstructuredMetric();

    /**
     * Generates a snowplow unstructured event.
     * This method helps to implement abstract getUnstructuredMetric method.
     * You can find example in {@link org.terasology.engine.telemetry.metrics.ModulesMetric}
     * and {@link org.terasology.engine.telemetry.metrics.SystemContextMetric}
     * @param schema the snowplow event register schema.
     * @param mapSentToServer the map that contains the data sent to the server.
     * @return Null option if the mapSentToServer doesn't contain data.
     */
    public Optional<Unstructured> getUnstructuredMetric(String schema, Map<String, Object> mapSentToServer) {
        Optional<Unstructured> optional = Optional.empty();
        if (!isEmpty()) {
            SelfDescribingJson modulesData = new SelfDescribingJson(schema, mapSentToServer);
            Unstructured unstructured =  Unstructured.builder().
                    eventData(modulesData).
                    build();
            optional = Optional.of(unstructured);
        }
        return optional;
    }

    /**
     * Fetches all TelemetryFields and create a map associating field's name (key) to field's value (value).
     * @return a map with key (field's name) and value (field's value).
     */
    public Map<String, ?> createTelemetryFieldToValue() {
        return AccessController.doPrivileged((PrivilegedAction<Map<String, ?>>) () -> {

            telemetryFieldToValue = new HashMap<>();
            Set<Field> fields = ReflectionUtils.getFields(this.getClass(), ReflectionUtils.withAnnotation(TelemetryField.class));

            for (Field field : fields) {
                try {
                    field.setAccessible(true);
                    telemetryFieldToValue.put(field.getName(), field.get(this));
                } catch (IllegalAccessException e) {
                    logger.error("The field is not inaccessible: ", e);
                }
            }

            return telemetryFieldToValue;
        });
    }

    /**
     * Filter the metric map by the binding map.
     * If the user doesn't want the field to be sent, its value will be covered by "Disabled Field".
     * @param bindingMap the binding map.
     * @return a new metric map that covers the field that the user doesn't want to send by "Disabled Field".
     */
    protected Map<String, Object> filterMetricMap(Map<String, Boolean> bindingMap) {
        TelemetryCategory telemetryCategory = this.getClass().getAnnotation(TelemetryCategory.class);
        Context context = CoreRegistry.get(Context.class);
        DisplayDevice display = context.get(DisplayDevice.class);
        if (display.isHeadless() || telemetryCategory.isOneMapMetric()) {
            return telemetryFieldToValue;
        }
        Map<String, Object> metricMapAfterPermission = new HashMap<>();
        for (String fieldName : telemetryFieldToValue.keySet()) {
            String fieldNameWithID = telemetryCategory.id() + ":" + fieldName;
            if (bindingMap.containsKey(fieldNameWithID)) {
                if (bindingMap.get(fieldNameWithID)) {
                    metricMapAfterPermission.put(fieldName, telemetryFieldToValue.get(fieldName));
                } else {
                    metricMapAfterPermission.put(fieldName, "Disabled Field");
                }
            }
        }

        return metricMapAfterPermission;
    }

    /**
     * Filter the metric map by the binding map.
     * If the user doesn't want the field to be sent, its value will be covered by "Disabled Field".
     * This method could be used in module since {@link org.terasology.engine.config.facade.TelemetryConfiguration} is exposed to modules
     * @param telemetryConfiguration the telemetry configuration exposed modules
     * @return a new metric map that covers the field that the user doesn't want to send by "Disabled Field".
     */
    protected Map<String, Object> filterMetricMap(TelemetryConfiguration telemetryConfiguration) {
        TelemetryCategory telemetryCategory = this.getClass().getAnnotation(TelemetryCategory.class);
        Context context = CoreRegistry.get(Context.class);
        DisplayDevice display = context.get(DisplayDevice.class);
        if (display.isHeadless() || telemetryCategory.isOneMapMetric()) {
            return telemetryFieldToValue;
        }
        Map<String, Object> metricMapAfterPermission = new HashMap<>();
        for (String fieldName : telemetryFieldToValue.keySet()) {
            String fieldNameWithID = telemetryCategory.id() + ":" + fieldName;
            if (telemetryConfiguration.containsField(fieldNameWithID)) {
                if (telemetryConfiguration.get(fieldNameWithID)) {
                    metricMapAfterPermission.put(fieldName, telemetryFieldToValue.get(fieldName));
                } else {
                    metricMapAfterPermission.put(fieldName, "Disabled Field");
                }
            }
        }
        return metricMapAfterPermission;
    }

    /**
     * Add the new metric to {@link org.terasology.engine.telemetry.Metrics} instance.
     * This method will only be used when a metric constructor needs some specific arguments
     * other than {@link org.terasology.engine.context.Context}.
     * @param metrics the metrics class instance in the game context.
     */
    public void addToMetrics(Metrics metrics) {
        metrics.addMetric(this);
    }

    /**
     * Get a list of all the telemetry field names marked with {@link org.terasology.engine.telemetry.TelemetryField} annotation in this class.
     * The field name is in the form telemetryCategory.id() + ":" fieldName.
     * @return the list of all the telemetry field names in this class.
     */
    public List<String> createTelemetryFieldList() {
        TelemetryCategory telemetryCategory = this.getClass().getAnnotation(TelemetryCategory.class);
        List<String> fieldsList = new ArrayList<>();
        if (!telemetryCategory.isOneMapMetric()) {
            Set<Field> fields = ReflectionUtils.getFields(this.getClass(), ReflectionUtils.withAnnotation(TelemetryField.class));
            for (Field field : fields) {
                String fieldName = telemetryCategory.id() + ":" + field.getName();
                fieldsList.add(fieldName);
            }
        }
        return fieldsList;
    }

    public boolean isEmpty() {
        return (telemetryFieldToValue.size() == 0);
    }
}


text:
external help file: Microsoft.Azure.Commands.Compute.dll-Help.xml
ms.assetid: 92F192A5-F75E-4EFE-B2D2-B0DF0B78D3B5
online version:
schema: 2.0.0
---

# New-AzureRmVmssIpConfig

## SYNOPSIS
Creates an IP configuration for a network interface of a VMSS.

## SYNTAX

```
New-AzureRmVmssIpConfig [[-Name] <String>] [[-Id] <String>] [[-SubnetId] <String>]
 [[-ApplicationGatewayBackendAddressPoolsId] <String[]>] [[-LoadBalancerBackendAddressPoolsId] <String[]>]
 [[-LoadBalancerInboundNatPoolsId] <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
The **New-AzureRmVmssIpConfig** cmdlet creates an IP configuration object for a network interface of a Virtual Machine Scale Set (VMSS).
Specify the configuration from this cmdlet as the *IPConfiguration* parameter of the Add-AzureRmVmssNetworkInterfaceConfiguration cmdlet.

## EXAMPLES

### Example 1: Create an IP configuration object for a VMSS interface
```
PS C:\>$IPConfiguration = New-AzureRmVmssIPConfig -Name "ContosoVmssInterface02" -SubnetId $SubnetId
```

This command creates an IP configuration object named ContosoVmssInterface02.
The command uses a previously defined subnet ID stored in $SubnetId.
The command stores the configuration settings in the $IPConfiguration variable for later use with **Add-AzureRmVmssNetworkInterfaceConfiguration**.

### Example 2: Create an IP configuration object that includes NAT pool settings
```
PS C:\>$IPConfiguration = New-AzureRmVmssIPConfig -Name "ContosoVmssInterface03" -LoadBalancerInboundNatPoolsId $expectedLb.InboundNatPools[0].Id -LoadBalancerBackendAddressPoolsId $expectedLb.BackendAddressPools[0].Id -SubnetId $SubnetId
```

This command creates an IP configuration object named ContosoVmssInterface03, and then stores it in the $IPConfiguration variable for later use.
The command uses a previously defined subnet ID stored in $SubnetId.
The command stores the configuration settings in the $IPConfiguration variable for later use.
The command specifies values for the *LoadBalancerInboundNatPoolsId* and *LoadBalancerBackendAddressPoolsId* parameters.

## PARAMETERS

### -ApplicationGatewayBackendAddressPoolsId
Specifies an array of references to backend address pools of load balancers.
A scale set can reference backend address pools of one public and one internal load balancer.
Multiple scale sets cannot use the same load balancer.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Id
Specifies an ID.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -LoadBalancerBackendAddressPoolsId
Specifies an array of references to incoming network address translation (NAT) pools of the load balancers.
A scale set can reference incoming NAT pools of one public and one internal load balancer.
Multiple scale sets cannot use the same load balancer.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -LoadBalancerInboundNatPoolsId
Specifies an array of references to incoming NAT pools of the load balancers.
A scale set can reference incoming NAT pools of one public and one internal load balancer.
Multiple scale sets cannot use the same load balancer.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Name
Specifies the name of the IP configuration.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -SubnetId
Specifies the subnet ID in which the configuration creates  the VMSS network interface.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS

[Add-AzureRmVmssNetworkInterfaceConfiguration](./Add-AzureRmVmssNetworkInterfaceConfiguration.md)


text:
Module Image

   implicit none

   type RGBimage
      integer, dimension(:,:), pointer :: Red, Green, Blue
      integer                          :: width, height
   end type RGBimage

   type RGBAimage
      integer, dimension(:,:), pointer :: Red, Green, Blue, Alpha
      integer                          :: width, height
   end type RGBAimage

   type RGB
      integer :: Red, Green, Blue
   end type RGB

   type RGBA
      integer :: Red, Green, Blue, Alpha
   end type RGBA

   interface alloc_image
      module procedure alloc_imageRGB
      module procedure alloc_imageRGBA
   end interface

   interface init_image
      module procedure init_imageRGB
      module procedure init_imageRGBA
   end interface

   interface get_pixel
      module procedure get_pixelRGB
      module procedure get_pixelRGBA
   end interface

   interface set_pixel
      module procedure set_pixelRGB
      module procedure set_pixelRGBA
   end interface

   interface fill_img
      module procedure fill_imgRGB
      module procedure fill_imgRGBA
   end interface

   interface read_ppm
      module procedure read_ppm_RGB
      module procedure read_ppm_RGBA
   end interface read_ppm

   interface write_ppm
      module procedure write_ppm_RGB
      module procedure write_ppm_RGBA
   end interface

   interface open_image
      module procedure open_imageRGB
      module procedure open_imageRGBA
   end interface

   interface save_image
      module procedure save_imageRGB
      module procedure save_imageRGBA
   end interface

   interface operator (==)
      module procedure RGBequal
      module procedure RGBAequal
   end interface

   interface operator (/=)
      module procedure RGBnotequal
      module procedure RGBAnotequal
   end interface

   interface operator (.dist.)
      module procedure colourdistance
   end interface

   interface operator (*)
      module procedure colourmultiply
   end interface

   interface operator (+)
      module procedure colouradd
   end interface

   interface assignment (=)
      module procedure RGBimageequal
      module procedure RGBAimageequal
   end interface

Contains

   subroutine init_imageRGB(img)

      implicit none

      type(RGBimage), intent(OUT) :: img

      nullify(img%Red)
      nullify(img%Green)
      nullify(img%Blue)
      img%width = 0
      img%height = 0

   end subroutine init_imageRGB

  subroutine init_imageRGBA(img)

      implicit none

      type(RGBAimage), intent(OUT) :: img

      nullify(img%Red)
      nullify(img%Green)
      nullify(img%Blue)
      nullify(img%Alpha)

      img%width = 0
      img%height = 0

   end subroutine init_imageRGBA

   subroutine alloc_imageRGB(image, w, h)

      implicit none

      type(RGBimage)      :: image
      integer, intent(IN) :: w, h

      allocate(image%Red(w, h))
      allocate(image%Green(w, h))
      allocate(image%Blue(w, h))
      image%width = w
      image%height = h

   end subroutine alloc_imageRGB

   subroutine alloc_imageRGBA(image, w, h)

      implicit none

      type(RGBAimage)     :: image
      integer, intent(IN) :: w, h

      allocate(image%Red(w, h))
      allocate(image%Green(w, h))
      allocate(image%Blue(w, h))
      allocate(image%Alpha(w, h))

      image%width = w
      image%height = h

   end subroutine alloc_imageRGBA

   subroutine set_pixelRGB(img, x, y, colour)

      implicit none

      type(RGBimage), intent(INOUT) :: img
      integer,        intent(in)    :: x, y
      type(RGB),      intent(in)    :: colour

      if(x > img%width .or. x < 1)then
         return
      elseif(y > img%height .or. y < 1)then
         return
      end if

      img%Red(x, y) = colour%Red
      img%Green(x, y) = colour%Green
      img%Blue(x, y) = colour%Blue

   end subroutine set_pixelRGB

   subroutine set_pixelRGBA(img, x, y, colour)

      implicit none

      type(RGBAimage), intent(INOUT) :: img
      integer,        intent(in)     :: x, y
      type(RGBA),      intent(in)    :: colour

      if(x > img%width .or. x < 1)then
         return
      elseif(y > img%height .or. y < 1)then
         return
      end if

      img%Red(x, y) = colour%Red
      img%Green(x, y) = colour%Green
      img%Blue(x, y) = colour%Blue
      img%Alpha(x, y) = colour%Alpha

   end subroutine set_pixelRGBA

   subroutine get_pixelRGB(img, x, y, colour)

      implicit none

      type(RGBimage), intent(INOUT) :: img
      type(RGB),      intent(INOUT) :: colour
      integer,        intent(in)    :: x, y

      if(x > img%width .or. x < 1)then
         return
      elseif(y > img%height .or. y < 1)then
         return
      end if

      colour%Red = img%Red(x, y)
      colour%Green = img%Green(x, y)
      colour%Blue = img%Blue(x, y)

   end subroutine get_pixelRGB

   subroutine get_pixelRGBA(img, x, y, colour)

      implicit none

      type(RGBAimage), intent(INOUT) :: img
      type(RGBA),      intent(INOUT) :: colour
      integer,        intent(in)     :: x, y

      if(x > img%width .or. x < 1)then
         return
      elseif(y > img%height .or. y < 1)then
         return
      end if

      colour%Red = img%Red(x, y)
      colour%Green = img%Green(x, y)
      colour%Blue = img%Blue(x, y)
      colour%Alpha = img%Blue(x, y)

   end subroutine get_pixelRGBA

   subroutine fill_imgRGB(img, colour)

      implicit none

      type(RGBimage), intent(INOUT) :: img
      type(RGB),      intent(IN)    :: colour
      integer                       :: i, j

      do j = 1, img%height
         do i = 1, img%width
            img%Red(i,j) = colour%Red
            img%Green(i,j) = colour%Green
            img%Blue(i,j) = colour%Blue
         end do
      end do
   end subroutine fill_imgRGB

   subroutine fill_imgRGBA(img, colour)

      implicit none

      type(RGBAimage), intent(INOUT) :: img
      type(RGBA),      intent(IN)    :: colour
      integer                        :: i, j

      do j = 1, img%height
         do i = 1, img%width
            img%Red(i,j) = colour%Red
            img%Green(i,j) = colour%Green
            img%Blue(i,j) = colour%Blue
            img%Alpha(i,j) = colour%Alpha
         end do
      end do
   end subroutine fill_imgRGBA

   subroutine RGBimageequal(a1, a2)

      implicit none

      type(RGBimage), intent(OUT) :: a1
      type(RGBimage), intent(IN)  :: a2

      a1%red = a2%red
      a1%green = a2%green
      a1%blue = a2%blue

   end subroutine RGBimageequal

   subroutine RGBAimageequal(a1, a2)

      implicit none

      type(RGBAimage), intent(OUT) :: a1
      type(RGBAimage), intent(IN)  :: a2

      a1%red = a2%red
      a1%green = a2%green
      a1%blue = a2%blue
      a1%alpha = a2%alpha

   end subroutine RGBAimageequal

   logical function RGBequal(c1, c2)

      type(RGB), intent(IN) :: c1, c2

      RGBequal = .TRUE.
      if( (c1%red == c2%red) .and. (c1%Green == c2%Green) .and. (c1%Blue == c2%Blue))then
         return
      end if
      RGBequal = .FALSE.

   end function RGBequal

   logical function RGBAequal(c1, c2)

      type(RGBA), intent(IN) :: c1, c2

      RGBAequal = .TRUE.
      if( (c1%red == c2%red) .and. (c1%Green == c2%Green) .and. (c1%Blue == c2%Blue) .and. (c1%alpha == c2%alpha))then
         return
      end if
      RGBAequal = .FALSE.

   end function RGBAequal

   integer function clampInt(val, lo, hi)

      integer, intent(IN) :: lo, hi, val

      if(val < lo)then
         clampInt = lo
      elseif(val > hi)then
         clampInt = hi
      else
         clampInt = val
      end if

   end function

   logical function RGBnotequal(c1, c2)

      type(RGB), intent(IN) :: c1, c2

      RGBnotequal = .False.
      if( (c1%red == c2%red) .and. (c1%Green == c2%Green) .and. (c1%Blue == c2%Blue))then
         return
      end if
      RGBnotequal = .True.

   end function RGBnotequal

   logical function RGBAnotequal(c1, c2)

      type(RGBA), intent(IN) :: c1, c2

      RGBAnotequal = .False.
      if( (c1%red == c2%red) .and. (c1%Green == c2%Green) .and. (c1%Blue == c2%Blue) .and. (c1%alpha == c2%alpha))then
         return
      end if
      RGBAnotequal = .True.

   end function RGBAnotequal

   real function colourdistance(c1, c2)

         type(RGB), intent(IN) :: c1, c2

         colourdistance = sqrt(real(c1%red - c2%red)**2 + real(c1%Green - c2%Green)**2 &
                               + real(c1%Blue - c2%Blue)**2 )

   end function colourdistance

   function colouradd(c1, c2)

      type(RGBA), intent(IN) :: c1, c2
      type(RGBA)             :: colouradd

      colouradd = RGBA(c1%red + c2%red, c1%green + c2%green, c1%blue + c2%blue, c1%alpha + c2%alpha)

   end function colouradd

   function colourmultiply(colour, scalar)

      type(RGBA),intent(IN) :: colour
      type(RGBA)            :: colourmultiply
      real,      intent(IN) :: scalar

      colourmultiply = RGBA(int(colour%red*scalar), int(colour%green*scalar), int(colour%blue*scalar), colour%alpha)

   end function

   subroutine read_ppm_RGB(filename, img)

      implicit none

      type(RGBImage),     intent(OUT) :: img
      integer                         :: nmax, i, j, offset
      character(len = *), intent(IN)  :: filename
      character(2)                    :: mode
      character                       :: code

      img%width = 0
      img%height = 0
      nullify(img%Red)
      nullify(img%Green)
      nullify(img%Blue)

      open(56, file = filename, access='stream',form='formatted',status= 'old')

      read(56, '(A2)') mode
      read(56, *) img%width, img%height
      read(56, *) nmax
      inquire(56,pos=offset)
      close(56)
      open(56 ,file=filename,access='stream',status='old')
      read(56, pos=offset-1) code
      call alloc_image(img, img%width, img%height)

      if(mode == 'P6')then
         do j = 1, img%height
            do i = 1, img%width
               read(56) code
               img%Red(i,j) = iachar(code)
               read(56) code
               img%Green(i,j) = iachar(code)
               read(56) code
               img%Blue(i,j) = iachar(code)
            end do
         end do
      else
         print*,'Mode not supported!'
         call exit(0)
!         do j = 1, img%height
!            do i = 1, img%width
!               read(56) img%red(i,j)
!               read(56),img%green(i,j)
!               read(56),img%blue(i,j)
!               print*,img%red(i,j),img%green(i,j),img%blue(i,j)
!               call exit(0)
!            end do
!         end do
      end if

      close(56)

   end subroutine read_ppm_RGB

   subroutine read_ppm_RGBA(filename, img)

      implicit none

      type(RGBAImage),     intent(OUT) :: img
      integer                          :: nmax, i, j, offset
      character(len = *), intent(IN)   :: filename
      character(2)                     :: mode
      character                        :: code

      img%width = 0
      img%height = 0
      nullify(img%Red)
      nullify(img%Green)
      nullify(img%Blue)
      nullify(img%Alpha)

      open(56, file = filename, access='stream',form='formatted',status= 'old')

      read(56, '(A2)') mode
      read(56, *) img%width, img%height
      read(56, *) nmax
      inquire(56,pos=offset)
      close(56)
      open(56 ,file=filename,access='stream',status='old')
      read(56, pos=offset-1) code
      call alloc_image(img, img%width, img%height)

      if(mode == 'P6')then
         do j = 1, img%height
            do i = 1, img%width
               read(56) code
               img%Red(i,j) = iachar(code)
               read(56) code
               img%Green(i,j) = iachar(code)
               read(56) code
               img%Blue(i,j) = iachar(code)
            end do
         end do
      else
         print*,'Mode not supported!'
         call exit(0)
!         do j = 1, img%height
!            do i = 1, img%width
!               read(56) img%red(i,j)
!               read(56),img%green(i,j)
!               read(56),img%blue(i,j)
!               print*,img%red(i,j),img%green(i,j),img%blue(i,j)
!               call exit(0)
!            end do
!         end do
      end if

      close(56)

   end subroutine read_ppm_RGBA

   subroutine write_ppm_RGB(filename, img, mode)

      implicit none

      type(RGBimage),             intent(in) :: img
      character(len=*),           intent(in) :: filename
      character(len=*), optional, intent(in) :: mode
      integer                                :: i, j
      logical                                :: flag

      if(present(mode))then
         if(mode == 'P6')then
            flag = .TRUE.
         else
            flag=.FALSE.
         end if
      end if

      open(45, file = filename)

      if(flag)then
         write(45, '(A2)') 'P6'
      else
         write(45, '(A2)') mode
         print*,mode
      end if

      write(45, '(i0, " ",i0)') img%width, img%height
      write(45, '(i0)') 255

      if(flag)then
         do j = 1, img%height
            do i = 1, img%width
               write(45, '(3A1)', advance='no') achar(img%Red(i,j)), achar(img%Green(i,j)), achar(img%Blue(i,j))
            end do
         end do
      else
         do j = 1, img%height
            do i = 1, img%width
               write(45, '(3(I3.1,1X))',advance='no') img%Red(i,j), img%Green(i,j), img%Blue(i,j)
            end do
         end do
      end if
      close(45)

   end subroutine write_ppm_RGB

   subroutine write_ppm_RGBA(filename, img, mode)

      implicit none

      type(RGBAImage),             intent(in) :: img
      character(len=*),           intent(in)  :: filename
      character(len=*), optional, intent(in)  :: mode
      integer                                 :: i, j
      logical                                 :: flag

      if(present(mode))then
         if(mode == 'P6')then
            flag = .TRUE.
         else
            flag=.FALSE.
         end if
      end if

      open(45, file = filename)

      if(flag)then
         write(45, '(A2)') 'P6'
      else
         write(45, '(A2)') mode
         print*,mode
      end if

      write(45, '(i0, " ",i0)') img%width, img%height
      write(45, '(i0)') 255

      if(flag)then
         do j = 1, img%height
            do i = 1, img%width
               write(45, '(3A1)', advance='no') achar(img%Red(i,j)), achar(img%Green(i,j)), achar(img%Blue(i,j))
            end do
         end do
      else
         do j = 1, img%height
            do i = 1, img%width
               write(45, '(3(I3.1,1X))',advance='no') img%Red(i,j), img%Green(i,j), img%Blue(i,j)
            end do
         end do
      end if
      close(45)

   end subroutine write_ppm_RGBA

   subroutine open_imageRGB(img, filename, format)

      implicit none

      type(RGBimage), intent(OUT) :: img
      character(*),   intent(IN)  :: filename, format

      call system('convert '//filename//format//' '//filename//'.ppm')
      call read_ppm(filename//'.ppm', img)
      call system('rm '//filename//'.ppm')

   end subroutine open_imageRGB

   subroutine open_imageRGBA(img, filename, format)

      implicit none

      type(RGBAimage), intent(OUT) :: img
      character(*),   intent(IN)  :: filename, format

      call system('convert '//filename//format//' '//filename//'.ppm')
      call read_ppm(filename//'.ppm', img)
      call system('rm '//filename//'.ppm')

   end subroutine open_imageRGBA

   subroutine save_imageRGB(img, filename, format)

      implicit none

      type(RGBimage), intent(IN) :: img
      character(*),   intent(IN) :: filename, format

      print*,'Saving: ',filename//format
      ! call exit(0)
      call write_ppm(filename//'.ppm', img, 'P6')
      call system('convert '//filename//'.ppm '//filename//format)
      call system('rm '//filename//'.ppm')

   end subroutine save_imageRGB

   subroutine save_imageRGBA(img, filename, format)

      implicit none

      type(RGBAimage), intent(IN) :: img
      character(*),   intent(IN) :: filename, format

      print*,'Saving: ',filename//format
      ! call exit(0)
      call write_ppm(filename//'.ppm', img, 'P6')
      call system('convert '//filename//'.ppm '//filename//format)
      call system('rm '//filename//'.ppm')

   end subroutine save_imageRGBA
end module image


text:
class WXDLLIMPEXP_CORE wxRichMessageDialogBase : public wxGenericMessageDialog
{
public:
    wxRichMessageDialogBase( wxWindow *parent,
                             const wxString& message,
                             const wxString& caption,
                             long style )
        : wxGenericMessageDialog( parent, message, caption, style ),
          m_detailsExpanderCollapsedLabel( wxGetTranslation("&See details") ),
          m_detailsExpanderExpandedLabel( wxGetTranslation("&Hide details") ),
          m_checkBoxValue( false )
        { }

    void ShowCheckBox(const wxString& checkBoxText, bool checked = false)
    {
        m_checkBoxText = checkBoxText;
        m_checkBoxValue = checked;
    }

    wxString GetCheckBoxText() const { return m_checkBoxText; }

    void ShowDetailedText(const wxString& detailedText)
        { m_detailedText = detailedText; }

    wxString GetDetailedText() const { return m_detailedText; }

    virtual bool IsCheckBoxChecked() const { return m_checkBoxValue; }

protected:
    const wxString m_detailsExpanderCollapsedLabel;
    const wxString m_detailsExpanderExpandedLabel;

    wxString m_checkBoxText;
    bool m_checkBoxValue;
    wxString m_detailedText;

private:
    void ShowDetails(bool shown);

    wxDECLARE_NO_COPY_CLASS(wxRichMessageDialogBase);
};

// Always include the generic version as it's currently used as the base class
// by the MSW native implementation too.
#include "wx/generic/richmsgdlgg.h"

#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
    #include "wx/msw/richmsgdlg.h"
#else
    class WXDLLIMPEXP_CORE wxRichMessageDialog
                           : public wxGenericRichMessageDialog
    {
    public:
        wxRichMessageDialog( wxWindow *parent,
                             const wxString& message,
                             const wxString& caption = wxMessageBoxCaptionStr,
                             long style = wxOK | wxCENTRE )
            : wxGenericRichMessageDialog( parent, message, caption, style )
            { }

    private:
        wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxRichMessageDialog);
    };
#endif

#endif // wxUSE_RICHMSGDLG

#endif // _WX_RICHMSGDLG_H_BASE_


text:
/*------------------------------------------------*\
  #GENERAL
\*------------------------------------------------*/

/* --------- Text ------------- */

.sheet-bold{
  font-weight: 800;
  font-size: medium;
}

label {
  margin: 0px;
  width: 70px;
  text-transform: capitalize;
  font-size: 0.8em;
  height:
  /*overflow: hidden;*/
}
label.sheet-title{
  width: 130px;
  font-size: 1.3em;
  text-align: center;
}

h3{
  text-align: center;
}

.sheet-short{
  width: 50px;
}

.sheet-txtcenter{
  text-align: center;
}

.sheet-slash{
  font-size: 2em;
  font-weight: bold;
}

/* --------- Inputs ------------- */

input[type="text"] {
  background-color: transparent;
  border-style: none none solid none;
  border-width: 2px;
  border-radius: 0px;
  border-color: black;
  padding: 0px 4px;
  margin: 0px 4px;
  width: auto;
}

input[type="number"]{
  background-color: transparent;
  border-style: none none solid none;
  border-width: 2px;
  border-radius: 0px;
  border-color: black;
  text-align: center;
  width: 40px;
}

input[type="text"].sheet-w30,
input[type="number"].sheet-w30{
  width: 30px;
}

input[type="text"].sheet-w40,
input[type="number"].sheet-w40{
  width: 40px;
}

input[type="text"].sheet-w50,
input[type="number"].sheet-w50{
  width: 50px;
}

input[type="text"].sheet-w70,
input[type="number"].sheet-w70{
  width: 70px;
}

input[type="text"].sheet-w110,
input[type="number"].sheet-w110{
  width: 110px;
}

input[type="checkbox"].sheet-checkbox {
  border-style: solid black;
  border-radius: 0px;
}

input[type="text"].sheet-stat,
input[type="number"].sheet-stat{
  font-size: 2em;
  font-weight: bold;
}

/* highlights empty fields with light gray */
textarea:placeholder-shown,
input[type="text"]:placeholder-shown,
input[type="number"]:placeholder-shown{
  background-color: #EAC9D1;
}

/* higlight selected input */
textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus{
  background-color: #ccc;
}

/* -----Hides up/down buttons on numberfields that don't need them ---*/

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button,
input[type=number].sheet-txtfield::-webkit-inner-spin-button,
input[type=number].sheet-txtfield::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number],
input[type=number].sheet-txtfield {
  -moz-appearance: textfield;
}

/* ------- Buttons ---------- */

button[type="roll"].sheet-txt-btn:before{
  content: ' ';
}

button[type="roll"].sheet-txt-btn{
  height: 22px;
  border-style: none;
  background-color: transparent;
  margin-left: 5px;
  font-weight: bold;
  padding: 2px 5px 4px 5px;
}

button[type="roll"].sheet-txt-btn:hover{
    background-color: #d9d9d9;
    border-radius: 10px;
}

/*-----------------------------------------------------------------*\
  #SECTIONS
\*-----------------------------------------------------------------*/

/* --------- General Section Styling ------------- */
.sheet-section {
  display: flex;
  padding: 5px;
  border: 2px solid black;
  background: white;
  opacity: 0.9;
}

.sheet-columnflex {
  display: flex;
  flex-direction: column;
}
.sheet-rowflex {
  display: flex;
  flex-direction: row;
}
.sheet-wrap {
  flex-wrap: wrap;
}
.sheet-nowrap {
  flex-wrap: nowrap;
}

.sheet-center {
  align-items: center;
}

.sheet-middle {
  justify-content: center;
}
.sheet-spaced {
  justify-content: space-evenly;
}

/* Tabs */

.sheet-character,
.sheet-journal,
.sheet-config{
  display: none;
}

/* show the selected tab */
.sheet-tabstoggle[value="character"] ~ div.sheet-character,
.sheet-tabstoggle[value="journal"] ~ div.sheet-journal,
.sheet-tabstoggle[value="configuration"] ~ div.sheet-config{
  display: grid;
}

/* ------------ PAGES ---------- */

div.sheet-page1 {
  display: grid;
  grid-template-columns: 4fr 8fr 5fr 6fr;
  grid-template-rows: repeat(5, 2fr) 5fr 4fr;
  grid-template-areas:"name name    name    name     "
                      "attr skills  hp      condition"
                      "attr skills  prof    condition"
                      "attr skills  ac      condition"
                      "attr skills  speed   condition"
                      "attr skills  saves   ammo     "
                      "attr attacks attacks attacks  ";
  width: 850px;
  height: 1000px;
  background-image: url(https://raw.githubusercontent.com/Anduh/roll20-character-sheets/StarGate-v01/Stargate-RPG/images/bg.png);
  background-repeat: no-repeat;
  background-size: 700px 700px;
  background-position: center;
  background-color: black;
  margin-top: -23px;
}

div.sheet-page2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows:    1fr 1fr 1fr;
  grid-template-areas:"racial feats    "
                      "class  equipment"
                      "prof   notes    ";
  width: 840px;
  height: 990px;
  background-image: url(https://raw.githubusercontent.com/Anduh/roll20-character-sheets/StarGate-v01/Stargate-RPG/images/bg.png);
  background-repeat: no-repeat;
  background-size: 700px 700px;
  background-position: center;
  background-color: black;
  margin-top: -23px;
  grid-gap: 10px;
  padding: 5px;
}

div.sheet-config {
  display: grid;
  width: 50px;
  height: 1000px;
}

/* ------------ Section Specific ---------- */

/* ----------- page 1 ------------ */

/* NAME SECTION */
div.sheet-name{
  grid-area: name;
  padding: 5px 0px 0px 0px;
  margin: 5px;
  width: 834px;
}

div.sheet-name label{
    padding-left: 10px;
}

/* ATTRS SECTION */
div.sheet-attr{
  grid-area: attr;
}
div.sheet-attr .sheet-stat{
  background-image: url(https://raw.githubusercontent.com/Anduh/roll20-character-sheets/StarGate-v01/Stargate-RPG/images/attr.png);
  background-repeat: no-repeat;
  background-size: 124px 113px;
  width: 120px;
  height: 120px;
  background-position: center;
}
div.sheet-attr span:not(.sheet-mod),
div.sheet-skills span:not(.sheet-mod){
  font-weight: bold;
  font-size: 1.1em;
  text-transform: uppercase;
}

div.sheet-attr span:not(.sheet-mod){
  font-size: 1.5em;
}

div.sheet-skills span.sheet-mod,
div.sheet-prof span.sheet-mod,
div.sheet-saves span.sheet-mod{
  width: 25px;
  margin-top: 4px;
  border-style: none none solid none;
  margin-bottom: 4px;
  border-width: 2px;
  text-align: center;
}

div.sheet-attr span.sheet-mod{
  width: 25px;
  margin-top: 4px;
  border-style: none;
  margin-bottom: 17px;
  border-width: 2px;
  text-align: center;
  font-weight: bold;
}

div.sheet-attr input[type="number"]{
  width: 2em;
  margin-bottom: 7px;
  border-style: none;
  font-weight: bold;
  font-size: 1.5em;
}

div.sheet-attr button[type="roll"].sheet-large{
    font-size: 1.5em;
    margin-bottom: 2px;
    border-radius: 15px;
}

/* skills SECTION */

div.sheet-skills{
  grid-area:skills;
  padding-left: 10px;
  margin: 5px 2px 5px 5px;
}

div.sheet-skills div{
  align-content: space-around;
}

div.sheet-skills span:not(.sheet-mod),
div.sheet-condition span{
  text-transform: uppercase;
}

div.sheet-skills span:not(.sheet-mod){
    font-size: 0.7em;
    padding-top: 9px;
    margin-left: 0px;
}

div.sheet-skills .sheet-mod{
  margin: 0px 4px 0px 4px;
}

div.sheet-skills button[type="roll"]{
    margin-right: 0px;
    text-transform: uppercase;
    font-size: 1.2em;
}

div.sheet-skills input[type="number"],
div.sheet-saves input[type="number"]{
    margin-left: 5px;
}

/* hp SECTION */

div.sheet-hp{
  grid-area:hp;
}

div.sheet-hp > div:nth-child(2) {
  width: 100px;
}

div.sheet-hp div,
div.sheet-prof div,
div.sheet-ac div,
div.sheet-speed div{
  flex-grow: .4;
  margin: 5px;
}

div.sheet-hp label,
div.sheet-prof label{
  font-size: 1.1em;
  font-weight: bold;
}

div.sheet-ac label,
div.sheet-speed .sheet-speed label{
  font-size: 1.2em;
  font-weight: bold;
}

div.sheet-hp label.sheet-txtcenter{
  font-size: 1.8em;
}

div.sheet-hp .sheet-determ label{
  font-size: 1.2em;
  margin-right: 25px;
}

/* condition SECTION */

div.sheet-condition{
  grid-area:condition;
  padding-left: 10px;
  margin: 8px 25px 8px 4px;
}

div.sheet-condition span{
  padding-left: 5px;
  font-weight: bold;
}

/* prof SECTION */

div.sheet-prof{
  grid-area:prof;
}

div.sheet-prof > div:nth-child(1) > label:nth-child(1){
  width: 80px;
}

div.sheet-prof > div:nth-child(2) > label:nth-child(1) {
 padding: 0px;
}

div.sheet-prof .sheet-init{
  margin-left: 2px;
  margin-right: 2px;
  padding-left: 2px;
  padding-right: 2px;
}

div.sheet-prof .sheet-moxie{
  width: 50px;
}

.sheet-prof > div:nth-child(2) > label:nth-child(1) {
  width: 56px;
}

div.sheet-moxie > label:nth-child(1) {
  width: 54px;
}

/* ac SECTION */

div.sheet-ac{
  grid-area:ac;
}

div.sheet-prof label.sheet-wide,
div.sheet-ac label.sheet-wide{
  width: 96px;
  padding: 0px;
}

/* speed SECTION */

div.sheet-speed{
  grid-area:speed;
}

div.sheet-speed input[type="text"]{
  padding: 5px
}

div.sheet-speed div.sheet-death label{
    width: 100px;
    padding: 0px;
}

div.sheet-speed div.sheet-death span{
    font-size: 0.8em;
    font-weight: bold;
}

div.sheet-speed div.sheet-death div{
  margin: 5px 0px;
}

div.sheet-death > div:nth-child(3) > span:nth-child(4){
    padding-right: 9px;
}

div.sheet-speed div.sheet-death input[type="checkbox"]{
    transform: scale(0.8);
}

/* saves SECTION */

div.sheet-saves{
  grid-area:saves;
  margin: 5px 20px 5px 5px;
  justify-content: space-between;
}

div.sheet-saves div{
  padding-left: 8px;
}

div.sheet-saves span.sheet-mod{
  margin: 0px 4px;
}

div.sheet-saves div.sheet-mb20{
    margin-bottom: 20px;
}

/* ammo SECTION */

div.sheet-ammo.sheet-grid{
  grid-area:ammo;
  display: grid;
  grid-gap: 8px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  padding: 5px 20px 5px 0px;
}

div.sheet-ammo label{
  text-align: center;
  padding: 0px 0px 5px 0px;
}

div.sheet-ammo div{
  margin: 7px 1px 7px 1px;
}

/* attacks SECTION */

div.sheet-attacks{
  grid-area:attacks;
  display: grid;
  grid-template-columns: 4fr repeat(5, 1fr) 2fr;
  grid-template-rows: repeat(5, 1fr);
  margin: 0px 20px 10px 5px;
}

div.sheet-attacks label{
  text-transform: capitalize;
}

div.sheet-attacks .sheet-name{
  padding-left: 65px;
}

div.sheet-attacks .sheet-dmg-type{
  padding-left: 9px;
}

div.sheet-attacks span{
  height: 25px;
}

div.sheet-attacks div button[type="roll"],
div.sheet-attacks div input[type="text"]{
 height: 20px;
}

div.sheet-attacks .sheet-mr15{
    margin-right: 15px;
}

div.sheet-attacks .sheet-ml15{
    margin-left: 15px;
}

div.sheet-attacks .sheet-pl20{
    padding-left: 20px;
}

/*  -------- Page 2 -------- */

div.sheet-page2 label{
  font-size: 1.4em;
  font-weight: bold;
  text-align: center;
  width: 140px;
}

div.sheet-page2 textarea{
  width: 390px;
  height: 280px;
  margin-bottom: 0px;
}

/*  ------------ Tabs ---------- */

input.sheet-tab1:checked ~ div.sheet-tab1,
input.sheet-tab2:checked ~ div.sheet-tab2{
  display: grid;
}

/* styles tab button */
input.sheet-tab{
  width: 150px;
  height: 22px;
  position: relative;
  top: -23px;
  left: 82px;

  margin: 5px 0px 5px 0px;
  padding: 0px;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
}

input.sheet-tab + span::before{
  content: attr(title);
  width: 150px;
  height: 22px;
  position: absolute;
  top: 50px;
  left: 110px;

  border: solid 2px grey;
  border-radius: 13px;
  padding-bottom: 2px;
  text-align: center;
  font-size: 18px;
  display: inline-block;
  background: white;
}

input.sheet-tab:checked + span::before{
  background: #e5e5e5;
}

input.sheet-tab2 + span::before{
  left: 263px;
}

div.sheet-tab-content{
  display: none;
}


text:
<!DOCTYPE html>

  <title>Tic Tak Toe</title>

  <link rel="stylesheet" href="css/html5reset-1.6.1.css" type="text/css" />
  <link rel="stylesheet" href="css/playZone.css" type="text/css" />

      0
      -
      0

    <button class="sideControl-newGame js-newGame">New Game</button>

        Size: <input type="range" class="sizeControl-input js-lineSize" min="3" value="3" max=15 step="1" />

      3

  <canvas class="playZone js-game"></canvas>


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/action_settings"
        android:title="@string/action_settings"
        android:orderInCategory="100"
        android:showAsAction="never" />
</menu>
<!-- From: file:/Users/jacco/dev/wercker/HelloProject/Hello/src/main/res/menu/greet.xml -->


text:
package test;

public class Sprite {

	public String getResourceKey() {
		return resourceKey;
	}

	public void setResourceKey(String resourceKey) {
		this.resourceKey = resourceKey;
	}

	private String resourceKey;

	public void move(String target){
		System.out.println("Sprite move to " + target);
	}

}


text:
module NewRelic
  module Agent
    module LogOnce
      NUM_LOG_ONCE_KEYS = 1000

      def log_once(level, key, *msgs)
        @already_logged_lock.synchronize do
          return if @already_logged.include?(key)

          if @already_logged.size >= NUM_LOG_ONCE_KEYS && key.kind_of?(String)
            # The reason for preventing too many keys in `logged` is for
            # memory concerns.
            # The reason for checking the type of the key is that we always want
            # to allow symbols to log, since there are very few of them.
            # The assumption here is that you would NEVER pass dynamically-created
            # symbols, because you would never create symbols dynamically in the
            # first place, as that would already be a memory leak in most Rubies,
            # even if we didn't hang on to them all here.
            return
          end

          @already_logged[key] = true
        end

        self.send(level, *msgs)
      end

      def clear_already_logged
        @already_logged_lock.synchronize do
          @already_logged = {}
        end
      end
    end
  end
end


text:
import os
import json

from notebook.base.handlers import APIHandler, IPythonHandler, json_errors
from notebook.utils import url_path_join

from tornado import gen, web
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
from tornado.websocket import WebSocketHandler, websocket_connect
from tornado.httpclient import HTTPRequest
from tornado.escape import url_escape

from ipython_genutils.py3compat import cast_unicode
from jupyter_client.session import Session
from traitlets.config.configurable import LoggingConfigurable

# TODO: Find a better way to specify global configuration options
# for a server extension.
KG_URL = os.getenv('KG_URL', 'http://127.0.0.1:8888/')
KG_HEADERS = json.loads(os.getenv('KG_HEADERS', '{}'))
KG_HEADERS.update({
    'Authorization': 'token {}'.format(os.getenv('KG_AUTH_TOKEN', ''))
})
VALIDATE_KG_CERT = os.getenv('VALIDATE_KG_CERT') not in ['no', 'false']

KG_CLIENT_KEY = os.getenv('KG_CLIENT_KEY')
KG_CLIENT_CERT = os.getenv('KG_CLIENT_CERT')
KG_CLIENT_CA = os.getenv('KG_CLIENT_CA')

KG_HTTP_USER = os.getenv('KG_HTTP_USER', '')
KG_HTTP_PASS = os.getenv('KG_HTTP_PASS', '')

# Get env variables to handle timeout of request and connection
KG_CONNECT_TIMEOUT = float(os.getenv('KG_CONNECT_TIMEOUT', 20.0))
KG_REQUEST_TIMEOUT = float(os.getenv('KG_REQUEST_TIMEOUT', 20.0))

class WebSocketChannelsHandler(WebSocketHandler, IPythonHandler):

    def set_default_headers(self):
        """Undo the set_default_headers in IPythonHandler

        which doesn't make sense for websockets
        """
        pass

    def get_compression_options(self):
        # use deflate compress websocket
        return {}

    def authenticate(self):
        """Run before finishing the GET request

        Extend this method to add logic that should fire before
        the websocket finishes completing.
        """
        # authenticate the request before opening the websocket
        if self.get_current_user() is None:
            self.log.warning("Couldn't authenticate WebSocket connection")
            raise web.HTTPError(403)

        if self.get_argument('session_id', False):
            self.session.session = cast_unicode(self.get_argument('session_id'))
        else:
            self.log.warning("No session ID specified")

    def initialize(self):
        self.log.debug("Initializing websocket connection %s", self.request.path)
        self.session = Session(config=self.config)
        # TODO: make kernel client class configurable
        self.client = KernelGatewayWSClient()

    @gen.coroutine
    def get(self, kernel_id, *args, **kwargs):
        self.authenticate()
        self.kernel_id = cast_unicode(kernel_id, 'ascii')
        super(WebSocketChannelsHandler, self).get(kernel_id=kernel_id, *args, **kwargs)

    def open(self, kernel_id, *args, **kwargs):
        '''Handle web socket connection open to notebook server.'''
        # Delegate to web socket handler
        self.client.on_open(
            kernel_id=kernel_id,
            message_callback=self.write_message,
            compression_options=self.get_compression_options()
        )

    def on_message(self, message):
        '''Forward message to web socket handler.'''
        self.client.on_message(message)

    def write_message(self, message):
        '''Send message back to client.'''
        super(WebSocketChannelsHandler, self).write_message(message)

    def on_close(self):
        self.log.debug("Closing websocket connection %s", self.request.path)
        self.client.on_close()
        super(WebSocketChannelsHandler, self).on_close()

class KernelGatewayWSClient(LoggingConfigurable):
    '''Proxy web socket connection to a kernel gateway.'''

    def __init__(self):
        self.ws = None
        self.ws_future = Future()

    @gen.coroutine
    def _connect(self, kernel_id):
        ws_url = url_path_join(
            KG_URL.replace('http', 'ws'),
            '/api/kernels',
            url_escape(kernel_id),
            'channels'
        )
        self.log.info('Connecting to {}'.format(ws_url))
        parameters = {
          "headers" : KG_HEADERS,
          "validate_cert" : VALIDATE_KG_CERT,
          "auth_username" : KG_HTTP_USER,
          "auth_password" : KG_HTTP_PASS,
          "connect_timeout" : KG_CONNECT_TIMEOUT,
          "request_timeout" : KG_REQUEST_TIMEOUT
        }
        if KG_CLIENT_KEY:
            parameters["client_key"] = KG_CLIENT_KEY
            parameters["client_cert"] = KG_CLIENT_CERT
            if KG_CLIENT_CA:
                parameters["ca_certs"] = KG_CLIENT_CA
        request = HTTPRequest(ws_url, **parameters)
        self.ws_future = websocket_connect(request)
        self.ws = yield self.ws_future
        # TODO: handle connection errors/timeout

    def _disconnect(self):
        if self.ws is not None:
            # Close connection
            self.ws.close()
        elif not self.ws_future.done():
            # Cancel pending connection
            self.ws_future.cancel()

    @gen.coroutine
    def _read_messages(self, callback):
        '''Read messages from server.'''
        while True:
            message = yield self.ws.read_message()
            if message is None: break # TODO: handle socket close
            callback(message)

    def on_open(self, kernel_id, message_callback, **kwargs):
        '''Web socket connection open.'''
        self._connect(kernel_id)
        loop = IOLoop.current()
        loop.add_future(
            self.ws_future,
            lambda future: self._read_messages(message_callback)
        )

    def on_message(self, message):
        '''Send message to server.'''
        if self.ws is None:
            loop = IOLoop.current()
            loop.add_future(
                self.ws_future,
                lambda future: self._write_message(message)
            )
        else:
            self._write_message(message)

    def _write_message(self, message):
        '''Send message to server.'''
        self.ws.write_message(message)

    def on_close(self):
        '''Web socket closed event.'''
        self._disconnect()

#-----------------------------------------------------------------------------
# kernel handlers
#-----------------------------------------------------------------------------

class MainKernelHandler(APIHandler):
    """Replace default MainKernelHandler to enable async lookup of kernels."""

    @web.authenticated
    @json_errors
    @gen.coroutine
    def get(self):
        km = self.kernel_manager
        kernels = yield gen.maybe_future(km.list_kernels())
        self.finish(json.dumps(kernels))

    @web.authenticated
    @json_errors
    @gen.coroutine
    def post(self):
        km = self.kernel_manager
        model = self.get_json_body()
        if model is None:
            model = {
                'name': km.default_kernel_name
            }
        else:
            model.setdefault('name', km.default_kernel_name)

        kernel_id = yield gen.maybe_future(km.start_kernel(kernel_name=model['name']))
        # This is now an async operation
        model = yield gen.maybe_future(km.kernel_model(kernel_id))
        location = url_path_join(self.base_url, 'api', 'kernels', url_escape(kernel_id))
        self.set_header('Location', location)
        self.set_status(201)
        self.finish(json.dumps(model))

class KernelHandler(APIHandler):
    """Replace default KernelHandler to enable async lookup of kernels."""

    @web.authenticated
    @json_errors
    @gen.coroutine
    def get(self, kernel_id):
        km = self.kernel_manager
        # This is now an async operation
        model = yield gen.maybe_future(km.kernel_model(kernel_id))
        if model is None:
            raise web.HTTPError(404, u'Kernel does not exist: %s' % kernel_id)
        self.finish(json.dumps(model))

    @web.authenticated
    @json_errors
    @gen.coroutine
    def delete(self, kernel_id):
        km = self.kernel_manager
        yield gen.maybe_future(km.shutdown_kernel(kernel_id))
        self.set_status(204)
        self.finish()

class KernelActionHandler(APIHandler):
    """Replace default KernelActionHandler to enable async lookup of kernels."""

    @web.authenticated
    @json_errors
    @gen.coroutine
    def post(self, kernel_id, action):
        km = self.kernel_manager
        if action == 'interrupt':
            km.interrupt_kernel(kernel_id)
            self.set_status(204)
        if action == 'restart':

            try:
                yield gen.maybe_future(km.restart_kernel(kernel_id))
            except Exception as e:
                self.log.error("Exception restarting kernel", exc_info=True)
                self.set_status(500)
            else:
                # This is now an async operation
                model = yield gen.maybe_future(km.kernel_model(kernel_id))
                self.write(json.dumps(model))
        self.finish()

#-----------------------------------------------------------------------------
# kernel spec handlers
#-----------------------------------------------------------------------------

class MainKernelSpecHandler(APIHandler):
    @web.authenticated
    @json_errors
    @gen.coroutine
    def get(self):
        ksm = self.kernel_spec_manager
        kernel_specs = yield gen.maybe_future(ksm.list_kernel_specs())
        # TODO: Remove resources until we support them
        for name, spec in kernel_specs['kernelspecs'].items():
            spec['resources'] = {}
        self.set_header("Content-Type", 'application/json')
        self.finish(json.dumps(kernel_specs))

class KernelSpecHandler(APIHandler):
    @web.authenticated
    @json_errors
    @gen.coroutine
    def get(self, kernel_name):
        ksm = self.kernel_spec_manager
        kernel_spec = yield ksm.get_kernel_spec(kernel_name)
        if kernel_spec is None:
            raise web.HTTPError(404, u'Kernel spec %s not found' % kernel_name)
        # TODO: Remove resources until we support them
        kernel_spec['resources'] = {}
        self.set_header("Content-Type", 'application/json')
        self.finish(json.dumps(kernel_spec))

#-----------------------------------------------------------------------------
# URL to handler mappings
#-----------------------------------------------------------------------------

from notebook.services.kernels.handlers import _kernel_id_regex, _kernel_action_regex
from notebook.services.kernelspecs.handlers import kernel_name_regex

default_handlers = [
    (r"/api/kernels", MainKernelHandler),
    (r"/api/kernels/%s" % _kernel_id_regex, KernelHandler),
    (r"/api/kernels/%s/%s" % (_kernel_id_regex, _kernel_action_regex), KernelActionHandler),
    (r"/api/kernels/%s/channels" % _kernel_id_regex, WebSocketChannelsHandler),
    (r"/api/kernelspecs", MainKernelSpecHandler),
    (r"/api/kernelspecs/%s" % kernel_name_regex, KernelSpecHandler),
    # TODO: support kernel spec resources
    # (r"/kernelspecs/%s/(?P<path>.*)" % kernel_name_regex, KernelSpecResourceHandler),
]


text:
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
from scipy import misc
import STR2CTC
import os
import codecs

def read_image_list(pathToList):
    """Reads a .txt file containing paths to the images
    Args:
       image_list_file: a .txt file with one /path/to/image per line
       label: optionally, if set label will be pasted after each line
    Returns:
       List with all filenames in file image_list_file
    """
    f = open(pathToList, 'r')
    filenames = []
    for line in f:
        if line[-1] == '\n':
            filenames.append(line[:-1])
        else:
            filenames.append(line)
    f.close()
    return filenames

def get_batch_labels(bList, cm):
    u_labels = []
    for path in bList:
        labelFile = path[:] + ".txt"
        tmp = codecs.open(labelFile, 'r', encoding='utf-8')
        u_str = tmp.readline()
        u_labels.append(u_str)
        # print(str)
        if tmp is not None:
            tmp.close()
    idx, val, shape = STR2CTC.target_string_list_to_ctc_tensor_repr(u_labels, cm)
    return idx, val, shape

def get_batch_imgs(bList, imgW, mvn):
    imgs = []
    seqL = []

    # print("\n")
    for path in bList:
        # print(path)
        aImg = misc.imread(path)
        width = aImg.shape[1]
        hei = aImg.shape[0]
        # aSeqL = min(width, imgW)
        # aSeqL = max(aSeqL, imgW / 2)
        aSeqL = width
        seqL.append(aSeqL)
        # aImg = aImg.astype('float32')
        aImg = aImg / 255.0
        if mvn:
            std = np.std(aImg)
            mean = np.mean(aImg)
            tImg = (aImg - mean) / std
            aImg = tImg
        if width < imgW:
            padW = imgW - width
            npad = ((0, 0), (0, padW))
            tImg = np.pad(aImg, npad, mode='constant', constant_values=0)
            aImg = tImg
        # if width > imgW:
        #     tImg = aImg[:, :imgW]
        #     aImg = tImg
        # plt.imshow(aImg, cmap=plt.cm.gray)
        # plt.show()
        imgs.append(aImg)

    bSize = len(bList)
    imgBatched = np.zeros((bSize, hei, imgW, 1), dtype='float32')
    # batch the image list
    for idx, img in enumerate(imgs):
        imgBatched[idx, :, :, 0] = img

    return imgBatched, seqL

def get_list_vals(bList, cm, imgW, mvn=False):
    tgtIdx, tgtVal, tgtShape = get_batch_labels(bList, cm)
    inpBatch, inpSeqL = get_batch_imgs(bList, imgW, mvn)
    return inpBatch, inpSeqL, tgtIdx, tgtVal, tgtShape

def clean_list(list, imgW, cm, subsampling=-1):
    res = []
    # Count the skipped Images (width too big)
    countW = 0
    # Count the skipped Images (char not in charMap)
    countC = 0
    # Count the skipped Images (subsampling too much)
    countS = 0
    for path in list:
        aImg = misc.imread(path)
        width = aImg.shape[1]

        # Skip image if image width is bigger than imgW
        if width > imgW:
            countW += 1
            continue

        # Skip image if a character is not in charMap
        skip = False
        labelFile = path[:] + ".txt"
        tmp = codecs.open(labelFile, 'r', encoding='utf-8')
        u_str = tmp.readline()
        if subsampling > 0:
            if subsampling * len(u_str) > width:
                countS += 1
                continue
        if tmp is not None:
            tmp.close()
        count = 0
        lastCh = -1
        for c in u_str:
            try:
                ch = cm.get_channel(c)
                if lastCh == ch:
                    count += 1
                lastCh = ch
            except KeyError:
                # print('Character \'{}\' not in charMap, skipping Image...'.format(c))
                skip = True
                countC += 1
                break
        if not skip:
            if subsampling * (count + len(u_str)) > width:
                countS += 1
                continue
            res.append(path)
    print("Skipped {} out of {} images...".format(countC + countW + countS, len(list)))
    print("...{} too big images, {} images where subsampling is too much and additionally {} images with unknown characters.".format(countW, countS, countC))
    return res

if __name__ == '__main__':
    os.chdir("..")
    list = read_image_list('./resources/lp_only_train.lst')
    imgBatches, seqL = get_list_vals(list, STR2CTC.get_charmap_lp(), 100)
    # print(seqL)
    print(imgBatches.shape)
    print(imgBatches.dtype)
    plt.imshow(imgBatches[129], cmap=plt.cm.gray)
    plt.show()


text:
<?php

namespace Bowerphp\Test\Command;

use Bowerphp\Factory\CommandFactory;
use FilesystemIterator;
use PHPUnit\Framework\TestCase;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

/**
 * @group functional
 */
class UpdateCommandTest extends TestCase
{
    private $packageDotBowerFile;

    private $bowerFile;

    protected function setUp()
    {
        $dir = getcwd() . '/bower_components/';
        if (!is_dir($dir)) {
            mkdir($dir);
        }
        if (!is_dir($dir . 'jquery')) {
            mkdir($dir . 'jquery');
        }
        touch($dir . 'jquery/.bower.json');
        $this->packageDotBowerFile = $dir . 'jquery/.bower.json';
        $this->bowerFile = getcwd() . '/bower.json';

        file_put_contents($this->packageDotBowerFile, '{"name": "jquery", "version": "1.10.1"}');
        file_put_contents($this->bowerFile, '{"name": "test", "dependencies": {"jquery": "1.11.1"}}');
    }

    public function testUpdateDependencies()
    {
        //when
        CommandFactory::tester('update', ['package' => 'jquery']);

        //then
        $dotBower = json_decode(file_get_contents($this->packageDotBowerFile), true);
        $this->assertEquals('1.11.1', $dotBower['version']);
        $this->assertFileExists(getcwd() . '/bower_components/jquery/src/jquery.js');
    }

    /**
     * @expectedException \RuntimeException
     * @expectedExceptionMessage Package nonexistent-package is not installed
     */
    public function testThrowExceptionWhenPackageIsNotInstalled()
    {
        //when
        $commandTester = CommandFactory::tester('update', ['package' => 'nonexistent-package']);

        //then
        $this->assertRegExp('/Package nonexistent-package is not installed/', $commandTester->getDisplay());
    }

    protected function tearDown()
    {
        $dir = getcwd() . '/bower_components/';
        if (is_dir($dir)) {
            // see http://stackoverflow.com/a/15111679/369194
            foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $path) {
                $path->isFile() ? unlink($path->getPathname()) : rmdir($path->getPathname());
            }
            rmdir($dir);
        }
        unlink(getcwd() . '/bower.json');
    }
}


text:
#ifndef R600_RESOURCE_H
#define R600_RESOURCE_H

#include "util/u_transfer.h"
#include "util/u_vbuf.h"

/* flag to indicate a resource is to be used as a transfer so should not be tiled */
#define R600_RESOURCE_FLAG_TRANSFER     PIPE_RESOURCE_FLAG_DRV_PRIV

/* Texture transfer. */
struct r600_transfer {
	/* Base class. */
	struct pipe_transfer		transfer;
	/* Buffer transfer. */
	struct pipe_transfer		*buffer_transfer;
	unsigned			offset;
	struct pipe_resource		*staging_texture;
};

struct r600_resource_texture {
	struct r600_resource		resource;

	/* If this resource is a depth-stencil buffer on evergreen, this contains
	 * the depth part of the format. There is a separate stencil resource
	 * for the stencil buffer below. */
	enum pipe_format		real_format;

	unsigned			offset[PIPE_MAX_TEXTURE_LEVELS];
	unsigned			pitch_in_bytes[PIPE_MAX_TEXTURE_LEVELS];  /* transfer */
	unsigned			pitch_in_blocks[PIPE_MAX_TEXTURE_LEVELS]; /* texture resource */
	unsigned			layer_size[PIPE_MAX_TEXTURE_LEVELS];
	unsigned			array_mode[PIPE_MAX_TEXTURE_LEVELS];
	unsigned			pitch_override;
	unsigned			size;
	unsigned			tile_type;
	unsigned			depth;
	unsigned			dirty_db;
	struct r600_resource_texture    *stencil; /* Stencil is in a separate buffer on Evergreen. */
	struct r600_resource_texture	*flushed_depth_texture;
	boolean				is_flushing_texture;
};

#define R600_TEX_IS_TILED(tex, level) ((tex)->array_mode[level] != V_038000_ARRAY_LINEAR_GENERAL && (tex)->array_mode[level] != V_038000_ARRAY_LINEAR_ALIGNED)

struct r600_surface {
	struct pipe_surface		base;
	unsigned			aligned_height;
};

void r600_init_screen_resource_functions(struct pipe_screen *screen);

/* r600_texture */
struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
					const struct pipe_resource *templ);
struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen,
						const struct pipe_resource *base,
						struct winsys_handle *whandle);

static INLINE struct r600_resource *r600_resource(struct pipe_resource *r)
{
	return (struct r600_resource*)r;
}

int r600_texture_depth_flush(struct pipe_context *ctx, struct pipe_resource *texture, boolean just_create);

/* r600_texture.c texture transfer functions. */
struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
						struct pipe_resource *texture,
						unsigned level,
						unsigned usage,
						const struct pipe_box *box);
void r600_texture_transfer_destroy(struct pipe_context *ctx,
				   struct pipe_transfer *trans);
void* r600_texture_transfer_map(struct pipe_context *ctx,
				struct pipe_transfer* transfer);
void r600_texture_transfer_unmap(struct pipe_context *ctx,
				 struct pipe_transfer* transfer);

struct r600_pipe_context;

void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resource **rbuffer, uint32_t *offset);

#endif


text:
package com.linkedin.pinot.tools.scan.query;

import java.util.Collections;

public class MinFunction extends AggregationFunc {
  private static final String _name = "min";
  MinFunction(ResultTable rows, String columnId) {
    super(rows, columnId);
  }

  @Override
  public ResultTable run() {
    Double min = Double.MAX_VALUE;

    for (ResultTable.Row row : _rows) {
      min = Math.min(min, new Double(row.get(_column, _name).toString()));
    }

    ResultTable resultTable = new ResultTable(Collections.emptyList(), 1);
    resultTable.add(0, min);

    return resultTable;
  }
}


text:
<application>
  <component name="GradleExperimentalSettings">
    <option name="SELECT_MODULES_ON_PROJECT_IMPORT" value="true" />
    <option name="ENABLE_UNIT_TESTING_SUPPORT" value="true" />
  </component>
</application>