text:
package bigquery

import (
	"context"
	"errors"
	"fmt"
	"time"

	"cloud.google.com/go/internal/optional"
	"cloud.google.com/go/internal/trace"
	bq "google.golang.org/api/bigquery/v2"
)

// Routine represents a reference to a BigQuery routine.  There are multiple
// types of routines including stored procedures and scalar user-defined functions (UDFs).
// For more information, see the BigQuery documentation at https://cloud.google.com/bigquery/docs/
type Routine struct {
	ProjectID string
	DatasetID string
	RoutineID string

	c *Client
}

// FullyQualifiedName returns an identifer for the routine in project.dataset.routine format.
func (r *Routine) FullyQualifiedName() string {
	return fmt.Sprintf("%s.%s.%s", r.ProjectID, r.DatasetID, r.RoutineID)
}

// Create creates a Routine in the BigQuery service.
// Pass in a RoutineMetadata to define the routine.
func (r *Routine) Create(ctx context.Context, rm *RoutineMetadata) (err error) {
	ctx = trace.StartSpan(ctx, "cloud.google.com/go/bigquery.Routine.Create")
	defer func() { trace.EndSpan(ctx, err) }()

	routine, err := rm.toBQ()
	if err != nil {
		return err
	}
	routine.RoutineReference = &bq.RoutineReference{
		ProjectId: r.ProjectID,
		DatasetId: r.DatasetID,
		RoutineId: r.RoutineID,
	}
	req := r.c.bqs.Routines.Insert(r.ProjectID, r.DatasetID, routine).Context(ctx)
	setClientHeader(req.Header())
	_, err = req.Do()
	return err
}

// Metadata fetches the metadata for a given Routine.
func (r *Routine) Metadata(ctx context.Context) (rm *RoutineMetadata, err error) {
	ctx = trace.StartSpan(ctx, "cloud.google.com/go/bigquery.Routine.Metadata")
	defer func() { trace.EndSpan(ctx, err) }()

	req := r.c.bqs.Routines.Get(r.ProjectID, r.DatasetID, r.RoutineID).Context(ctx)
	setClientHeader(req.Header())
	var routine *bq.Routine
	err = runWithRetry(ctx, func() (err error) {
		routine, err = req.Do()
		return err
	})
	if err != nil {
		return nil, err
	}
	return bqToRoutineMetadata(routine)
}

// Update modifies properties of a Routine using the API.
func (r *Routine) Update(ctx context.Context, upd *RoutineMetadataToUpdate, etag string) (rm *RoutineMetadata, err error) {
	ctx = trace.StartSpan(ctx, "cloud.google.com/go/bigquery.Routine.Update")
	defer func() { trace.EndSpan(ctx, err) }()

	bqr, err := upd.toBQ()
	if err != nil {
		return nil, err
	}
	//TODO: remove when routines update supports partial requests.
	bqr.RoutineReference = &bq.RoutineReference{
		ProjectId: r.ProjectID,
		DatasetId: r.DatasetID,
		RoutineId: r.RoutineID,
	}

	call := r.c.bqs.Routines.Update(r.ProjectID, r.DatasetID, r.RoutineID, bqr).Context(ctx)
	setClientHeader(call.Header())
	if etag != "" {
		call.Header().Set("If-Match", etag)
	}
	var res *bq.Routine
	if err := runWithRetry(ctx, func() (err error) {
		res, err = call.Do()
		return err
	}); err != nil {
		return nil, err
	}
	return bqToRoutineMetadata(res)
}

// Delete removes a Routine from a dataset.
func (r *Routine) Delete(ctx context.Context) (err error) {
	ctx = trace.StartSpan(ctx, "cloud.google.com/go/bigquery.Model.Delete")
	defer func() { trace.EndSpan(ctx, err) }()

	req := r.c.bqs.Routines.Delete(r.ProjectID, r.DatasetID, r.RoutineID).Context(ctx)
	setClientHeader(req.Header())
	return req.Do()
}

// RoutineMetadata represents details of a given BigQuery Routine.
type RoutineMetadata struct {
	ETag string
	// Type indicates the type of routine, such as SCALAR_FUNCTION or PROCEDURE.
	Type             string
	CreationTime     time.Time
	LastModifiedTime time.Time
	// Language of the routine, such as SQL or JAVASCRIPT.
	Language string
	// The list of arguments for the the routine.
	Arguments  []*RoutineArgument
	ReturnType *StandardSQLDataType
	// For javascript routines, this indicates the paths for imported libraries.
	ImportedLibraries []string
	// Body contains the routine's body.
	// For functions, Body is the expression in the AS clause.
	//
	// For SQL functions, it is the substring inside the parentheses of a CREATE
	// FUNCTION statement.
	//
	// For JAVASCRIPT function, it is the evaluated string in the AS clause of
	// a CREATE FUNCTION statement.
	Body string
}

func (rm *RoutineMetadata) toBQ() (*bq.Routine, error) {
	r := &bq.Routine{}
	if rm == nil {
		return r, nil
	}
	r.Language = rm.Language
	r.RoutineType = rm.Type
	r.DefinitionBody = rm.Body

	var args []*bq.Argument
	for _, v := range rm.Arguments {
		bqa, err := v.toBQ()
		if err != nil {
			return nil, err
		}
		args = append(args, bqa)
	}
	r.Arguments = args
	r.ImportedLibraries = rm.ImportedLibraries
	if !rm.CreationTime.IsZero() {
		return nil, errors.New("cannot set CreationTime on create")
	}
	if !rm.LastModifiedTime.IsZero() {
		return nil, errors.New("cannot set LastModifiedTime on create")
	}
	if rm.ETag != "" {
		return nil, errors.New("cannot set ETag on create")
	}
	return r, nil
}

// RoutineArgument represents an argument supplied to a routine such as a UDF or
// stored procedured.
type RoutineArgument struct {
	// The name of this argument.  Can be absent for function return argument.
	Name string
	// Kind indicates the kind of argument represented.
	// Possible values:
	//   ARGUMENT_KIND_UNSPECIFIED
	//   FIXED_TYPE - The argument is a variable with fully specified
	//     type, which can be a struct or an array, but not a table.
	//   ANY_TYPE - The argument is any type, including struct or array,
	//     but not a table.
	Kind string
	// Mode is optional, and indicates whether an argument is input or output.
	// Mode can only be set for procedures.
	//
	// Possible values:
	//   MODE_UNSPECIFIED
	//   IN - The argument is input-only.
	//   OUT - The argument is output-only.
	//   INOUT - The argument is both an input and an output.
	Mode string
	// DataType provides typing information.  Unnecessary for ANY_TYPE Kind
	// arguments.
	DataType *StandardSQLDataType
}

func (ra *RoutineArgument) toBQ() (*bq.Argument, error) {
	if ra == nil {
		return nil, nil
	}
	a := &bq.Argument{
		Name:         ra.Name,
		ArgumentKind: ra.Kind,
		Mode:         ra.Mode,
	}
	if ra.DataType != nil {
		dt, err := ra.DataType.toBQ()
		if err != nil {
			return nil, err
		}
		a.DataType = dt
	}
	return a, nil
}

func bqToRoutineArgument(bqa *bq.Argument) (*RoutineArgument, error) {
	arg := &RoutineArgument{
		Name: bqa.Name,
		Kind: bqa.ArgumentKind,
		Mode: bqa.Mode,
	}
	dt, err := bqToStandardSQLDataType(bqa.DataType)
	if err != nil {
		return nil, err
	}
	arg.DataType = dt
	return arg, nil
}

func bqToArgs(in []*bq.Argument) ([]*RoutineArgument, error) {
	var out []*RoutineArgument
	for _, a := range in {
		arg, err := bqToRoutineArgument(a)
		if err != nil {
			return nil, err
		}
		out = append(out, arg)
	}
	return out, nil
}

func routineArgumentsToBQ(in []*RoutineArgument) ([]*bq.Argument, error) {
	var out []*bq.Argument
	for _, inarg := range in {
		arg, err := inarg.toBQ()
		if err != nil {
			return nil, err
		}
		out = append(out, arg)
	}
	return out, nil
}

// RoutineMetadataToUpdate governs updating a routine.
type RoutineMetadataToUpdate struct {
	Arguments         []*RoutineArgument
	Type              optional.String
	Language          optional.String
	Body              optional.String
	ImportedLibraries []string
	ReturnType        *StandardSQLDataType
}

func (rm *RoutineMetadataToUpdate) toBQ() (*bq.Routine, error) {
	r := &bq.Routine{}
	forceSend := func(field string) {
		r.ForceSendFields = append(r.ForceSendFields, field)
	}
	nullField := func(field string) {
		r.NullFields = append(r.NullFields, field)
	}
	if rm.Arguments != nil {
		if len(rm.Arguments) == 0 {
			nullField("Arguments")
		} else {
			args, err := routineArgumentsToBQ(rm.Arguments)
			if err != nil {
				return nil, err
			}
			r.Arguments = args
			forceSend("Arguments")
		}
	}
	if rm.Type != nil {
		r.RoutineType = optional.ToString(rm.Type)
		forceSend("RoutineType")
	}
	if rm.Language != nil {
		r.Language = optional.ToString(rm.Language)
		forceSend("Language")
	}
	if rm.Body != nil {
		r.DefinitionBody = optional.ToString(rm.Body)
		forceSend("DefinitionBody")
	}
	if rm.ImportedLibraries != nil {
		if len(rm.ImportedLibraries) == 0 {
			nullField("ImportedLibraries")
		} else {
			r.ImportedLibraries = rm.ImportedLibraries
			forceSend("ImportedLibraries")
		}
	}
	if rm.ReturnType != nil {
		dt, err := rm.ReturnType.toBQ()
		if err != nil {
			return nil, err
		}
		r.ReturnType = dt
		forceSend("ReturnType")
	}
	return r, nil
}

func bqToRoutineMetadata(r *bq.Routine) (*RoutineMetadata, error) {
	meta := &RoutineMetadata{
		ETag:              r.Etag,
		Type:              r.RoutineType,
		CreationTime:      unixMillisToTime(r.CreationTime),
		LastModifiedTime:  unixMillisToTime(r.LastModifiedTime),
		Language:          r.Language,
		ImportedLibraries: r.ImportedLibraries,
		Body:              r.DefinitionBody,
	}
	args, err := bqToArgs(r.Arguments)
	if err != nil {
		return nil, err
	}
	meta.Arguments = args
	ret, err := bqToStandardSQLDataType(r.ReturnType)
	if err != nil {
		return nil, err
	}
	meta.ReturnType = ret
	return meta, nil
}


text:
@interface EmoticonBoardUIHelper : MMObject
{
}

+ (double)calculateEdgeTopForRowCount:(long long)arg1 itemHeight:(double)arg2 intervalY:(double)arg3 totalHeight:(double)arg4;
+ (double)calculateEdgeLeftForColumnCount:(long long)arg1 itemWidth:(double)arg2 intervalX:(double)arg3 totalWidth:(double)arg4;
+ (long long)calculateRowCountForItemHeight:(double)arg1 IntervalY:(double)arg2 totalHeight:(double)arg3;
+ (long long)calculateColumnCountForItemWidth:(double)arg1 IntervalX:(double)arg2 totalWidth:(double)arg3;

@end

redpajama_set_name: RedPajamaGithub


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

<TITLE>
javax.microedition.pki (Java Card API, Connected Edition)
</TITLE>

