text:
package org.arakhne.afc.inputoutput.filetype;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

/** This class defines a set of informations that could distinguish
 * a file content from another one. It is also known as Magic Number
 * on several operating systems.
 *
 * @author $Author: sgalland$
 * @version $FullVersion$
 * @mavengroupid $GroupId$
 * @mavenartifactid $ArtifactId$
 * @since 14.0
 */
public final class MagicNumberStream extends InputStream {

	private final URL url;

	private final BufferedMagicNumberStream mainStream;

	private BufferedMagicNumberStream overridingStream;

	/** Constructor.
	 * @param url is the url of the input stream to read.
	 * @param is is the input stream.
	 */
	MagicNumberStream(URL url, InputStream is) {
		this.mainStream = new BufferedMagicNumberStream(is);
		this.url = url;
	}

	/** Replies the URL of the stream to test.
	 *
	 * @return the url of the stream to test.
	 */
	public URL getURL() {
		return this.url;
	}

	/** Set the input stream which may be used in place
	 * of the original input stream.
	 *
	 * @param newis is the stream to read.
	 */
	public void setOverridingStream(InputStream newis) {
		this.overridingStream = new BufferedMagicNumberStream(newis);
	}

	/**
	 * Cancel any previous call to {@link #setOverridingStream(InputStream)}.
	 */
	public void resetOverridingStream() {
		this.overridingStream = null;
	}

	private BufferedMagicNumberStream getStream() {
		return (this.overridingStream != null) ? this.overridingStream : this.mainStream;
	}

	/** Replies the stream read by the magic number API.
	 * The replied input stream is the stream linked to
	 * the file to test, or the stream passed as parameter
	 * of {@link #setOverridingStream(InputStream)} if invoked.
	 *
	 * @return the stream read by the magic number API.
	 */
	public InputStream getInputStream() {
		return getStream().getStream();
	}

	/** Replies the bytes at the specified offset.
	 *
	 * @param offset is the position of the first byte to read.
	 * @param length is the cout of bytes to read.
	 * @return the array of red bytes.
	 * @throws IOException in case of problems
	 */
	public byte[] read(int offset, int length) throws IOException {
		return getStream().read(offset, length);
	}

	/** Replies a byte at the specified offset.
	 *
	 * @param offset is the position of the byte to read.
	 * @return the byte.
	 * @throws IOException in case of problems
	 */
	public byte read(int offset) throws IOException {
		return getStream().read(offset);
	}

	@Override
	public int read() throws IOException {
		return getStream().read();
	}

	/** Replies the bytes until the next end of the first line (inclusive).
	 *
	 * @param offset is the position of the byte to read.
	 * @return the bytes.
	 * @throws IOException in case of problems
	 */
	public byte[] readLine(int offset) throws IOException {
		return getStream().readLine(offset);
	}

	/** {@inheritDoc}
	 */
	@Override
	public void close() throws IOException {
		getStream().close();
	}

}

redpajama_set_name: RedPajamaGithub


text:
const propertyHelpers = require('../property-helpers')

describe('PropertyHelpers: Conversion of empty values to nulls in an object with nullEmptyFields', () => {
  it('Should convert an empty string to a null', () => {
    const source = {
      foo: 'foo',
      bar: '',
    }
    const actual = propertyHelpers.nullEmptyFields(source)
    expect(actual.foo).equal('foo')
    expect(actual.bar).be.null
  })
  it('Should leave existing nulls alone', () => {
    const source = {
      foo: 'foo',
      bar: null,
    }
    const actual = propertyHelpers.nullEmptyFields(source)
    expect(actual.foo).equal('foo')
    expect(actual.bar).be.null
  })
})

describe('PropertyHelpers: Stripping fields with null values out of an object with deleteNulls', () => {
  it('Removes fields that have null values from an object', () => {
    const source = {
      foo: 'foo',
      bar: null,
    }
    const actual = propertyHelpers.deleteNulls(source)
    expect(actual.foo).equal('foo')
    expect(actual).to.not.have.property('bar')
  })
  it('Return an empty object if all fields are null', () => {
    const source = {
      foo: null,
      bar: null,
    }
    const actual = propertyHelpers.deleteNulls(source)
    expect(actual).to.deep.equal({})
  })
  it('Should ignore empty strings', () => {
    const source = {
      foo: 'foo',
      bar: '',
    }
    const actual = propertyHelpers.deleteNulls(source)
    expect(actual.foo).to.equal('foo')
    expect(actual.bar).to.equal('')
  })
  it('Should ignore false fields', () => {
    const source = {
      foo: 'foo',
      bar: false,
    }
    const actual = propertyHelpers.deleteNulls(source)
    expect(actual.foo).to.equal('foo')
    expect(actual.bar).to.be.false
  })
})

describe('PropertyHelpers: Finding names in objects with getPropertyName', () => {
  it('Should find a name in the first level of an object', () => {
    const source = {
      foo: 'bar',
      data: {
        id: '123456',
        name: 'morph the cat',
      },
    }
    const actual = propertyHelpers.getPropertyName(source, 'data')
    expect(actual).to.equal('morph the cat')
  })
  it('Should return undefined if the source property exists but does not have a name sub-property', () => {
    const source = {
      foo: 'bar',
      data: {
        id: '123456',
        nomme: 'morph the cat',
      },
    }
    const actual = propertyHelpers.getPropertyName(source, 'data')
    expect(actual).to.eq(null)
  })
  it('Should return null if the source property dows not exist', () => {
    const source = {
      foo: 'bar',
      picard: {
        id: '123456',
        nomme: 'morph the cat',
      },
    }
    const actual = propertyHelpers.getPropertyName(source, 'data')
    expect(actual).to.be.null
  })
})

describe('PropertyHelpers: Finding IDs in objects with getPropertyId', () => {
  it('Should find a name in the first level of an object', () => {
    const source = {
      foo: 'bar',
      data: {
        id: '123456',
        name: 'morph the cat',
      },
    }
    const actual = propertyHelpers.getPropertyId(source, 'data')
    expect(actual).to.equal('123456')
  })
  it('Should return undefined if the source property exists but does not have a name sub-property', () => {
    const source = {
      foo: 'bar',
      data: {
        guid: '123456',
        name: 'morph the cat',
      },
    }
    const actual = propertyHelpers.getPropertyId(source, 'data')
    expect(actual).to.equal(null)
  })
  it('Should return null if the source property dows not exist', () => {
    const source = {
      foo: 'bar',
      picard: {
        id: '123456',
        nomme: 'morph the cat',
      },
    }
    const actual = propertyHelpers.getPropertyId(source, 'data')
    expect(actual).to.be.null
  })
})

describe('PropertyHelpers: Convert Yes and No string to true and false with convertYesNoToBoolean', () => {
  it('Should turn a Yes into a boolean true', () => {
    const source = {
      foo: 'Yes',
    }

    const actual = propertyHelpers.convertYesNoToBoolean(source)
    expect(actual.foo).to.equal(true)
    expect(typeof actual.foo).to.equal('boolean')
  })
  it('Should turn a No into a boolean false', () => {
    const source = {
      foo: 'No',
    }

    const actual = propertyHelpers.convertYesNoToBoolean(source)
    expect(actual.foo).to.equal(false)
    expect(typeof actual.foo).to.equal('boolean')
  })
  it('Should ignore case', () => {
    const source = {
      foo: 'yES',
      bar: 'nO',
    }

    const actual = propertyHelpers.convertYesNoToBoolean(source)
    expect(actual.foo).to.be.true
    expect(typeof actual.foo).to.equal('boolean')
    expect(actual.bar).to.be.false
    expect(typeof actual.bar).to.equal('boolean')
  })
})

describe('PropertyHelpers: Conversion of nested objects', () => {
  it('Should convert an empty string to null', () => {
    const source = {
      foo: 'foo',
      bar: null,
    }
    const actual = propertyHelpers.convertNestedObjects(source, ['bar'])
    expect(actual.bar).be.null
  })
  it('Should convert a string to a nested object', () => {
    const source = {
      foo: 'foo',
      bar: 'some-id',
    }
    const actual = propertyHelpers.convertNestedObjects(source, ['bar'])
    expect(actual.bar).to.deep.equal({
      id: 'some-id',
    })
  })
  it('Should do nothing if props is not passed in', () => {
    const source = {
      foo: 'foo',
      bar: 'some-id',
    }
    const actual = propertyHelpers.convertNestedObjects(source)
    expect(actual).to.deep.equal(source)
  })
  it('Should do nothing if object and props are not passed in', () => {
    const actual = propertyHelpers.convertNestedObjects()
    expect(actual).to.deep.equal({})
  })
})


text:
import Event = require('./Event');

class TimeEvent extends Event
{
	public delta:number;
	public paused:boolean;
	public time:number;
	public runTime:number;

	constructor(type:string, delta:number, paused:boolean, time:number, runtime:number, bubbles:boolean = null, cancelable:boolean = null)
	{
		super(type, bubbles, cancelable);

		this.delta = delta;
		this.paused = paused;
		this.time = time;
		this.runTime = runtime;
	}
}
export = TimeEvent;


text:
namespace BookShop.Core.Commands
{
    using System.Linq;
    using Models.Enums;

    public class GoldenBooksCommand : Command
    {
        public override string Execute()
        {
            var goldenBooks = this.context
                .Books
                .Where(b => b.Copies < 5000 && b.EditionType.Equals(EditionType.Gold))
                .OrderBy(b => b.BookId)
                .Select(b => b.Title)
                .ToList();

            goldenBooks.ForEach(b => this.sb.AppendLine(b));

            var result = this.sb
                .ToString()
                .TrimEnd();

            return result;
        }
    }
}


text:
from django import forms
from django.utils.translation import ugettext_lazy as _

__all__ = ['AddToCartForm', 'UpdateCartForm']

class AddToCartForm(forms.Form):
    quantity = forms.IntegerField(label=_("Quantity"),
                                  initial=1, min_value=1)

class UpdateCartForm(forms.Form):
    quantity = forms.IntegerField(label=_("Quantity"),
                                  min_value=0)


