text:
/*
 Implementation of the Python Pencil Code internal calls; holds functions which can only be called from JavaScript.

 Note: __name__ is implicit (see Python documentation.)

 ['__doc__', '__file__', '__name__', '__package__', 'accept2dyear', 'altzone', 'asctime', 'clock', 'ctime', 'daylight', 'gmtime', 'localtime', 'mktime', 'sleep', 'strftime', 'strptime', 'struct_time', 'time', 'timezone', 'tzname', 'tzset']

 */

var $builtinmodule = function (name) {
    var mod = {};

    // These are set for compatibility with Python conventions; normally these are handled internally by Python.
    mod.__file__ = "/lib/pencilcode_internal/__init__.js";
    mod.__package__ = Sk.builtin.none.none$;

    // The doc string cannot be added in code as is usually done in Python, so we set it manually here.
    mod.__doc__ = "This module provides implemention of the Pencil Code internal functions in Python.";

    // Sk.builtin.func creates a Python function out of a JS function
    mod.addalemon = new Sk.builtin.func(function (data) {
        // Check arguments: func name, arguments passed, min number, max number
        Sk.builtin.pyCheckArgs("dumps", arguments, 1, 1);
        return data.v + " with a lemon"; // Data comes in as a Python string; we have to use the value (v) in JS
    });

	//MOVE
    // Wrapper for functions in jquery-turtle.js; See for more options!
    mod.fd = new Sk.builtin.func(function (sprite, distance) {
        Sk.builtin.pyCheckArgs("fd", arguments, 2, 2);
        if (sprite/* turtle */ === Sk.builtin.none.none$) {
            return fd(distance.v);
        }
        return sprite.fd(distance.v);
    });

    mod.bk = new Sk.builtin.func(function (sprite, distance) {
        Sk.builtin.pyCheckArgs("bk", arguments, 2, 2);
        if (sprite === Sk.builtin.none.none$) {
            return bk(distance.v);
        }
        return sprite.bk(distance.v);
    });

    mod.rt = new Sk.builtin.func(function (sprite, angle) {
        Sk.builtin.pyCheckArgs("rt", arguments, 2, 2);
        if (sprite === Sk.builtin.none.none$) {
            return rt(angle.v);
        }
        return sprite.rt(angle.v);
    });

    mod.lt = new Sk.builtin.func(function (sprite, angle) {
        Sk.builtin.pyCheckArgs("lt", arguments, 2, 2);
        if (sprite === Sk.builtin.none.none$) {
            return lt(angle.v);
        }
        return sprite.lt(angle.v);
    });

	mod.ra = new Sk.builtin.func(function (sprite, radius, angle) {
       Sk.builtin.pyCheckArgs("rt", arguments, 2, 3);
	   if (sprite === Sk.builtin.none.none$) {
            return rt((radius).v, angle.v);
        }
        return sprite.rt((radius).v, angle.v);
    });

	mod.la = new Sk.builtin.func(function (sprite, radius, angle) {
       Sk.builtin.pyCheckArgs("lt", arguments, 2, 3);
        if (sprite === Sk.builtin.none.none$) {
            return lt((radius).v, angle.v);
        }
        return sprite.lt((radius).v, angle.v);
    });

	mod.speed = new Sk.builtin.func(function (sprite, value) {
       Sk.builtin.pyCheckArgs("speed", arguments, 2, 2);
       if (sprite === Sk.builtin.none.none$) {
            return speed(value.v);
        }
       return sprite.speed(value.v);
    });

	mod.home = new Sk.builtin.func(function (sprite) {
       Sk.builtin.pyCheckArgs("home", arguments, 1, 1);
       if (sprite === Sk.builtin.none.none$) {
            return home();
        }
       return sprite.home();
    });

	mod.turnto = new Sk.builtin.func(function (sprite, value) {
       Sk.builtin.pyCheckArgs("turnto", arguments, 2, 3);
       if (sprite === Sk.builtin.none.none$) {
            return turnto(value.v);
        }
       return sprite.turnto(value.v);
    });

	mod.moveto = new Sk.builtin.func(function (sprite, value1, value2) {
       Sk.builtin.pyCheckArgs("moveto", arguments, 3, 3);
       if (sprite === Sk.builtin.none.none$) {
            return moveto(value1.v, value2.v);
        }
       return sprite.moveto(value1.v, value2.v);
    });

	mod.movexy = new Sk.builtin.func(function (sprite, value1, value2) {
       Sk.builtin.pyCheckArgs("movexy", arguments, 3, 3);
       if (sprite === Sk.builtin.none.none$) {
            return movexy(value1.v, value2.v);
        }
       return sprite.movexy(value1.v, value2.v);
    });

	mod.jumpto = new Sk.builtin.func(function (sprite, value1, value2) {
       Sk.builtin.pyCheckArgs("jumpto", arguments, 3, 3);
        if (sprite === Sk.builtin.none.none$) {
            return jumpto(value1.v, value2.v);
        }
       return sprite.jumpto(value1.v, value2.v);
    });

	mod.jumpxy = new Sk.builtin.func(function (sprite, value1, value2) {
       Sk.builtin.pyCheckArgs("jumpxy", arguments, 3, 3);
        if (sprite === Sk.builtin.none.none$) {
            return jumpxy(value1.v, value2.v);
        }
       return sprite.jumpxy(value1.v, value2.v);
    });

	mod.pause = new Sk.builtin.func(function (sprite, value) {
       Sk.builtin.pyCheckArgs("pause", arguments, 2, 2);
       if (sprite === Sk.builtin.none.none$) {
            return pause(value);
        }
       return sprite.pause(value);
    });

    //Control
    //Cannot find control functions for new sprites!!! Possible Fix Needed

	mod.button = new Sk.builtin.func(function (sprite, buttonclick, callee) {
       Sk.builtin.pyCheckArgs("button", arguments, 3, 3);
	   if (sprite === Sk.builtin.none.none$) {
            return button(buttonclick.v, function () { Sk.misceval.callsim(callee); } );
        }
       //return sprite.button(buttonclick.v, function () { Sk.misceval.callsim(callee); } );

    });

	mod.click = new Sk.builtin.func(function (sprite, fn) {
       Sk.builtin.pyCheckArgs("click", arguments, 2, 2);
	   if (sprite === Sk.builtin.none.none$) {
            return click( function () { Sk.misceval.callsim(fn); } );
        }
       //return sprite.click( function () { Sk.misceval.callsim(fn); } );
    });

	mod.keydown = new Sk.builtin.func(function (sprite, key) {
       Sk.builtin.pyCheckArgs("keydown", arguments, 2, 2);
	   if (sprite === Sk.builtin.none.none$) {
            return keydown(function () { Sk.misceval.callsim(key); });
        }
       //return sprite.keydown(function () { Sk.misceval.callsim(key); });
    });

	mod.keyup = new Sk.builtin.func(function (sprite, key) {
       Sk.builtin.pyCheckArgs("keyup", arguments, 2, 2);
	   if (sprite === Sk.builtin.none.none$) {
            return keyup(function () { Sk.misceval.callsim(key); });
        }
       //return sprite.keyup(function () { Sk.misceval.callsim(key); });
    });

	//Sound/////////////
	mod.play = new Sk.builtin.func(function (sprite, note) {
       Sk.builtin.pyCheckArgs("play", arguments, 2, 2);
       if (sprite === Sk.builtin.none.none$) {
            return play(note.v);
        }
       return sprite.play(note.v);
    });

	//mod.tone3 = new Sk.builtin.func(function (a, b, c) {
    //   Sk.builtin.pyCheckArgs("tone", arguments, 3, 3);
    //   return tone(a.v, b.v, c.v);
    //});

	mod.tone = new Sk.builtin.func(function (sprite, a, b, c) {
       Sk.builtin.pyCheckArgs("tone", arguments, 3, 4);
	   if (sprite === Sk.builtin.none.none$) {
            return tone(a.v, b.v, c.v);
        }
       return sprite.tone(a.v, b.v, c.v);
    });

	mod.silence = new Sk.builtin.func(function (sprite) {
       Sk.builtin.pyCheckArgs("silence", arguments, 1, 1);
	   if (sprite === Sk.builtin.none.none$) {
            return silence();
        }
       return sprite.silence();
    });

	mod.say = new Sk.builtin.func(function (sprite, a) {
       Sk.builtin.pyCheckArgs("say", arguments, 2, 2);
	   if (sprite === Sk.builtin.none.none$) {
            return say(a.v);
        }
       return sprite.say(a.v);
    });

	 // TEXT METHODS /////////////////////////////////////////////////////////
    mod.write = new Sk.builtin.func(function (message) {
        Sk.builtin.pyCheckArgs("write", arguments, 1, 1);
        return write(message.v);
    });

    mod.debug = new Sk.builtin.func(function (object) {
        Sk.builtin.pyCheckArgs("debug", arguments, 1, 1);
        return debug(object.v);
    });

    mod.type = new Sk.builtin.func(function (message) {
        Sk.builtin.pyCheckArgs("type", arguments, 1, 1);
        return type(message.v);
    });

    mod.typebox = new Sk.builtin.func(function (color) {
        Sk.builtin.pyCheckArgs("typebox", arguments, 1, 1);
        return typebox(color.v);
    });

    mod.typeline = new Sk.builtin.func(function () {
        Sk.builtin.pyCheckArgs("typeline", arguments, 0, 0);
        return typeline();
    });

    mod.label = new Sk.builtin.func(function (name) {
        Sk.builtin.pyCheckArgs("label", arguments, 1, 1);
        return label(name.v);
    });

    /*mod.await = new Sk.builtin.func(function (lambda_expression) {
        Sk.builtin.pyCheckArgs("await", arguments, 1, 1);
        return await(lambda_expression.v);
    });*/

    mod.read = new Sk.builtin.func(function (prompt) {
        Sk.builtin.pyCheckArgs("read", arguments, 1, 1);
        return read(prompt.v);
    });

    mod.readnum = new Sk.builtin.func(function (prompt) {
        Sk.builtin.pyCheckArgs("readnum", arguments, 1, 1);
        return readnum(prompt.v);
    });

	//SPRITES/////////////////

	mod.Turtle = new Sk.builtin.func(function (value) {
       Sk.builtin.pyCheckArgs("Turtle", arguments, 1, 1);
       return new Turtle(value.v);
    });

	mod.Sprite = new Sk.builtin.func(function () {
       Sk.builtin.pyCheckArgs("Sprite", arguments, 0, 0);
       return new Sprite();
    });

//	mod.Piano = new Sk.builtin.func(function (keys) {
//       Sk.builtin.pyCheckArgs("Piano", arguments, 1, 1);
//       return new Piano(keys.v);
//    });
	mod.Piano = new Sk.builtin.func(function () {
       Sk.builtin.pyCheckArgs("Piano", arguments, 0, 0);
       return new Piano();
    });

    mod.Pencil = new Sk.builtin.func(function () {
       Sk.builtin.pyCheckArgs("Pencil", arguments, 0, 0);
       return new Pencil();
    });

	//ART//////

	mod.hide = new Sk.builtin.func(function (sprite) {
        Sk.builtin.pyCheckArgs("ht", arguments, 1, 1);
		if (sprite === Sk.builtin.none.none$) {
            return ht();
        }
       return sprite.ht();
    });

	mod.show = new Sk.builtin.func(function (sprite) {
        Sk.builtin.pyCheckArgs("st", arguments, 1, 1);
		if (sprite === Sk.builtin.none.none$) {
            return st();
        }
       return sprite.st();
    });

	mod.cs = new Sk.builtin.func(function (sprite) {
        Sk.builtin.pyCheckArgs("cs", arguments, 1, 1);
        if (sprite === Sk.builtin.none.none$) {
            return cs();
        }
       return sprite.cs();
    });

	mod.st = new Sk.builtin.func(function (sprite) {
        Sk.builtin.pyCheckArgs("st", arguments, 1, 1);
        if (sprite === Sk.builtin.none.none$) {
            return st();
        }
       return sprite.st();
    });

	mod.ht = new Sk.builtin.func(function (sprite) {
        Sk.builtin.pyCheckArgs("ht", arguments, 1, 1);
        if (sprite === Sk.builtin.none.none$) {
            return ht();
        }
       return sprite.ht();
    });

	mod.pu = new Sk.builtin.func(function (sprite) {
        Sk.builtin.pyCheckArgs("pu", arguments, 1, 1);
        if (sprite === Sk.builtin.none.none$) {
            return pu();
        }
       return sprite.pu();
    });

	mod.pd = new Sk.builtin.func(function (sprite) {
        Sk.builtin.pyCheckArgs("pd", arguments, 1, 1);
        if (sprite === Sk.builtin.none.none$) {
            return pd();
        }
       return sprite.pd();
    });

	mod.pen = new Sk.builtin.func(function (sprite, color, size) {
        Sk.builtin.pyCheckArgs("pen", arguments, 3, 3);
        if (sprite === Sk.builtin.none.none$) {
            return pen(color.v, size.v);
        }
       return sprite.pen(color.v, size.v);
    });

	mod.dot = new Sk.builtin.func(function (sprite, color, dia) {
        Sk.builtin.pyCheckArgs("dot", arguments, 3, 3);
        if (sprite === Sk.builtin.none.none$) {
            return dot(color.v, dia.v);
        }
       return sprite.dot(color.v, dia.v);
    });

	mod.box = new Sk.builtin.func(function (sprite, color, size) {
        Sk.builtin.pyCheckArgs("box", arguments, 3, 3);
		if (sprite === Sk.builtin.none.none$) {
            return box(color.v, size.v);
        }
       return sprite.box(color.v, size.v);
    });

	mod.fill = new Sk.builtin.func(function (sprite, color) {
        Sk.builtin.pyCheckArgs("dot", arguments, 2, 2);
		if (sprite === Sk.builtin.none.none$) {
            return fill(color.v);
        }
       return sprite.fill(color.v);
    });

	mod.wear = new Sk.builtin.func(function (sprite, color) {
        Sk.builtin.pyCheckArgs("wear", arguments, 2, 2);
		if (sprite === Sk.builtin.none.none$) {
            return wear(color.v);
        }
       return sprite.wear(color.v);
    });

	mod.grow = new Sk.builtin.func(function (sprite, size) {
        Sk.builtin.pyCheckArgs("grow", arguments, 2, 2);
		if (sprite === Sk.builtin.none.none$) {
            return grow(size.v);
        }
       return sprite.grow(size.v);
    });

	mod.drawon = new Sk.builtin.func(function (sprite, canvas) {
        Sk.builtin.pyCheckArgs("drawon", arguments, 2, 2);
		if (sprite === Sk.builtin.none.none$) {
            return drawon(canvas.v);
        }
       return sprite.drawon(canvas.v);
    });

	//Operators
	mod.min = new Sk.builtin.func(function (value1, value2) {
        Sk.builtin.pyCheckArgs("min", arguments, 1, 2);
        return min(value1.v, value2.v);
    });

	mod.random = new Sk.builtin.func(function (value) {
        Sk.builtin.pyCheckArgs("random", arguments, 1, 1);
        return random(value.v);
    });

    return mod;
};