<META NAME="date" CONTENT="2009-12-11">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

javax.microedition.pki

Interfaces

Certificate

Exceptions

CertificateException


text:
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<iframe src="resources/store-import-meta.html"></iframe>

<script type="module">
import * as otherImportMeta from "./resources/export-import-meta.mjs";
setup({ explicit_done: true });

window.onload = () => {
  test(() => {
    assert_not_equals(frames[0].importMetaURL, import.meta.url,
      "Precondition check: we've set things up so that the other script has a different import.meta.url");

    const expected = (new URL("resources/x", location.href)).href;
    assert_equals(frames[0].importMetaResolve("./x"), expected);
  }, "import.meta.resolve resolves URLs relative to the import.meta.url, not relative to the active script when it is called: another global's inline script");

  test(() => {
    const otherFrameImportMetaResolve = frames[0].importMetaResolve;

    document.querySelector("iframe").remove();

    const expected = (new URL("resources/x", location.href)).href;
    assert_equals(otherFrameImportMetaResolve("./x"), expected);
  }, "import.meta.resolve still works if its global has been destroyed (by detaching the iframe)");

  test(() => {
    assert_not_equals(otherImportMeta.url, import.meta.url,
      "Precondition check: we've set things up so that the other script has a different import.meta.url");

    const expected = (new URL("resources/x", location.href)).href;
    assert_equals(otherImportMeta.resolve("./x"), expected);
  }, "import.meta.resolve resolves URLs relative to the import.meta.url, not relative to the active script when it is called: another module script");

  done();
};
</script>


text:
<TITLE>Review for Haut bas fragile (1995)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Haut bas fragile (1995)

reviewed by
Dennis Schwartz

UP/ DOWN/ FRAGILE (HAUT/ BAS/ FRAGILE)(director/writer: Jacques Rivette;
screenwriter: Laurence Côte/Pascal Bonitzer/Christine Laurent;
cinematographer: Christophe Pollock; cast: Marianne Denicourt (Louise),
Nathalie Richard (Ninon), Laurence Côte (Ida), Andre Marcon (Roland),
Anna Karina (Sarah), Bruno Todeschini (Lucien), 1995-Fr.)

Reviewed by Dennis Schwartz

The title comes from the markings found on packages delivered by the
postal service. The inspiration of the film comes from the studio-like
Hollywood musicals of the '50s. According to Rivette, he was most
influenced by Stanley Donen's musical GIVE A GIRL A BREAK (1953). His
other influences are the great French directors of the past, such as
Renoir and Vigo. I rented UP DOWN FRAGILE, along with Rivette's first
feature, PARIS BELONGS TO US (1960), and it was interesting to see how
Rivette kept some of the same themes, how one has the need to be alone
and also the need to be with a group, how one handles reality and
fantasy, and the politics of being. It is his firm belief that the
individual alone is responsible for his life's direction, it is one's
responsibility to take charge of one's life not anyone else'. In his
newer film, which was stylistically and cinematically a much more
sophisticated and well-done production than the former, we see these
themes come out clearer, brought out by a director who is more assured
of his abilities to work with actors on a more experimental basis, as
they each collaborate on the script, as he gets them to improvise in
their roles.

The film follows the life of its three main characters: Ninon (Natashe),
Louise (Marianne), and Ida (Laurence), as they try to work out their
many problems in life, occasionally breaking out in song and dance at
the oddest moments, even when the film is moving along in a dramatic
fashion. This lighthearted approach to the film annoyed me on my first
viewing, but when I watched the film for a second time, I felt more
relaxed and was able to get in the mood Rivette probably intended for
his film to be viewed; which is, that it is up to me to fill in the
meaning of the story. But, this also, allowed me not to take this film
as a very serious work but more or less as a spectacle in the Hollywood
tradition, a tradition that Rivette gladly acknowledges a kinship and
admiration for.

Its entertainment value was enhanced by the gorgeous use of colors,
which captured the summertime Paris streets and parks, as well as the
beautful indoor sets. We followed the moped messenger, ex-whore, Ninon,
do her deliveries. Then we viewed Louise's splendidly delicious living
quarters; she is from an upper-class family, having just been released
from a clinic after being five-years in a coma following an accident.
She is being followed for her own protection by an neophyte bodyguard,
Lucien (Bruno), hired by her father without her knowledge to protect
her. She will awkwardly meet and fall in love with him. Ida is the
adopted orphan, working as a librarian, looking for her real parents,
wanting to find out why they put her up for adoption, still plagued by
that. Roland (Andre) is the set designer, the male thread that connects
all three women heroines, the Gene Kelly look-alike. He meets Louise in
her aunt's house, the one she has just inherited; he falls in love with
Ninon at the site of their respective workplaces, which are on the same
street, where she works as a messenger and he designs stage sets; and,
lastly, he meets Ida while doing research in the library she works at,
hearing her hum a tune that he recognizes, which turns out to be a song
Sarah (Anna) uses in her nightclub act, a place he often frequents.
Sarah is the real mother Ida has been looking for.

That this musical is better than most of the Hollywood musicals it
flatteringly immitates, is true to a certain extent. It is better in the
sense, that Rivette is able to bring out the poetry of the real-life
situations and present his existential view of life and not just play
for the song and dance to be the thing.Though the Hollywood performers
are more professional and have better voices and quicker feet, is
certainly true, but they also, seem to rely on an artificial story.
While for Rivette, as amateur as his performers might seem to be in
comparison, the story still seems real and important, and the musical
numbers are intrusive but seem to be imbued with a magical quality about
them, that makes them seem  just as fantasy oriented as the typical
Hollywood production; and, in my opinion, that makes for a more
interesting and better film. Though it makes for a different way for
American audiences to appreciate the musical, a form of film that
Hollywood at one time was the most innovative creators of, but has now
all but abandoned that genre because of high production costs and not
enough box office gross to show for its efforts.

REVIEWED ON 1/7/99                     GRADE: B

Dennis Schwartz: "Ozus' World Movie Reviews"

http://www.sover.net/~ozus

ozus@sover.net

© ALL RIGHTS RESERVED   DENNIS SCHWARTZ

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
import toInteger from 'lodash-es/toInteger.js';
import InvalidSchemaVersion from './exceptions/InvalidSchemaVersion.js';

/**
 * Regular expression pattern for matching a valid SchemaVersion string.
 * @type {RegExp}
 */
export const VALID_PATTERN = /^([0-9]+)-([0-9]+)-([0-9]+)$/;

/**
 * Similar to semantic versioning but with dashes and no "alpha, beta, etc." qualifiers.
 *
 * E.g. 1-0-0 (major-minor-patch)
 *
 * MAJOR
 * Is incremented when a change is made which breaks the rules of Protobuf/Thrift backward
 * compatibility, such as changing the type of a field.
 *
 * MINOR
 * Is a change which is backward compatible but not forward compatible. Records created from
 * the old version of the schema can be deserialized using the new schema, but not the other way
 * around.  Example: adding a new field to a union type.
 *
 * PATCH
 * Is a change which is both backward compatible and forward compatible. The previous version of
 * the schema can be used to deserialize records created from the new version of the schema, and
 * vice versa. Example: adding a new optional field.
 *
 * @link http://semver.org/
 * @link http://snowplowanalytics.com/blog/2014/05/13/introducing-schemaver-for-semantic-versioning-of-schemas/
 *
 */
export default class SchemaVersion {
  /**
   * @param {number} major
   * @param {number} minor
   * @param {number} patch
   *
   * @throws {InvalidSchemaVersion}
   */
  constructor(major = 1, minor = 0, patch = 0) {
    this.major = toInteger(major);
    this.minor = toInteger(minor);
    this.patch = toInteger(patch);
    this.version = `${major}-${minor}-${patch}`;

    if (!VALID_PATTERN.test(this.version)) {
      throw new InvalidSchemaVersion(
        `SchemaVersion [${this.version}] is invalid. It must match the pattern [${VALID_PATTERN}].`,
      );
    }

    Object.freeze(this);
  }

  /**
   * @param {string} version - A valid SchemaVersion as a string, e.g. 1-0-0
   *
   * @returns {SchemaVersion}
   *
   * @throws {InvalidSchemaVersion}
   */
  static fromString(version = '1-0-0') {
    const matches = `${version}`.match(VALID_PATTERN);
    if (matches === null) {
      throw new InvalidSchemaVersion(
        `SchemaVersion [${version}] is invalid. It must match the pattern [${VALID_PATTERN}].`,
      );
    }

    return new SchemaVersion(matches[1], matches[2], matches[3]);
  }

  /**
   * @returns {string}
   */
  toString() {
    return this.version;
  }

  /**
   * @returns {string}
   */
  toJSON() {
    return this.version;
  }

  /**
   * @returns {string}
   */
  valueOf() {
    return this.version;
  }

  /**
   * @returns {number}
   */
  getMajor() {
    return this.major;
  }

  /**
   * @returns {number}
   */
  getMinor() {
    return this.minor;
  }

  /**
   * @returns {number}
   */
  getPatch() {
    return this.patch;
  }
}


text:
'''
    Finds out the gender of all Names in a table on wikipedia.org
    @author: tbach, slau
'''

from ..nameparser import *
import stringhelper
import urllib2

class WikiTableParser(NameParser):

    WIKI_BASE = "https://de.wikipedia.org"
    WIKI_PAGE = WIKI_BASE + "/wiki/"

    def __init__(self, address, url):
        NameParser.__init__(self, address, url)
        start_table = "