text:
(function ( $ ) {

	$.fn.aslider = function( options ) {

		//crete the timer variable to store the setInterval function
        this.timer;

		//hide all the slides except the first one
		this.find("div.slide:gt(0)").hide();

		//add a class "active" to the first slide
		this.find("div.slide:eq(0)").addClass('active');

        // register the options based on the data attributes.
        var settings = $.extend({
        	//data-speed="3000" data-wait="1000" data-preview="yes" data-dots="yes"
            speed: 500,
            wait: 3000,
            preview: false,
            dots: false
        }, options );

		//duplicate selector
		var _ = this;

		//store the amount of slides
        var tot = _.find('div.slide').length;

        var firstClass = '';
        var dotNext = '';
        var slideNext = '';

        //cross fade to the next slide
        this.nextSlide = function() {

        	dotNext = _.find('div.active').next('div.slide').attr('id');
        	$('.dot[data-slide="'+dotNext+'"]').addClass('active').siblings().removeClass('active');

			_.find('div.active').stop().
			fadeOut(settings.speed).removeClass('active').
			next('div.slide').fadeIn(settings.speed).addClass('active').
			end().appendTo(this);

        }

        //cross fade to the previous slide
        this.prevSlide = function() {

        	//check if a previsou element exists, otherwise prepend the last element
        	if ( _.find('div.active').prev('div.slide').length == 0 ) {

        		_.find('div.slide:last-child').insertAfter('.aslider-next');

        	}

        	dotNext = _.find('div.active').prev('div.slide').attr('id');
        	$('.dot[data-slide="'+dotNext+'"]').addClass('active').siblings().removeClass('active');

			_.find('div.active').stop().
			fadeOut(settings.speed).removeClass('active').
			prev('div.slide').fadeIn(settings.speed).addClass('active');

        }

        //generate the navigation arrows
        this.navArrows = function () {

	        _.prepend('');

        }

        //preview slide function
        this.previewSlide = function(slide) {

	        if( slide=='prev' ){
				_.find('div.slide:last-child').find('img').clone().
				insertAfter('.aslider-'+slide).addClass('slide-preview preview-'+slide).animate({right:'90%'},200);
			} else if( slide=='next' ){
				_.find('div.active').next('div.slide').find('img').clone().
				insertAfter('.aslider-'+slide).addClass('slide-preview preview-'+slide).animate({left:'90%'},200);
			}

			_.find('.aslider-'+slide).on('mouseleave' , function() {
				if( slide=='prev' ){
					$('.slide-preview').animate({right:'100%'},200, function() { this.remove(); });
				} else if( slide=='next' ){
					$('.slide-preview').animate({left:'100%'},200, function() { this.remove(); });
				}
			});

        }

        this.activeDots = function () {

        	if( tot > 0 ){

	        	$('

').insertAfter(this);

	        	$('div.slide').each(function( index ) {
	        		if (index==0) { firstClass = ' active'; }else{ firstClass = ''; }
	        		$('.dots').append('');
	        	});

	        	$('.dot').on('click',function(){

	        		clearInterval(timer);

		        	$(this).addClass('active').siblings().removeClass('active');

		        	slideNext = $(this).data('slide');

		        	_.find('div.active:not(#'+slideNext+')').stop().fadeOut(settings.speed).removeClass('active');
					_.find('div#'+slideNext+':not(.active)').fadeIn(settings.speed).addClass('active').prevAll('div.slide').appendTo(_);

	        	});

        	}

        }

		this.startTimer = function() {

		    timer = setInterval(function() {

		    	_.nextSlide();

			},  settings.wait);

		}

		//on hover clear the interval and stop the slider
		this.hover(function(ev){ clearInterval(timer); }, function(ev){ _.startTimer(); });

		//auto start
		_.startTimer(); _.navArrows();

		//call the navigation functions on click
		_.find('.aslider-nav').on('click' , function() {

			$.isFunction(_[$(this).data('call')]) && _[$(this).data('call')]();

			if( settings.preview == true ) {

				$('.slide-preview').fadeOut(200, function() { this.remove(); });

			}

		});

		//if preview is true, show the next/prev slide preview
		if( settings.preview == true ) {

			_.find('.aslider-nav').on('mouseenter' , function() {
				_.previewSlide( $(this).data('preview') );
			});

		}

		if( settings.dots == true ) {

			_.activeDots();

		}

    };

	$('[data-slide="aslider"]').each(function() {
		$(this).aslider({
            speed: $(this).data('speed'),
            wait: $(this).data('wait'),
            preview: $(this).data('preview'),
            dots: $(this).data('dots')
		});
	});

}( jQuery ));


text:
/*
 * generated by Xtext
 */
package person.zhoujg.ui.contentassist;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.*;
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor;
import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;

/**
 * Represents a generated, default implementation of superclass {@link org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider}.
 * Methods are dynamically dispatched on the first parameter, i.e., you can override them
 * with a more concrete subtype.
 */
@SuppressWarnings("all")
public class AbstractFeatureProposalProvider extends org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider {

	public void completeRootDeclaration_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeRootDeclaration_InCard(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeRootDeclaration_Body(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureDeclaration_OutCard(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureDeclaration_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureDeclaration_Ref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureDeclaration_InCard(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureDeclaration_Body(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureBody_Attrs(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureBody_Features(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureBody_RuleBody(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeAttributePart_Attr(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeRuleBody_Rules(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeAttribute_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeAttribute_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureExpr_Left(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureExpr_Op(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFeatureExpr_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeLogicExpr_LeftLogicExpr(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeLogicExpr_LogicOP(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeLogicExpr_Right(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeBasicExpr_LExpr(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeBasicExpr_CompOp(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeBasicExpr_RExpr(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeAtom_Literal(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeAtom_Sub(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeLiteral_Str(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeLiteral_Int(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeLiteral_Bool(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeLiteral_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
	}

	public void complete_RootDeclaration(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_FeatureDeclaration(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_FeatureBody(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_StandaloneCardinality(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_GroupCardinality(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_AttributePart(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_RuleBody(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_Attribute(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_AttributeType(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_FeatureExpr(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_LogicExpr(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_BasicExpr(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_ComparationOP(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_Atom(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_Literal(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_BOOL(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_QualifiedName(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_FeatureOP(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_LogicOP(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
}


text:
package com.vector.onetodo;

public class PopupItem {
	private int itemId;
	private String titleText;
	private Class<?> activityClassName;

	public PopupItem(int itemId, String titleText, Class<?> activityClassName) {
		super();
		this.itemId = itemId;
		this.titleText = titleText;
		this.activityClassName = activityClassName;
	}

	public int getItemId() {
		return itemId;
	}

	public String getTitleText() {
		return titleText;
	}

	public Class<?> getActivityClassName() {
		return activityClassName;
	}
}


text:
Vector Tile Tools
=================
A set of classes for managing tiles of geospatial vector data

![Build Status](https://travis-ci.org/SkyTruth/vectortile.svg)

Installation and Unittests
--------------------------
Install via pip:

    pip install vectortile

Source:

    $ git clone https://github.com/SkyTruth/vectortile.git
    $ cd vectortile
    $ pip install -r requirements.txt
    $ nosetests
    $ python setup.py install

TypedMatrix
-----------
TypedMatrix is a binary coded format optimized for delivering large amounts of
tabular data from a web server to a javascript client without the need for
parsing in javascript on the client side.

The vectortile.TypedMatrix module provides functions to read and write
typed-matrix formatted strings.

### Format Details ###
A TypedMatrix is a packed 2 dimensional array of typed values suitable for
typecasting to a set of javascript arrays.  Currently two fundamental data
types are supported:

- Int32
- Float32

Special handling is provided for converting datetime values to Float32.  The
format includes a header containing a json object, which can contain arbitrary
content.  The header must contain at least:

- length: indicated the number of rows in the data section
- cols: an array of column definitions.  The length of this array indicates the number of columns in each row

For example, a TypedMatrix with 2 rows and 3 columns:

    {
        'length': 2,
        'cols': [
            {
                'type': 'Float32',
                'name': 'float'
            },
            {
                'type': 'Int32',
                'name': 'int'
            },
            {
                'type': 'Float32',
                'name': 'timestamp'
            }
        ]
    }

### Usage Examples ###

    >>> from vectortile import TypedMatrix
    >>> from datetime import datetime
    >>> from pprint import pprint

    # Create two rows of 3 columns each: int, float and datetime
    >>> data = [{'int':1, 'float':1.0, 'timestamp': datetime(2014,1,1)}]
    >>> data.append ({'int':2, 'float':2.0, 'timestamp':datetime(2014,1,2)})
    >>> t_str = TypedMatrix.pack(data)

    # Typedmatrix is now coded as a binary string, packed row-wise
    >>> t_str
    'tmtx\x01\x00\x00\x00r\x89\x00\x00\x00{"length": 2, "cols": [{"type": "Float32", "name": "float"}, {"type": "Int32", "name": "int"}, {"type": "Float32", "name": "timestamp"}]}\x00\x00\x80?\x01\x00\x00\x00\x8d\xa5\xa1S\x00\x00\x00@\x02\x00\x00\x00 \xa8\xa1S'

    >>> header, data = TypedMatrix.unpack(t_str)
    >>> pprint(header)
    {
        'cols': [
            {
                'name': 'float',
                'type': 'Float32'
            },
            {
                'name': 'int',
                'type': 'Int32'
            },
            {
                'name': 'timestamp',
                'type': 'Float32'
            }
        ],
        'length': 2
    }

    >>> pprint(data)
    [
        {
            'float': 1.0,
            'int': 1,
            'timestamp': 1388534431744.0
        },
        {
            'float': 2.0,
            'int': 2,
            'timestamp': 1388620808192.0
        }
    ]

    # Pack data column-wise
    >>> TypedMatrix.pack(data,orientation='columnwise')
    'tmtx\x01\x00\x00\x00c\x89\x00\x00\x00{"length": 2, "cols": [{"type": "Float32", "name": "float"}, {"type": "Int32", "name": "int"}, {"type": "Float32", "name": "timestamp"}]}\x00\x00\x80?\x00\x00\x00@\x01\x00\x00\x00\x02\x00\x00\x00\x8d\xa5\xa1S \xa8\xa1S'

    >>> header, data = TypedMatrix.unpack(t_str)
    >>> pprint(header)
    {
        'cols': [
            {
                'name': 'float',
                'type': 'Float32'
            },
            {
                'name': 'int',
                'type': 'Int32'
            },
            {
                'name': 'timestamp',
                'type': 'Float32'
            }
        ],
        'length': 2
    }

    >>> pprint(data)
    [
        {
            'float': 1.0,
            'int': 1,
            'timestamp': 1388534431744.0
        },
        {
            'float': 2.0,
            'int': 2,
            'timestamp': 1388620808192.0
        }
    ]

### Javascript Example ###
See [data-visualization-tools](https://github.com/SkyTruth/data-visualization-tools)


text:
Template.map.onCreated(() => {

  //console.log("map created");
  GoogleMaps.load({ v: '3', key: Meteor.settings["public"].GoogleMapKey, libraries: 'geometry,places'});

});

Template.map.onRendered(function () {

  let lookup = [];
  let self = this;
  function getBox (map) {

    let bounds = map.instance.getBounds();
    let ne = bounds.getNorthEast();
    let sw = bounds.getSouthWest();
    let box = [
      [sw.lng(),sw.lat()],
      [ne.lng(),ne.lat()]
    ];

    Session.set("box", box);
  }

  GoogleMaps.ready('bigmap', (map) => {

    google.maps.event.addListener(map.instance, 'dragend', (e) => { getBox(map); });
    google.maps.event.addListener(map.instance, 'zoom_changed', (e) => { getBox(map); });

  });

    /*
    self.autorun(() => {

      getBox(map);
      self.subscribe('users.location', Session.get('box'), TAPi18n.getLanguage(), () => {

        // Map stuff
        let markers = [];
        Users.find({haslocation:true}).forEach((doc) => {

          let lat = doc.location.coordinates[1];
          let lng = doc.location.coordinates[0];

          if (!_.contains(lookup, lat+','+lng)) {

            let marker = new SlidingMarker({
              draggable: false,
              animation: google.maps.Animation.DROP,
              position: new google.maps.LatLng(lat, lng),
              map: map.instance,
              id: doc._id,
              duration: 2000,
              easing: "easeOutExpo",
              icon: '/map/marker.png',
              title: '100'
            });

            lookup.push(lat+','+lng);
            markers.push(marker);

            let w = new google.maps.InfoWindow({
              content: 'plap'
            });
            google.maps.event.addListener(marker, 'click', () => {
              w.open(map.instance, marker);
            });
          }
        });

        let options = {
            imagePath: '/map/m'
        };
        let markerCluster = new MarkerClusterer(map.instance, markers, options);

      });
    });
    */

});

Template.map.onDestroyed(() => {

  //console.log("map destroyed");
  delete(GoogleMaps.maps.bigmap);
});

Template.map.helpers({
  ops () {
    if (GoogleMaps.loaded()) {

      let lat = 58.0041;
      let lng = 25.7482;

      return {
        center: new google.maps.LatLng(lat, lng),
        zoom: 5,
        scrollwheel: false,
        backgroundColor: "rgba(255, 255, 255, 1)",
        mapTypeControl: false,
      };
    }
  }
});


text:
try:
    import simplejson as json
except ImportError:
    import json

from flask import Flask, Response, render_template, request
from werkzeug.contrib.cache import SimpleCache
import requests

app = Flask('roundup')
app.config.from_object('settings')
# TODO: In a production environment, you would never use an in-memory cache like
# this.  You should instead use something like Redis or Memcached.
cache = SimpleCache()

def get_top_posts(*args, **kwargs):
    kwargs['time'] = kwargs.get('time') or '6h'

    url = '{}/realtime/posts'.format(app.config['PARSELY']['api_base_url'])
    posts = []

    for apikey, config in app.config['PARSELY']['apikeys'].iteritems():
        kwargs['apikey'] = apikey
        kwargs['secret'] = config['secret']
        apikey_posts = requests.get(url, params=kwargs).json()['data']
        for post in apikey_posts:
            post['apikey'] = apikey
            post['logo_url'] = config.get('logo_url')

        posts.extend(apikey_posts)

    posts = sorted(posts, key=lambda x: x['_hits'], reverse=True)
    return posts[:kwargs['limit']]

@app.route('/top_posts')
def top_posts():
    limit = request.args.get('limit', default=app.config['NUMBER_OF_POSTS'],
                             type=int)
    if limit <= 0:
        limit = app.config['NUMBER_OF_POSTS']

    posts = cache.get('top_posts')
    if posts is None:
        posts = get_top_posts(limit=limit)
        cache.set('top_posts', posts, timeout=app.config['CACHE_EXPIRY'])

    return Response(json.dumps(posts), content_type='application/json')

@app.route('/')
def home():
    return render_template('home.jinja2.html')

if __name__ == '__main__':
    app.run()


text:
import { WebSocket } from 'global';
import { Channel, ChannelHandler } from '@storybook/channels';
import { isJSON, parse, stringify } from 'telejson';

type OnError = (message: Event) => void;

interface WebsocketTransportArgs {
  url: string;
  onError: OnError;
}

interface CreateChannelArgs {
  url: string;
  async: boolean;
  onError: OnError;
}

export class WebsocketTransport {
  private socket: WebSocket;

  private handler: ChannelHandler;

  private buffer: string[] = [];

  private isReady = false;

  constructor({ url, onError }: WebsocketTransportArgs) {
    this.connect(url, onError);
  }

  setHandler(handler: ChannelHandler) {
    this.handler = handler;
  }

  send(event: any) {
    if (!this.isReady) {
      this.sendLater(event);
    } else {
      this.sendNow(event);
    }
  }

  private sendLater(event: any) {
    this.buffer.push(event);
  }

  private sendNow(event: any) {
    const data = stringify(event, { maxDepth: 15, allowFunction: true });
    this.socket.send(data);
  }

  private flush() {
    const { buffer } = this;
    this.buffer = [];
    buffer.forEach((event) => this.send(event));
  }

  private connect(url: string, onError: OnError) {
    this.socket = new WebSocket(url);
    this.socket.onopen = () => {
      this.isReady = true;
      this.flush();
    };
    this.socket.onmessage = ({ data }) => {
      const event = typeof data === 'string' && isJSON(data) ? parse(data) : data;
      this.handler(event);
    };
    this.socket.onerror = (e) => {
      if (onError) {
        onError(e);
      }
    };
  }
}

export default function createChannel({ url, async, onError }: CreateChannelArgs) {
  const transport = new WebsocketTransport({ url, onError });
  return new Channel({ transport, async });
}


text:
package org.apache.roller.ui.rendering.filters;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.config.RollerConfig;
import org.apache.roller.ui.rendering.RequestMapper;

/**
 * Provides generalized request mapping capablilites.
 *
 * Incoming requests can be inspected by a series of RequestMappers and can
 * potentially be re-routed to different places within the application.
 *
 * @web.filter name="RequestMappingFilter"
 */
public class RequestMappingFilter implements Filter {

    private static Log log = LogFactory.getLog(RequestMappingFilter.class);

    // list of RequestMappers that want to inspect the request
    private final List requestMappers = new ArrayList();

    public void init(FilterConfig filterConfig) {

        // lookup set of request mappers we are going to use
        String rollerMappers = RollerConfig.getProperty("rendering.rollerRequestMappers");
        String userMappers = RollerConfig.getProperty("rendering.userRequestMappers");

        // instantiate user defined request mapper classes
        if(userMappers != null && userMappers.trim().length() > 0) {

            RequestMapper requestMapper = null;
            String[] uMappers = userMappers.split(",");
            for(int i=0; i < uMappers.length; i++) {
                try {
                    Class mapperClass = Class.forName(uMappers[i]);
                    requestMapper = (RequestMapper) mapperClass.newInstance();
                    requestMappers.add(requestMapper);
                } catch(ClassCastException cce) {
                    log.error("It appears that your mapper does not implement "+
                            "the RequestMapper interface", cce);
                } catch(Exception e) {
                    log.error("Unable to instantiate request mapper ["+uMappers[i]+"]", e);
                }
            }
        }

        // instantiate roller standard request mapper classes
        if(rollerMappers != null && rollerMappers.trim().length() > 0) {

            RequestMapper requestMapper = null;
            String[] rMappers = rollerMappers.split(",");
            for(int i=0; i < rMappers.length; i++) {
                try {
                    Class mapperClass = Class.forName(rMappers[i]);
                    requestMapper = (RequestMapper) mapperClass.newInstance();
                    requestMappers.add(requestMapper);
                } catch(ClassCastException cce) {
                    log.error("It appears that your mapper does not implement "+
                            "the RequestMapper interface", cce);
                } catch(Exception e) {
                    log.error("Unable to instantiate request mapper ["+rMappers[i]+"]", e);
                }
            }
        }

        if(requestMappers.size() < 1) {
            // hmm ... failed to load any request mappers?
            log.warn("Failed to load any request mappers.  "+
                    "Weblog urls probably won't function as you expect.");
        }

        log.info("Request mapping filter initialized, "+requestMappers.size()+
                " mappers configured.");
    }

    /**
     * Inspect incoming urls and see if they should be routed.
     */
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
            throws IOException, ServletException {

        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;

        log.debug("entering");

        // give each mapper a chance to handle the request
        RequestMapper mapper = null;
        Iterator mappersIT = this.requestMappers.iterator();
        while(mappersIT.hasNext()) {
            mapper = (RequestMapper) mappersIT.next();

            log.debug("trying mapper "+mapper.getClass().getName());

            boolean wasHandled = mapper.handleRequest(request, response);
            if(wasHandled) {
                // if mapper has handled the request then we are done
                log.debug("request handled by "+mapper.getClass().getName());
                log.debug("exiting");
                return;
            }
        }

        log.debug("request not mapped");

        // nobody handled the request, so let it continue as usual
        chain.doFilter(request, response);

        log.debug("exiting");
    }

    public void destroy() {}

}


text:
The FrameworkCoreBundle will add some functionality which will enable you build
application in a short timespan. Below all functionality is listed:

* Error handling
* Integrates Twitter Bootstrap

## Documentation

All documentation is located in the `Resources/doc/index.md`

## License

This bundle is under the MIT license. See the complete license in the bundle:

    Resources/meta/LICENSE

## About

FrameworkCoreBundle is a bundle created by [SumoCoders](https://github.com/sumocoders)
and is intended to be used with the Framework

## Issues?

Feel free to add an Issue on Github, or even better create a Pull Request.


text:
import { Component, Input } from "@angular/core";
import { Router } from "@angular/router";

@Component({
    selector: "boss-image",
    templateUrl: "./bossimage.component.html",
    styleUrls: ["./bossimage.component.css"]
})
export class BossimageComponent {

    @Input() cssv: number;
    @Input() cssh: number;
    @Input() url: string;
    @Input() width: number;

    constructor(private router: Router) { }

    setStyles(): Object {
        return {
            "background": "transparent",
            "background-image": "url(assets/i/bosses/allinone.png)",
            "background-position": `-${this.cssh}px -${this.cssv}px`,
            "width": `${this.width}px`
        }
    }

    navigateToBoss(): void {
        this.router.navigate(["Boss", this.url]);
    }
}


text:
AcousticBrainz Submit Plugin
============================

The ``absubmit`` plugin lets you submit acoustic analysis results to the
`AcousticBrainz`_ server.

Installation
------------

The ``absubmit`` plugin requires the `streaming_extractor_music`_ program
to run. Its source can be found on `GitHub`_, and while it is possible to
compile the extractor from source, AcousticBrainz would prefer if you used
their binary (see the AcousticBrainz `FAQ`_).

The ``absubmit`` plugin also requires `requests`_, which you can install
using `pip`_ by typing::

    pip install requests

After installing both the extractor binary and requests you can enable
the plugin ``absubmit`` in your configuration (see :ref:`using-plugins`).

Submitting Data
---------------

Type::

    beet absubmit [-f] [-d] [QUERY]

To run the analysis program and upload its results. By default, the
command will only look for AcousticBrainz data when the tracks
doesn't already have it; the ``-f`` or ``--force`` switch makes it refetch
data even when it already exists. You can use the ``-d`` or ``--dry`` swtich
to check which files will be analyzed, before you start a longer period
of processing.

The plugin works on music with a MusicBrainz track ID attached. The plugin
will also skip music that the analysis tool doesn't support.
`streaming_extractor_music`_ currently supports files with the extensions
``mp3``, ``ogg``, ``oga``, ``flac``, ``mp4``, ``m4a``, ``m4r``, ``m4b``,
``m4p``, ``aac``, ``wma``, ``asf``, ``mpc``, ``wv``, ``spx``, ``tta``,
``3g2``, ``aif``, ``aiff`` and ``ape``.

Configuration
-------------

To configure the plugin, make a ``absubmit:`` section in your configuration
file. The available options are:

- **auto**: Analyze every file on import. Otherwise, you need to use the
  ``beet absubmit`` command explicitly.
  Default: ``no``
- **extractor**: The absolute path to the `streaming_extractor_music`_ binary.
  Default: search for the program in your ``$PATH``
- **force**: Analyze items and submit of AcousticBrainz data even for tracks
  that already have it.
  Default: ``no``.
- **pretend**: Do not analyze and submit of AcousticBrainz data but print out
  the items which would be processed.
  Default: ``no``.

.. _streaming_extractor_music: https://acousticbrainz.org/download
.. _FAQ: https://acousticbrainz.org/faq
.. _pip: https://pip.pypa.io
.. _requests: https://requests.readthedocs.io/en/master/
.. _github: https://github.com/MTG/essentia
.. _AcousticBrainz: https://acousticbrainz.org


text:
using System;
using System.Globalization;
using JetBrains.Annotations;
using Sakura.AspNetCore.Mvc.Internal;

namespace Sakura.AspNetCore.Mvc.Generators
{
	/// <summary>
	///     Generate link url string from a formatted string. The page number will be used as the format argument {0}.	///
	/// </summary>
	public class FormattedLinkGenerator : IPagerItemLinkGenerator
	{
		/// <summary>
		///     Initialize a new generator with specified parameters.
		/// </summary>
		/// <param name="format">The format string used to be generate the link.</param>
		/// <param name="formatProvider">
		///     The format provider used to generate the link. If this parameter is <c>null</c>,
		///     <see cref="CultureInfo.InvariantCulture" /> will be used.
		/// </param>
		/// <exception cref="ArgumentNullException"><paramref name="format" /> is <c>null</c>.</exception>
		public FormattedLinkGenerator([NotNull] string format,
			IFormatProvider formatProvider = null)
		{
			Format = format ?? throw new ArgumentNullException(nameof(format));
			FormatProvider = formatProvider ?? CultureInfo.InvariantCulture;
		}

		/// <summary>
		///     Get the format string used to be generate the link.
		/// </summary>
		[PublicAPI]
		[NotNull]
		public string Format { get; }

		/// <summary>
		///     Get the format provider used to generate the link.
		/// </summary>
		[PublicAPI]
		[NotNull]
		public IFormatProvider FormatProvider { get; }

		#region Implementation of IPagerItemLinkGenerator

		/// <summary>
		///     Generate the link url for the specified <see cref="PagerItem" />.
		/// </summary>
		/// <param name="context">The generation context.</param>
		public string GenerateLink(PagerItemGenerationContext context)
		{
			return string.Format(FormatProvider, Format, context.PagerItem.PageNumber);
		}

		#endregion
	}
}


text:
"use strict";

var MongoError = require('mongodb-core').MongoError

var shallowClone = function(obj) {
  var copy = {};
  for(var name in obj) copy[name] = obj[name];
  return copy;
}

// Set simple property
var getSingleProperty = function(obj, name, value) {
  Object.defineProperty(obj, name, {
    enumerable:true,
    get: function() {
      return value
    }
  });
}

var formatSortValue = exports.formatSortValue = function(sortDirection) {
  var value = ("" + sortDirection).toLowerCase();

  switch (value) {
    case 'ascending':
    case 'asc':
    case '1':
      return 1;
    case 'descending':
    case 'desc':
    case '-1':
      return -1;
    default:
      throw new Error("Illegal sort clause, must be of the form "
                    + "[['field1', '(ascending|descending)'], "
                    + "['field2', '(ascending|descending)']]");
  }
};

var formattedOrderClause = exports.formattedOrderClause = function(sortValue) {
  var orderBy = {};
  if(sortValue == null) return null;
  if (Array.isArray(sortValue)) {
    if(sortValue.length === 0) {
      return null;
    }

    for(var i = 0; i < sortValue.length; i++) {
      if(sortValue[i].constructor == String) {
        orderBy[sortValue[i]] = 1;
      } else {
        orderBy[sortValue[i][0]] = formatSortValue(sortValue[i][1]);
      }
    }
  } else if(sortValue != null && typeof sortValue == 'object') {
    orderBy = sortValue;
  } else if (typeof sortValue == 'string') {
    orderBy[sortValue] = 1;
  } else {
    throw new Error("Illegal sort clause, must be of the form " +
      "[['field1', '(ascending|descending)'], ['field2', '(ascending|descending)']]");
  }

  return orderBy;
};

var checkCollectionName = function checkCollectionName (collectionName) {
  if('string' !== typeof collectionName) {
    throw Error("collection name must be a String");
  }

  if(!collectionName || collectionName.indexOf('..') != -1) {
    throw Error("collection names cannot be empty");
  }

  if(collectionName.indexOf('$') != -1 &&
      collectionName.match(/((^\$cmd)|(oplog\.\$main))/) == null) {
    throw Error("collection names must not contain '$'");
  }

  if(collectionName.match(/^\.|\.$/) != null) {
    throw Error("collection names must not start or end with '.'");
  }

  // Validate that we are not passing 0x00 in the colletion name
  if(!!~collectionName.indexOf("\x00")) {
    throw new Error("collection names cannot contain a null character");
  }
};

var handleCallback = function(callback, err, value1, value2) {
  try {
    if(callback == null) return;
    if(callback) {
      return value2 ? callback(err, value1, value2) :  callback(err, value1);
    }
  } catch(err) {
    process.nextTick(function() { throw err; });
    return false;
  }

  return true;
}

/**
 * Wrap a Mongo error document in an Error instance
 * @ignore
 * @api private
 */
var toError = function(error) {
  if (error instanceof Error) return error;

  var msg = error.err || error.errmsg || error.errMessage || error;
  var e = MongoError.create({message: msg, driver:true});

  // Get all object keys
  var keys = typeof error == 'object'
    ? Object.keys(error)
    : [];

  for(var i = 0; i < keys.length; i++) {
    try {
      e[keys[i]] = error[keys[i]];
    } catch(err) {
      // continue
    }
  }

  return e;
}

/**
 * @ignore
 */
var normalizeHintField = function normalizeHintField(hint) {
  var finalHint = null;

  if(typeof hint == 'string') {
    finalHint = hint;
  } else if(Array.isArray(hint)) {
    finalHint = {};

    hint.forEach(function(param) {
      finalHint[param] = 1;
    });
  } else if(hint != null && typeof hint == 'object') {
    finalHint = {};
    for (var name in hint) {
      finalHint[name] = hint[name];
    }
  }

  return finalHint;
};

/**
 * Create index name based on field spec
 *
 * @ignore
 * @api private
 */
var parseIndexOptions = function(fieldOrSpec) {
  var fieldHash = {};
  var indexes = [];
  var keys;

  // Get all the fields accordingly
  if('string' == typeof fieldOrSpec) {
    // 'type'
    indexes.push(fieldOrSpec + '_' + 1);
    fieldHash[fieldOrSpec] = 1;
  } else if(Array.isArray(fieldOrSpec)) {
    fieldOrSpec.forEach(function(f) {
      if('string' == typeof f) {
        // [{location:'2d'}, 'type']
        indexes.push(f + '_' + 1);
        fieldHash[f] = 1;
      } else if(Array.isArray(f)) {
        // [['location', '2d'],['type', 1]]
        indexes.push(f[0] + '_' + (f[1] || 1));
        fieldHash[f[0]] = f[1] || 1;
      } else if(isObject(f)) {
        // [{location:'2d'}, {type:1}]
        keys = Object.keys(f);
        keys.forEach(function(k) {
          indexes.push(k + '_' + f[k]);
          fieldHash[k] = f[k];
        });
      } else {
        // undefined (ignore)
      }
    });
  } else if(isObject(fieldOrSpec)) {
    // {location:'2d', type:1}
    keys = Object.keys(fieldOrSpec);
    keys.forEach(function(key) {
      indexes.push(key + '_' + fieldOrSpec[key]);
      fieldHash[key] = fieldOrSpec[key];
    });
  }

  return {
    name: indexes.join("_"), keys: keys, fieldHash: fieldHash
  }
}

var isObject = exports.isObject = function (arg) {
  return '[object Object]' == toString.call(arg)
}

var debugOptions = function(debugFields, options) {
  var finaloptions = {};
  debugFields.forEach(function(n) {
    finaloptions[n] = options[n];
  });

  return finaloptions;
}

var decorateCommand = function(command, options, exclude) {
  for(var name in options) {
    if(exclude[name] == null) command[name] = options[name];
  }

  return command;
}

var mergeOptions = function(target, source) {
  for(var name in source) {
    target[name] = source[name];
  }

  return target;
}

// Merge options with translation
var translateOptions = function(target, source) {
  var translations = {
    // SSL translation options
    'sslCA': 'ca', 'sslValidate': 'rejectUnauthorized', 'sslKey': 'key', 'sslCert': 'cert', 'sslPass': 'passphrase',
    // SocketTimeout translation options
    'socketTimeoutMS': 'socketTimeout', 'connectTimeoutMS': 'connectionTimeout',
    // Replicaset options
    'replicaSet': 'setName', 'rs_name': 'setName', 'secondaryAcceptableLatencyMS': 'acceptableLatency',
    'connectWithNoPrimary': 'secondaryOnlyConnectionAllowed',
    // Mongos options
    'acceptableLatencyMS': 'localThresholdMS'
  }

  for(var name in source) {
    if(translations[name]) {
      target[translations[name]] = source[name];
    } else {
      target[name] = source[name];
    }
  }

  return target;
}

var filterOptions = function(options, names) {
  var filterOptions =  {};

  for(var name in options) {
    if(names.indexOf(name) != -1) filterOptions[name] = options[name];
  }

  // Filtered options
  return filterOptions;
}

// Object.assign method or polyfille
var assign = Object.assign ? Object.assign : function assign(target) {
  if (target === undefined || target === null) {
    throw new TypeError('Cannot convert first argument to object');
  }

  var to = Object(target);
  for (var i = 1; i < arguments.length; i++) {
    var nextSource = arguments[i];
    if (nextSource === undefined || nextSource === null) {
      continue;
    }

    var keysArray = Object.keys(Object(nextSource));
    for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
      var nextKey = keysArray[nextIndex];
      var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
      if (desc !== undefined && desc.enumerable) {
        to[nextKey] = nextSource[nextKey];
      }
    }
  }
  return to;
}

exports.filterOptions = filterOptions;
exports.mergeOptions = mergeOptions;
exports.translateOptions = translateOptions;
exports.shallowClone = shallowClone;
exports.getSingleProperty = getSingleProperty;
exports.checkCollectionName = checkCollectionName;
exports.toError = toError;
exports.formattedOrderClause = formattedOrderClause;
exports.parseIndexOptions = parseIndexOptions;
exports.normalizeHintField = normalizeHintField;
exports.handleCallback = handleCallback;
exports.decorateCommand = decorateCommand;
exports.isObject = isObject;
exports.debugOptions = debugOptions;
exports.MAX_JS_INT = 0x20000000000000;
exports.assign = assign;


text:
(function () {
    'use strict';

    function CommitsService($q, $http, baseServiceUrl, data) {

        function latestTenCommits() {
            return data.get('api/commits');
        }

        function commitDetails(commitId) {
            return data.get('api/commits/' + commitId);
        }

        function allCommitsPerProject(projectId) {
            return data.get('api/commits/byproject/' + projectId);
        }

        function createCommit(commit) {
            return data.post('api/commits', commit);
        }

        //function allProjects(queryParams) {
        //    return data.get('api/projects/all', queryParams);
        //}

        //function addProjectCollaborator(projectId) {
        //    return data.put('api/projects/' + projectId);
        //}

        return {
            latestTenCommits: latestTenCommits,
            allCommitsPerProject: allCommitsPerProject,
            createCommit: createCommit,
            commitDetails: commitDetails,
            //projectsDetails: projectsDetails,
            //addProjectCollaborator: addProjectCollaborator,
            //allCollaboratorPerProject: allCollaboratorPerProject
        }
    }

    angular.module('SourceControlSystem.services')
        .factory('commits', ['$q', '$http', 'baseServiceUrl', 'data', CommitsService]);
}());


text:
<!DOCTYPE html>
<html>
<head>
    <title>'X-Content-Type-Options: nosniff;' blocks scripts!</title>
<body>
    <script src="/js-test-resources/js-test.js"></script>
    <script>
        description('Check that script sent with an invalid \'X-Content-Type-Options: nosniff\' header is correctly allowed, even if the MIME type isn\'t scripty.');
        window.jsTestIsAsync = true;

        var unscriptyMimeTypes = [
            'application/json',
            'text/html',
            'text/vbs',
            'text/vbscript',
            'text/x-javascript',
        ];

        window.scriptsSuccessfullyLoaded = 0;

        for (var i = 0; i < unscriptyMimeTypes.length; i++) {
            document.write('<script src="./resources/script-with-header.pl?mime=' + unscriptyMimeTypes[i] + '&options=invalid"><' + '/script>');
        }

        window.onload = function () {
            shouldBe('window.scriptsSuccessfullyLoaded', 'unscriptyMimeTypes.length');
            finishJSTest();
        };
    </script>
</body>
</html>


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<title>Shannon's Website!</title>
		<link rel="stylesheet" href="assets/css/style.css">

About Me

Goals

What I want to do

My goals

Coming from a design background, I am excited to start exploring the world of web development to gain a better understanding of the medium I already work with. While I am not quite sure of the type of job I'm after just yet, I know I'd like to work in a team environment with collaborative and creative individuals. Hopefully this won't be too difficult to find!

Programming Career

Click below to find out how I feel about starting my new programming career.
 Click Me!

x


text:
namespace performance_manager {
namespace execution_context_priority {

// Aggregator that allows votes from 2 different Voters, where one of the voters
// is allowed to override the votes of another. This aggregator should be
// completely setup before any votes are submitted to it.
class OverrideVoteAggregator : public VoteObserver {
 public:
  OverrideVoteAggregator();
  ~OverrideVoteAggregator() override;

  OverrideVoteAggregator(const OverrideVoteAggregator&) = delete;
  OverrideVoteAggregator& operator=(const OverrideVoteAggregator&) = delete;

  // All 3 of these must have been called in order for the aggregator to be
  // fully setup.
  VotingChannel GetOverrideVotingChannel();
  VotingChannel GetDefaultVotingChannel();
  void SetUpstreamVotingChannel(VotingChannel channel);

  bool IsSetup() const;

  size_t GetSizeForTesting() const { return vote_data_map_.size(); }

 protected:
  // VoteObserver implementation:
  void OnVoteSubmitted(VoterId voter_id,
                       const ExecutionContext* execution_context,
                       const Vote& vote) override;
  void OnVoteChanged(VoterId voter_id,
                     const ExecutionContext* execution_context,
                     const Vote& new_vote) override;
  void OnVoteInvalidated(VoterId voter_id,
                         const ExecutionContext* execution_context) override;

 private:
  // This is move-only because all of its members are move-only.
  class VoteData {
   public:
    enum class VoterType {
      kDefault,
      kOverride,
    };

    VoteData();
    VoteData(const VoteData& rhs) = delete;
    VoteData(VoteData&& rhs);
    VoteData& operator=(const VoteData& rhs) = delete;
    VoteData& operator=(VoteData&& rhs) = default;
    ~VoteData();

    void AddVote(VoterType voter_type, const Vote& vote);
    void ChangeVote(VoterType voter_type, const Vote& new_vote);
    void RemoveVote(VoterType voter_type);

    bool HasChosenVote() const;

    const Vote& GetChosenVote() const;

   private:
    // At least one of these is not null if a vote has been emitted for this
    // execution context.
    absl::optional<Vote> default_vote_;
    absl::optional<Vote> override_vote_;
  };

  using VoteDataMap = std::map<const ExecutionContext*, VoteData>;

  // Looks up the VoteData associated with the provided |vote|. The data is
  // expected to already exist (enforced by a DCHECK).
  VoteDataMap::iterator GetVoteData(const ExecutionContext* execution_context);

  // Returns the VoterType associated with |voter_id|.
  VoteData::VoterType GetVoterType(VoterId voter_id) const;

  // Our two input voters. We'll only accept votes from these voters otherwise
  // we'll DCHECK.
  VoterId override_voter_id_;
  VoterId default_voter_id_;

  // Our channel for upstreaming our votes.
  VotingChannel channel_;

  // Provides VotingChannels to our input voters.
  VotingChannelFactory voting_channel_factory_{this};

  // The votes we've upstreamed to our consumer.
  VoteDataMap vote_data_map_;
};

}  // namespace execution_context_priority
}  // namespace performance_manager

#endif  // COMPONENTS_PERFORMANCE_MANAGER_EXECUTION_CONTEXT_PRIORITY_OVERRIDE_VOTE_AGGREGATOR_H_


text:
namespace Google.Cloud.GkeMultiCloud.V1.Snippets
{
    // [START gkemulticloud_v1_generated_AzureClusters_GetAzureNodePool_sync_flattened]
    using Google.Cloud.GkeMultiCloud.V1;

    public sealed partial class GeneratedAzureClustersClientSnippets
    {
        /// <summary>Snippet for GetAzureNodePool</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void GetAzureNodePool()
        {
            // Create client
            AzureClustersClient azureClustersClient = AzureClustersClient.Create();
            // Initialize request argument(s)
            string name = "projects/[PROJECT]/locations/[LOCATION]/azureClusters/[AZURE_CLUSTER]/azureNodePools/[AZURE_NODE_POOL]";
            // Make the request
            AzureNodePool response = azureClustersClient.GetAzureNodePool(name);
        }
    }
    // [END gkemulticloud_v1_generated_AzureClusters_GetAzureNodePool_sync_flattened]
}


text:
/*  General methods and properties of OEIS sequences
 *  @(#) $Id: Sequence.java 231 2009-08-25 08:47:16Z gfis $
 *  2019-08-25: Georg Fischer
 */
/*
 * Copyright 2019 Dr. Georg Fischer <dr.georg.fischer(at)gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.teherba.ramath.sequence;
import  org.teherba.ramath.linear.BigVector;
import  java.io.Serializable;
import  java.math.BigInteger;

/** General methods and properties of OEIS sequences.
 *  @author Dr. Georg Fischer
 */
public class Sequence extends BigVector
        implements Cloneable, Serializable
        {
    private static final long serialVersionUID = 1L;
    public final static String CVSID = "@(#) $Id: Sequence.java 231 2009-08-25 08:47:16Z gfis $";
    /** Debugging level: 0 = none, 1 = some, 2 = more */
    public static int debug = 0;

    /** OEIS A-number of the sequence */
    protected String aNumber;
    /** Sets the OEIS A-number.
     *  @param aNumber OEIS sequential id of the sequence: "A" and 6 digits
     */
    public void setANumber(String aNumber) {
        this.aNumber = aNumber;
    } // setANumber
    /** Gets the OEIS A-number.
     *  @return aNumber OEIS sequential id of the sequence: "A" and 6 digits
     */
    public String getANumber() {
        return this.aNumber;
    } // getANumber

    /** index of last term */
    protected long bfimax;
    /** Sets the highest term index
     *  @param bfimax index of last term
     */
    public void setBfimax(long bfimax) {
        this.bfimax = bfimax;
    } // setBfimax

    /** Gets the highest term index
     *  @return bfimax index of last term
     */
    public long getBfimax() {
        return bfimax;
    } // getBfimax

    /** OEIS Offset1: natural index of first term */
    protected long offset;
    /** Sets the OEIS offset1
     *  @param offset OEIS natural index of first term
     */
    public void setOffset(long offset) {
        this.offset = offset;
    } // setOffset
    /** Gets the OEIS offset1
     *  @return the OEIS natural index of first term
     */
    public long getOffset() {
        return offset;
    } // getOffset

    //------------------------------
    /** No-args constructor.
     */
    public Sequence() {
        super();
    } // no-args constructor

    /** Construct for a known number of terms
     *  @param termNo number of terms
     */
    public Sequence(int termNo) {
        super(termNo);
        offset = 0;
        bfimax = termNo - 1;
    } // Constructor(int)

    /** Construct from a BigInteger array
     *  @param terms array of BigInteger
     */
    public Sequence(BigInteger[] terms) {
        super(terms);
        offset = 0;
        bfimax = vector.length - 1;
    } // Constructor(BigInteger[])

    /** Clone this Sequence.
     *  @return a deep copy
     */
    public Sequence clone() {
        Sequence result = new Sequence(super.vector);
        result.setANumber(getANumber());
        result.setOffset (getOffset ());
        result.setBfimax (getBfimax ());
        return result;
    } // clone()

    //--------------------------------------
    /** Prints the sequence in b-file format.
     */
    public void printBFile() {
        int iterm = 0;
        long n = getOffset();
        System.out.println("# " + getANumber() + " generated by Sequence");
        System.out.println("# Table of n, a(n) for n = " + getOffset() + ".." + getBfimax());
        while (iterm < size()) {
            System.out.println(n + " " + getBig(iterm));
            iterm ++;
            n ++;
        } // while iterm
    } // printBFile

    /** Gets a comma separated list of a number of terms
     *  @return list with all elements
     */
    public String toList() {
        return toList(29061947);
    } // toList()

    /** Gets a comma separated list of a number of terms
     *  @param termNo number of terms to be concatenated
     *  @return a list with at most termNo elements
     */
    public String toList(int termNo) {
        StringBuffer result = new StringBuffer(256);
        int iterm = 0;
        while (iterm < size()) {
            if (iterm > 0) {
                result.append(",");
            }
            result.append(getBig(iterm ++));
            if (iterm >= termNo) {
                iterm = size(); // break loop
            }
        } // while iterm
        return result.toString();
    } // toList

} // Sequence


text:
var config = require('config');
var Util = require('../util/util.js');
var Promise = require('promise-js');
var RtmClient = require('@slack/client').RtmClient;
var WebClient = require('@slack/client').WebClient;
var CLIENT_EVENTS = require('@slack/client').CLIENT_EVENTS;
var RTM_EVENTS = require('@slack/client').RTM_EVENTS;
var token = config.get('slack.token');
var web = new WebClient(token);
var rtm = new RtmClient(token);

module.exports = function () {
    return {
        getUserName: getUserName,
        getChannelName: getChannelName,
        getGroupName: getGroupName,
        getChannelNameOrGroupNameOrDirectChannel: getChannelNameOrGroupNameOrDirectChannel,
        getBotInfo: getBotInfo,
        getTeamName: getTeamName,
        addReaction: addReaction,
        rtmStart: rtmStart
    };
}();

function getUserName(userId) {
    return new Promise(function (resolve, reject) {
        web.users.info(userId, function (err, response) {
            if (err || !response.ok) {
                return reject(err);
            }
            resolve(response.user.name);
        })
    });
}

function getChannelNameOrGroupNameOrDirectChannel(channelId) {
    if (channelId.indexOf('C') == 0) {
        return getChannelName(channelId);
    } else if (channelId.indexOf('G') == 0) {
        return getGroupName(channelId);
    } else if (channelId.indexOf('D') == 0) {
        return new Promise(function (resolve, reject) {
            resolve('DirectChannel')
        });
    }
    return new Promise(function (resolve, reject) {
        resolve('UnknownChannel')
    });
}

function getChannelName(channelId) {
    return new Promise(function (resolve, reject) {
        web.channels.info(channelId, function (err, response) {
            if (err || !response.ok) {
                return reject(err);
            }
            resolve(response.channel.name);
        })
    });
}

function getGroupName(groupId) {
    return new Promise(function (resolve, reject) {
        web.groups.info(groupId, function (err, response) {
            if (err || !response.ok) {
                return reject(err);
            }
            resolve(response.group.name);
        })
    });
}
function getBotInfo(botId) {
    return new Promise(function (resolve, reject) {
        web.bots.info(botId, function (err, response) {
            console.log('getBotInfo', botId, response);
            if (err || !response.ok) {
                return reject(err);
            }
            resolve(response.channel.name);
        })
    });
}

function getTeamName() {
    return new Promise(function (resolve, reject) {
        web.team.info(function (err, response) {
            if (err || !response.ok) {
                return reject(err);
            }
            resolve(response.team.name);
        })
    });
}

function addReaction(reactionName, channel, ts) {
    return new Promise(function (resolve, reject) {
        web.reactions.add(reactionName, { channel: channel, timestamp: ts }, function (err, res) {
            if (err) {
                return reject(err);
            }
            resolve("Message sent");
        });
    });
}

function rtmStart(messageHandlers) {
    rtm.on(CLIENT_EVENTS.RTM.AUTHENTICATED, function (rtmStartData) {
        console.log(`Logged in as ${rtmStartData.self.name} of team ${rtmStartData.team.name}`);
    });
    rtm.on(RTM_EVENTS.MESSAGE, function (message) {
        console.log(message);
        messageHandlers.forEach(function (handler) {
            handler.call(null, message);
        });
    });
    rtm.start();
}


text:
<?php
/* @var $this UsersController */
/* @var $model Users */
/* @var $form CActiveForm */
?>

<?php /** @var BootActiveForm $form */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id'=>'verticalForm',
    'htmlOptions'=>array('class'=>'well'),
)); ?>

 <?php echo $form->errorSummary($model); ?>

<?php echo $form->dropDownListRow($model,'memberTyp'
		, array(''=>'Select Person typ',
				'Parent'=>'Parent',
				 'Child'=>'Child',
				 'Supporter'=>'Supporter',
				 'Parent waiting'=>'Parent waiting',
				 'Child waiting'=>'Child waiting')
		,array('class'=>'span4')
			 ); ?>

<?php echo $form->dropDownListRow($model,'associationMember'
		, array(''=>'Select member typ',
				'0'=>'No member',
				 '1'=>'Ordinary member',
				 '2'=>'Founder'
				 )
				,array('class'=>'span4')

			 ); ?>

<legend>Personal data</legend>

<?php echo $form->dropDownListRow($model,'gender'
		, array(''=>'Select person gender',
				'M'=>'Male',
				 'F'=>'Female'
				 )
		,array('class'=>'span4')
			 ); ?>

<?php echo $form->textFieldRow($model, 'firstName', array('class'=>'span6')); ?>
<?php echo $form->textFieldRow($model, 'lastName', array('class'=>'span6')); ?>
<?php echo $form->textFieldRow($model, 'adress', array('class'=>'span6')); ?>
<?php echo $form->textFieldRow($model, 'zip', array('class'=>'span6')); ?>
<?php echo $form->textFieldRow($model, 'telefon', array('class'=>'span6')); ?>
<?php echo $form->textFieldRow($model, 'handy', array('class'=>'span6')); ?>

<?php

$countryArray = CHtml::listData($countries, 'code','en');
array_unshift($countryArray, "Select nationality please");

echo $form->dropDownListRow(
		$model
		, 'nationality'
		, $countryArray
		, array(
			'class'=>'span4'
		)
);?>

<?php

echo $form->dropDownListRow(
		$model
		, 'nationality2'
		,  $countryArray
		, array(
			'class'=>'span4'
		)
);

?>

<?php echo $form->labelEx($model,'birthOfDate'); ?>
<?php
		$this->widget('zii.widgets.jui.CJuiDatePicker',array(
			'attribute'=>'birthOfDate',
		    'name'=>'birthOfDate',
		    // additional javascript options for the date picker plugin
			'model'=>$model,
		    'options'=>array(
		     'showAnim'=>'fold',
			 'changeYear'=>true,
			 'dateFormat'=>'yy-mm-dd',
			 'yearRange'=>'1940:'.date('Y'),
		    ),
		    'htmlOptions'=>array(),

		));
		?>

<legend>Account data</legend>
<?php echo $form->textFieldRow($model, 'email', array('class'=>'span6')); ?>
<?php echo $form->passwordFieldRow($model, 'userPassword', array('class'=>'span6')); ?>

<legend>Membership data</legend>

<?php echo $form->labelEx($model,'inAssociationSince'); ?>

<?php
		$this->widget('zii.widgets.jui.CJuiDatePicker',array(
			'attribute'=>'inAssociationSince',
		    'name'=>'inAssociationSince',
		    // additional javascript options for the date picker plugin
			'model'=>$model,
		    'options'=>array(
		    'showAnim'=>'slideDown',
			'changeYear'=>true,
			'dateFormat'=>'yy-mm-dd',
			'yearRange'=>'2012:'.date('Y'),

		    ),
		    'htmlOptions'=>array(),
		));
		?>

<?php echo $form->labelEx($model,'inAssociationUntil'); ?>
<?php
		$this->widget('zii.widgets.jui.CJuiDatePicker',array(
			'attribute'=>'inAssociationUntil',
		    'name'=>'inAssociationUntil',
		    // additional javascript options for the date picker plugin
			'model'=>$model,
		    'options'=>array(
		    'showAnim'=>'slideDown',
			'changeYear'=>true,
			'dateFormat'=>'yy-mm-dd',
			'yearRange'=>'2012:'.date('Y'),

		    ),
		    'htmlOptions'=>array(),
		));
		?>

<?php echo $form->labelEx($model,'desiredEntryDate'); ?>
<?php
		$this->widget('zii.widgets.jui.CJuiDatePicker',array(
			'attribute'=>'desiredEntryDate',
		    'name'=>'desiredEntryDate',
		    // additional javascript options for the date picker plugin
			'model'=>$model,
		    'options'=>array(
		    'showAnim'=>'slideDown',
			'changeYear'=>true,
			'dateFormat'=>'yy-mm-dd',
			'yearRange'=>'2011:'.(date('Y')+3),

		    ),
		    'htmlOptions'=>array(),
		));
		?>

<?php $this->widget('bootstrap.widgets.TbButton', array('buttonType'=>'submit', 'label'=>'Create user')); ?>

<?php $this->endWidget(); ?>


text:
package com.ulyseo.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "audio_element")
public class AudioElement {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long id;

	@Column
	private String title;

	@Column
	private String description;

	@Column
	private Date creationDate;

	@ManyToOne(targetEntity = AudioChapter.class)
	@JoinColumn(name = "chapter_id")
	private AudioChapter chapter;

	public Integer getPosition() {
		return chapter.getAudioElementList().indexOf(this) + 1;
	}

	public AudioChapter getChapter() {
		return chapter;
	}

	public void setChapter(AudioChapter chapter) {
		this.chapter = chapter;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

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

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

}


text:
class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
    tabbar = UITabBarController.alloc.init
    tabbar.viewControllers = [BeerMapController.alloc.init, BeerListController.alloc.init]
    tabbar.selectedIndex = 0
    @window.rootViewController = UINavigationController.alloc.initWithRootViewController(tabbar)
    @window.rootViewController.wantsFullScreenLayout = true
    @window.makeKeyAndVisible
    true
  end

  def beer_details_controller
    @beer_details_controller ||= BeerDetailsController.alloc.init
  end
end


text:
using Newtonsoft.Json;

namespace Box.V2.Models
{
    /// <summary>
    /// Copy of BoxFileEventSource
    /// </summary>
    public class BoxFolderEventSource : BoxEntity
    {
        public const string FieldItemType = "item_type";
        public const string FieldItemId = "item_id";
        public const string FieldItemName = "item_name";
        public const string FieldItemParent = "parent";

        /// <summary>
        /// The type of the event source
        /// </summary>
        [JsonProperty(PropertyName = FieldItemType)]
        public override string Type { get; protected set; }

        /// <summary>
        /// The unique id of the file
        /// </summary>
        [JsonProperty(PropertyName = FieldItemId)]
        public override string Id { get; protected set; }

        /// <summary>
        /// The name of the file
        /// </summary>
        [JsonProperty(PropertyName = FieldItemName)]
        public string Name { get; private set; }

        /// <summary>
        /// The folder that contains this file
        /// </summary>
        [JsonProperty(PropertyName = FieldItemParent)]
        public BoxFolder Parent { get; private set; }
    }
}


text:
# Angular Material bi-directionality

## Setting a text-direction for your application

The [`dir` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
is typically applied to `<html>` or `<body>` element of a page. However, it can be used on any
element, within your Angular app, to apply a text-direction to a smaller subset of the page.

All Angular Material components automatically reflect the LTR/RTL direction
of their container.

## Reading the text-direction in your own components

`@angular/cdk/bidi` provides a `Directionality` injectable that can be used by any component
in your application. To consume it, you must import `BidiModule` from `@angular/cdk/bidi`.

`Directionality` provides two useful properties:
* `value`: the current text direction, either `'ltr'` or `'rtl'`.
* `change`: an `Observable` that emits whenever the text-direction changes. Note that this only
captures changes from `dir` attributes _inside the Angular application context_. It will not
emit for changes to `dir` on `<html>` and `<body>`, as they are assumed to be static.

### Example

```ts
@Component({ /* ... */ })
export class MyCustomComponent {
  private dir: Direction;

  constructor(directionality: Directionality) {
    this.dir = directionality.value;

    directionality.change.subscribe(() => {
      this.dir = directionality.value;
    });
  }
}
```


text:
    ALog(@"Not Implemented exception thrown"); \
    [NSException raise:@"Not Implemented" format:@"Not Implemented"]; \
  } while (0)

#define MB_ATTRIBUTE(Name) @synthesize Name = _##Name
#define MB_ELEMENT(Name) @synthesize Name = _##Name
#define MB_STRING_ELEMENT(Name) @synthesize Name = _##Name; \
  - (void) set##Name :(MBEntity *)entity \
    { \
      if (entity && entity.Text) \
        _##Name = entity.Text; \
    }
#define MB_NUMBER_ELEMENT(Name) @synthesize Name = _##Name; \
  - (void) set##Name :(MBEntity *)entity \
    { \
      if (entity && entity.Text) \
        _##Name = [entity.Text number]; \
    }

#define kISRC_Regex @"^[A-Z{2}[A-Z0-9]{3}[0-9]{2}[0-9]{5}$"
#define kUUID_Regex @"^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"

#if __has_feature(objc_dictionary_literals)
# define DICT_LIT 1
#else
# define DICT_LIT 0
#endif

#if __has_feature(objc_array_literals)
# define ARRAY_LIT 1
#else
# define ARRAY_LIT 0
#endif

#if __has_feature(objc_subscripting)
# define OBJ_SUB 1
#else
# define OBJ_SUB 0
#endif

#if __has_feature(objc_boxed_expressions)
# define NUM_LIT 1
#else
# define NUM_LIT 0
#endif

#define kErrorKey        @"error"
#define kListKey         @"list"
#define kMetadataKey     @"metadata"
#define kLifespanKey     @"life-span"
#define kTextRepresentationKey @"text-representation"
#define kIPIKey          @"ipi"
#define kArtistKey       @"artist"
#define kReleaseKey      @"release"
#define kReleaseGroupKey @"release-group"
#define kRecordingKey    @"recording"
#define kLabelKey        @"label"
#define kWorkKey         @"work"
#define kDiscKey         @"disc"
#define kPUIDKey         @"puid"
#define kISRCKey         @"isrc"
#define kArtistCreditKey @"artist-credit"
#define kNameCreditKey   @"name-credit"
#define kRelationKey     @"relation"
#define kAttributeKey    @"attribute"
#define kAliasKey        @"alias"
#define kISWCKey         @"iswc"
#define kTagKey          @"tag"
#define kUserTagKey      @"user-tag"
#define kRatingKey       @"rating"
#define kUserRatingKey   @"user-rating"
#define kLabelInfoKey    @"label-info"
#define kMediumKey       @"medium"
#define kTrackKey        @"track"
#define kAnnotationKey   @"annotation"
#define kCDStubKey       @"cdstub"
#define kFreeDBDiscKey   @"freedb-disc"
#define kNonMBTrackKey   @"nonmb-track"
#define kCollectionKey   @"collection"
#define kMessageKey      @"message"

#if TARGET_OS_IPHONE && defined(__IPHONE_5_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0) && __clang__ && (__clang_major__ >= 3)
# define CPT_SDK_SUPPORTS_WEAK 1
#elif TARGET_OS_MAC && defined(__MAC_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7) && __clang__ && (__clang_major__ >= 3)
# define CPT_SDK_SUPPORTS_WEAK 1
#else
# define CPT_SDK_SUPPORTS_WEAK 0
#endif

#if CPT_SDK_SUPPORTS_WEAK
# define __cpt_weak        __weak
# define cpt_weak_property weak
#else
# if __clang__ && (__clang_major__ >= 3)
#  define __cpt_weak __unsafe_unretained
# else
#  define __cpt_weak
# endif
# define cpt_weak_property assign
#endif

NS_INLINE NSString * urlEscapeStringWithEncoding(NSString * unencodedString, NSStringEncoding encoding)
{
  return CFBridgingRelease
  (CFURLCreateStringByAddingPercentEscapes
   (NULL,
    (__bridge CFStringRef)unencodedString, NULL,
    (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",
    CFStringConvertNSStringEncodingToEncoding(encoding)
    )
   );
}

NS_INLINE NSString * urlEscapeString(NSString * unencodedString)
{ return urlEscapeStringWithEncoding(unencodedString, NSUTF8StringEncoding); }


text:
#define LOG_TAG "SurfaceTexture"

#include <stdio.h>

#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

#include <gui/GLConsumer.h>
#include <gui/Surface.h>

#include "core_jni_helpers.h"

#include <utils/Log.h>
#include <utils/misc.h>

#include "jni.h"
#include "JNIHelp.h"

// ----------------------------------------------------------------------------

#define EGL_PROTECTED_CONTENT_EXT 0x32C0

namespace android {

static const char* const OutOfResourcesException =
    "android/view/Surface$OutOfResourcesException";
static const char* const IllegalStateException = "java/lang/IllegalStateException";
const char* const kSurfaceTextureClassPathName = "android/graphics/SurfaceTexture";

struct fields_t {
    jfieldID  surfaceTexture;
    jfieldID  producer;
    jfieldID  frameAvailableListener;
    jmethodID postEvent;
};
static fields_t fields;

// Get an ID that's unique within this process.
static int32_t createProcessUniqueId() {
    static volatile int32_t globalCounter = 0;
    return android_atomic_inc(&globalCounter);
}

// Check whether the current EGL context is protected.
static bool isProtectedContext() {
    EGLDisplay dpy = eglGetCurrentDisplay();
    EGLContext ctx = eglGetCurrentContext();

    if (dpy == EGL_NO_DISPLAY || ctx == EGL_NO_CONTEXT) {
        return false;
    }

    EGLint isProtected = EGL_FALSE;
    eglQueryContext(dpy, ctx, EGL_PROTECTED_CONTENT_EXT, &isProtected);

    return isProtected;
}

// ----------------------------------------------------------------------------

static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz,
        const sp<GLConsumer>& surfaceTexture)
{
    GLConsumer* const p =
        (GLConsumer*)env->GetLongField(thiz, fields.surfaceTexture);
    if (surfaceTexture.get()) {
        surfaceTexture->incStrong((void*)SurfaceTexture_setSurfaceTexture);
    }
    if (p) {
        p->decStrong((void*)SurfaceTexture_setSurfaceTexture);
    }
    env->SetLongField(thiz, fields.surfaceTexture, (jlong)surfaceTexture.get());
}

static void SurfaceTexture_setProducer(JNIEnv* env, jobject thiz,
        const sp<IGraphicBufferProducer>& producer)
{
    IGraphicBufferProducer* const p =
        (IGraphicBufferProducer*)env->GetLongField(thiz, fields.producer);
    if (producer.get()) {
        producer->incStrong((void*)SurfaceTexture_setProducer);
    }
    if (p) {
        p->decStrong((void*)SurfaceTexture_setProducer);
    }
    env->SetLongField(thiz, fields.producer, (jlong)producer.get());
}

static void SurfaceTexture_setFrameAvailableListener(JNIEnv* env,
        jobject thiz, sp<GLConsumer::FrameAvailableListener> listener)
{
    GLConsumer::FrameAvailableListener* const p =
        (GLConsumer::FrameAvailableListener*)
            env->GetLongField(thiz, fields.frameAvailableListener);
    if (listener.get()) {
        listener->incStrong((void*)SurfaceTexture_setSurfaceTexture);
    }
    if (p) {
        p->decStrong((void*)SurfaceTexture_setSurfaceTexture);
    }
    env->SetLongField(thiz, fields.frameAvailableListener, (jlong)listener.get());
}

sp<GLConsumer> SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz) {
    return (GLConsumer*)env->GetLongField(thiz, fields.surfaceTexture);
}

sp<IGraphicBufferProducer> SurfaceTexture_getProducer(JNIEnv* env, jobject thiz) {
    return (IGraphicBufferProducer*)env->GetLongField(thiz, fields.producer);
}

sp<ANativeWindow> android_SurfaceTexture_getNativeWindow(JNIEnv* env, jobject thiz) {
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    sp<IGraphicBufferProducer> producer(SurfaceTexture_getProducer(env, thiz));
    sp<Surface> surfaceTextureClient(surfaceTexture != NULL ? new Surface(producer) : NULL);
    return surfaceTextureClient;
}

bool android_SurfaceTexture_isInstanceOf(JNIEnv* env, jobject thiz) {
    jclass surfaceTextureClass = env->FindClass(kSurfaceTextureClassPathName);
    return env->IsInstanceOf(thiz, surfaceTextureClass);
}

// ----------------------------------------------------------------------------

class JNISurfaceTextureContext : public GLConsumer::FrameAvailableListener
{
public:
    JNISurfaceTextureContext(JNIEnv* env, jobject weakThiz, jclass clazz);
    virtual ~JNISurfaceTextureContext();
    virtual void onFrameAvailable(const BufferItem& item);

private:
    static JNIEnv* getJNIEnv(bool* needsDetach);
    static void detachJNI();

    jobject mWeakThiz;
    jclass mClazz;
};

JNISurfaceTextureContext::JNISurfaceTextureContext(JNIEnv* env,
        jobject weakThiz, jclass clazz) :
    mWeakThiz(env->NewGlobalRef(weakThiz)),
    mClazz((jclass)env->NewGlobalRef(clazz))
{}

JNIEnv* JNISurfaceTextureContext::getJNIEnv(bool* needsDetach) {
    *needsDetach = false;
    JNIEnv* env = AndroidRuntime::getJNIEnv();
    if (env == NULL) {
        JavaVMAttachArgs args = {
            JNI_VERSION_1_4, "JNISurfaceTextureContext", NULL };
        JavaVM* vm = AndroidRuntime::getJavaVM();
        int result = vm->AttachCurrentThread(&env, (void*) &args);
        if (result != JNI_OK) {
            ALOGE("thread attach failed: %#x", result);
            return NULL;
        }
        *needsDetach = true;
    }
    return env;
}

void JNISurfaceTextureContext::detachJNI() {
    JavaVM* vm = AndroidRuntime::getJavaVM();
    int result = vm->DetachCurrentThread();
    if (result != JNI_OK) {
        ALOGE("thread detach failed: %#x", result);
    }
}

JNISurfaceTextureContext::~JNISurfaceTextureContext()
{
    bool needsDetach = false;
    JNIEnv* env = getJNIEnv(&needsDetach);
    if (env != NULL) {
        env->DeleteGlobalRef(mWeakThiz);
        env->DeleteGlobalRef(mClazz);
    } else {
        ALOGW("leaking JNI object references");
    }
    if (needsDetach) {
        detachJNI();
    }
}

void JNISurfaceTextureContext::onFrameAvailable(const BufferItem& /* item */)
{
    bool needsDetach = false;
    JNIEnv* env = getJNIEnv(&needsDetach);
    if (env != NULL) {
        env->CallStaticVoidMethod(mClazz, fields.postEvent, mWeakThiz);
    } else {
        ALOGW("onFrameAvailable event will not posted");
    }
    if (needsDetach) {
        detachJNI();
    }
}

// ----------------------------------------------------------------------------

#define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture"
#define ANDROID_GRAPHICS_PRODUCER_JNI_ID "mProducer"
#define ANDROID_GRAPHICS_FRAMEAVAILABLELISTENER_JNI_ID \
                                         "mFrameAvailableListener"

static void SurfaceTexture_classInit(JNIEnv* env, jclass clazz)
{
    fields.surfaceTexture = env->GetFieldID(clazz,
            ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID, "J");
    if (fields.surfaceTexture == NULL) {
        ALOGE("can't find android/graphics/SurfaceTexture.%s",
                ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID);
    }
    fields.producer = env->GetFieldID(clazz,
            ANDROID_GRAPHICS_PRODUCER_JNI_ID, "J");
    if (fields.producer == NULL) {
        ALOGE("can't find android/graphics/SurfaceTexture.%s",
                ANDROID_GRAPHICS_PRODUCER_JNI_ID);
    }
    fields.frameAvailableListener = env->GetFieldID(clazz,
            ANDROID_GRAPHICS_FRAMEAVAILABLELISTENER_JNI_ID, "J");
    if (fields.frameAvailableListener == NULL) {
        ALOGE("can't find android/graphics/SurfaceTexture.%s",
                ANDROID_GRAPHICS_FRAMEAVAILABLELISTENER_JNI_ID);
    }

    fields.postEvent = env->GetStaticMethodID(clazz, "postEventFromNative",
            "(Ljava/lang/ref/WeakReference;)V");
    if (fields.postEvent == NULL) {
        ALOGE("can't find android/graphics/SurfaceTexture.postEventFromNative");
    }
}

static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jboolean isDetached,
        jint texName, jboolean singleBufferMode, jobject weakThiz)
{
    sp<IGraphicBufferProducer> producer;
    sp<IGraphicBufferConsumer> consumer;
    BufferQueue::createBufferQueue(&producer, &consumer);

    if (singleBufferMode) {
        consumer->setMaxBufferCount(1);
    }

    sp<GLConsumer> surfaceTexture;
    if (isDetached) {
        surfaceTexture = new GLConsumer(consumer, GL_TEXTURE_EXTERNAL_OES,
                true, !singleBufferMode);
    } else {
        surfaceTexture = new GLConsumer(consumer, texName,
                GL_TEXTURE_EXTERNAL_OES, true, !singleBufferMode);
    }

    if (surfaceTexture == 0) {
        jniThrowException(env, OutOfResourcesException,
                "Unable to create native SurfaceTexture");
        return;
    }
    surfaceTexture->setName(String8::format("SurfaceTexture-%d-%d-%d",
            (isDetached ? 0 : texName),
            getpid(),
            createProcessUniqueId()));

    // If the current context is protected, inform the producer.
    if (isProtectedContext()) {
        consumer->setConsumerUsageBits(GRALLOC_USAGE_PROTECTED);
    }

    SurfaceTexture_setSurfaceTexture(env, thiz, surfaceTexture);
    SurfaceTexture_setProducer(env, thiz, producer);

    jclass clazz = env->GetObjectClass(thiz);
    if (clazz == NULL) {
        jniThrowRuntimeException(env,
                "Can't find android/graphics/SurfaceTexture");
        return;
    }

    sp<JNISurfaceTextureContext> ctx(new JNISurfaceTextureContext(env, weakThiz,
            clazz));
    surfaceTexture->setFrameAvailableListener(ctx);
    SurfaceTexture_setFrameAvailableListener(env, thiz, ctx);
}

static void SurfaceTexture_finalize(JNIEnv* env, jobject thiz)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    surfaceTexture->setFrameAvailableListener(0);
    SurfaceTexture_setFrameAvailableListener(env, thiz, 0);
    SurfaceTexture_setSurfaceTexture(env, thiz, 0);
    SurfaceTexture_setProducer(env, thiz, 0);
}

static void SurfaceTexture_setDefaultBufferSize(
        JNIEnv* env, jobject thiz, jint width, jint height) {
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    surfaceTexture->setDefaultBufferSize(width, height);
}

static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    status_t err = surfaceTexture->updateTexImage();
    if (err == INVALID_OPERATION) {
        jniThrowException(env, IllegalStateException, "Unable to update texture contents (see "
                "logcat for details)");
    } else if (err < 0) {
        jniThrowRuntimeException(env, "Error during updateTexImage (see logcat for details)");
    }
}

static void SurfaceTexture_releaseTexImage(JNIEnv* env, jobject thiz)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    status_t err = surfaceTexture->releaseTexImage();
    if (err == INVALID_OPERATION) {
        jniThrowException(env, IllegalStateException, "Unable to release texture contents (see "
                "logcat for details)");
    } else if (err < 0) {
        jniThrowRuntimeException(env, "Error during updateTexImage (see logcat for details)");
    }
}

static jint SurfaceTexture_detachFromGLContext(JNIEnv* env, jobject thiz)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    return surfaceTexture->detachFromContext();
}

static jint SurfaceTexture_attachToGLContext(JNIEnv* env, jobject thiz, jint tex)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    return surfaceTexture->attachToContext((GLuint)tex);
}

static void SurfaceTexture_getTransformMatrix(JNIEnv* env, jobject thiz,
        jfloatArray jmtx)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    float* mtx = env->GetFloatArrayElements(jmtx, NULL);
    surfaceTexture->getTransformMatrix(mtx);
    env->ReleaseFloatArrayElements(jmtx, mtx, 0);
}

static jlong SurfaceTexture_getTimestamp(JNIEnv* env, jobject thiz)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    return surfaceTexture->getTimestamp();
}

static void SurfaceTexture_release(JNIEnv* env, jobject thiz)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    surfaceTexture->abandon();
}

static jboolean SurfaceTexture_isReleased(JNIEnv* env, jobject thiz)
{
    sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz));
    return surfaceTexture->isAbandoned();
}

// ----------------------------------------------------------------------------

static const JNINativeMethod gSurfaceTextureMethods[] = {
    {"nativeClassInit",            "()V",   (void*)SurfaceTexture_classInit },
    {"nativeInit",                 "(ZIZLjava/lang/ref/WeakReference;)V", (void*)SurfaceTexture_init },
    {"nativeFinalize",             "()V",   (void*)SurfaceTexture_finalize },
    {"nativeSetDefaultBufferSize", "(II)V", (void*)SurfaceTexture_setDefaultBufferSize },
    {"nativeUpdateTexImage",       "()V",   (void*)SurfaceTexture_updateTexImage },
    {"nativeReleaseTexImage",      "()V",   (void*)SurfaceTexture_releaseTexImage },
    {"nativeDetachFromGLContext",  "()I",   (void*)SurfaceTexture_detachFromGLContext },
    {"nativeAttachToGLContext",    "(I)I",   (void*)SurfaceTexture_attachToGLContext },
    {"nativeGetTransformMatrix",   "([F)V", (void*)SurfaceTexture_getTransformMatrix },
    {"nativeGetTimestamp",         "()J",   (void*)SurfaceTexture_getTimestamp },
    {"nativeRelease",              "()V",   (void*)SurfaceTexture_release },
    {"nativeIsReleased",           "()Z",   (void*)SurfaceTexture_isReleased },
};

int register_android_graphics_SurfaceTexture(JNIEnv* env)
{
    return RegisterMethodsOrDie(env, kSurfaceTextureClassPathName, gSurfaceTextureMethods,
                                NELEM(gSurfaceTextureMethods));
}

} // namespace android