text:
GetBPM.org
==========

GetBPM.org is the package host for the [BPM
project](https://github.com/bpm/bpm). The code is based on [RubyGems.org
(Gemcutter)](https://github.com/rubygems/rubygems.org).

redpajama_set_name: RedPajamaGithub


text:
This is the Japronto portion of a [benchmarking tests suite](../../)
comparing a variety of web development platforms.

The information below is specific to Japronto. For further guidance,
review the [documentation](http://frameworkbenchmarks.readthedocs.org/en/latest/).
Also note that there is additional information provided in
the [Python README](../).

## Description

[Japronto](https://github.com/squeaky-pl/japronto) is a screaming-fast, scalable,
asynchronous Python 3.5+ HTTP toolkit.

## Test Paths & Sources

All of the test implementations are located within a single file ([app.py](app.py)).

* [JSON Serialization](app.py): "/json"
* [Plaintext](app.py): "/plaintext"


text:
package com.asakusafw.dmdl.thundergate.view.model;

import java.text.MessageFormat;

/**
 * {@code FROM ~}.
 */
public class From {

    /**
     * The source table name.
     */
    public final Name table;

    /**
     * The table alias name, or {@code null} if not specified.
     */
    public final String alias;

    /**
     * The join expression, or {@code null} if not specified.
     */
    public final Join join;

    /**
     * Creates and returns a new instance.
     * @param table the source table name
     * @param alias the table alias name, or {@code null} if not specified.
     * @throws IllegalArgumentException if some parameters were {@code null}
     */
    public From(Name table, String alias) {
        this(table, alias, null);
    }

    /**
     *
     * Creates and returns a new instance.
     * @param table the source table name
     * @param alias the table alias name, or {@code null} if not specified.
     * @param join the join expression, or {@code null} if not specified.
     * @throws IllegalArgumentException if some parameters were {@code null}
     */
    public From(Name table, String alias, Join join) {
        if (table == null) {
            throw new IllegalArgumentException("table must not be null"); //$NON-NLS-1$
        }
        this.table = table;
        this.alias = alias;
        this.join = join;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + table.hashCode();
        result = prime * result + ((join == null) ? 0 : join.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        From other = (From) obj;
        if (!table.equals(other.table)) {
            return false;
        }
        if (join == null) {
            if (other.join != null) {
                return false;
            }
        } else if (!join.equals(other.join)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        if (join == null) {
            return MessageFormat.format(
                    "FROM {0}",
                    table);
        } else {
            return MessageFormat.format(
                    "FROM {0} {1}",
                    table,
                    join);
        }
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.04.20 at 03:09:04 PM EDT
//

package org.slc.sli.sample.entities;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 * Encapsulates the possible attributes that can be used to lookup the identity of assessments.
 *
 *
Java class for AssessmentIdentityType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="AssessmentIdentityType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <choice>
 *         <element name="AssessmentIdentificationCode" type="{http://ed-fi.org/0100}AssessmentIdentificationCode" maxOccurs="unbounded"/>
 *         <sequence>
 *           <element name="AssessmentFamilyTitle" type="{http://ed-fi.org/0100}AssessmentTitle" minOccurs="0"/>
 *           <element name="AssessmentTitle" type="{http://ed-fi.org/0100}AssessmentTitle" minOccurs="0"/>
 *           <element name="AssessmentCategory" type="{http://ed-fi.org/0100}AssessmentCategoryType" minOccurs="0"/>
 *           <element name="AcademicSubject" type="{http://ed-fi.org/0100}AcademicSubjectType" minOccurs="0"/>
 *           <element name="GradeLevelAssessed" type="{http://ed-fi.org/0100}GradeLevelType" minOccurs="0"/>
 *           <element name="Version" type="{http://ed-fi.org/0100}Version" minOccurs="0"/>
 *         </sequence>
 *       </choice>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AssessmentIdentityType", propOrder = {
    "assessmentIdentificationCode",
    "assessmentFamilyTitle",
    "assessmentTitle",
    "assessmentCategory",
    "academicSubject",
    "gradeLevelAssessed",
    "version"
})
public class AssessmentIdentityType {

    @XmlElement(name = "AssessmentIdentificationCode")
    protected List<AssessmentIdentificationCode> assessmentIdentificationCode;
    @XmlElement(name = "AssessmentFamilyTitle")
    protected String assessmentFamilyTitle;
    @XmlElement(name = "AssessmentTitle")
    protected String assessmentTitle;
    @XmlElement(name = "AssessmentCategory")
    protected AssessmentCategoryType assessmentCategory;
    @XmlElement(name = "AcademicSubject")
    protected AcademicSubjectType academicSubject;
    @XmlElement(name = "GradeLevelAssessed")
    protected GradeLevelType gradeLevelAssessed;
    @XmlElement(name = "Version")
    protected Integer version;

    /**
     * Gets the value of the assessmentIdentificationCode property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the assessmentIdentificationCode property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getAssessmentIdentificationCode().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link AssessmentIdentificationCode }
     *
     *
     */
    public List<AssessmentIdentificationCode> getAssessmentIdentificationCode() {
        if (assessmentIdentificationCode == null) {
            assessmentIdentificationCode = new ArrayList<AssessmentIdentificationCode>();
        }
        return this.assessmentIdentificationCode;
    }

    /**
     * Gets the value of the assessmentFamilyTitle property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAssessmentFamilyTitle() {
        return assessmentFamilyTitle;
    }

    /**
     * Sets the value of the assessmentFamilyTitle property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAssessmentFamilyTitle(String value) {
        this.assessmentFamilyTitle = value;
    }

    /**
     * Gets the value of the assessmentTitle property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAssessmentTitle() {
        return assessmentTitle;
    }

    /**
     * Sets the value of the assessmentTitle property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAssessmentTitle(String value) {
        this.assessmentTitle = value;
    }

    /**
     * Gets the value of the assessmentCategory property.
     *
     * @return
     *     possible object is
     *     {@link AssessmentCategoryType }
     *
     */
    public AssessmentCategoryType getAssessmentCategory() {
        return assessmentCategory;
    }

    /**
     * Sets the value of the assessmentCategory property.
     *
     * @param value
     *     allowed object is
     *     {@link AssessmentCategoryType }
     *
     */
    public void setAssessmentCategory(AssessmentCategoryType value) {
        this.assessmentCategory = value;
    }

    /**
     * Gets the value of the academicSubject property.
     *
     * @return
     *     possible object is
     *     {@link AcademicSubjectType }
     *
     */
    public AcademicSubjectType getAcademicSubject() {
        return academicSubject;
    }

    /**
     * Sets the value of the academicSubject property.
     *
     * @param value
     *     allowed object is
     *     {@link AcademicSubjectType }
     *
     */
    public void setAcademicSubject(AcademicSubjectType value) {
        this.academicSubject = value;
    }

    /**
     * Gets the value of the gradeLevelAssessed property.
     *
     * @return
     *     possible object is
     *     {@link GradeLevelType }
     *
     */
    public GradeLevelType getGradeLevelAssessed() {
        return gradeLevelAssessed;
    }

    /**
     * Sets the value of the gradeLevelAssessed property.
     *
     * @param value
     *     allowed object is
     *     {@link GradeLevelType }
     *
     */
    public void setGradeLevelAssessed(GradeLevelType value) {
        this.gradeLevelAssessed = value;
    }

    /**
     * Gets the value of the version property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getVersion() {
        return version;
    }

    /**
     * Sets the value of the version property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setVersion(Integer value) {
        this.version = value;
    }

}


text:
package org.apache.beam.sdk.extensions.euphoria.core.client.functional;

import java.io.Serializable;
import org.apache.beam.sdk.extensions.euphoria.core.annotation.audience.Audience;

/**
 * Function of single argument.
 *
 * @param <InputT> the type of the element processed
 * @param <OutputT> the type of the result applying element to the function
 */
@Audience(Audience.Type.CLIENT)
@FunctionalInterface
public interface UnaryFunction<InputT, OutputT> extends Serializable {

  /**
   * Return the result of this function.
   *
   * @param what the element applied to the function
   * @return the result of the function application
   */
  OutputT apply(InputT what);

  /**
   * Returns a {@link UnaryFunction} that always returns its input argument.
   *
   * @param <T> the type of the input and output objects to the function
   * @return a function that always returns its input argument
   */
  static <T> UnaryFunction<T, T> identity() {
    return t -> t;
  }
}


text:
#ifndef __SOT_SOTINTEGRATORFORCEEXACT_H__
#define __SOT_SOTINTEGRATORFORCEEXACT_H__

/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */

/* Matrix */
#include <dynamic-graph/linear-algebra.h>

/* SOT */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
#include <sot/dynamic-pinocchio/integrator-force.h>

#include <sot/core/matrix-geometry.hh>

/* STD */
#include <string>

/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */

#if defined(WIN32)
#if defined(integrator_force_exact_EXPORTS)
#define SOTINTEGRATORFORCEEXACT_EXPORT __declspec(dllexport)
#else
#define SOTINTEGRATORFORCEEXACT_EXPORT __declspec(dllimport)
#endif
#else
#define SOTINTEGRATORFORCEEXACT_EXPORT
#endif

namespace dynamicgraph {
namespace sot {
namespace dg = dynamicgraph;

/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */

class SOTINTEGRATORFORCEEXACT_EXPORT IntegratorForceExact
    : public IntegratorForce {
 public:
  static const std::string CLASS_NAME;

 protected:
 public: /* --- CONSTRUCTION --- */
  IntegratorForceExact(const std::string& name);
  virtual ~IntegratorForceExact(void);

 public: /* --- SIGNAL --- */
 public: /* --- FUNCTIONS --- */
  dynamicgraph::Vector& computeVelocityExact(dynamicgraph::Vector& res,
                                             const int& time);
};

} /* namespace sot */
} /* namespace dynamicgraph */

#endif  // #ifndef __SOT_SOTINTEGRATORFORCEEXACT_H__


text:
<!DOCTYPE html>

    <title>aadm: a volte milano</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="http://aadm.github.io/favicon.png" rel="icon">

<link rel="canonical" href="http://aadm.github.io/2010-07-11-a-volte-milano.html">

        <meta name="author" content="Alessandro Amato del Monte" />
        <meta name="keywords" content="misc" />
        <meta name="description" content="D'estate si riesce ad apprezzare Milano; vai ad uno dei cinema all'aperto come quello del Conservatorio, ti vedi un film italiano, simpatico e non pretenzioso (mai l'avresti detto, è di Salvatores), giri in bicicletta senza rischiare di essere stirato. A volte, Milano è bella." />

        <meta property="og:site_name" content="aadm" />
        <meta property="og:type" content="article"/>
        <meta property="og:title" content="a volte milano"/>
        <meta property="og:url" content="http://aadm.github.io/2010-07-11-a-volte-milano.html"/>
        <meta property="og:description" content="D'estate si riesce ad apprezzare Milano; vai ad uno dei cinema all'aperto come quello del Conservatorio, ti vedi un film italiano, simpatico e non pretenzioso (mai l'avresti detto, è di Salvatores), giri in bicicletta senza rischiare di essere stirato. A volte, Milano è bella."/>
        <meta property="article:published_time" content="2010-07-11" />
            <meta property="article:section" content="misc" />
            <meta property="article:tag" content="misc" />
            <meta property="article:author" content="Alessandro Amato del Monte" />

        <link rel="stylesheet" href="http://aadm.github.io/theme/css/bootstrap.journal.min.css" type="text/css"/>
    <link href="http://aadm.github.io/theme/css/font-awesome.min.css" rel="stylesheet">

    <link href="http://aadm.github.io/theme/css/pygments/tango.css" rel="stylesheet">
        <link href="http://aadm.github.io/theme/css/typogrify.css" rel="stylesheet">
    <link rel="stylesheet" href="http://aadm.github.io/theme/css/style.css" type="text/css"/>
        <link href="http://aadm.github.io/static/custom.css" rel="stylesheet">

        <link href="http://aadm.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
              title="aadm ATOM Feed"/>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                Toggle navigation

            </button>

aadm

                        a volte milano

    Date

        <time datetime="2010-07-11T23:29:00+02:00"> 2010-07-11</time>

Tags
	misc

D'estate si riesce ad apprezzare Milano; vai ad uno dei cinema all'aperto come
quello del Conservatorio, ti vedi un film italiano, simpatico e non
pretenzioso (mai l'avresti detto, è di Salvatores), giri in bicicletta senza
rischiare di essere stirato. A volte, Milano è bella.

Related Posts:

after a long pause

branzino

oltre kickstarter

direttamente dal cassetto

dogs chasing fake rabbits

 PREVIOUS

NEXT

© 2005-2019 Alessandro Amato del Monte

  Creative Commons Attribution 4.0 International License

 TOP


text:
package org.apache.hadoop.chukwa.datacollection.controller;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import org.apache.hadoop.chukwa.datacollection.agent.ChukwaAgent;
import org.apache.log4j.Logger;

/**
 * A convenience library for applications to communicate to the
 * {@link ChukwaAgent}. Can be used to register and unregister new
 * {@link Adaptor}s. Also contains functions for applications to use for
 * handling log rations.
 */
public class ChukwaAgentController {
  static Logger log = Logger.getLogger(ChukwaAgentController.class);

  public class AddAdaptorTask extends TimerTask {

    String adaptorName;
    String type;
    String params;
    private long offset;
    long numRetries;
    long retryInterval;

    AddAdaptorTask(String adaptorName, String type, String params, long offset,
                   long numRetries, long retryInterval) {
      this.adaptorName = adaptorName;
      this.type = type;
      this.params = params;
      this.offset = offset;
      this.numRetries = numRetries;
      this.retryInterval = retryInterval;
    }

    @Override
    public void run() {
      try {
        log.info("Trying to resend the add command [" + adaptorName + "]["
            + offset + "][" + params + "] [" + numRetries + "]");
        addByName(null, adaptorName, type, params, offset, numRetries, retryInterval);
      } catch (Exception e) {
        log.warn("Exception in AddAdaptorTask.run", e);
        e.printStackTrace();
      }
    }
  }

  // our default adaptors, provided here for convenience
  public static final String CharFileTailUTF8 = "org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8";
  public static final String CharFileTailUTF8NewLineEscaped = "org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8NewLineEscaped";

  static String DEFAULT_FILE_TAILER = CharFileTailUTF8NewLineEscaped;
  static int DEFAULT_PORT = 9093;
  static String DEFAULT_HOST = "localhost";
  static int numArgs = 0;

  class Adaptor {
    public String id;
    final public String className;
    final public String params;
    final public String appType;
    public long offset;

    Adaptor(String className, String appType, String params, long offset) {
      this.className = className;
      this.appType = appType;
      this.params = params;
      this.offset = offset;
    }

    Adaptor(String id, String className, String appType, String params,
            long offset) {
      this.id = id;
      this.className = className;
      this.appType = appType;
      this.params = params;
      this.offset = offset;
    }

    /**
     * Registers this {@link Adaptor} with the agent running at the specified
     * hostname and portno
     *
     * @return The id of the this {@link Adaptor}, assigned by the agent
     *         upon successful registration
     * @throws IOException
     */
    String register() throws IOException {
      Socket s = new Socket(hostname, portno);
      try {
        s.setSoTimeout(60000);
      } catch (SocketException e) {
        log.warn("Error while settin soTimeout to 60000");
        e.printStackTrace();
      }
      PrintWriter bw = new PrintWriter(new OutputStreamWriter(s
          .getOutputStream()));
      if(id != null)
        bw.println("ADD " + id + " = " + className + " " + appType + " " + params + " " + offset);
      else
        bw.println("ADD " + className + " " + appType + " " + params + " " + offset);
      bw.flush();
      BufferedReader br = new BufferedReader(new InputStreamReader(s
          .getInputStream()));
      String resp = br.readLine();
      if (resp != null) {
        String[] fields = resp.split(" ");
        if (fields[0].equals("OK")) {
            id = fields[fields.length - 1];
        }
      }
      s.close();
      return id;
    }

    void unregister() throws IOException {
      Socket s = new Socket(hostname, portno);
      try {
        s.setSoTimeout(60000);
      } catch (SocketException e) {
        log.warn("Error while settin soTimeout to 60000");
        e.printStackTrace();
      }
      PrintWriter bw = new PrintWriter(new OutputStreamWriter(s
          .getOutputStream()));
      bw.println("SHUTDOWN " + id);
      bw.flush();

      BufferedReader br = new BufferedReader(new InputStreamReader(s
          .getInputStream()));
      String resp = br.readLine();
      if (resp == null || !resp.startsWith("OK")) {
        // error. What do we do?
      } else if (resp.startsWith("OK")) {
        String[] respSplit = resp.split(" ");
        String newOffset = respSplit[respSplit.length - 1];
        try {
          offset = Long.parseLong(newOffset);
        } catch (NumberFormatException nfe) {
          log.error("adaptor didn't shutdown gracefully.\n" + nfe);
        }
      }

      s.close();
    }

    public String toString() {
      String[] namePieces = className.split("\\.");
      String shortName = namePieces[namePieces.length - 1];
      return id + " " + shortName + " " + appType + " " + params + " " + offset;
    }
  }

  Map<String, ChukwaAgentController.Adaptor> runningAdaptors = new HashMap<String, Adaptor>();
  Map<String, ChukwaAgentController.Adaptor> runningInstanceAdaptors = new HashMap<String, Adaptor>();
  Map<String, ChukwaAgentController.Adaptor> pausedAdaptors;
  String hostname;
  int portno;

  public ChukwaAgentController() {
    portno = DEFAULT_PORT;
    hostname = DEFAULT_HOST;
    pausedAdaptors = new HashMap<String, Adaptor>();

    syncWithAgent();
  }

  public ChukwaAgentController(String hostname, int portno) {
    this.hostname = hostname;
    this.portno = portno;
    pausedAdaptors = new HashMap<String, Adaptor>();

    syncWithAgent();
  }

  private boolean syncWithAgent() {
    // set up adaptors by using list here
    try {
      runningAdaptors = list();
      return true;
    } catch (IOException e) {
      System.err.println("Error initializing ChukwaClient with list of "
              + "currently registered adaptors, clearing our local list of adaptors");
      // e.printStackTrace();
      // if we can't connect to the LocalAgent, reset/clear our local view of
      // the Adaptors.
      runningAdaptors = new HashMap<String, ChukwaAgentController.Adaptor>();
      return false;
    }
  }

  /**
   * Registers a new adaptor. Makes no guarantee about success. On failure, we
   * print a message to stderr and ignore silently so that an application
   * doesn't crash if it's attempt to register an adaptor fails. This call does
   * not retry a conection. for that use the overloaded version of this which
   * accepts a time interval and number of retries
   *
   * @return the id number of the adaptor, generated by the agent
   */
  public String add(String adaptorName, String type, String params, long offset) {
    return addByName(null, adaptorName, type, params, offset, 20, 15 * 1000);// retry for
                                                                 // five
                                                                 // minutes,
                                                                 // every
                                                                 // fifteen
                                                                 // seconds
  }

  /**
   * Registers a new adaptor. Makes no guarantee about success. On failure, to
   * connect to server, will retry numRetries times, every
   * retryInterval milliseconds.
   *
   * @return the id number of the adaptor, generated by the agent
   */
  public String addByName(String adaptorID, String adaptorName, String type, String params, long offset,
      long numRetries, long retryInterval) {
    ChukwaAgentController.Adaptor adaptor = new ChukwaAgentController.Adaptor(
        adaptorName, type, params, offset);
    adaptor.id = adaptorID;
    if (numRetries >= 0) {
      try {
        adaptorID = adaptor.register();

        if (adaptorID != null) {
          runningAdaptors.put(adaptorID, adaptor);
          runningInstanceAdaptors.put(adaptorID, adaptor);
        } else {
          System.err.println("Failed to successfully add the adaptor in AgentClient, adaptorID returned by add() was negative.");
        }
      } catch (IOException ioe) {
        log.warn("AgentClient failed to contact the agent ("
            + hostname + ":" + portno + ")");

        log.warn("Scheduling a agent connection retry for adaptor add() in another "
                + retryInterval
                + " milliseconds, "
                + numRetries
                + " retries remaining");

        Timer addFileTimer = new Timer();
        addFileTimer.schedule(new AddAdaptorTask(adaptorName, type, params,
            offset, numRetries - 1, retryInterval), retryInterval);
      }
    } else {
      System.err.println("Giving up on connecting to the local agent");
    }
    return adaptorID;
  }

  public synchronized ChukwaAgentController.Adaptor remove(String adaptorID)
      throws IOException {
    syncWithAgent();
    ChukwaAgentController.Adaptor a = runningAdaptors.remove(adaptorID);
    if ( a != null ) {
      a.unregister();
    }
    return a;

  }

  public void remove(String className, String appType, String filename)
      throws IOException {
    syncWithAgent();
    // search for FileTail adaptor with string of this file name
    // get its id, tell it to unregister itself with the agent,
    // then remove it from the list of adaptors
    for (Adaptor a : runningAdaptors.values()) {
      if (a.className.equals(className) && a.params.equals(filename)
          && a.appType.equals(appType)) {
        remove(a.id);
      }
    }
  }

  public void removeAll() {
    syncWithAgent();
    ArrayList<String> keyset = new ArrayList<String>();
    keyset.addAll( runningAdaptors.keySet());

    for (String id : keyset) {
      try {
        remove(id);
      } catch (IOException ioe) {
        System.err.println("Error removing an adaptor in removeAll()");
        ioe.printStackTrace();
      }
      log.info("Successfully removed adaptor " + id);
    }
  }

  public void removeInstanceAdaptors() {
    // Remove adaptors created by this instance of chukwa agent controller.
    // Instead of removing using id, this is removed by using the stream name
    // and record type.  This prevents the system to shutdown the wrong
    // adaptor after agent crashes.
    for (Adaptor a : runningInstanceAdaptors.values()) {
      try {
        remove(a.className, a.appType, a.params);
      } catch (IOException ioe) {
        log.warn("Error removing an adaptor in removeInstanceAdaptors()");
        ioe.printStackTrace();
      }
    }
  }

  Map<String, ChukwaAgentController.Adaptor> list() throws IOException {
    Socket s = new Socket(hostname, portno);
    try {
      s.setSoTimeout(60000);
    } catch (SocketException e) {
      log.warn("Error while settin soTimeout to 60000");
      e.printStackTrace();
    }
    PrintWriter bw = new PrintWriter(
        new OutputStreamWriter(s.getOutputStream()));

    bw.println("LIST");
    bw.flush();
    BufferedReader br = new BufferedReader(new InputStreamReader(s
        .getInputStream()));
    String ln;
    Map<String, Adaptor> listResult = new HashMap<String, Adaptor>();
    while ((ln = br.readLine()) != null) {
      if (ln.equals("")) {
        break;
      } else {
        String[] parts = ln.split("\\s+");
        if (parts.length >= 4) { // should have id, className appType, params,
                                 // offset
          String id = parts[0].substring(0, parts[0].length() - 1); // chop
                                                                        // off
                                                                        // the
                                                                        // right
                                                                        // -
                                                                        // paren
          long offset = Long.parseLong(parts[parts.length - 1]);
          String tmpParams = parts[3];
          for (int i = 4; i < parts.length - 1; i++) {
            tmpParams += " " + parts[i];
          }
          listResult.put(id, new Adaptor(id, parts[1], parts[2], tmpParams,
              offset));
        }
      }
    }
    s.close();
    return listResult;
  }

  // ************************************************************************
  // The following functions are convenience functions, defining an easy
  // to use API for application developers to integrate chukwa into their app
  // ************************************************************************

  /**
   * Registers a new "LineFileTailUTF8" adaptor and starts it at offset 0.
   * Checks to see if the file is being watched already, if so, won't register
   * another adaptor with the agent. If you have run the tail adaptor on this
   * file before and rotated or emptied the file you should use
   * {@link ChukwaAgentController#pauseFile(String, String)} and
   * {@link ChukwaAgentController#resumeFile(String, String)} which will store
   * the adaptors metadata and re-use them to pick up where it left off.
   *
   * @param type the datatype associated with the file to pass through
   * @param filename of the file for the tail adaptor to start monitoring
   * @return the id number of the adaptor, generated by the agent
   */
  public String addFile(String appType, String filename, long numRetries,
      long retryInterval) {
    filename = new File(filename).getAbsolutePath();
    // TODO: Mabye we want to check to see if the file exists here?
    // Probably not because they might be talking to an agent on a different
    // machine?

    // check to see if this file is being watched already, if yes don't set up
    // another adaptor for it
    boolean isDuplicate = false;
    for (Adaptor a : runningAdaptors.values()) {
      if (a.className.equals(DEFAULT_FILE_TAILER) && a.appType.equals(appType)
          && a.params.endsWith(filename)) {
        isDuplicate = true;
      }
    }
    if (!isDuplicate) {
      return addByName(null, DEFAULT_FILE_TAILER, appType, 0L + " " + filename, 0L,
          numRetries, retryInterval);
    } else {
      log.info("An adaptor for filename \"" + filename
          + "\", type \"" + appType
          + "\", exists already, addFile() command aborted");
      return null;
    }
  }

  public String addFile(String appType, String filename) {
    return addFile(appType, filename, 0, 0);
  }

  /**
   * Pause all active adaptors of the default file tailing type who are tailing
   * this file This means we actually stop the adaptor and it goes away forever,
   * but we store it state so that we can re-launch a new adaptor with the same
   * state later.
   *
   * @param appType
   * @param filename
   * @return array of adaptorID numbers which have been created and assigned the
   *         state of the formerly paused adaptors
   * @throws IOException
   */
  public Collection<String> pauseFile(String appType, String filename)
      throws IOException {
    syncWithAgent();
    // store the unique streamid of the file we are pausing.
    // search the list of adaptors for this filename
    // store the current offset for it
    List<String> results = new ArrayList<String>();
    for (Adaptor a : runningAdaptors.values()) {
      if (a.className.equals(DEFAULT_FILE_TAILER) && a.params.endsWith(filename)
          && a.appType.equals(appType)) {
        pausedAdaptors.put(a.id, a); // add it to our list of paused adaptors
        remove(a.id); // tell the agent to remove/unregister it
        results.add(a.id);
      }
    }
    return results;
  }

  public boolean isFilePaused(String appType, String filename) {
    for (Adaptor a : pausedAdaptors.values()) {
      if (a.className.equals(DEFAULT_FILE_TAILER) && a.params.endsWith(filename)
          && a.appType.equals(appType)) {
        return true;
      }
    }
    return false;
  }

  /**
   * Resume all adaptors for this filename that have been paused
   *
   * @param appType the appType
   * @param filename filename by which to lookup adaptors which are paused (and
   *        tailing this file)
   * @return an array of the new adaptor ID numbers which have resumed where the
   *         old adaptors left off
   * @throws IOException
   */
  public Collection<String> resumeFile(String appType, String filename)
      throws IOException {
    syncWithAgent();
    // search for a record of this paused file
    List<String> results = new ArrayList<String>();
    for (Adaptor a : pausedAdaptors.values()) {
      if (a.className.equals(DEFAULT_FILE_TAILER) && a.params.endsWith(filename)
          && a.appType.equals(appType)) {
        String newID = add(DEFAULT_FILE_TAILER, a.appType, a.offset + " "
            + filename, a.offset);
        pausedAdaptors.remove(a.id);
        a.id = newID;
        results.add(a.id);
      }
    }
    return results;
  }

  public void removeFile(String appType, String filename) throws IOException {
    syncWithAgent();
    // search for FileTail adaptor with string of this file name
    // get its id, tell it to unregister itself with the agent,
    // then remove it from the list of adaptors
    for (Adaptor a : runningAdaptors.values()) {
      if (a.className.equals(DEFAULT_FILE_TAILER) && a.params.endsWith(filename)
          && a.appType.equals(appType)) {
        remove(a.id);
      }
    }
  }

  // ************************************************************************
  // command line utilities
  // ************************************************************************

  public static void main(String[] args) {
    ChukwaAgentController c = getClient(args);
    if (numArgs >= 3 && args[0].toLowerCase().equals("addfile")) {
      doAddFile(c, args[1], args[2]);
    } else if (numArgs >= 3 && args[0].toLowerCase().equals("removefile")) {
      doRemoveFile(c, args[1], args[2]);
    } else if (numArgs >= 1 && args[0].toLowerCase().equals("list")) {
      doList(c);
    } else if (numArgs >= 1 && args[0].equalsIgnoreCase("removeall")) {
      doRemoveAll(c);
    } else {
      System.err.println("usage: ChukwaClient addfile <apptype> <filename> [-h hostname] [-p portnumber]");
      System.err.println("       ChukwaClient removefile adaptorID [-h hostname] [-p portnumber]");
      System.err.println("       ChukwaClient removefile <apptype> <filename> [-h hostname] [-p portnumber]");
      System.err.println("       ChukwaClient list [IP] [port]");
      System.err.println("       ChukwaClient removeAll [IP] [port]");
    }
  }

  private static ChukwaAgentController getClient(String[] args) {
    int portno = 9093;
    String hostname = "localhost";

    numArgs = args.length;

    for (int i = 0; i < args.length; i++) {
      if (args[i].equals("-h") && args.length > i + 1) {
        hostname = args[i + 1];
        log.debug("Setting hostname to: " + hostname);
        numArgs -= 2; // subtract for the flag and value
      } else if (args[i].equals("-p") && args.length > i + 1) {
        portno = Integer.parseInt(args[i + 1]);
        log.debug("Setting portno to: " + portno);
        numArgs -= 2; // subtract for the flat, i.e. -p, and value
      }
    }
    return new ChukwaAgentController(hostname, portno);
  }

  private static String doAddFile(ChukwaAgentController c, String appType,
      String params) {
    log.info("Adding adaptor with filename: " + params);
    String adaptorID = c.addFile(appType, params);
    if (adaptorID != null) {
      log.info("Successfully added adaptor, id is:" + adaptorID);
    } else {
      System.err.println("Agent reported failure to add adaptor, adaptor id returned was:"
              + adaptorID);
    }
    return adaptorID;
  }

  private static void doRemoveFile(ChukwaAgentController c, String appType,
      String params) {
    try {
      log.debug("Removing adaptor with filename: " + params);
      c.removeFile(appType, params);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  private static void doList(ChukwaAgentController c) {
    try {
      Iterator<Adaptor> adptrs = c.list().values().iterator();
      while (adptrs.hasNext()) {
        log.debug(adptrs.next().toString());
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  private static void doRemoveAll(ChukwaAgentController c) {
    log.info("Removing all adaptors");
    c.removeAll();
  }
}


text:
/*********************************************************************/
/*                                                                   */
/*             Optimized BLAS libraries                              */
/*                     By Kazushige Goto <kgoto@tacc.utexas.edu>     */
/*                                                                   */
/* Copyright (c) The University of Texas, 2009. All rights reserved. */
/* UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING  */
/* THIS SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF      */
/* MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE,              */
/* NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY  */
/* THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF     */
/* TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO   */
/* THE USE OF THE SOFTWARE OR DOCUMENTATION.                         */
/* Under no circumstances shall University be liable for incidental, */
/* special, indirect, direct or consequential damages or loss of     */
/* profits, interruption of business, or related expenses which may  */
/* arise from use of Software or Documentation, including but not    */
/* limited to those resulting from defects in Software and/or        */
/* Documentation, or loss or inaccuracy of data of any kind.         */
/*********************************************************************/

#include <stdio.h>
#include "common.h"

blasint CNAME(blas_arg_t *args, BLASLONG *range_m, BLASLONG *range_n, FLOAT *sa, FLOAT *sb, BLASLONG mypos) {

#ifndef TRANS
  LASWP_PLUS(args -> n, 1, args -> m, ZERO, args -> b, args -> ldb, NULL, 0, args -> c, 1);

  if (args -> n == 1){
    TRSV_NLU (args -> m, args -> a, args -> lda, args -> b, 1, sb);
    TRSV_NUN (args -> m, args -> a, args -> lda, args -> b, 1, sb);
  } else {
    TRSM_LNLU (args, range_m, range_n, sa, sb, 0);
    TRSM_LNUN (args, range_m, range_n, sa, sb, 0);
  }

#else

  if (args -> n == 1){
    TRSV_TUN (args -> m, args -> a, args -> lda, args -> b, 1, sb);
    TRSV_TLU (args -> m, args -> a, args -> lda, args -> b, 1, sb);
  } else {
    TRSM_LTUN  (args, range_m, range_n, sa, sb, 0);
    TRSM_LTLU  (args, range_m, range_n, sa, sb, 0);
  }

  LASWP_MINUS(args -> n, 1, args -> m, ZERO, args -> b, args -> ldb, NULL, 0, args -> c, -1);
#endif

  return 0;  }


text:
package com.aspose.cells.examples.data;

import com.aspose.cells.*;
import com.aspose.cells.examples.Utils;

public class FormatRanges2 {

	public static void main(String[] args) throws Exception {

		// The path to the documents directory.
		String dataDir = Utils.getSharedDataDir(FormatRanges2.class) + "data/";

		// Instantiating a Workbook object
		Workbook workbook = new Workbook();

		// Adding a new worksheet to the Workbook object
		// Obtaining the reference of the newly added worksheet
		int sheetIndex = workbook.getWorksheets().add();
		Worksheet worksheet = workbook.getWorksheets().get(sheetIndex);

		// Accessing the "A1" cell from the worksheet
		Cell cell = worksheet.getCells().get("A1");

		// Adding some value to the "A1" cell
		cell.setValue("Hello World From Aspose");

		// Creating a range of cells starting from "A1" cell to 3rd column in a
		// row
		Range range = worksheet.getCells().createRange("A1:C1");
		range.setName("MyRange");

		// Adding a thick outline border with the blue line
		range.setOutlineBorders(CellBorderType.THICK, Color.getBlue());

		// Saving the Excel file
		workbook.save(dataDir + "FormatRanges2_out.xls");

		// Print message
		System.out.println("Process completed successfully");

	}
}


text: Repository for all of my test code


text:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [ServerEye].[dm_os_latch_stats](
	[UTCCaptureTime] [datetime] NOT NULL,
	[LocalCaptureTime] [datetime] NOT NULL,
	[DimLatchClassID] [smallint] NOT NULL,
	[waiting_requests_count] [bigint] NULL,
	[wait_time_ms] [bigint] NULL,
	[max_wait_time_ms] [bigint] NULL,
 CONSTRAINT [PK_dm_os_latch_stats] PRIMARY KEY CLUSTERED
(
	[UTCCaptureTime] ASC,
	[DimLatchClassID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO


text:
package org.pentaho.di.ui.repository.repositoryexplorer.uisupport;

import org.pentaho.ui.xul.impl.DefaultXulOverlay;

public class RepositoryExplorerDefaultXulOverlay extends DefaultXulOverlay{
  private Class<?> packageClass;
  public RepositoryExplorerDefaultXulOverlay(String overlayUri) {
    super(overlayUri);
  }
  public RepositoryExplorerDefaultXulOverlay(String overlayUri, Class<?> packageClass) {
    super(overlayUri);
    this.packageClass = packageClass;
  }
  public void setPackageClass(Class<?> packageClass) {
    this.packageClass = packageClass;
  }
  public Class<?> getPackageClass() {
    return packageClass;
  }

}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jdbi.v3.sqlobject.statement.internal;

import java.lang.reflect.Method;
import java.util.function.Function;

import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.config.ConfigRegistry;
import org.jdbi.v3.core.generic.GenericTypes;
import org.jdbi.v3.core.qualifier.QualifiedType;
import org.jdbi.v3.core.qualifier.Qualifiers;
import org.jdbi.v3.core.result.ResultBearing;
import org.jdbi.v3.core.result.ResultIterable;
import org.jdbi.v3.core.statement.Update;
import org.jdbi.v3.sqlobject.UnableToCreateSqlObjectException;
import org.jdbi.v3.sqlobject.statement.GetGeneratedKeys;
import org.jdbi.v3.sqlobject.statement.UseRowMapper;
import org.jdbi.v3.sqlobject.statement.UseRowReducer;

public class SqlUpdateHandler extends CustomizingStatementHandler<Update> {
    private final Function<Update, Object> returner;
    private final ResultReturner magic;

    public SqlUpdateHandler(Class<?> sqlObjectType, Method method) {
        super(sqlObjectType, method);

        if (method.isAnnotationPresent(UseRowReducer.class)) {
            throw new UnsupportedOperationException("Cannot declare @UseRowReducer on a @SqlUpdate method.");
        }

        boolean isGetGeneratedKeys = method.isAnnotationPresent(GetGeneratedKeys.class);

        QualifiedType<?> returnType = QualifiedType.of(
            GenericTypes.resolveType(method.getGenericReturnType(), sqlObjectType))
            .withAnnotations(new Qualifiers().findFor(method));

        if (isGetGeneratedKeys) {
            magic = ResultReturner.forMethod(sqlObjectType, method);

            String[] columnNames = method.getAnnotation(GetGeneratedKeys.class).value();

            this.returner = update -> {
                ResultBearing resultBearing = update.executeAndReturnGeneratedKeys(columnNames);

                UseRowMapper useRowMapper = method.getAnnotation(UseRowMapper.class);
                ResultIterable<?> iterable = useRowMapper == null
                        ? resultBearing.mapTo(returnType)
                        : resultBearing.map(rowMapperFor(useRowMapper));

                return magic.mappedResult(iterable, update.getContext());
            };
        } else if (isNumeric(method.getReturnType())) {
            this.returner = update -> update.execute();
            magic = null;
        } else if (isBoolean(method.getReturnType())) {
            this.returner = update -> update.execute() > 0;
            magic = null;
        } else {
            throw new UnableToCreateSqlObjectException(invalidReturnTypeMessage(method, returnType));
        }
    }

    @Override
    public void warm(ConfigRegistry config) {
        super.warm(config);
        if (magic != null) {
            magic.warm(config);
        }
    }

    @Override
    Update createStatement(Handle handle, String locatedSql) {
        return handle.createUpdate(locatedSql);
    }

    @Override
    void configureReturner(Update u, SqlObjectStatementConfiguration cfg) {
        cfg.setReturner(() -> returner.apply(u));
    }

    private boolean isNumeric(Class<?> type) {
        return Number.class.isAssignableFrom(type)
            || type.equals(int.class)
            || type.equals(long.class)
            || type.equals(void.class);
    }

    private boolean isBoolean(Class<?> type) {
        return type.equals(boolean.class) || type.equals(Boolean.class);
    }

    private String invalidReturnTypeMessage(Method method, QualifiedType<?> returnType) {
        return method.getDeclaringClass().getSimpleName() + "." + method.getName()
                + " method is annotated with @SqlUpdate so should return void, boolean, or Number but is returning: "
                + returnType;
    }
}


text:
package network

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"github.com/Azure/go-autorest/tracing"
	"net/http"
)

// ApplicationGatewayPrivateLinkResourcesClient is the network Client
type ApplicationGatewayPrivateLinkResourcesClient struct {
	BaseClient
}

// NewApplicationGatewayPrivateLinkResourcesClient creates an instance of the
// ApplicationGatewayPrivateLinkResourcesClient client.
func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string) ApplicationGatewayPrivateLinkResourcesClient {
	return NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}

// NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI creates an instance of the
// ApplicationGatewayPrivateLinkResourcesClient client using a custom endpoint.  Use this when interacting with an
// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayPrivateLinkResourcesClient {
	return ApplicationGatewayPrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)}
}

// List lists all private link resources on an application gateway.
// Parameters:
// resourceGroupName - the name of the resource group.
// applicationGatewayName - the name of the application gateway.
func (client ApplicationGatewayPrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateLinkResourceListResultPage, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourcesClient.List")
		defer func() {
			sc := -1
			if result.agplrlr.Response.Response != nil {
				sc = result.agplrlr.Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	result.fn = client.listNextResults
	req, err := client.ListPreparer(ctx, resourceGroupName, applicationGatewayName)
	if err != nil {
		err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", nil, "Failure preparing request")
		return
	}

	resp, err := client.ListSender(req)
	if err != nil {
		result.agplrlr.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", resp, "Failure sending request")
		return
	}

	result.agplrlr, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", resp, "Failure responding to request")
		return
	}
	if result.agplrlr.hasNextLink() && result.agplrlr.IsEmpty() {
		err = result.NextWithContext(ctx)
		return
	}

	return
}

// ListPreparer prepares the List request.
func (client ApplicationGatewayPrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"applicationGatewayName": autorest.Encode("path", applicationGatewayName),
		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2021-02-01"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ApplicationGatewayPrivateLinkResourcesClient) ListSender(req *http.Request) (*http.Response, error) {
	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}

// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client ApplicationGatewayPrivateLinkResourcesClient) ListResponder(resp *http.Response) (result ApplicationGatewayPrivateLinkResourceListResult, err error) {
	err = autorest.Respond(
		resp,
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// listNextResults retrieves the next set of results, if any.
func (client ApplicationGatewayPrivateLinkResourcesClient) listNextResults(ctx context.Context, lastResults ApplicationGatewayPrivateLinkResourceListResult) (result ApplicationGatewayPrivateLinkResourceListResult, err error) {
	req, err := lastResults.applicationGatewayPrivateLinkResourceListResultPreparer(ctx)
	if err != nil {
		return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", nil, "Failure preparing next results request")
	}
	if req == nil {
		return
	}
	resp, err := client.ListSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", resp, "Failure sending next results request")
	}
	result, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", resp, "Failure responding to next results request")
	}
	return
}

// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client ApplicationGatewayPrivateLinkResourcesClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateLinkResourceListResultIterator, err error) {
	if tracing.IsEnabled() {
		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourcesClient.List")
		defer func() {
			sc := -1
			if result.Response().Response.Response != nil {
				sc = result.page.Response().Response.Response.StatusCode
			}
			tracing.EndSpan(ctx, sc, err)
		}()
	}
	result.page, err = client.List(ctx, resourceGroupName, applicationGatewayName)
	return
}


text:
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$string['filtername'] = 'URL-i hiperkeçidlərə və şəkillərə çevir.';
$string['settingformats'] = 'Formatlara tətbiq et';
$string['settingformats_desc'] = 'Əgər mətn seçilmiş formatlardan birində qoyularsa, o zaman filtrdən istifadə ediləcək.';


text:
<?php
class TextControl extends EditControl
{
	/**
	 * Form the control specified search options array and built the control's search options markup
	 * @param String selOpt		The search option value
	 * @param Boolean not		It indicates if the search option negation is set
	 * @param Boolean both		It indicates if the control needs 'NOT'-options
	 * @return String			A string containing options markup
	 */
	function getSearchOptions($selOpt, $not, $both)
	{
		$optionsArray = array();
		$isPHPEncripted = $this->pageObject->cipherer->isFieldPHPEncrypted($this->field);
		if(!$isPHPEncripted){
			$optionsArray[] = CONTAINS;
		}
		$optionsArray[] = EQUALS;
		if(!$isPHPEncripted){
			$optionsArray[] = STARTS_WITH;
			$optionsArray[] = MORE_THAN;
			$optionsArray[] = LESS_THAN;
			$optionsArray[] = BETWEEN;
		}
		$optionsArray[] = EMPTY_SEARCH;
		if($both)
		{
			if(!$isPHPEncripted){
				$optionsArray[] = NOT_CONTAINS;
			}
			$optionsArray[] = NOT_EQUALS;
			if(!$isPHPEncripted){
				$optionsArray[] = NOT_STARTS_WITH;
				$optionsArray[] = NOT_MORE_THAN;
				$optionsArray[] = NOT_LESS_THAN;
				$optionsArray[] = NOT_BETWEEN;
			}
			$optionsArray[] = NOT_EMPTY;
		}
		return $this->buildSearchOptions($optionsArray, $selOpt, $not, $both);
	}
}
?>


text:
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.Test;

import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;

public class SmaliUtilsShould {
  @Test public void mapPrimitives() {
    List<String> primitives =
        Arrays.asList("void", "boolean", "byte", "short", "char", "int", "float", "long", "double");
    List<String> mappedPrimitives = new ArrayList<>(9);

    for (String primitive : primitives) {
      mappedPrimitives.add(SmaliUtils.smalifyType(primitive));
    }

    assertThat(mappedPrimitives).containsExactly("V", "Z", "B", "S", "C", "I", "F", "J", "D");
  }

  @Test public void mapArrayOfPrimitives() {
    List<String> primitives =
        Arrays.asList("void", "boolean[]", "byte[]", "short[][]", "char[]", "int[][][]", "float[]",
            "long[]", "double[]");
    List<String> mappedPrimitives = new ArrayList<>(9);

    mappedPrimitives.addAll(primitives.stream()
        .map(SmaliUtils::smalifyType)
        .collect(Collectors.toList()));

    assertThat(mappedPrimitives).containsExactly("V", "[Z", "[B", "[[S", "[C", "[[[I", "[F", "[J", "[D");
  }

  @Test public void mapReferenceTypes() {
    List<String> referenceTypes = Arrays.asList("java.util.String", "android.net.wifi.WifiManager");
    List<String> mappedPrimitives = new ArrayList<>(2);

    mappedPrimitives.addAll(referenceTypes.stream()
        .map(SmaliUtils::smalifyType)
        .collect(Collectors.toList()));

    assertThat(mappedPrimitives).containsExactly("Ljava/util/String;", "Landroid/net/wifi/WifiManager;");
  }

  @Test public void mapArrayOfReferenceTypes() {
    List<String> referenceTypes = Arrays.asList("java.util.String[][]", "android.net.wifi.WifiManager[]");
    List<String> mappedPrimitives = new ArrayList<>(2);

    mappedPrimitives.addAll(referenceTypes.stream()
        .map(SmaliUtils::smalifyType)
        .collect(Collectors.toList()));

    assertThat(mappedPrimitives).containsExactly("[[Ljava/util/String;", "[Landroid/net/wifi/WifiManager;");
  }

  @Test public void stripWhiteSpaces() {
    List<String> referenceTypes = Arrays.asList("java.util.String [] ", " boolean ");
    List<String> mappedPrimitives = new ArrayList<>(2);

    mappedPrimitives.addAll(referenceTypes.stream()
        .map(SmaliUtils::smalifyType)
        .collect(Collectors.toList()));

    assertThat(mappedPrimitives).containsExactly("[Ljava/util/String;", "Z");
  }
}


text:
<!DOCTYPE html>

<link rel="help" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#dom-a-text">


text:
namespace sf
{
////////////////////////////////////////////////////////////
/// \brief Implementation of input stream based on a memory chunk
///
////////////////////////////////////////////////////////////
class SFML_SYSTEM_API MemoryInputStream : public InputStream
{
public:

    ////////////////////////////////////////////////////////////
    /// \brief Default constructor
    ///
    ////////////////////////////////////////////////////////////
    MemoryInputStream();

    ////////////////////////////////////////////////////////////
    /// \brief Open the stream from its data
    ///
    /// \param data        Pointer to the data in memory
    /// \param sizeInBytes Size of the data, in bytes
    ///
    ////////////////////////////////////////////////////////////
    void open(const void* data, std::size_t sizeInBytes);

    ////////////////////////////////////////////////////////////
    /// \brief Read data from the stream
    ///
    /// After reading, the stream's reading position must be
    /// advanced by the amount of bytes read.
    ///
    /// \param data Buffer where to copy the read data
    /// \param size Desired number of bytes to read
    ///
    /// \return The number of bytes actually read, or -1 on error
    ///
    ////////////////////////////////////////////////////////////
    virtual Int64 read(void* data, Int64 size);

    ////////////////////////////////////////////////////////////
    /// \brief Change the current reading position
    ///
    /// \param position The position to seek to, from the beginning
    ///
    /// \return The position actually sought to, or -1 on error
    ///
    ////////////////////////////////////////////////////////////
    virtual Int64 seek(Int64 position);

    ////////////////////////////////////////////////////////////
    /// \brief Get the current reading position in the stream
    ///
    /// \return The current position, or -1 on error.
    ///
    ////////////////////////////////////////////////////////////
    virtual Int64 tell();

    ////////////////////////////////////////////////////////////
    /// \brief Return the size of the stream
    ///
    /// \return The total number of bytes available in the stream, or -1 on error
    ///
    ////////////////////////////////////////////////////////////
    virtual Int64 getSize();

private:

    ////////////////////////////////////////////////////////////
    // Member data
    ////////////////////////////////////////////////////////////
    const char* m_data;   ///< Pointer to the data in memory
    Int64       m_size;   ///< Total size of the data
    Int64       m_offset; ///< Current reading position
};

} // namespace sf

#endif // SFML_MEMORYINPUTSTREAM_HPP

////////////////////////////////////////////////////////////
/// \class MemoryeInputStream
/// \ingroup system
///
/// This class is a specialization of InputStream that
/// reads from data in memory.
///
/// It wraps a memory chunk in the common InputStream interface
/// and therefore allows to use generic classes or functions
/// that accept such a stream, with content already loaded in memory.
///
/// In addition to the virtual functions inherited from
/// InputStream, MemoryInputStream adds a function to
/// specify the pointer and size of the data in memory.
///
/// SFML resource classes can usually be loaded directly from
/// memory, so this class shouldn't be useful to you unless
/// you create your own algorithms that operate on a InputStream.
///
/// Usage example:
/// \code
/// void process(InputStream& stream);
///
/// MemoryStream stream;
/// stream.open(thePtr, theSize);
/// process(stream);
/// \endcode
///
/// InputStream, FileStream
///
////////////////////////////////////////////////////////////


text:
class ChangeStateToStatusEnum < ActiveRecord::Migration
  def up
    add_column :sites, :status, :integer
    add_index  :sites, :status

    Site.reset_column_information

    Site.where(state: 'submitted').update_all status: 0
    Site.where(state: 'started').update_all   status: 1
    Site.where(state: 'succeeded').update_all status: 2
    Site.where(state: 'failed').update_all    status: 3

    remove_column :sites, :state
  end

  def down
    add_column :sites, :state

    Site.where(status: 0).update_all state: 'submitted'
    Site.where(status: 1).update_all state: 'started'
    Site.where(status: 2).update_all state: 'succeeded'
    Site.where(status: 3).update_all state: 'failed'

    remove_colum :sites, :status
  end
end


text:
namespace Neo.UI
{
    partial class OptionsDialog
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsDialog));
            this.tabControl1 = new System.Windows.Forms.TabControl();
            this.tabPage1 = new System.Windows.Forms.TabPage();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.tabControl1.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            //
            // tabControl1
            //
            resources.ApplyResources(this.tabControl1, "tabControl1");
            this.tabControl1.Controls.Add(this.tabPage1);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            //
            // tabPage1
            //
            resources.ApplyResources(this.tabPage1, "tabPage1");
            this.tabPage1.Controls.Add(this.groupBox1);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.UseVisualStyleBackColor = true;
            //
            // groupBox1
            //
            resources.ApplyResources(this.groupBox1, "groupBox1");
            this.groupBox1.Controls.Add(this.textBox1);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.TabStop = false;
            //
            // textBox1
            //
            resources.ApplyResources(this.textBox1, "textBox1");
            this.textBox1.AcceptsReturn = true;
            this.textBox1.Name = "textBox1";
            //
            // button1
            //
            resources.ApplyResources(this.button1, "button1");
            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.button1.Name = "button1";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.Apply_Click);
            //
            // button2
            //
            resources.ApplyResources(this.button2, "button2");
            this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button2.Name = "button2";
            this.button2.UseVisualStyleBackColor = true;
            //
            // button3
            //
            resources.ApplyResources(this.button3, "button3");
            this.button3.Name = "button3";
            this.button3.UseVisualStyleBackColor = true;
            this.button3.Click += new System.EventHandler(this.Apply_Click);
            //
            // OptionsDialog
            //
            resources.ApplyResources(this, "$this");
            this.AcceptButton = this.button1;
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.button2;
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.tabControl1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.Name = "OptionsDialog";
            this.ShowInTaskbar = false;
            this.tabControl1.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.TabControl tabControl1;
        private System.Windows.Forms.TabPage tabPage1;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.TextBox textBox1;
    }
}


text:
<?php defined('SYSPATH') or die('No direct script access.');

class Anqh_Model_Login extends AutoModeler {

	protected $_table_name = 'logins';

	protected $_data = array(
		'id'       => null,
		'stamp'    => null,
		'user_id'  => null,
		'username' => null,
		'ip'       => null,
		'hostname' => null,
		'success'  => null,
		'password' => null,
	);

	/**
	 * Log login attempt
	 *
	 * @static
	 * @param  boolean            $success   Was login succesful
	 * @param  string|Model_User  $user      User or username if no user found
	 * @param  boolean            $password  Password given
	 */
	public static function log($success, $user = null, $password = false) {
		$login = new Model_Login();
		try {
			$login->set_fields(array(
				'password' => $password,
				'username' => $user instanceof Model_User ? $user->username : $user,
				'success'  => (bool)$success,
				'ip'       => Request::$client_ip,
				'hostname' => Request::host_name(),
				'stamp'    => time(),
			));
			if ($user instanceof Model_User) {
				$login->user_id  = $user->id;
				$login->username = $user->usernam;
			} else if (is_string($user)) {
				$login->username = $user;
			}
			$login->save();
		} catch (Database_Exception $e) {}
	}

}