"
        if self.pageContent.find(start_table) == -1:
            print("Did not find a table on the page found under '{}'").format(url)
        self.pageContent = stringhelper.get_part_between(self.pageContent, start_table, "
")
        self._make_name_list()

    def _make_name_list(self):
        ''' Parses all wiki links in table for MDB to get the gender'''
        all_tr = self.pageContent.split("
")
        count_male = 0
        count_female = 0
        count_unknown = 0
        for tr in all_tr[1:]:
            td = stringhelper.get_part_between(tr, "", "	")
            name_family = stringhelper.get_part_between_after(td, "\">", ",", "display:none")
            name = stringhelper.get_part_between(td, "display:none\">", ",")
            if "usgeschieden" in tr or "nahm sein Mandat nicht an" in tr \
                    or "verstorben" in tr:
                print "Skipped {}, {}...".format(name_family, name)
                continue
            if "span" in name_family:  # glockner...
                name_family = stringhelper.get_part_between_after(td, "\">", "!", "display:non")
            name_full = stringhelper.get_part_between_after(td, "\">", "", "title")
            partei = stringhelper.get_part_between_n_occurrences(tr, "", "	", 3)
            gender = ""

            link = self.WIKI_BASE + stringhelper.get_part_between(td, "a href=\"", "\"")
            wiki_person_content = urllib2.urlopen(link).read()
            if "/wiki/Kategorie:Mann" in wiki_person_content:
                count_male += 1
                gender = "male"
            elif "/wiki/Kategorie:Frau" in wiki_person_content:
                count_female += 1
                gender = "female"
            else:
                count_unknown += 1
            self._make_name(name, name_family, partei, gender)
        total = count_female + count_male
        print "sum: {} female: {} male: {} unknown: {}".format(total, count_female, count_male, count_unknown)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace NSysmon.Collector.SqlServer
{
    public class SqlDatabaseFileInfo : ISQLVersionedObject
    {
        [JsonIgnore]
        public Version MinVersion { get { return SqlServerVersions.SQL2008R2.RTM; } }

        public string DatabaseName { get; private set; }
        public int DatabaseId { get; private set; }
        public int FileId { get; private set; }
        public string FileName { get; private set; }
        public byte FileType { get; private set; }
        public string FileTypeDesc { get; private set; }
        public string FilePhysicalName { get; private set; }
        public byte FileState { get; private set; }
        public string FileStateDesc { get; private set; }
        public int FileSizeInPages { get; private set; }
        public int FileMaxSizeInPages { get; private set; }
        public int Growth { get; private set; }
        public bool IsPercentGrowth { get; private set; }
        public string LogicalVolumeName { get; private set; }
        public string VolumeMountPoint { get; private set; }
        public long VolumeTotalBytes { get; private set; }
        public long VolumeAvailableBytes { get; private set; }

        public const string FetchSQL = @"
SELECT
    d.name AS DatabaseName
    , f.database_id AS DatabaseId
    , f.[file_id] AS FileId
    , f.name AS [FileName]
    , f.[type] AS FileType
    , f.type_desc AS FileTypeDesc
    , f.physical_name AS FilePhysicalName
    , f.[state] AS FileState
    , f.state_desc AS FileStateDesc
    , f.size AS FileSizeInPages
    , f.max_size AS FileMaxSizeInPages
    , f.growth AS Growth
    , f.is_percent_growth AS IsPercentGrowth
    , logical_volume_name AS LogicalVolumeName
    , volume_mount_point AS VolumeMountPoint
    , total_bytes AS VolumeTotalBytes
    , available_bytes AS VolumeAvailableBytes
FROM sys.master_files AS f
    INNER JOIN sys.databases as d on d.database_id = f.database_id
    CROSS APPLY sys.dm_os_volume_stats(f.database_id, f.file_id);
";

        public string GetFetchSQL(Version version)
        {
            return FetchSQL;
        }
    }
}


text:
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

namespace RestWell.Domain.Request
{
    internal sealed class DelegatingAction : DelegatingHandler
    {
        #region Private Fields

        private readonly Action<HttpRequestMessage, CancellationToken> actionBeforeSendingRequest;

        #endregion Private Fields

        #region Public Constructors

        public DelegatingAction(Action<HttpRequestMessage, CancellationToken> actionBeforeSendingRequest)
        {
            this.actionBeforeSendingRequest = actionBeforeSendingRequest;
        }

        #endregion Public Constructors

        #region Protected Methods

        protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        {
            this.actionBeforeSendingRequest(request, cancellationToken);
            return await base.SendAsync(request, cancellationToken);
        }

        #endregion Protected Methods
    }
}


text:
namespace LinqPractise
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.Spatial;

    [Table("Core.Images")]
    public partial class Image
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Image()
        {
            ImageBands = new HashSet<ImageBand>();
            ImageLanes = new HashSet<ImageLane>();
            ImageSources = new HashSet<ImageSource>();
        }

        public int Id { get; set; }

        public int ProductId { get; set; }

        [Required]
        [StringLength(200)]
        public string Title { get; set; }

        public int? ApplicationTypeId { get; set; }

        [StringLength(3000)]
        public string Legend { get; set; }

        public int ImagePositionId { get; set; }

        public bool ShowOnPWS { get; set; }

        [Required]
        [StringLength(255)]
        public string FileName { get; set; }

        public short? DisplayOrder { get; set; }

        public int Width { get; set; }

        public int Height { get; set; }

        public Guid Rowguid { get; set; }

        [StringLength(250)]
        public string Credit { get; set; }

        public string InternalNotes { get; set; }

        [StringLength(60)]
        public string Code { get; set; }

        public int? PredictedBand { get; set; }

        public int? OwnerId { get; set; }

        [Column(TypeName = "timestamp")]
        [MaxLength(8)]
        [Timestamp]
        public byte[] timestamp { get; set; }

        public virtual ApplicationType ApplicationType { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<ImageBand> ImageBands { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<ImageLane> ImageLanes { get; set; }

        public virtual ImagePosition ImagePosition { get; set; }

        public virtual Product Product { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<ImageSource> ImageSources { get; set; }

        public virtual ImageThumbnail ImageThumbnail { get; set; }

        public virtual WbIpImage WbIpImage { get; set; }
    }
}


text:
Login

                <form class="form col-md-12 center-block">

                        <input type="text" class="form-control input-lg" placeholder="Username" ng-model="username" required>

                        <input type="password" class="form-control input-lg" ng-model="password" placeholder="Password" required>

                        <button ng-disabled="!username || !password" class="btn btn-primary" ng-click="login()">Sign In</button>

                </form>

Login Failed!

                    <button type="button" class="btn btn-lg btn-danger" ng-click="showLoginModal()" data-dismiss="modal">OK</button>


text:
/**
 * RemotePermissionScheme_Helper.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package org.javelin.sws.ext.ws.axis1.jira.contractfirst.tm12_arraysplain;

@SuppressWarnings("all")
public class RemotePermissionScheme_Helper {
	// Type metadata
	private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(RemotePermissionScheme.class, true);

	static {
		typeDesc.setXmlType(new javax.xml.namespace.QName("http://beans.soap.rpc.jira.atlassian.com", "RemotePermissionScheme"));
		org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
		elemField.setFieldName("permissionMappings");
		elemField.setXmlName(new javax.xml.namespace.QName("", "permissionMappings"));
		elemField.setXmlType(new javax.xml.namespace.QName("http://beans.soap.rpc.jira.atlassian.com", "RemotePermissionMapping"));
		elemField.setNillable(true);
		typeDesc.addFieldDesc(elemField);
	}

	/**
	 * Return type metadata object
	 */
	public static org.apache.axis.description.TypeDesc getTypeDesc() {
		return typeDesc;
	}

	/**
	 * Get Custom Serializer
	 */
	public static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) {
		return new org.apache.axis.encoding.ser.BeanSerializer(_javaType, _xmlType, typeDesc);
	}

	/**
	 * Get Custom Deserializer
	 */
	public static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) {
		return new org.apache.axis.encoding.ser.BeanDeserializer(_javaType, _xmlType, typeDesc);
	}

}


text:
package com.wanyukang.emma;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import android.app.Instrumentation;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;

/**
 * Emma代码覆盖率记录Service
 *
 * @author wanyukang
 */
public class EmmaService extends Service {

    private static final String TAG = "EmmaService";
    //	private static final String DEFAULT_COVERAGE_FILE_PATH = "/mnt/sdcard/coverage.ec";
    private final Bundle mResults = new Bundle();
    //	private String mCoverageFilePath;
    private String DEFAULT_COVERAGE_FILE_PATH_MEMORY_DIR;        //日志文件在内存中的路径(日志文件在安装目录中的路径)
    private String DEFAULT_COVERAGE_FILE_PATH_SDCARD_DIR;        //日志文件在sdcard中的路径
    private final int SDCARD_TYPE = 0;        //当前的日志记录类型为存储在SD卡下面
    private final int MEMORY_TYPE = 1;        //当前的日志记录类型为存储在内存中
    private int CURR_TYPE = SDCARD_TYPE;    //当前的日志记录位置
    private SDStateMonitorReceiver sdStateReceiver;        //SDcard状态监测
    private static boolean IS_Coverage = false;

    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void onCreate() {

        Log.i(TAG, "EmmaService==>>onCreate");
        super.onCreate();
        init();
        register();
    }

    private void init() {

        DEFAULT_COVERAGE_FILE_PATH_MEMORY_DIR = getFilesDir().getAbsolutePath() + File.separator + "Emma";
        DEFAULT_COVERAGE_FILE_PATH_SDCARD_DIR = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "MyApp" + File.separator + "Emma";
        createLogDir();
        CURR_TYPE = getCurrLogType();
    }

    private void register() {
        IntentFilter sdCarMonitorFilter = new IntentFilter();
        sdCarMonitorFilter.addAction(Intent.ACTION_MEDIA_MOUNTED);
        sdCarMonitorFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
        sdCarMonitorFilter.addDataScheme("file");
        sdStateReceiver = new SDStateMonitorReceiver();
        registerReceiver(sdStateReceiver, sdCarMonitorFilter);

    }

    /**
     * 获取当前应存储在内存中还是存储在SDCard中
     *
     * @return
     */
    private int getCurrLogType() {

        if (!Environment.getExternalStorageState().equals(
                Environment.MEDIA_MOUNTED)) {
            return MEMORY_TYPE;
        } else {
            return SDCARD_TYPE;
        }
    }

    /**
     * 创建目录
     */
    private void createLogDir() {

        File file = new File(DEFAULT_COVERAGE_FILE_PATH_MEMORY_DIR);
        boolean mkOk;
        if (!file.isDirectory()) {
            mkOk = file.mkdirs();
            if (!mkOk) {
                mkOk = file.mkdirs();
            }
        }

        if (Environment.getExternalStorageState().equals(
                Environment.MEDIA_MOUNTED)) {
            file = new File(DEFAULT_COVERAGE_FILE_PATH_SDCARD_DIR);
            if (!file.isDirectory()) {
                mkOk = file.mkdirs();
                if (!mkOk) {
                    Log.i(TAG, "move file failed, dir is not created succ");
                    return;
                }
            }
        }
    }

    /**
     * 监控SDCard状态
     *
     * @author wanyukang
     */
    class SDStateMonitorReceiver extends BroadcastReceiver {
        public void onReceive(Context context, Intent intent) {

            if (Intent.ACTION_MEDIA_UNMOUNTED.equals(intent.getAction())) {   //存储卡被卸载
                if (CURR_TYPE == SDCARD_TYPE) {
                    Log.i(TAG, "SDcard 已卸载!");
                    CURR_TYPE = MEMORY_TYPE;
                }
            } else {                                                          //存储卡被挂载
                if (CURR_TYPE == MEMORY_TYPE) {
                    Log.i(TAG, "SDcard 已挂载!");
                    CURR_TYPE = SDCARD_TYPE;
                }
            }
        }
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {

        Log.i(TAG, "EmmaService==>>onStartCommand");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {

        generateCoverageReport();
        Log.i(TAG, "EmmaServie==>>onDestroy");
        super.onDestroy();
        unregisterReceiver(sdStateReceiver);
    }

    private void generateCoverageReport() {

        Log.i(TAG, "generateCoverageReport()");

        File coverageFile = new File(getCoverageFilePath());

        try {
            Class<?> emmaRTClass = Class.forName("com.vladium.emma.rt.RT");
            Method dumpCoverageMethod = emmaRTClass.getMethod(
                    "dumpCoverageData", coverageFile.getClass(), boolean.class,
                    boolean.class);
            dumpCoverageMethod.invoke(null, coverageFile, true, false);
        } catch (ClassNotFoundException e) {
            reportEmmaError("Emma.jar not in the class path?", e);
        } catch (SecurityException e) {
            reportEmmaError(e);
        } catch (NoSuchMethodException e) {
            reportEmmaError(e);
        } catch (IllegalArgumentException e) {
            reportEmmaError(e);
        } catch (IllegalAccessException e) {
            reportEmmaError(e);
        } catch (InvocationTargetException e) {
            reportEmmaError(e);
        }
    }

    /**
     * 获取当前存储位置的绝对路径
     *
     * @return
     */
    private String getCoverageFilePath() {
//		if (mCoverageFilePath == null) {
//			return DEFAULT_COVERAGE_FILE_PATH;
//		} else {
//			return mCoverageFilePath;
//		}

        if (CURR_TYPE == MEMORY_TYPE) {
            Log.i(TAG, "CoverageFile in memory, the path is:" + DEFAULT_COVERAGE_FILE_PATH_MEMORY_DIR);
            return DEFAULT_COVERAGE_FILE_PATH_MEMORY_DIR + File.separator + "coverage.ec";
        } else {
            Log.i(TAG, "CoverageFile in SDCard, the path is:" + DEFAULT_COVERAGE_FILE_PATH_SDCARD_DIR);
            return DEFAULT_COVERAGE_FILE_PATH_SDCARD_DIR + File.separator + "coverage.ec";
        }

    }

    private void reportEmmaError(Exception e) {
        reportEmmaError("", e);
    }

    private void reportEmmaError(String hint, Exception e) {
        String msg = "Failed to generate emma coverage. " + hint;
        Log.e(TAG, msg, e);
        mResults.putString(Instrumentation.REPORT_KEY_STREAMRESULT, "\nError: " + msg);
    }

    public static void startEmmaService(Context context) {
        if (IS_Coverage == true) {
            Intent intent = new Intent(context, EmmaService.class);
            context.startService(intent);
        }
    }

    public static void stopEmmaService(Context context) {
        if (IS_Coverage == true) {
            Intent intent = new Intent(context, EmmaService.class);
            context.stopService(intent);
        }
    }
}


text:
/*jslint node: true */

var forms = require('./forms'),
    util = require('util'),
    async = require('async');

exports.string = function (opt) {
    opt = opt || {};

    var k, f = {};

    for (k in opt) {
        if (opt.hasOwnProperty(k)) {
            f[k] = opt[k];
        }
    }
    f.widget = f.widget || forms.widgets.text();

    f.parse = function (raw_data) {
        if (typeof raw_data !== 'undefined' && raw_data !== null) {
            return String(raw_data);
        }
        return '';
    };
    f.bind = function (raw_data) {
        var k, b = {};
        // clone field object:
        for (k in f) {
            if (f.hasOwnProperty(k)) {
                b[k] = f[k];
            }
        }
        b.value = raw_data;
        b.data = b.parse(raw_data);
        b.validate = function (form, callback) {
            if (raw_data === '' || raw_data === null || typeof raw_data === 'undefined') {
                // don't validate empty fields, but check if required
                if (b.required) { b.error = opt.emptyMessage || 'This field is required.'; }
                process.nextTick(function () { callback(null, b); });
            } else {
                async.forEachSeries(b.validators || [], function (v, callback) {
                    if (!b.error) {
                        v(form, b, function (v_err) {
                            b.error = v_err ? v_err.toString() : null;
                            callback(null);
                        });
                    } else {
                        callback(null);
                    }
                }, function (err) {
                    callback(err, b);
                });
            }
        };
        return b;
    };
    f.clear = function() {
        this.value = '';
        this.error = undefined;
        return this;
    };
    f.errorHTML = function () {
        return this.error ? '' + this.error + '' : '';
    };
    f.labelText = function (name) {
        return this.label || name[0].toUpperCase() + name.substr(1).replace('_', ' ');
    };
    f.labelHTML = function (name, id) {
        if (this.widget.type === 'hidden') { return ''; }
        return '' + this.labelText(name, id) + '';
    };
    f.classes = function () {
        var r = ['field'];
        if (this.error) { r.push('error'); }
        if (this.required) { r.push('required'); }
        return r;
    };
    f.toHTML = function (name, iterator) {
        return (iterator || forms.render.control)(name, this);
    };
    f.toJSON = function (name) {
        return forms.render.json(name, this);
    };

    return f;
};

exports.number = function (opt) {
    opt = opt || {};
    var f = exports.string(opt);

    f.parse = function (raw_data) {
        if (raw_data === null || raw_data === '') {
            return NaN;
        }
        return Number(raw_data);
    };
    return f;
};

exports.boolean = function (opt) {
    opt = opt || {};
    var f = exports.string(opt);

    f.widget = opt.widget || forms.widgets.checkbox();
    f.parse = function (raw_data) {
        return Boolean(raw_data);
    };
    return f;
};

exports.email = function (opt) {
    opt = opt || {};
    var f = exports.string(opt);
    if (f.validators) {
        f.validators.unshift(forms.validators.email(opt.invalidMessage));
    } else {
        f.validators = [forms.validators.email(opt.invalidMessage)];
    }
    return f;
};

exports.phone = function (opt) {
    opt = opt || {};
    var f = exports.string(opt);
    if (f.validators) {
        f.validators.unshift(forms.validators.phone(opt.invalidMessage));
    } else {
        f.validators = [forms.validators.phone(opt.invalidMessage)];
    }
    return f;
};

exports.password = function (opt) {
    opt = opt || {};
    var f = exports.string(opt);
    f.widget = opt.widget || forms.widgets.password();
    return f;
};

exports.url = function (opt) {
    opt = opt || {};
    var f = exports.string(opt);
    if (f.validators) {
        f.validators.unshift(forms.validators.url(opt.invalidMessage));
    } else {
        f.validators = [forms.validators.url(opt.invalidMessage)];
    }
    return f;
};

exports.array = function (opt) {
  opt = opt || {};
  var f = exports.string(opt);
  f.parse = function (raw_data) {
    if (typeof raw_data === 'undefined') { return []; }
    return Array.isArray(raw_data) ? raw_data : [raw_data];
  };
  return f;
};

exports.date = function (opt) {
  opt = opt || {};
  var f = exports.string(opt);

  f.parse = function (raw_data) {
    if (raw_data === null || raw_data === '') {
      return NaN;
    }
    if(util.isDate(raw_data)){
      // if so we can format it to RFC3339 specification, 'yyyy-mm-dd'
      var day = raw_data.getDate();
      var month = raw_data.getMonth() + 1; //Months are zero based
      var year = raw_data.getFullYear();
      return year + '-' + (month < 10 ? '0'+month: month) + '-' + day;
    }
    return Date(raw_data);
  };
  return f;
};


text:
<!DOCTYPE html>

<link rel="stylesheet" type="text/css" href="viewer.css">
<link rel="stylesheet" href="http://ol3js.org/en/master/css/ol.css" type="text/css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css" type="text/css">

				Collecties

			<form>

					<input name="{{ds.name}}" type="checkbox" ng-model="ds.enabled"> {{ds.name}}</input>

			</form>

				Zoeken op onderwerp

				<form>
					<input id="subjectInput" auto-complete ui-items="subjects" ng-model="search_selection"/>
					<input type="button" value="Zoek" ng-click="doSearch()">
				</form>


text:
<?php
/**
 * @package limba.interfaces
 * @since 11 juin 2009
 * @author  Ludovic Reenaers
 * @link http://code.google.com/p/limba
 */
abstract class Generator{
	protected $params;
	protected $content="";
	protected $Factory = null;
	function __construct($params,$factory){
		$this->params=$params;
		$this->Factory = $factory;
	}
	function getParams(){
		return $this->params;
	}
	function dump(){
		$this->setUp();
		return $this->content;
	}
	abstract function setUp();
}
?>


text:
package cat.wuyingren.rorhelper.utils;

import android.os.Build;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import cat.wuyingren.rorhelper.activities.MainActivity;

/**
 * Created by wuyingren on 18/02/14.
 */
public class SystemUtils {

    public static Spinner configureSpinner(View v, int id, int arrayId) {
        Spinner spinner = (Spinner) v.findViewById(id);
        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(MainActivity.getContext(),
                arrayId, android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner.setAdapter(adapter);
        return spinner;
    }

    public static int safeLongToInt(long l) {
        if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) {
            throw new IllegalArgumentException
                    (l + " cannot be cast to int without changing its value.");
        }
        return (int) l;
    }

    // Android 1.5 has no Build.VERSION.SDK_INT
    public static int getSdkInt() {
        if (Build.VERSION.RELEASE.startsWith("1.5"))
            return 3;

        try {
            Log.d("TAG", String.valueOf(SDKHelper.getSdkIntInternal()));
            return SDKHelper.getSdkIntInternal();
        } catch (VerifyError e) {
            return 3;
        }
    }

    // Needed because Java will check if the class is valid. In Android 1.5, it will not.
    private static class SDKHelper {
        private static int getSdkIntInternal() {
            return Build.VERSION.SDK_INT;
        }
    }
}


text:
function [ DL ] = initDL( WA, DI )
%--------------------------------------------------------------------------
%initDInterior: initialize the data structure of Dictionary Learning
%--------------------------------------------------------------------------
% DESCRIPTION:
%
% INPUT ARGUMENTS:
%   WA, the data structue of W ADMM
%   DI, the data structure of D Interior
% OUTPUT ARGUMENTS:
%   DL, the data structure of dictionary learning, has the following
%   fields,
%       WA, the W ADMM.
%       DI, the D Interiror.
%       itNum: # loop of the dictionary learning (outer loop).
%       SAVE_TEM_PERIOD, how many iterations to save current model.
%       LP_TOL, a termination criterion. If the difference of LP between
%       the recent two iterations is <= current LP * LP_TOL, then break.
%       W_TOL, D_TOL, other termination criteria. If the difference of D is
%       <= D_TOL and the difference of W is <= max(current W)*W_TOL, then
%       break.
%       D_HIST_FLAG, a flag indicates whether to save D in each iteration.
%       W_HIST_FLAG, a flag indicates whether to save W in each iteration.
%       LPAry, a vector recording log posterior values for each iteration.
DL.W = WA;
DL.D = DI;
DL.itNum= 100;
DL.SAVE_TEM_PERIOD = 3;
DL.LP_TOL = 1e-6;
DL.W_TOL = 1e-4;
DL.D_TOL = 1e-4;
DL.D_HIST_FLAG = 0;
DL.W_HIST_FLAG = 0;
DL.LPAry = zeros( 1, DL.itNum+1 );
end


text:
<?php

namespace allejo\DaPulse\Objects;

use allejo\DaPulse\Exceptions\ColumnNotFoundException;

/**
 * Class PulseColumnTextValue
 *
 * @package allejo\DaPulse\Objects
 * @since   0.1.0
 */
class PulseColumnTextValue extends PulseColumnValue
{
    /**
     * Get a text column's content
     *
     * @api
     *
     * @since  0.4.0 ColumnNotFoundException is now thrown
     * @since  0.1.0
     *
     * @throws ColumnNotFoundException The specified column ID does not exist for the parent Pulse
     *
     * @return string|null The column's content
     */
    public function getValue ()
    {
        return parent::getValue();
    }

    /**
     * Update the text of a text column
     *
     * @api
     *
     * @param string $text
     *
     * @since 0.3.0 \InvalidArgumentException is now thrown
     * @since 0.1.0
     *
     * @throws \InvalidArgumentException if $text does not have a string representation
     */
    public function updateValue ($text)
    {
        if (!is_scalar($text) || (is_object($text) && method_exists($text, '__toString')))
        {
            throw new \InvalidArgumentException('$text is expected to have a string representation');
        }

        $url        = sprintf("%s/%d/columns/%s/text.json", self::apiEndpoint(), $this->board_id, $this->column_id);
        $postParams = [
            "pulse_id" => $this->pulse_id,
            "text"     => (string)$text
        ];

        $result = self::sendPut($url, $postParams);
        $this->jsonResponse = $result;
        $this->setValue($result);
    }

    protected function setValue ($response)
    {
        $this->column_value = $response["value"];
    }
}


text:
import Container from './container';
import Configuration from './configuration';
import Dispatcher from './events/dispatcher';

let isFunction = require('lodash').isFunction;

let config = new Configuration();

let setup = function (app: Application) {
  app.singleton('event', () => new Dispatcher());
};

export default class Application {
  private environment: string;
  private instances: any = {};

  constructor(environment: string = 'production') {
    this.environment = environment;

    setup(this);
  }

  detectEnvironment(environment: any): string {
    if (isFunction(environment)) {
      environment = environment.apply(this);
    }

    return this.environment = environment;
  }

  env(): string {
    return this.environment;
  }

  get(key: string, defaults: any = null): any {
    return config.get(key, defaults);
  }

  put(key: string, value: any): Application {
    config.put(key, value);

    return this;
  }

  on(name: string, callback: any): Application {
    this.make('event').listen(name, callback);

    return this
  }

  emit(name: string, options: any = []): Application {
    this.make('event').emit(name, options);

    return this;
  }

  bind(name: string, instance: any): Application {
    this.instances[name] = new Container(name, instance);

    return this;
  }

  singleton(name: string, instance: any): Application {
    this.instances[name] = new Container(name, instance, true);

    return this;
  }

  make(name: string): any {
    let options = Array.prototype.slice.call(arguments);
    name = options.shift();

    if (this.instances[name] instanceof Container) {
      return this.instances[name].resolving(options);
    }
  }

  when(environment: string, callback: any): any {
    let env = this.environment;

    if (env === environment || environment == '*') {
      return this.run(callback);
    }
  }

  run(callback: any): any {
    if (isFunction(callback)) {
      return callback.call(this);
    }
  }
}


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="thirdPartyCode/idb.filesystem.js"></script>
</head>
<body>

<script>

    window.requestFileSystem(TEMPORARY, 1024 * 1024, function(fs) {
        console.log('Opened ' + fs.name);

        fs.root.getFile('NewFile.txt', {create: true}, function(fileEntry) {
            fileEntry.createWriter(function(fileWriter) {
                fileWriter.onwritestart = function() {
                    console.log('WRITE START');
                };

                fileWriter.onwriteend = function() {
                    console.log('WRITE END');
                };

                var blob = new Blob(['1234567890'], {type: 'text/plain'});

                fileWriter.write(blob);
            }, onError);
        }, onError);
    }, onError);

    function onError(e) {
        console.log('Error', e);
    }

</script>
</body>
</html>


text:
package com.drivemode.timberlorry.app;

import com.drivemode.timberlorry.payload.Payload;

/**
 * @author KeishinYokomaku
 */
public class ButtonClick implements Payload {
    private final long timeInMillis;

    public ButtonClick(long timeInMillis) {
        this.timeInMillis = timeInMillis;
    }
}


text: alter table `judges` add column `kind` enum('Presiding', 'Scoring') not null default 'Presiding';


text:
<?php

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

namespace Twilio\Rest\Api\V2010\Account;

use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceResource;
use Twilio\Values;
use Twilio\Version;

/**
 * @property string accountSid
 * @property string apiVersion
 * @property string callSid
 * @property \DateTime dateCreated
 * @property \DateTime dateUpdated
 * @property string duration
 * @property string sid
 * @property string price
 * @property string priceUnit
 * @property string status
 * @property integer channels
 * @property string source
 * @property string uri
 * @property array encryptionDetails
 * @property integer errorCode
 */
class RecordingInstance extends InstanceResource {
    protected $_transcriptions = null;
    protected $_addOnResults = null;

    /**
     * Initialize the RecordingInstance
     *
     * @param \Twilio\Version $version Version that contains the resource
     * @param mixed[] $payload The response payload
     * @param string $accountSid The unique sid that identifies this account
     * @param string $sid Fetch by unique recording Sid
     * @return \Twilio\Rest\Api\V2010\Account\RecordingInstance
     */
    public function __construct(Version $version, array $payload, $accountSid, $sid = null) {
        parent::__construct($version);

        // Marshaled Properties
        $this->properties = array(
            'accountSid' => Values::array_get($payload, 'account_sid'),
            'apiVersion' => Values::array_get($payload, 'api_version'),
            'callSid' => Values::array_get($payload, 'call_sid'),
            'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
            'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
            'duration' => Values::array_get($payload, 'duration'),
            'sid' => Values::array_get($payload, 'sid'),
            'price' => Values::array_get($payload, 'price'),
            'priceUnit' => Values::array_get($payload, 'price_unit'),
            'status' => Values::array_get($payload, 'status'),
            'channels' => Values::array_get($payload, 'channels'),
            'source' => Values::array_get($payload, 'source'),
            'uri' => Values::array_get($payload, 'uri'),
            'encryptionDetails' => Values::array_get($payload, 'encryption_details'),
            'errorCode' => Values::array_get($payload, 'error_code'),
        );

        $this->solution = array(
            'accountSid' => $accountSid,
            'sid' => $sid ?: $this->properties['sid'],
        );
    }

    /**
     * Generate an instance context for the instance, the context is capable of
     * performing various actions.  All instance actions are proxied to the context
     *
     * @return \Twilio\Rest\Api\V2010\Account\RecordingContext Context for this
     *                                                         RecordingInstance
     */
    protected function proxy() {
        if (!$this->context) {
            $this->context = new RecordingContext(
                $this->version,
                $this->solution['accountSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }

    /**
     * Fetch a RecordingInstance
     *
     * @return RecordingInstance Fetched RecordingInstance
     */
    public function fetch() {
        return $this->proxy()->fetch();
    }

    /**
     * Deletes the RecordingInstance
     *
     * @return boolean True if delete succeeds, false otherwise
     */
    public function delete() {
        return $this->proxy()->delete();
    }

    /**
     * Access the transcriptions
     *
     * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList
     */
    protected function getTranscriptions() {
        return $this->proxy()->transcriptions;
    }

    /**
     * Access the addOnResults
     *
     * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList
     */
    protected function getAddOnResults() {
        return $this->proxy()->addOnResults;
    }

    /**
     * Magic getter to access properties
     *
     * @param string $name Property to access
     * @return mixed The requested property
     * @throws TwilioException For unknown properties
     */
    public function __get($name) {
        if (array_key_exists($name, $this->properties)) {
            return $this->properties[$name];
        }

        if (property_exists($this, '_' . $name)) {
            $method = 'get' . ucfirst($name);
            return $this->$method();
        }

        throw new TwilioException('Unknown property: ' . $name);
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString() {
        $context = array();
        foreach ($this->solution as $key => $value) {
            $context[] = "$key=$value";
        }
        return '[Twilio.Api.V2010.RecordingInstance ' . implode(' ', $context) . ']';
    }
}


text:
namespace extensions_v8 {

class GearsExtension {
 public:
  static v8::Extension* Get();
};

}  // namespace extensions_v8

#endif  // WEBKIT_EXTENSIONS_V8_GEARS_EXTENSION_H_


text:
const request = require('supertest')
const db = require('APP/db');
const {expect} = require('chai');
const Entry = require('./entry').Entry;

describe('Entry Model', () => {
	beforeEach(function(done){
		Entry.sync({force: true})
				 .then(() => Entry.sync({force: true}))
				 .then(done)
				 .catch(done);
	});
});


text:
<!--
	Insecure cookies are set for these domains and hosts:

		- anonimag.es
		- .anonimag.es

-->
<ruleset name="Anon Imag.es">

	<!--	Direct rewrites:
				-->
	<target host="anonimag.es" />
	<target host="www.anonimag.es" />

	<!--	Not secured by server:
					-->
	<!--securecookie host="^anonimag\.es$" name="^PHPSESSID$" /-->
	<!--securecookie host="^\.anonimag\.es$" name="^(?:__cfduid|cf_clearance)$" /-->

	<securecookie host="^\.?anonimag\.es$" name=".+" />

	<rule from="^http:"
		to="https:" />

</ruleset>


text:
![build status](https://travis-ci.org/openhab/jmdns.svg)

This library is licensed under the Apache License Version 2.0.
Please see the file [NOTICE.txt](NOTICE.txt).

Arthur van Hoff
avh@strangeberry.com

Rick Blair
rickblair@mac.com

Kai Kreuzer
kai@openhab.org

# JmDNS

This is an implemenation of multi-cast DNS in Java. It
supports service discovery and service registration. It is fully
interoperable with Apple's Bonjour.

## Sample Code for Service Registration

```
    import javax.jmdns.*;

    JmDNS jmdns = new JmDNS();
    jmdns.registerService(
    	new ServiceInfo("_http._tcp.local.", "foo._http._tcp.local.", 1234, 0, 0, "path=index.html")
    );
```

## Sample code for Serivice Discovery

```
    import javax.jmdns.*;

    static class SampleListener implements ServiceListener {
    	public void addService(JmDNS jmdns, String type, String name)
    	{
    	    System.out.println("ADD: " + jmdns.getServiceInfo(type, name));
    	}
    	public void removeService(JmDNS jmdns, String type, String name)
    	{
    	    System.out.println("REMOVE: " + name);
    	}
    	public void resolveService(JmDNS jmdns, String type, String name, ServiceInfo info)
    	{
    	    System.out.println("RESOLVED: " + info);
    	}
    }

    JmDNS jmdns = new JmDNS();
    jmdns.addServiceListener("_http._tcp.local.", new SampleListener());
```


text:
#include <cstddef>
#include <cstdint>
#include <string>
#include <utility>

#include "mlir/IR/Attributes.h"  // from @llvm-project
#include "mlir/IR/Visitors.h"  // from @llvm-project
#include "mlir/Pass/Pass.h"  // from @llvm-project
#include "mlir/Pass/PassManager.h"  // from @llvm-project
#include "mlir/Support/LLVM.h"  // from @llvm-project
#include "mlir/Transforms/Passes.h"  // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
#include "tensorflow/compiler/mlir/tensorflow/utils/visitor_util.h"

namespace tensorflow {
namespace {

std::string get_stage_description(const WalkStage &stage) {
  if (stage.IsBeforeAllRegions()) return "before all regions";
  if (stage.IsAfterAllRegions()) return "after all regions";
  return "before region #" + std::to_string(stage.GetNextRegion());
}

// A pass that annotates each operation with an remarks that include a unique
// step ID and a description of the visitor step.
class TestVisitorUtil
    : public mlir::PassWrapper<TestVisitorUtil, mlir::FunctionPass> {
 public:
  void runOnFunction() override {
    mlir::FuncOp func = getOperation();
    int step_id = 0;
    GenericWalk(func, [&](mlir::Operation *op, const WalkStage &stage) {
      op->emitRemark() << step_id++ << ": " << get_stage_description(stage);
    });

    // Exercise static inference of operation type
    GenericWalk(func, [&](mlir::TF::IfRegionOp op, const WalkStage &stage) {
      op.emitRemark() << step_id++ << ": " << get_stage_description(stage);
    });
  }
};

class TestVisitorUtilInterrupt
    : public mlir::PassWrapper<TestVisitorUtilInterrupt, mlir::FunctionPass> {
 public:
  void runOnFunction() override {
    mlir::FuncOp func = getOperation();
    int step_id = 0;

    auto walker = [&](mlir::Operation *op, const WalkStage &stage) {
      if (auto interrupt_before_all =
              op->getAttrOfType<mlir::BoolAttr>("interrupt_before_all"))
        if (interrupt_before_all.getValue() && stage.IsBeforeAllRegions())
          return mlir::WalkResult::interrupt();

      if (auto interrupt_after_all =
              op->getAttrOfType<mlir::BoolAttr>("interrupt_after_all"))
        if (interrupt_after_all.getValue() && stage.IsAfterAllRegions())
          return mlir::WalkResult::interrupt();

      if (auto interrupt_after_region =
              op->getAttrOfType<mlir::IntegerAttr>("interrupt_after_region"))
        if (stage.IsAfterRegion(
                static_cast<int>(interrupt_after_region.getInt())))
          return mlir::WalkResult::interrupt();

      op->emitRemark() << step_id++ << ": " << get_stage_description(stage);
      return mlir::WalkResult::advance();
    };

    // Interrupt the walk based on attributes on the operation.
    auto result = GenericWalk(func, walker);

    if (result.wasInterrupted())
      func.emitRemark() << step_id++ << ": walk was interrupted";

    // Exercise static inference of operation type for interrupting callback.
    result =
        GenericWalk(func, [&](mlir::TF::IfRegionOp op, const WalkStage &stage) {
          return walker(op, stage);
        });

    if (result.wasInterrupted())
      func.emitRemark() << step_id++ << ": walk was interrupted";
  }
};

mlir::PassRegistration<TestVisitorUtil> pass(
    "tf-test-visitor-util",
    "Add remarks that trace order of visiting operations using TF visitor "
    "utilities.");

mlir::PassRegistration<TestVisitorUtilInterrupt> pass_interrupt(
    "tf-test-visitor-util-interrupt",
    "Add remarks that trace order of visiting operations using TF visitor "
    "utilities, interrupt version.");

}  // anonymous namespace
}  // namespace tensorflow


text:
  - fixed bug that broke json & xml message output
    (see https://github.com/validator/validator.github.io/issues/5
    and thanks to https://github.com/cavweb20)

# 25 August 2014
  - added support for the `<picture>` element
  - improved ARIA support for various table elements
  - made refinements to outline handling
  - added experimental warnings for some heading/outline issues
  - improved checking for `meta@name` and `link@rel` values
  - CLI now exits with `1` if any errors are found
  - CLI no longer says `XHTML element` in error messages
  - switched to galimatias for URL checking
  - updated to latest ICU4J
  - release now includes WAR file

# 02 February 2014
  - initial `vnu.jar` release


text:
DROP TABLE IF EXISTS Record;
CREATE TABLE Record (
    id BIGINT(20) NOT NULL AUTO_INCREMENT,
    type VARCHAR(20) NOT NULL,
    data LONGTEXT NOT NULL,
    createDate BIGINT(20) NOT NULL,
    createUserId BIGINT(20) NOT NULL,
    updateDate BIGINT(20) NOT NULL,
    updateUserId BIGINT(20) NOT NULL,
    deleteDate BIGINT(20) NULL,
    deleteUserId BIGINT(20) NOT NULL,
    PRIMARY KEY (id),
    KEY k_type_updateDate (type, updateDate),
    KEY k_updateDate (updateDate),
    KEY k_updateUserId_updateDate (updateUserId, updateDate)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS RecordHistory;
CREATE TABLE RecordHistory (
    id BIGINT(20) NOT NULL AUTO_INCREMENT,
    recordId BIGINT(20) NOT NULL,
    type VARCHAR(20) NOT NULL,
    data LONGTEXT NOT NULL,
    updateDate BIGINT(20) NOT NULL,
    updateUserId BIGINT(20) NOT NULL,
    PRIMARY KEY (id),
    KEY k_recordId_updateDate (recordId, updateDate)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS RecordInput;
CREATE TABLE RecordInput (
    recordId BIGINT(20) NOT NULL,
    data LONGTEXT NOT NULL,
    updateDate BIGINT(20) NOT NULL,
    PRIMARY KEY (recordId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS RecordLink;
CREATE TABLE RecordLink (
    parentId BIGINT(20) NOT NULL,
    childId BIGINT(20) NOT NULL,
    KEY k_parentId (parentId),
    KEY k_childId (childId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS RecordName;
CREATE TABLE RecordName (
    recordId BIGINT(20) NOT NULL,
    namespace VARCHAR(20) NOT NULL,
    name VARCHAR(200) NOT NULL,
    KEY k_recordId (recordId),
    KEY k_namespace_name (namespace, name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS RecordOutput;
CREATE TABLE RecordOutput (
    recordId BIGINT(20) NOT NULL,
    format VARCHAR(20) NOT NULL,
    data LONGTEXT NOT NULL,
    updateDate BIGINT(20) NOT NULL,
    PRIMARY KEY (recordId, format)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


text:
package BESA.Mobile.CommunicationChannel;

import BESA.Kernel.System.AdmBESA;
import BESA.Mobile.CommunicationChannel.BaseClasses.ServerBPO;
import BESA.Mobile.IAdmBPO;

/**
 *
 * @author Andrea
 */
public class ServerConnectionListenerBPO extends Thread {

    private boolean alive;
    private ServerBPO server;

    public ServerConnectionListenerBPO(ServerBPO server) {
        this.alive = true;
        this.server = server;
    }

    @Override
    public synchronized void run() {
        while (alive) {
            try {
                ICommunicationChannelBPO communicationChannel = server.accept();
                if (alive) {
                    ((IAdmBPO)AdmBESA.getInstance()).getPostOffice().acceptConnection(communicationChannel);
                }
            } catch (Exception e) {
            }
        }
    }

    public void kill() {
        alive = false;
        server.close();
    }

    public int getPort() {
        return server.getPort();
    }
}


text:
<!DOCTYPE html>

<title>Firing Range - DOM Tests</title>

Cookies

Cookie - Value is set - eval

Cookie - eval

Cookie - innerHTML

Cookie - documentWrite

Referrer

Referrer - eval

Referrer - innerHTML

Referrer - documentWrite

Window name

window.name - eval

window.name - innerHTML

window.name - documentWrite

LocalStorage

LocalStorage - Array - eval

LocalStorage - Function - innerHTML

LocalStorage - Property - documentWrite

SessionStorage

SessionStorage - Array - eval

SessionStorage - Function - innerHTML

SessionStorage - Property - documentWrite

PostMessage

Sinks located inside a PostMessage handler missing a proper origin check.

PostMessage - eval

PostMessage - innerHTML

PostMessage - documentWrite

Event triggering

 This class of XSS is only triggered after an event is fired

Event triggering - eval

Event triggering - innerHTML

Event triggering - documentWrite


text:
/*global describe, it */
var assert = require('assert'),
  should = require('should'),
  util = require('util');

var make_tester = require('./tester'),
  Connection = require('../lib/connection');

var cases = require('./transmit.json');

var bufferToString = function (buf) {
  var i, s = ['['];
  for (i = 0; i < buf.length - 1; i++) {
    s.push(buf[i]);
    s.push(',');
  }
  s.push(buf[i]);
  s.push(']');
  return s.join('');
};

var errString = function (fixture, packet, index) {
  var error = util.format(
    'Generated packet and fixtures differ at %d:\n\t\t\tFixture: %j\n\t\t\tPacket:  %j',
    index,
    bufferToString(fixture),
    bufferToString(packet)
  );
  return error;
};

/*
 * Test for success
 */
function testSuccess(test, index, done) {
  var desc = test.description,
    input = test.input,
    fixture = new Buffer(test.fixture),
    type = this.type,
    timeout;
  this.tester.once('data', (function (fixture, timeout) {
    return function (data, error) {
      var j;
      clearTimeout(timeout);
      for (j = 0; j < fixture.length && j < data.length; j++) {
        assert.equal(data[j], fixture[j], errString(fixture, data, j));
      }
      done();
    };
  }(fixture, timeout)));

  assert.notEqual(this.uut[type](input), false);
}

/*
 * Test for failure
 */
function testFailure(test, index, done) {
  var desc = test.description,
    input = test.input;
  assert.equal(this.uut[this.type](input),
    false,
    util.format("Connection#%s did not return false", this.type));
  done();
}

/*
 * Create a success testcase
 */
function make_transmit_success_test(type, test, index) {
  return it("should be successfull for '" + test.description + "'", function (done) {
    this.tester = make_tester();
    this.type = type;
    this.uut = new Connection(this.tester);
    testSuccess.call(this, test, index, done);
  });
}

/*
 * Create a failure testcase
 */
function make_transmit_fail_test(type, test, index) {
  it("should fail for '" + test.description + "'", function (done) {
    this.tester = make_tester();
    this.type = type;
    this.uut = new Connection(this.tester);
    testFailure.call(this, test, index, done);
  });
}

/*
 * Create the test suite
 */
function make_transmit_suite(type, successes, failures) {
  return function () {
    var i;
    for (i = 0; i < successes.length; i++) {
      make_transmit_success_test.call(this, type, successes[i], i);
    }//end for i in successes

    for (i = 0; i < failures.length; i++) {
      make_transmit_fail_test.call(this, type, failures[i], i);
    }//end for i in failures
  };
}

/*
 * Tests start here
 */
describe("Connection Transmit", function () {
  var type, successes, failures;
  for (type in cases) {
    if (cases.hasOwnProperty(type)) {
      successes = cases[type].success;
      failures = cases[type].failure;
      describe("with type '" + type + "'", make_transmit_suite(type, successes, failures));
    }
  }
});


text:
package models;

import com.google.common.base.Charsets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;

import java.io.File;
import java.io.FileNotFoundException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public class ConfigReader {
    final private static Logger log = LoggerFactory.getLogger(ConfigReader.class);

    final private static ConfigReader reader = new ConfigReader();
    Map<String, Object> yaml = null;

    private ConfigReader() {
        try {
            final File SettingsFile = getSettingsFile();
            yaml = (Map<String, Object>) new Yaml().load(com.google.common.io.Files.newReader(SettingsFile, Charsets.UTF_8));
        } catch (final FileNotFoundException | URISyntaxException e) {
            log.warn("config file is not exist.", e);
            throw new RuntimeException();
        }
    }

    private static File getSettingsFile() throws FileNotFoundException,URISyntaxException {
        final String userFilePath = "conf/capybara.yaml";
        if (Files.exists(Paths.get(userFilePath))) {
            return new File(userFilePath);
        }

        final URI defaultPath = Capybara.class.getClassLoader().getResource("capybara.yaml").toURI();
        if (Files.exists(Paths.get(defaultPath))) {
            return new File(defaultPath);
        }

        throw new FileNotFoundException();
    }

    public static ConfigReader getInstance() {
        return reader;
    }

    public int getPort() {
        return (int) yaml.get("port");
    }

    public String getBasicIcon() {
        return (String) yaml.get("icon.basic");
    }

    public String getHappyIcon() {
        return (String) yaml.get("icon.happy");
    }

    public String getAngryIcon() {
        return (String) yaml.get("icon.angry");
    }

    public String getSadIcon() {
        return (String) yaml.get("icon.sad");
    }

    public List<String> getOtherIcon() {
        return (List) yaml.get("icon.other");
    }

    public String getOneOthericon() {
        final List<String> otherIcon = getOtherIcon();
        Collections.shuffle(otherIcon);
        return otherIcon.get(0);
    }

    public String getDatabaseURI() {
        return (String) yaml.get("database.uri");
    }

    public String getDatabaseId() {
        return (String) yaml.get("database.id");
    }

    public String getDatabasePassword() {
        return (String) yaml.get("database.password");
    }

    public String getKvsURI() {
        return (String) yaml.get("kvs.uri");
    }

    public String getKvsName() {
        return (String) yaml.get("kvs.name");
    }

    public String getSlackTeam() {
        return (String) yaml.get("slack.team");
    }

    public String getSlackUserName() {
        return (String) yaml.get("slack.username");
    }

    public String getSlackPassword() {
        return (String) yaml.get("slack.password");
    }

    public String getSlackRoom() {
        return (String) yaml.get("slack.room");
    }

    public String getSlackApiToken() {
        return (String) yaml.get("slack.api.token");
    }

    public String getGoogleMapApiKey() {
        return (String) yaml.get("google.map.api.key");
    }

    public String getGoogleMapLanguage() {
        return (String) yaml.get("google.map.language");
    }

    public String getGoogleMapSensor() {
        return (String) yaml.get("google.map.sensor");
    }

    public String getGoogleMapScale() {
        return (String) yaml.get("google.map.scale");
    }

    public String getGoogleMapZoom() {
        return (String) yaml.get("google.map.zoom");
    }

    public String getGoogleMapSizeLength() {
        return (String) yaml.get("google.map.size.length");
    }

    public String getGoogleMapSizeHeight() {
        return (String) yaml.get("google.map.size.height");
    }
}


text:
var Sequelize = require('sequelize'),
    sequelize = require('../db/sequelize');

var Good = sequelize.define('good', {
    id: {
        type: Sequelize.INTEGER(11),
        autoIncrement: true,
        primaryKey: true
    },
    name: {
        type: Sequelize.STRING(100)
    },
    count: {
        type: Sequelize.INTEGER(11)
    }
}, {
    freezeTableName: true,
    underscored: true,
    timestamps: false
});

module.exports = Good;


text:
const Sequelize = require('sequelize');
require('dotenv').config();
const sequelize = new Sequelize(process.env.DB_NAME, process.env.DB_USER, process.env.DB_PASS,{
	host: process.env.DB_HOST,
	dialect: process.env.DB_DIALECT,
	define: {
		charset: 'utf8',
		collate: 'utf8_general_ci',
		timestamps: true
	}
});

module.exports = sequelize;


text:
          <img src="<?php echo base_url('/assets/images/usjrlogo.png'); ?>" alt="logo">

USJR Online Enrollment System

        <img src="<?php echo base_url('/assets/images/profile.png'); ?>" alt="profilepicture" class="profile-picture">

              Edit Profile

              Logout


text:
"""MD5 cryptographic hash algorithm.

MD5 is specified in RFC1321_ and produces the 128 bit digest of a message.

    >>> from Cryptodome.Hash import MD5
    >>>
    >>> h = MD5.new()
    >>> h.update(b'Hello')
    >>> print h.hexdigest()

MD5 stand for Message Digest version 5, and it was invented by Rivest in 1991.

This algorithm is insecure. Do not use it for new designs.

.. _RFC1321: http://tools.ietf.org/html/rfc1321
"""

__all__ = ['new', 'block_size', 'digest_size']

from Cryptodome.Util.py3compat import *

def __make_constructor():
    try:
        # The md5 module is deprecated in Python 2.6, so use hashlib when possible.
        from hashlib import md5 as _hash_new
    except ImportError:
        from md5 import new as _hash_new

    h = _hash_new()
    if hasattr(h, 'new') and hasattr(h, 'name') and hasattr(h, 'digest_size') and hasattr(h, 'block_size'):
        # The module from stdlib has the API that we need.  Just use it.
        return _hash_new
    else:
        # Wrap the hash object in something that gives us the expected API.
        _copy_sentinel = object()
        class _MD5(object):
            digest_size = 16
            block_size = 64
            oid = "1.2.840.113549.2.5"
            def __init__(self, *args):
                if args and args[0] is _copy_sentinel:
                    self._h = args[1]
                else:
                    self._h = _hash_new(*args)
            def copy(self):
                return _MD5(_copy_sentinel, self._h.copy())
            def update(self, *args):
                f = self.update = self._h.update
                f(*args)
            def digest(self):
                f = self.digest = self._h.digest
                return f()
            def hexdigest(self):
                f = self.hexdigest = self._h.hexdigest
                return f()
        _MD5.new = _MD5
        return _MD5

new = __make_constructor()
del __make_constructor

#: The size of the resulting hash in bytes.
digest_size = new().digest_size

#: The internal block size of the hash algorithm in bytes.
block_size = new().block_size


text:
package ImageRepresentationModels.BoC.LBOC;

import Utils.DistanceFunctions;
import Utils.Utilities;
import Utils.Image.ColorConversion;
import Utils.Image.ColorConversion.ColorSpace;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import static java.awt.image.BufferedImage.TYPE_INT_RGB;
import java.awt.image.WritableRaster;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.semanticmetadata.lire.utils.ImageUtils;

/**
 *
 * @author Spyridon Stathopoulos
 */
public class Processor {

    public static double[][] getImagePixels(BufferedImage img){
        int n=img.getHeight(),m=img.getWidth();
        double[][] ret= new double[3][img.getWidth()*img.getHeight()];
        double[] data = img.getData().getPixels(img.getMinX(),img.getMinY(), img.getWidth(), img.getHeight(),(double[])null);

        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                ret[0][i*n+j] =data[(i*m*3)+(j*3+0)];
                if(img.getRaster().getNumBands()==3){
                    ret[1][i*n+j] =data[(i*m*3)+(j*3+1)];
                    ret[2][i*n+j] =data[(i*m*3)+(j*3+2)];
                }
            }
        }
        return ret;
    }

    public static BufferedImage getEmptyImage(){
        BufferedImage img = new BufferedImage(256,256,BufferedImage.TYPE_INT_RGB);
        Graphics2D g2d = (Graphics2D)img.getGraphics();
        Font font = new Font("Arial", Font.PLAIN, 25);
        g2d.setFont(font);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.drawString("Empty", 128, 128);
        g2d.dispose();
        return img;
    }

    public static BufferedImage getTextImage(String text){
        BufferedImage img = new BufferedImage(256,256,BufferedImage.TYPE_INT_RGB);
        Graphics2D g2d = (Graphics2D)img.getGraphics();
        Font font = new Font("Arial", Font.PLAIN, 25);
        g2d.setFont(font);
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.drawString(text, 128, 128);
        g2d.dispose();
        return img;
    }

     public static BufferedImage convertToGrayScale(BufferedImage img) {
        BufferedImage image = new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_BYTE_GRAY);
        Graphics g = image.getGraphics();
        g.drawImage(img, 0, 0, null);
        g.dispose();
        return image;
    }

    public static BufferedImage resizeImage(BufferedImage img, int newWidth, int newHeight,
                                            boolean keepAspectRatio) {
        int w = img.getWidth();
        int h = img.getHeight();

        if(keepAspectRatio){
            newHeight = h * newWidth / w;
        }
        int type=img.getType();
        if(type==0) type = TYPE_INT_RGB;
        BufferedImage dimg = new BufferedImage(newWidth, newHeight,type);
        Graphics2D g = dimg.createGraphics();
        g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
        g.drawImage(img, 0, 0, newWidth, newHeight, 0, 0, w, h, null);
        g.dispose();
        return dimg;
    }

    public static BufferedImage scaleImage(BufferedImage img, int newWidth, int newHeight){
        return ImageUtils.scaleImage(img, newWidth, newHeight);//fast scale using java 1.4
    }

    public static BufferedImage[] splitImage(BufferedImage img, int cols, int rows) {
        int w = img.getWidth() / cols;
        int h = img.getHeight() / rows;
        int num = 0;
        BufferedImage imgs[] = new BufferedImage[cols * rows];
        for (int y = 0; y < rows; y++) {
            for (int x = 0; x < cols; x++) {
                imgs[num] = new BufferedImage(w, h, img.getType());
                // Tell the graphics to draw only one block of the image
                Graphics2D g = imgs[num].createGraphics();
                g.drawImage(img, 0, 0, w, h, w * x, h * y, w * x + w, h * y + h, null);
                g.dispose();
                num++;
            }
        }
        return imgs;
    }

    public static BufferedImage[] splitImage(BufferedImage img, int[] cols, int[] rows){
        List<BufferedImage> imgs=new ArrayList<BufferedImage>();
        for(int i=0;i<cols.length;i++){
            BufferedImage blocks[]=splitImage(img,cols[i],rows[i]);
            for(BufferedImage b:blocks){
                imgs.add(b);
            }
        }
        return imgs.toArray(new BufferedImage[0]);
    }

    public static BufferedImage conCatImages(BufferedImage[] imgs, int cols, int rows) {
        if (imgs.length > 0) {
            int w = imgs[0].getWidth();
            int h = imgs[0].getHeight();
            int num = 0;
            BufferedImage dimg = new BufferedImage(w * cols, h * rows, imgs[0].getType());
            Graphics2D g = dimg.createGraphics();
            for (int y = 0; y < rows; y++) {
                for (int x = 0; x < cols; x++) {
                    g.drawImage(imgs[num], w * x, h * y, w * x + w, h * y + h, 0, 0, w, h, null);
                    g.drawRect(w * x, h * y, w, h);
                    num++;
                }
            }
            g.dispose();
            return dimg;
        } else {
            return null;
        }
    }

    public static BufferedImage[] centerSplit(BufferedImage img, int centerPercent){
        //center of image
        int centX=img.getWidth()/2;
        int centY=img.getHeight()/2;

        //center part dimensions
        float centPct= (float)centerPercent/ 100;
        int centW= (int) (img.getWidth() * centPct);
        int centH= (int) (img.getHeight() * centPct);
        //border offsets
        float brdPct=(1-centPct)/2;
        int offX = (int) (img.getWidth() *brdPct);
        int offY = (int) (img.getHeight()*brdPct);
        //The border pixels are filled with black full TRANSPARENT pixels.
        Color cl = new Color(0, 0, 0);
        Graphics2D g;
        BufferedImage imgs[] = new BufferedImage[5];

        //split image int 2 x 2
        BufferedImage bimgs[] = splitImage(img,2,2);
        //upper left
        imgs[0] = bimgs[0];
        g = imgs[0].createGraphics();
        g.setColor(cl);
        g.fillRect(offX, offY, centW/2, centH/2);
        g.dispose();
        //upper right
        imgs[1] = bimgs[1];
        g = imgs[1].createGraphics();
        g.setColor(cl);
        g.fillRect(0, offY, centW/2, centH/2);
        g.dispose();
        //lower left
        imgs[2] = bimgs[2];
        g = imgs[2].createGraphics();
        g.setColor(cl);
        g.fillRect(offX,0, centW/2, centH/2);
        g.dispose();
        //lower right
        imgs[3] = bimgs[3];
        g = imgs[3].createGraphics();
        g.setColor(cl);
        g.fillRect(0, 0, centW/2, centH/2);
        g.dispose();
        //center
        imgs[4] = new BufferedImage(centW,centH,img.getType());
        g = imgs[4].createGraphics();
        g.setColor(cl);
        g.drawImage(img,0,0,centW,centH,offX,offY,img.getWidth()-offX,img.getHeight()-offY,null);
        g.dispose();

        return imgs;
    }

    public static BufferedImage conCatCenterSplit(BufferedImage imgs[],int centerPercent,
                                                  Color borderColor){

        if(imgs.length!=5) {throw new InvalidParameterException("imgs.length != 5\nNot a center split");}
        int imgW = (imgs[4].getWidth()*100)/centerPercent;
        int imgH = (imgs[4].getHeight()*100)/centerPercent;
        //center of image
        int centX=imgW/2;
        int centY=imgH/2;
        //center part dimensions
        float centPct= (float)centerPercent/ 100;
        int centW= (int) (imgW * centPct);
        int centH= (int) (imgH * centPct);
        //border offsets
        float brdPct=(1-centPct)/2;
        int offX = (int) (imgW*brdPct);
        int offY = (int) (imgH*brdPct);

        BufferedImage img=new BufferedImage(imgW,imgH,imgs[4].getType());
        Graphics2D g=img.createGraphics();
        g.setColor(borderColor);
        g.setStroke(new BasicStroke(2));
        //draw borders
        //upper left
        g.drawImage(imgs[0],0,0,centX,centY,0,0,imgs[0].getWidth(),imgs[0].getHeight(),null);
        g.drawRect(0, 0, imgs[0].getWidth(),imgs[0].getHeight());

        //upper right
        g.drawImage(imgs[1],centX,0,imgW,centY,0,0,imgs[1].getWidth(),imgs[1].getHeight(),null);
        g.drawRect(centX, 0, imgs[1].getWidth(),imgs[1].getHeight());

        //lower left
        g.drawImage(imgs[2],0,centY,centX,imgH,0,0,imgs[2].getWidth(),imgs[2].getHeight(),null);
        g.drawRect(0, centY, imgs[2].getWidth(),imgs[2].getHeight());

        //lower right
        g.drawImage(imgs[3],centX,centY,imgW,imgH,0,0,imgs[0].getWidth(),imgs[3].getHeight(),null);
        g.drawRect(centX,centY, imgs[3].getWidth(),imgs[3].getHeight());

//        //center
        g.drawImage(imgs[4],offX,offY,imgW-offX,imgH-offY,0,0,imgs[4].getWidth(),imgs[4].getHeight(),null);
        g.drawRect(offX,offY, imgs[4].getWidth(),imgs[4].getHeight());
        return img;
    }

    public static BufferedImage quantizeImage(BufferedImage img, int colors){
        int scale = 256/colors;
        BufferedImage img2 = new BufferedImage(img.getWidth(),img.getHeight(),img.getType());
        WritableRaster rst =img2.getRaster();
         for (int i = 0; i < img.getWidth(); i++) {
            for (int j = 0; j < img.getHeight(); j++) {
                Color cl = new Color(img.getRGB(i, j));
                int r=cl.getRed();
                r = (r/scale)*256 / colors;
                int g=cl.getGreen();
                g = (g/scale)*256 / colors;
                int b=cl.getBlue();
                b = (b/scale)*256 / colors;
                rst.setPixel(i, j, new int[]{r,g,b});
            }
         }
        return img2;
    }

    public static int[] getDominantColor(BufferedImage img, ColorSpace cs){
       int ret[] = new int[3];
       Map<String,Integer> domC = new HashMap<String,Integer>();
       for (int i = 0; i < img.getWidth(); i++) {
            for (int j = 0; j < img.getHeight(); j++) {
                Color cl = new Color(img.getRGB(i, j));
                int r=cl.getRed();
                int g=cl.getGreen();
                int b=cl.getBlue();
                int color[] = ColorConversion.convertFromRGB(cs, r,g,b);
                String key="";
                for(int c=0;c<color.length;c++){key+=color[c]+";";}
                if(domC.containsKey(key)){
                    domC.put(key, domC.get(key) + 1);
                }else{
                    domC.put(key, 1);
                }
            }
       }

       String keyMax="";
       int max=-1;
       for(Map.Entry<String,Integer> entry:domC.entrySet()){
           if(max<entry.getValue()){
               max = entry.getValue();
               keyMax = entry.getKey();
           }
       }

       String[] scolors = keyMax.split(";");
       ret[0] = Integer.valueOf(scolors[0]);
       ret[1] = Integer.valueOf(scolors[1]);
       ret[2] = Integer.valueOf(scolors[2]);
       return ret;
    }

    public static int[][] getDominantColors(BufferedImage img,int cols, int rows,
                                            ColorSpace cs){
        int[][] ret = new int[cols*rows][3];
        BufferedImage imgs[] = splitImage(img,cols,rows);
        for(int i=0;i<imgs.length;i++){
            int[] cl = getDominantColor(imgs[i],cs);
            for(int j=0;j<3;j++){ret[i][j] = cl[j];}
        }
        return ret;
    }

    public static BufferedImage getDominantColorsImage(BufferedImage img,int cols, int rows,
                                            ColorSpace cs){
        int[][] colors = getDominantColors(img,cols,rows,cs);
        BufferedImage imgs[] = splitImage(img,cols,rows);
        int w = imgs[0].getWidth();
        int h = imgs[0].getHeight();
        BufferedImage dimg = new BufferedImage(w * cols, h * rows, imgs[0].getType());
        Graphics2D g = dimg.createGraphics();
        int num = 0;
        for (int y = 0; y < rows; y++) {
            for (int x = 0; x < cols; x++) {
                int[] cl = ColorConversion.convertToRGB(cs,colors[num][0],colors[num][1],colors[num][2]);
                g.setColor(new Color(cl[0],cl[1],cl[2]));
                g.fillRect(w * x, h * y, w, h);
//                g.setColor(Color.white);
//                g.drawRect(w * x, h * y, w, h);
                num++;
            }
        }

        return dimg;
    }

    public static BufferedImage getImageFromPalette(BufferedImage img, int[][] palette, ColorConversion.ColorSpace cs){
        BufferedImage ret = new BufferedImage(img.getWidth(),img.getHeight(),img.getType());
        Graphics2D g = ret.createGraphics();
        for(int x=0;x<img.getWidth();x++){
            for(int y=0;y<img.getHeight();y++){
                Color color = new Color(img.getRGB(x, y));
                int[] cl = new int[]{color.getRed(),color.getGreen(),color.getBlue()};
                cl = ColorConversion.convertFromRGB(cs, cl[0], cl[1], cl[2]);
                cl = getPaletteClosestColor(palette,cl);
                cl = ColorConversion.convertToRGB(cs, cl[0], cl[1], cl[2]);
                color = new Color(cl[0],cl[1],cl[2]);
                g.setColor(color);
                ret.setRGB(x, y, color.getRGB());
            }
        }
        return ret;
    }

    public static int[] getPaletteClosestColor(int[][] palette, int[] cl){
        return palette[getClosestColorIndx(palette,cl)];
    }

    public static int getClosestColorIndx(int[][] palette, int[] cl){
        double minDist=DistanceFunctions.getL2Distance(palette[0], cl);
        int minIndx = 0;

        for(int i=1;i<palette.length;i++){
            double d = DistanceFunctions.getL2Distance(palette[i], cl);
            if(minDist>d){
                minDist = d;
                minIndx = i;
            }
        }
        return minIndx;
    }

    public static BufferedImage getPaletteImg(int[][] palette, int colsPerRow, int sizeHW,
                                                   ColorConversion.ColorSpace cs){
         //int rows = sizeHW / colsPerRow;
         int w =(int) Math.round(Math.sqrt(sizeHW));
         int h = w;

         BufferedImage dimg = new BufferedImage(sizeHW,sizeHW,BufferedImage.TYPE_INT_RGB);
         Graphics2D g = dimg.createGraphics();
         int col = 0;
         int row = 0;

         //int[][] palete = getPalleteFromClusters(clusterFile, true, cs);
         for(int[] cl:palette){
             cl = ColorConversion.convertToRGB(cs, cl[0], cl[1], cl[2]);
             g.setColor(new Color(cl[0],cl[1],cl[2]));
             g.fillRect(w * row, h * col, w, h);
             g.setColor(Color.white);
             g.drawRect(w * row, h * col, w, h);

             col++;
             if(col>=colsPerRow){
                 row++;
                 col=0;
             }
         }
         return dimg;
    }
}


text:
drop table if exists items;

create table items (
    id serial primary key,
    name character varying(200),
    description text,
    created timestamp
);


text:
require 'rubygems'
gem 'google-adwords-api'
require 'adwords_api'

API_VERSION = :v201101

def add_campaign_ad_extension()
  # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
  # when called without parameters.
  adwords = AdwordsApi::Api.new

  # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
  # the configuration file or provide your own logger:
  # adwords.logger = Logger.new('adwords_xml.log')

  campaign_ad_ext_srv =
      adwords.service(:CampaignAdExtensionService, API_VERSION)
  geo_location_srv = adwords.service(:GeoLocationService, API_VERSION)

  campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i

  selector = {
    :addresses => [
      {
        :street_address => '1600 Amphitheatre Parkway',
        :city_name => 'Mountain View',
        :province_code => 'CA',
        :postal_code => '94043',
        :country_code => 'US'
      },
      {
        :street_address => "38 Avenue de l'Opéra",
        :city_name => 'Paris',
        :postal_code => '75002',
        :country_code => 'FR'
      }
    ]
  }

  # Get the geo location info for the various addresses and build the operations
  # with that information.
  locations = geo_location_srv.get(selector)
  if locations
    operations = []
    locations.each do |location|
      operation = {
        :operator => 'ADD',
        :operand => {
          :campaign_id => campaign_id,
          :status => 'ACTIVE',
          :ad_extension => {
            # The 'xsi_type' field allows you to specify the xsi:type of the
            # object being created. It's only necessary when you must provide an
            # explicit type that the client library can't infer.
            :xsi_type => 'LocationExtension',
            :address => location[:address],
            :geo_point => location[:geo_point],
            :encoded_location => location[:encoded_location],
            :source => 'ADWORDS_FRONTEND'
          }
        }
      }
      operations << operation
    end
  else
    puts "Unable to retrieve geo locations."
    exit
  end

  # Add campaign ad extensions.
  response = campaign_ad_ext_srv.mutate(operations)
  extensions = response[:value]
  extensions.each do |extension|
    puts "Campaign extension id #{extension[:ad_extension][:id]} and status " +
        "#{extension[:status]} successfully added."
  end
end

if __FILE__ == $0
  begin
    add_campaign_ad_extension()

  # Connection error. Likely transitory.
  rescue Errno::ECONNRESET, SOAP::HTTPStreamError, SocketError => e
    puts 'Connection Error: %s' % e
    puts 'Source: %s' % e.backtrace.first

  # API Error.
  rescue AdwordsApi::Errors::ApiException => e
    puts 'API Exception caught.'
    puts 'Message: %s' % e.message
    puts 'Code: %d' % e.code if e.code
    puts 'Trigger: %s' % e.trigger if e.trigger
    puts 'Errors:'
    if e.errors
      e.errors.each_with_index do |error, index|
        puts ' %d. Error type is %s. Fields:' % [index + 1, error[:xsi_type]]
        error.each_pair do |field, value|
          if field != :xsi_type
            puts '     %s: %s' % [field, value]
          end
        end
      end
    end
  end
end


text:
package cheme.properties;

import java.util.Set;

/**
 * This interface defines some common methods for properties to be supported
 * by the UI.
 */
public interface Property {

    /**
     * Return the supported unit strings that can be used to construct an
     * instance of this Property.
     *
     * @return the available unit strings that can be used to construct this
     * Property
     */
    public Set<String> SupportedUnits();

    /**
     * Get this instance's value using a particular unit.
     *
     * @param unit "Pa", "K", etc. as returned by SupportedUnits()
     * @return value the numeric value
     */
    public double get(final String unit);

}