text:
/*
 * image.cpp
 *
 *  Created on: Mar 23, 2013
 *      Author: fanl
 */

#include "image.h"
#include <cerrno>
#include <CImg.h>
#include <iostream>

using namespace cimg_library;
using namespace std;

image::image()
{
	img = NULL;
}

image::~image()
{
	if (img) delete img;
}

void image::load(const char* path_to_image)
{
	img = new CImg<unsigned char>(path_to_image);

	cout << "Image Width: " << img->width() << endl;
	cout << "Image Height: " << img->height() << endl;
	cout << "Image Depth: " << img->depth() << endl;
}

void image::check()
{
	if (!img)
	{
		cout << "Bad usage of class image";
		exit(-1);
	}
}

void image::display(const char * title)
{
	img->display(title);
}

void image::merge()
{
	if (img->depth() > 1)
	{
		cout << "Merging Channels..." << endl;
		CImg<unsigned char> original_img(*img);
		delete img;
		img = new CImg<unsigned char>(original_img.width(), original_img.height(), 1, 1, 0);
		*img = original_img.RGBtoHSI().get_channel(2);
	}
}

void image::create_icon_from_alpha()
{
	check();

	cout << "Getting Icon from Alpha Channel" << endl;

	CImg<unsigned char> white(img->width(),img->height(), 1, 1, 255);

	CImg<unsigned char> render(img->width(),img->height(), 1, 1);
	render.fill(0);
	render.draw_image(0,0,0,0, white, img->channel(img->depth()), 1, 255);

	delete img;
	img = new CImg<unsigned char>(render.width(), render.height(), 1, 1, 0);
	*img = render;
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef _VKTBINDINGDESCRIPTORBUFFERTESTS_HPP
#define _VKTBINDINGDESCRIPTORBUFFERTESTS_HPP
/*!
 * \file vktBindingDescriptorBufferTests.hpp
 * \brief Descriptor buffer (extension) tests
 *//*--------------------------------------------------------------------*/

#include "tcuDefs.hpp"
#include "tcuTestCase.hpp"
#include "vktTestCase.hpp"

namespace vkt
{
namespace BindingModel
{

tcu::TestCaseGroup*	createDescriptorBufferTests	(tcu::TestContext& testCtx);

} // BindingModel
} // vkt

#endif // _VKTBINDINGDESCRIPTORBUFFERTESTS_HPP


text:
package se.arbetsformedlingen.venice.model;

import org.junit.Ignore;
import org.junit.Test;

import java.time.LocalDateTime;

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

public class TimeValueTest {

    @Test
    public void normalize_event_date_to_specific_hour() {
        LocalDateTime eventTime = LocalDateTime.parse("2017-09-21T10:32:00");
        TimeSeriesValue timeSeriesValue = new TimeSeriesValue(eventTime, 4711);

        assertThat(timeSeriesValue.getTime().getHour()).isEqualTo(10);
        assertThat(timeSeriesValue.getTime().getMinute()).isEqualTo(0);
        assertThat(timeSeriesValue.getValue()).isEqualTo(4711);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_bluetooth"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.projecttango.examples.java.helloareadescription.BluetoothChatService">

</RelativeLayout>


text:
var detachingNodes = [];
var debouncedCount = 0;

module.exports = {
    init: function () {
        if (FIRE_EDITOR) {
            Fire.engine.on('post-update', this._debounceNodeEvent);
        }
    },

    // assert(node)
    onNodeAttachedToParent: function (node) {
        if (FIRE_EDITOR) {
            var uuid = Fire(node).uuid;
            if (!uuid) {
                return;
            }
            var index = detachingNodes.lastIndexOf(uuid);
            if (index !== -1) {
                // debounce
                if (index === detachingNodes.length - 1) {
                    --detachingNodes.length;
                }
                else {
                    detachingNodes[index] = null;
                    ++debouncedCount;
                }
            }
            else {
                // new node
                Fire.engine.emit('node-attach-to-scene', {
                    targetN: node
                });
            }
        }
    },

    // assert(node)
    onNodeDetachedFromParent: function (node) {
        if (FIRE_EDITOR) {
            var uuid = Fire(node).uuid;
            if (!uuid) {
                return;
            }
            detachingNodes.push(uuid);
        }
    },

    _debounceNodeEvent: function () {
        if (FIRE_EDITOR) {
            if (detachingNodes.length > debouncedCount) {
                for (var i = 0, len = detachingNodes.length; i < len; ++i) {
                    var id = detachingNodes[i];
                    if (id) {
                        var wrapper = Fire.engine.attachedWrappers[id];
                        if (wrapper && wrapper.targetN) {
                            Fire.engine.emit('node-detach-from-scene', {
                                targetN: wrapper.targetN
                            });
                        }
                        else {
                            Editor.error("Failed to get last frame's node to detach, " +
                                         wrapper ? "target node not exists." : "wrapper not attached.");
                        }
                    }
                }
            }
            detachingNodes.length = 0;
            debouncedCount = 0;
        }
    }
};


text:
using System;

using WatchKit;
using Foundation;
using CoreLocation;

namespace WatchSpeedExt
{

	public partial class InterfaceController : WKInterfaceController
	{
		NSTimer timer;

		readonly NSString statusKey = new NSString("status");

		readonly NSString speedKey = new NSString("speed");

		readonly NSString speedUnitKey = new NSString("speedUnit");

		readonly NSString courseCardinalKey = new NSString("courseCardinal");

		readonly NSString courseDegreesKey = new NSString("courseDegrees");

		readonly NSString northUnitKey = new NSString("northUnit");

		public InterfaceController (IntPtr handle) : base (handle)
		{
		}

		public override void Awake (NSObject context)
		{
			base.Awake (context);

			timer = NSTimer.CreateRepeatingScheduledTimer (1, UpdateUserInterface);

			UpdateUserInterface (timer);

			// Configure interface objects here.
			Console.WriteLine ("{0} awake with context", this);
		}

		public override void WillActivate ()
		{
			// This method is called when the watch view controller is about to be visible to the user.
			Console.WriteLine ("{0} will activate", this);
		}

		public override void DidDeactivate ()
		{
			// This method is called when the watch view controller is no longer visible to the user.
			Console.WriteLine ("{0} did deactivate", this);
		}

		void UpdateUserInterface (NSTimer t)
		{
			WKInterfaceController.OpenParentApplication (new NSDictionary(), (replyInfo, error) => {
				if (error != null) {
					Console.WriteLine (error);
					return;
				}

				var status = (CLAuthorizationStatus)((NSNumber)replyInfo[statusKey]).UInt32Value;

				switch (status) {

					case CLAuthorizationStatus.AuthorizedAlways:

						var speedValue = replyInfo[speedKey].ToString ();
						var speedUnitValue = replyInfo[speedUnitKey].ToString ();
						var courseCardinalValue = replyInfo[courseCardinalKey].ToString ();
						var courseDegreesValue = replyInfo[courseDegreesKey].ToString ();
						var northUnitValue = replyInfo[northUnitKey].ToString ();

						updateSpeed (speedValue, speedUnitValue);
						updateCourse (courseCardinalValue, courseDegreesValue, northUnitValue);

						break;

					case CLAuthorizationStatus.NotDetermined:
					case CLAuthorizationStatus.Denied:

						displayLocationServicesError ();

						break;

					default:
						throw new NotImplementedException();
				}
			});
		}

		void updateSpeed (string speed, string unit)
		{
			SpeedValueLabel.SetText (speed);
			SpeedUnitLabel.SetText (unit);
		}

		void updateCourse (string cardinal, string degrees, string north, bool locationDisabled = false)
		{
			CogValueCardinalLabel.SetText (cardinal);
			CogValueDegreeLabel.SetText (degrees);

			NorthValueLabel.SetText (north);

			CogLabel.SetText (locationDisabled ? "Location Unavailable" : "COG");
		}

		void displayLocationServicesError ()
		{
			updateSpeed ("--", string.Empty);

			updateCourse (string.Empty, string.Empty, string.Empty, true);
		}
	}
}


text:
package hudson.node_monitors;

import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.HudsonTestCase;
import hudson.slaves.DumbSlave;
import hudson.slaves.SlaveComputer;
import hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace;

/**
 * @author Kohsuke Kawaguchi
 */
public class DiskSpaceMonitorDescriptorTest extends HudsonTestCase {
    /**
     * Makes sure that it returns some value.
     */
    @Bug(3381)
    public void testRemoteDiskSpaceUsage() throws Exception {
        DumbSlave s = createSlave();
        SlaveComputer c = s.getComputer();
        c.connect(false).get(); // wait until it's connected
        if(c.isOffline())
            fail("Slave failed to go online: "+c.getLog());

        DiskSpace du = TemporarySpaceMonitor.DESCRIPTOR.monitor(c);
        du.toHtml();
        assertTrue(du.size>0);
    }
}


text:
package org.frameworkset.event;

/**
 *
 *
Title: ResourceChangeEventTypeImpl.java

 *
 *
Description:

 *
 *
Copyright (c) 2009

 *
 *
bboss workgroup

 * @Date May 17, 2009
 * @author biaoping.yin
 * @version 1.0
 */
public class ResourceChangeEventTypeImpl extends AbstractEventType implements ResourceChangeEventType {
	public ResourceChangeEventTypeImpl()
	{

	}

	public ResourceChangeEventTypeImpl(String eventtype)
	{
		this.eventtype = eventtype;
	}

}


text:
NSString * const kGTLRAuthScopePubsub              = @"https://www.googleapis.com/auth/pubsub";
NSString * const kGTLRAuthScopePubsubCloudPlatform = @"https://www.googleapis.com/auth/cloud-platform";

// ----------------------------------------------------------------------------
//   GTLRPubsubService
//

@implementation GTLRPubsubService

- (instancetype)init {
  self = [super init];
  if (self) {
    // From discovery.
    self.rootURLString = @"https://pubsub.googleapis.com/";
    self.batchPath = @"batch";
    self.prettyPrintQueryParameterNames = @[ @"prettyPrint" ];
  }
  return self;
}

@end


text:
package com.canoo.platform.remoting.server.spring;

import com.canoo.dp.impl.remoting.server.spring.RemotingSpringBeanFactory;
import com.canoo.platform.server.spring.EnableDolphinPlatform;
import org.apiguardian.api.API;
import org.springframework.context.annotation.Import;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static org.apiguardian.api.API.Status.MAINTAINED;

@Import({RemotingSpringBeanFactory.class})
@Documented
@Target({TYPE})
@Retention(RUNTIME)
@EnableDolphinPlatform
@API(since = "0.x", status = MAINTAINED)
public @interface EnableRemoting {

}


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class ServerInfos : NetworkBehaviour {

	[SerializeField]
	[SyncVar]
	private int playerCount = 0;

	[SerializeField]
	[SyncVar]
	private SyncListString playerList;

	void Awake(){
		playerList = new SyncListString();
		Debug.Log("Awake!");
		name = "ServerInfos";
	}

	void Update(){
		//Debug.Log("Hello!" + gameObject);
	}

	public void NewPlayer(string name){
		if(playerList == null){
			playerList = new SyncListString();
		}
		playerList.Add(name);
		playerCount = playerList.Count;
	}

	public SyncListString getPlayerList(){
		return playerList;
	}
}


text:
// SymbolSet.cs
// Script#/Core/Compiler
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Text;
using System.Xml;
using ScriptSharp.CodeModel;

namespace ScriptSharp.ScriptModel {

    internal sealed class SymbolSet : ISymbolTable {

        private List<NamespaceSymbol> _namespaces;
        private Dictionary<string, NamespaceSymbol> _namespaceMap;
        private NamespaceSymbol _systemNamespace;
        private NamespaceSymbol _globalNamespace;

        private Dictionary<string, TypeSymbol> _arrayTypeTable;
        private Dictionary<string, TypeSymbol> _genericTypeTable;

        private MemberSymbol _entryPoint;
        private string _scriptName;
        private List<ScriptReference> _dependencies;
        private Dictionary<string, ScriptReference> _dependencySet;

        private Dictionary<string, Dictionary<string, ResXItem>> _resources;

        private XmlDocument _docComments;

        public SymbolSet() {
            _namespaces = new List<NamespaceSymbol>();
            _namespaceMap = new Dictionary<string, NamespaceSymbol>();

            _globalNamespace = new NamespaceSymbol(String.Empty, this);
            _globalNamespace.SetTransformedName(String.Empty);
            _namespaces.Add(_globalNamespace);
            _namespaceMap[String.Empty] = _globalNamespace;

            _systemNamespace = new NamespaceSymbol("System", this);
            _namespaces.Add(_systemNamespace);
            _namespaceMap["System"] = _systemNamespace;

            _dependencies = new List<ScriptReference>();
            _dependencySet = new Dictionary<string, ScriptReference>(StringComparer.Ordinal);
            _resources = new Dictionary<string, Dictionary<string, ResXItem>>(StringComparer.OrdinalIgnoreCase);
        }

        public IEnumerable<ScriptReference> Dependencies {
            get {
                return _dependencies;
            }
        }

        public MemberSymbol EntryPoint {
            get {
                return _entryPoint;
            }
        }

        public NamespaceSymbol GlobalNamespace {
            get {
                return _globalNamespace;
            }
        }

        public bool HasResources {
            get {
                return _resources.Count != 0;
            }
        }

        public ICollection<NamespaceSymbol> Namespaces {
            get {
                return _namespaces;
            }
        }

        public string ScriptName {
            get {
                return _scriptName;
            }
            set {
                _scriptName = value;
            }
        }

        public NamespaceSymbol SystemNamespace {
            get {
                return _systemNamespace;
            }
        }

        public void AddDependency(ScriptReference dependency) {
            ScriptReference existingDependency;
            if (_dependencySet.TryGetValue(dependency.Name, out existingDependency)) {
                // The dependency already exists ... copy over identifier
                // from the new one to the existing one.

                // This is to support the scenario where a dependency got defined
                // by virtue of the app using a [ScriptReference] to specify path/delayLoad
                // semnatics, and we're finding the imported dependency later on
                // such as when a type with a dependency is referred in the code.

                if ((existingDependency.HasIdentifier == false) &&
                    dependency.HasIdentifier) {
                    existingDependency.Identifier = dependency.Identifier;
                }
            }
            else {
                _dependencies.Add(dependency);
                _dependencySet[dependency.Name] = dependency;
            }
        }

        public TypeSymbol CreateArrayTypeSymbol(TypeSymbol itemTypeSymbol) {
            if ((_arrayTypeTable != null) && (_arrayTypeTable.ContainsKey(itemTypeSymbol.FullName))) {
                return _arrayTypeTable[itemTypeSymbol.FullName];
            }
            else {
                TypeSymbol specificArrayTypeSymbol = CreateArrayTypeCore(itemTypeSymbol);

                if (_arrayTypeTable == null) {
                    _arrayTypeTable = new Dictionary<string, TypeSymbol>();
                }
                _arrayTypeTable[itemTypeSymbol.FullName] = specificArrayTypeSymbol;

                return specificArrayTypeSymbol;
            }
        }

        private TypeSymbol CreateArrayTypeCore(TypeSymbol itemTypeSymbol) {
            TypeSymbol arrayTypeSymbol =
                (TypeSymbol)((ISymbolTable)_systemNamespace).FindSymbol("Array", null, SymbolFilter.Types);
            Debug.Assert(arrayTypeSymbol != null);

            TypeSymbol specificArrayTypeSymbol = new ClassSymbol("Array", _systemNamespace);
            foreach (MemberSymbol memberSymbol in arrayTypeSymbol.Members) {
                specificArrayTypeSymbol.AddMember(memberSymbol);
            }

            IndexerSymbol indexerSymbol = new IndexerSymbol(specificArrayTypeSymbol, itemTypeSymbol,
                                                            MemberVisibility.Public);
            indexerSymbol.SetScriptIndexer();
            specificArrayTypeSymbol.AddMember(indexerSymbol);
            specificArrayTypeSymbol.SetIgnoreNamespace();
            specificArrayTypeSymbol.SetArray();

            return specificArrayTypeSymbol;
        }

        private MemberSymbol CreateGenericMember(MemberSymbol templateMember, IList<TypeSymbol> typeArguments) {
            TypeSymbol parentType = (TypeSymbol)templateMember.Parent;
            TypeSymbol instanceAssociatedType;

            if (templateMember.AssociatedType.Type == SymbolType.GenericParameter) {
                GenericParameterSymbol genericParameter = (GenericParameterSymbol)templateMember.AssociatedType;
                instanceAssociatedType = typeArguments[genericParameter.Index];
            }
            else {
                instanceAssociatedType = typeArguments[0];
            }

            if (templateMember.Type == SymbolType.Indexer) {
                IndexerSymbol templateIndexer = (IndexerSymbol)templateMember;
                IndexerSymbol instanceIndexer = new IndexerSymbol(parentType, instanceAssociatedType);

                if (templateIndexer.UseScriptIndexer) {
                    instanceIndexer.SetScriptIndexer();
                }
                instanceIndexer.SetVisibility(templateIndexer.Visibility);

                return instanceIndexer;
            }
            else if (templateMember.Type == SymbolType.Property) {
                PropertySymbol templateProperty = (PropertySymbol)templateMember;
                PropertySymbol instanceProperty = new PropertySymbol(templateProperty.Name, parentType, instanceAssociatedType);

                if (templateProperty.IsTransformed) {
                    instanceProperty.SetTransformedName(templateProperty.GeneratedName);
                }
                instanceProperty.SetNameCasing(templateProperty.IsCasePreserved);
                instanceProperty.SetVisibility(templateProperty.Visibility);

                return instanceProperty;
            }
            else if (templateMember.Type == SymbolType.Field) {
                FieldSymbol templateField = (FieldSymbol)templateMember;
                FieldSymbol instanceField = new FieldSymbol(templateField.Name, parentType, instanceAssociatedType);

                if (templateField.IsTransformed) {
                    instanceField.SetTransformedName(templateField.GeneratedName);
                }
                instanceField.SetNameCasing(templateField.IsCasePreserved);
                instanceField.SetVisibility(templateField.Visibility);

                return instanceField;
            }
            else if (templateMember.Type == SymbolType.Method) {
                MethodSymbol templateMethod = (MethodSymbol)templateMember;
                MethodSymbol instanceMethod = new MethodSymbol(templateMethod.Name, parentType, instanceAssociatedType);

                if (templateMethod.IsAliased) {
                    instanceMethod.SetAlias(templateMethod.Alias);
                }
                else if (templateMethod.IsTransformed) {
                    instanceMethod.SetTransformedName(templateMethod.GeneratedName);
                }
                if (templateMethod.SkipGeneration) {
                    instanceMethod.SetSkipGeneration();
                }
                if (templateMethod.InterfaceMember != null) {
                    instanceMethod.SetInterfaceMember(templateMethod.InterfaceMember);
                }
                instanceMethod.SetNameCasing(templateMethod.IsCasePreserved);
                instanceMethod.SetVisibility(templateMethod.Visibility);

                return instanceMethod;
            }

            Debug.Fail("Unexpected generic member '" + templateMember.Name + " on type '" + ((TypeSymbol)templateMember.Parent).FullName + "'.");
            return null;
        }

        public TypeSymbol CreateGenericTypeSymbol(TypeSymbol templateType, IList<TypeSymbol> typeArguments) {
            foreach (TypeSymbol typeSymbol in typeArguments) {
                if (typeSymbol.Type == SymbolType.GenericParameter) {
                    return templateType;
                }
            }

            StringBuilder keyBuilder = new StringBuilder(templateType.FullName);
            foreach (TypeSymbol typeSymbol in typeArguments) {
                keyBuilder.Append("+");
                keyBuilder.Append(typeSymbol.FullName);
            }

            string key = keyBuilder.ToString();

            if ((_genericTypeTable != null) && (_genericTypeTable.ContainsKey(key))) {
                return _genericTypeTable[key];
            }
            else {
                if (_genericTypeTable == null) {
                    _genericTypeTable = new Dictionary<string, TypeSymbol>();
                }

                // Prepopulate with a placeholder ... if a generic type's member refers to its
                // parent type it will use the type being created when the return value is null.
                _genericTypeTable[key] = null;

                TypeSymbol instanceTypeSymbol = CreateGenericTypeCore(templateType, typeArguments);
                _genericTypeTable[key] = instanceTypeSymbol;

                return instanceTypeSymbol;
            }
        }

        private TypeSymbol CreateGenericTypeCore(TypeSymbol templateType, IList<TypeSymbol> typeArguments) {
            if (templateType.Type == SymbolType.Class) {
                ClassSymbol genericClass = (ClassSymbol)templateType;
                ClassSymbol instanceClass = new ClassSymbol(genericClass.Name, (NamespaceSymbol)genericClass.Parent);
                instanceClass.SetInheritance(genericClass.BaseClass, genericClass.Interfaces);
                instanceClass.SetImported(genericClass.Dependency);
                if (genericClass.IgnoreNamespace) {
                    instanceClass.SetIgnoreNamespace();
                }
                instanceClass.ScriptNamespace = genericClass.ScriptNamespace;
                if (genericClass.IsTransformed) {
                    instanceClass.SetTransformedName(genericClass.GeneratedName);
                }
                else if (genericClass.IsTransformAllowed == false) {
                    instanceClass.DisableNameTransformation();
                }
                if (genericClass.IsArray) {
                    instanceClass.SetArray();
                }

                instanceClass.AddGenericParameters(genericClass.GenericParameters);
                instanceClass.AddGenericArguments(genericClass, typeArguments);

                CreateGenericTypeMembers(genericClass, instanceClass, typeArguments);

                return instanceClass;
            }
            else if (templateType.Type == SymbolType.Interface) {
                InterfaceSymbol genericInterface = (InterfaceSymbol)templateType;
                InterfaceSymbol instanceInterface = new InterfaceSymbol(genericInterface.Name, (NamespaceSymbol)genericInterface.Parent);

                instanceInterface.SetImported(genericInterface.Dependency);
                if (genericInterface.IgnoreNamespace) {
                    instanceInterface.SetIgnoreNamespace();
                }
                if (genericInterface.IsTransformed) {
                    instanceInterface.SetTransformedName(genericInterface.GeneratedName);
                }
                else if (genericInterface.IsTransformAllowed == false) {
                    instanceInterface.DisableNameTransformation();
                }

                instanceInterface.AddGenericParameters(genericInterface.GenericParameters);
                instanceInterface.AddGenericArguments(genericInterface, typeArguments);

                CreateGenericTypeMembers(genericInterface, instanceInterface, typeArguments);

                return instanceInterface;
            }
            else if (templateType.Type == SymbolType.Delegate) {
                DelegateSymbol genericDelegate = (DelegateSymbol)templateType;
                DelegateSymbol instanceDelegate = new DelegateSymbol(genericDelegate.Name, (NamespaceSymbol)genericDelegate.Parent);

                instanceDelegate.AddGenericParameters(genericDelegate.GenericParameters);
                instanceDelegate.AddGenericArguments(genericDelegate, typeArguments);

                CreateGenericTypeMembers(genericDelegate, instanceDelegate, typeArguments);

                return instanceDelegate;
            }

            return null;
        }

        private void CreateGenericTypeMembers(TypeSymbol templateType, TypeSymbol instanceType, IList<TypeSymbol> typeArguments) {
            foreach (MemberSymbol memberSymbol in templateType.Members) {
                if ((memberSymbol.AssociatedType.Type == SymbolType.GenericParameter) &&
                    ((GenericParameterSymbol)memberSymbol.AssociatedType).IsTypeParameter) {
                    MemberSymbol instanceMemberSymbol = CreateGenericMember(memberSymbol, typeArguments);
                    instanceType.AddMember(instanceMemberSymbol);
                }
                else if (memberSymbol.AssociatedType.IsGeneric &&
                         (memberSymbol.AssociatedType.GenericArguments == null) &&
                         (memberSymbol.AssociatedType.GenericParameters.Count == typeArguments.Count)) {
                    TypeSymbol genericType = CreateGenericTypeSymbol(memberSymbol.AssociatedType, typeArguments);
                    if (genericType == null) {
                        genericType = instanceType;
                    }
                    List<TypeSymbol> memberTypeArgs = new List<TypeSymbol>() { genericType };

                    MemberSymbol instanceMemberSymbol = CreateGenericMember(memberSymbol, memberTypeArgs);
                    instanceType.AddMember(instanceMemberSymbol);
                }
                else {
                    instanceType.AddMember(memberSymbol);
                }
            }

            IndexerSymbol indexer = null;

            if (templateType.Type == SymbolType.Class) {
                indexer = ((ClassSymbol)templateType).Indexer;
            }
            else if (templateType.Type == SymbolType.Interface) {
                indexer = ((InterfaceSymbol)templateType).Indexer;
            }

            if (indexer != null) {
                if (indexer.AssociatedType.Type == SymbolType.GenericParameter) {
                    MemberSymbol instanceIndexer = CreateGenericMember(indexer, typeArguments);
                    instanceType.AddMember(instanceIndexer);
                }
                else if (indexer.AssociatedType.IsGeneric &&
                         (indexer.AssociatedType.GenericArguments == null) &&
                         (indexer.AssociatedType.GenericParameters.Count == typeArguments.Count)) {
                    TypeSymbol genericType = CreateGenericTypeSymbol(indexer.AssociatedType, typeArguments);
                    if (genericType == null) {
                        genericType = instanceType;
                    }
                    List<TypeSymbol> memberTypeArgs = new List<TypeSymbol>() { genericType };

                    MemberSymbol instanceMemberSymbol = CreateGenericMember(indexer, memberTypeArgs);
                    instanceType.AddMember(instanceMemberSymbol);
                }
                else {
                    instanceType.AddMember(indexer);
                }
            }
        }

        private void CreateNamespace(string namespaceName) {
            if (namespaceName.IndexOf('.') > 0) {
                NamespaceSymbol namespaceSymbol = new NamespaceSymbol(namespaceName, this);

                _namespaces.Add(namespaceSymbol);
                _namespaceMap[namespaceName] = namespaceSymbol;
            }
            else {
                // Split up the namespace into its individual parts, and then
                // create namespace symbols for each sub-namespace leading up
                // to the full specified namespace

                string[] namespaceParts = namespaceName.Split('.');

                for (int i = 0; i < namespaceParts.Length; i++) {
                    string partialNamespace;
                    if (i == 0) {
                        partialNamespace = namespaceParts[0];
                    }
                    else {
                        partialNamespace = String.Join(".", namespaceParts, 0, i + 1);
                    }

                    NamespaceSymbol namespaceSymbol = new NamespaceSymbol(partialNamespace, this);

                    _namespaces.Add(namespaceSymbol);
                    _namespaceMap[namespaceName] = namespaceSymbol;
                }
            }
        }

        public ScriptReference GetDependency(string name, out bool newReference) {
            newReference = false;

            ScriptReference reference;
            if (_dependencySet.TryGetValue(name, out reference) == false) {
                reference = new ScriptReference(name, null);
                newReference = true;
                AddDependency(reference);
            }
            return reference;
        }

        public NamespaceSymbol GetNamespace(string namespaceName) {
            if (_namespaceMap.ContainsKey(namespaceName) == false) {
                CreateNamespace(namespaceName);
            }

            return _namespaceMap[namespaceName];
        }

        public string GetParameterDocumentation(string id, string paramName) {
            if (_docComments != null) {
                XmlNode paramNode = _docComments.SelectSingleNode(
                    String.Format("//doc/members/member[@name='{0}']/param[@name='{1}']", id, paramName));

                if (paramNode != null) {
                    return paramNode.InnerXml;
                }
            }

            return String.Empty;
        }

        public Dictionary<string, ResXItem> GetResources(string name) {
            Debug.Assert(String.IsNullOrEmpty(name) == false);

            Dictionary<string, ResXItem> resourceTable;
            if (_resources.TryGetValue(name, out resourceTable)) {
                return resourceTable;
            }

            resourceTable = new Dictionary<string, ResXItem>(StringComparer.Ordinal);
            _resources[name] = resourceTable;

            return resourceTable;
        }

        public string GetSummaryDocumentation(string id) {
            if (_docComments != null) {
                XmlNode summaryNode = _docComments.SelectSingleNode(
                    String.Format("//doc/members/member[@name='{0}']/summary", id));

                if (summaryNode != null) {
                    return summaryNode.InnerXml;
                }
            }

            return String.Empty;
        }

        public bool IsSymbol(TypeSymbol symbol, string symbolName) {
            return (((ISymbolTable)this).FindSymbol(symbolName, null, SymbolFilter.Types) == symbol);
        }

        /// <summary>
        /// This maps C# intrinsic types (managed types that have an equivalent
        /// C# keyword)
        /// </summary>
        public TypeSymbol ResolveIntrinsicType(IntrinsicType type) {
            string mappedTypeName = null;
            string mappedNamespace = null;

            switch (type) {
                case IntrinsicType.Object:
                    mappedTypeName = "Object";
                    break;
                case IntrinsicType.Boolean:
                    mappedTypeName = "Boolean";
                    break;
                case IntrinsicType.String:
                    mappedTypeName = "String";
                    break;
                case IntrinsicType.Integer:
                    mappedTypeName = "Int32";
                    break;
                case IntrinsicType.UnsignedInteger:
                    mappedTypeName = "UInt32";
                    break;
                case IntrinsicType.Long:
                    mappedTypeName = "Int64";
                    break;
                case IntrinsicType.UnsignedLong:
                    mappedTypeName = "UInt64";
                    break;
                case IntrinsicType.Short:
                    mappedTypeName = "Int16";
                    break;
                case IntrinsicType.UnsignedShort:
                    mappedTypeName = "UInt16";
                    break;
                case IntrinsicType.Byte:
                    mappedTypeName = "Byte";
                    break;
                case IntrinsicType.SignedByte:
                    mappedTypeName = "SByte";
                    break;
                case IntrinsicType.Single:
                    mappedTypeName = "Single";
                    break;
                case IntrinsicType.Date:
                    mappedTypeName = "Date";
                    break;
                case IntrinsicType.Decimal:
                    mappedTypeName = "Decimal";
                    break;
                case IntrinsicType.Double:
                    mappedTypeName = "Double";
                    break;
                case IntrinsicType.Delegate:
                    mappedTypeName = "Delegate";
                    break;
                case IntrinsicType.Function:
                    mappedTypeName = "Function";
                    break;
                case IntrinsicType.Void:
                    mappedTypeName = "Void";
                    break;
                case IntrinsicType.Array:
                    mappedTypeName = "Array";
                    break;
                case IntrinsicType.Dictionary:
                    mappedTypeName = "Dictionary";
                    mappedNamespace = "System.Collections";
                    break;
                case IntrinsicType.GenericList:
                    mappedTypeName = "List`1";
                    mappedNamespace = "System.Collections.Generic";
                    break;
                case IntrinsicType.GenericDictionary:
                    mappedTypeName = "Dictionary`2";
                    mappedNamespace = "System.Collections.Generic";
                    break;
                case IntrinsicType.Type:
                    mappedTypeName = "Type";
                    break;
                case IntrinsicType.IEnumerator:
                    mappedTypeName = "IEnumerator";
                    mappedNamespace = "System.Collections";
                    break;
                case IntrinsicType.Enum:
                    mappedTypeName = "Enum";
                    break;
                case IntrinsicType.Exception:
                    mappedTypeName = "Exception";
                    break;
                case IntrinsicType.Script:
                    mappedTypeName = "Script";
                    break;
                case IntrinsicType.Number:
                    mappedTypeName = "Number";
                    break;
                case IntrinsicType.Arguments:
                    mappedTypeName = "Arguments";
                    break;
                case IntrinsicType.Nullable:
                    mappedTypeName = "Nullable`1";
                    break;
                default:
                    Debug.Fail("Unmapped intrinsic type " + type);
                    break;
            }

            NamespaceSymbol ns = _systemNamespace;
            if (mappedNamespace != null) {
                ns = GetNamespace(mappedNamespace);
                Debug.Assert(ns != null);
            }

            if (mappedTypeName != null) {
                TypeSymbol typeSymbol = (TypeSymbol)((ISymbolTable)ns).FindSymbol(mappedTypeName, null, SymbolFilter.Types);
                Debug.Assert(typeSymbol != null);

                return typeSymbol;
            }

            return null;
        }

        public TypeSymbol ResolveType(ParseNode node, ISymbolTable symbolTable, Symbol contextSymbol) {
            if (node is IntrinsicTypeNode) {
                IntrinsicType intrinsicType = IntrinsicType.Integer;

                IntrinsicTypeNode intrinsicTypeNode = (IntrinsicTypeNode)node;
                switch (intrinsicTypeNode.Type) {
                    case TokenType.Object:
                        intrinsicType = IntrinsicType.Object;
                        break;
                    case TokenType.Bool:
                        intrinsicType = IntrinsicType.Boolean;
                        break;
                    case TokenType.String:
                    case TokenType.Char:
                        intrinsicType = IntrinsicType.String;
                        break;
                    case TokenType.Int:
                        intrinsicType = IntrinsicType.Integer;
                        break;
                    case TokenType.UInt:
                        intrinsicType = IntrinsicType.UnsignedInteger;
                        break;
                    case TokenType.Long:
                        intrinsicType = IntrinsicType.Long;
                        break;
                    case TokenType.ULong:
                        intrinsicType = IntrinsicType.UnsignedLong;
                        break;
                    case TokenType.Short:
                        intrinsicType = IntrinsicType.Short;
                        break;
                    case TokenType.UShort:
                        intrinsicType = IntrinsicType.UnsignedShort;
                        break;
                    case TokenType.Byte:
                        intrinsicType = IntrinsicType.Byte;
                        break;
                    case TokenType.SByte:
                        intrinsicType = IntrinsicType.SignedByte;
                        break;
                    case TokenType.Float:
                        intrinsicType = IntrinsicType.Single;
                        break;
                    case TokenType.Decimal:
                        intrinsicType = IntrinsicType.Decimal;
                        break;
                    case TokenType.Double:
                        intrinsicType = IntrinsicType.Double;
                        break;
                    case TokenType.Delegate:
                        intrinsicType = IntrinsicType.Delegate;
                        break;
                    case TokenType.Void:
                        intrinsicType = IntrinsicType.Void;
                        break;
                }

                TypeSymbol typeSymbol = ResolveIntrinsicType(intrinsicType);

                if (intrinsicTypeNode.IsNullable) {
                    TypeSymbol nullableType = ResolveIntrinsicType(IntrinsicType.Nullable);
                    typeSymbol = CreateGenericTypeSymbol(nullableType, new List<TypeSymbol>() { typeSymbol });
                }

                return typeSymbol;
            }
            else if (node is ArrayTypeNode) {
                ArrayTypeNode arrayTypeNode = (ArrayTypeNode)node;

                TypeSymbol itemTypeSymbol = ResolveType(arrayTypeNode.BaseType, symbolTable, contextSymbol);
                Debug.Assert(itemTypeSymbol != null);

                return CreateArrayTypeSymbol(itemTypeSymbol);
            }
            else if (node is GenericNameNode) {
                GenericNameNode genericNameNode = (GenericNameNode)node;
                string genericTypeName = genericNameNode.Name + "`" + genericNameNode.TypeArguments.Count;
                TypeSymbol templateType = (TypeSymbol)symbolTable.FindSymbol(genericTypeName, contextSymbol, SymbolFilter.Types);

                List<TypeSymbol> typeArguments = new List<TypeSymbol>();
                foreach (ParseNode argNode in genericNameNode.TypeArguments) {
                    TypeSymbol argType = ResolveType(argNode, symbolTable, contextSymbol);
                    typeArguments.Add(argType);
                }

                TypeSymbol resolvedSymbol = CreateGenericTypeSymbol(templateType, typeArguments);
                Debug.Assert(resolvedSymbol != null);

                return resolvedSymbol;
            }
            else {
                Debug.Assert(node is NameNode);
                NameNode nameNode = (NameNode)node;

                return (TypeSymbol)symbolTable.FindSymbol(nameNode.Name, contextSymbol, SymbolFilter.Types);
            }
        }

        public void SetComments(XmlDocument docComments) {
            Debug.Assert(_docComments == null);
            Debug.Assert(docComments != null);

            _docComments = docComments;
        }

        public void SetEntryPoint(MemberSymbol entryPoint) {
            Debug.Assert(_entryPoint == null);
            Debug.Assert(entryPoint != null);

            _entryPoint = entryPoint;
        }

        #region ISymbolTable Members
        ICollection ISymbolTable.Symbols {
            get {
                return _namespaces;
            }
        }

        Symbol ISymbolTable.FindSymbol(string name, Symbol context, SymbolFilter filter) {
            if ((filter & SymbolFilter.Types) == 0) {
                return null;
            }

            Symbol symbol = null;

            if (name.IndexOf('.') > 0) {
                int nameIndex = name.LastIndexOf('.') + 1;
                Debug.Assert(nameIndex < name.Length);

                string namespaceName = name.Substring(0, nameIndex - 1);
                name = name.Substring(nameIndex);

                NamespaceSymbol namespaceSymbol;
                if (_namespaceMap.TryGetValue(namespaceName, out namespaceSymbol)) {
                    symbol = ((ISymbolTable)namespaceSymbol).FindSymbol(name, /* context */ null, SymbolFilter.Types);
                }
            }
            else {
                Debug.Assert(context != null);

                TypeSymbol typeSymbol = context as TypeSymbol;
                if (typeSymbol == null) {
                    Symbol parentSymbol = context.Parent;
                    while (parentSymbol != null) {
                        typeSymbol = parentSymbol as TypeSymbol;
                        if (typeSymbol != null) {
                            break;
                        }

                        parentSymbol = parentSymbol.Parent;
                    }
                }

                Debug.Assert(typeSymbol != null);
                if (typeSymbol == null) {
                    return null;
                }

                bool systemNamespaceChecked = false;

                NamespaceSymbol containerNamespace = (NamespaceSymbol)typeSymbol.Parent;
                Debug.Assert(containerNamespace != null);

                symbol = ((ISymbolTable)containerNamespace).FindSymbol(name, /* context */ null, SymbolFilter.Types);
                if (containerNamespace == _systemNamespace) {
                    systemNamespaceChecked = true;
                }
                if (symbol == null) {
                    if ((typeSymbol.Aliases != null) && typeSymbol.Aliases.ContainsKey(name)) {
                        string typeReference = typeSymbol.Aliases[name];
                        symbol = ((ISymbolTable)this).FindSymbol(typeReference, /* context */ null, SymbolFilter.Types);
                    }
                    else if (typeSymbol.Imports != null) {
                        foreach (string importedNamespaceReference in typeSymbol.Imports) {
                            if (_namespaceMap.ContainsKey(importedNamespaceReference) == false) {
                                // Since we included all parent namespaces of the current type's
                                // namespace, we might run into a namespace that doesn't contain
                                // any defined types, i.e. doesn't exist.

                                continue;
                            }

                            NamespaceSymbol importedNamespace = _namespaceMap[importedNamespaceReference];
                            if (importedNamespace == containerNamespace) {
                                continue;
                            }

                            symbol = ((ISymbolTable)importedNamespace).FindSymbol(name, /* context */ null, SymbolFilter.Types);
                            if (importedNamespace == _systemNamespace) {
                                systemNamespaceChecked = true;
                            }
                            if (symbol != null) {
                                break;
                            }
                        }
                    }
                }
                if ((symbol == null) && (systemNamespaceChecked == false)) {
                    symbol = ((ISymbolTable)_systemNamespace).FindSymbol(name, /* context */ null, SymbolFilter.Types);
                }
                if (symbol == null) {
                    symbol = ((ISymbolTable)_globalNamespace).FindSymbol(name, /* context */ null, SymbolFilter.Types);
                }
            }

            return symbol;
        }
        #endregion
    }
}


text:
namespace busynet
{
typedef std::function<void()> Task;
class EventLoop
{
  EventLoop(const EventLoop &);
public:
  EventLoop();
  void loop();
  void quit() {exitAtNextLoop_ = true;}

  void addEvent(Event *ev);

  void runInLoop(const Task& task);
private:
  std::unique_ptr<Poller> poller_;
  std::vector<Task> pendingTasks_; //等待处理的任务

  std::atomic<bool> exitAtNextLoop_;
};
}


text:
package CloudForest

import ()

/*CatMap is for mapping categorical values to integers.
It contains:

	Map  : a map of ints by the string used for the category
	Back : a slice of strings by the int that represents them

And is embedded by Feature and CatBallotBox.
*/
type CatMap struct {
	Map  map[string]int //map categories from string to Num
	Back []string       // map categories from Num to string
}

//CatToNum provides the int equivalent of the provided categorical value
//if it already exists or adds it to the map and returns the new value if
//it doesn't.
func (cm *CatMap) CatToNum(value string) (numericv int) {
	numericv, exsists := cm.Map[value]
	if exsists == false {
		numericv = len(cm.Back)
		cm.Map[value] = numericv
		cm.Back = append(cm.Back, value)

	}
	return
}

//NumToCat returns the catagory label that has been assigned i
func (cm *CatMap) NumToCat(i int) (value string) {
	return cm.Back[i]
}

//NCats returns the number of distinct catagories.
func (cm *CatMap) NCats() (n int) {
	if cm.Back == nil {
		n = 0
	} else {
		n = len(cm.Back)
	}
	return
}


text:
import {Utils} from '../utils';

export class Article {
	title: String;
	author: String;
	date: Date;
	description: String;
	category: String;
	constructor(data:any) {
		Utils.CopyProperties(data, this);
	}
}


text:
'use strict';
const TBL = 'Samples';
module.exports = {
  up(qi, Sequelize) {
    /*
      Add altering commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return qi.createTable('users', { id: Sequelize.INTEGER });
    */
    return qi.sequelize.transaction(() => qi.removeColumn(TBL, 'isDeleted'))
    .then(() => qi.removeColumn(TBL, 'deletedAt'));
  },

  down(qi, Sequelize) {
    // /*
    //   Add reverting commands here.
    //   Return a promise to correctly handle asynchronicity.

    //   Example:
    //   return qi.dropTable('users');
    // */
    return qi.sequelize.transaction(() => qi.addColumn(TBL, 'isDeleted', {
      type: Sequelize.DATE,
      allowNull: true,
    }))
    .then(() => qi.addColumn(TBL, 'deletedAt', {
      type: Sequelize.DATE,
      allowNull: true,
    }));
  },
};


text:
using System;
using Mono.Cecil;
using Mono.Cecil.Cil;

namespace Smocks.IL.Visitors
{
    internal class NumberPushedVisitor : InstructionVisitorBase<int>
    {
        public override int Visit(Instruction instruction)
        {
            switch (instruction.OpCode.Code)
            {
                case Code.Nop:
                case Code.Stloc:
                case Code.Stloc_0:
                case Code.Stloc_1:
                case Code.Stloc_2:
                case Code.Stloc_3:
                case Code.Stloc_S:
                case Code.Stelem_Ref:
                case Code.Stfld:
                case Code.Brtrue:
                case Code.Brtrue_S:
                case Code.Brfalse:
                case Code.Brfalse_S:
                case Code.Stsfld:
                case Code.Pop:
                case Code.Br:
                case Code.Ret: // From the current method's perspective
                    return 0;

                case Code.Ldc_R4:
                case Code.Ldc_R8:
                case Code.Ldc_I4:
                case Code.Ldc_I4_0:
                case Code.Ldc_I4_1:
                case Code.Ldc_I4_2:
                case Code.Ldc_I4_3:
                case Code.Ldc_I4_4:
                case Code.Ldc_I4_5:
                case Code.Ldc_I4_6:
                case Code.Ldc_I4_7:
                case Code.Ldc_I4_8:
                case Code.Ldc_I4_M1:
                case Code.Ldc_I4_S:
                case Code.Newarr:
                case Code.Newobj:
                case Code.Castclass:
                case Code.Ldtoken:
                case Code.Ldarg:
                case Code.Ldarg_0:
                case Code.Ldarg_1:
                case Code.Ldarg_2:
                case Code.Ldarg_3:
                case Code.Ldfld:
                case Code.Ldflda:
                case Code.Ldnull:
                case Code.Ldstr:
                case Code.Ldloc:
                case Code.Ldloc_0:
                case Code.Ldloc_1:
                case Code.Ldloc_2:
                case Code.Ldloc_3:
                case Code.Ldloc_S:
                case Code.Ldloca:
                case Code.Ldloca_S:
                case Code.Ldsfld:
                case Code.Ldsflda:
                case Code.Box:
                case Code.Ceq:
                    return 1;
                case Code.Dup:
                    return 2;

                case Code.Call:
                case Code.Calli:
                case Code.Callvirt:
                    return VisitInlineMethod(instruction, (MethodReference)instruction.Operand);
            }

            throw new NotImplementedException($"Unexpected opcode: {instruction.OpCode.Code}");
        }

        public override int VisitInlineMethod(Instruction instruction, MethodReference operand)
        {
            switch (instruction.OpCode.Code)
            {
                case Code.Call:
                case Code.Callvirt:
                    return operand.ReturnType.FullName == "System.Void" ? 0 : 1;

                case Code.Newobj:
                    return 1;

                case Code.Ldftn: // "Pushes an unmanaged pointer (type native int) to the native code implementing a specific method onto the evaluation stack."
                    return 1;

                default:
                    throw new NotSupportedException("Unexpected opcode");
            }
        }
    }
}


text:
package flatbuffers

// Codec implements gRPC-go Codec which is used to encode and decode messages.
var Codec = "flatbuffers"

// FlatbuffersCodec defines the interface gRPC uses to encode and decode messages.  Note
// that implementations of this interface must be thread safe; a Codec's
// methods can be called from concurrent goroutines.
type FlatbuffersCodec struct{}

// Marshal returns the wire format of v.
func (FlatbuffersCodec) Marshal(v interface{}) ([]byte, error) {
	return v.(*Builder).FinishedBytes(), nil
}

// Unmarshal parses the wire format into v.
func (FlatbuffersCodec) Unmarshal(data []byte, v interface{}) error {
	v.(flatbuffersInit).Init(data, GetUOffsetT(data))
	return nil
}

// String  old gRPC Codec interface func
func (FlatbuffersCodec) String() string {
	return Codec
}

// Name returns the name of the Codec implementation. The returned string
// will be used as part of content type in transmission.  The result must be
// static; the result cannot change between calls.
//
// add Name() for ForceCodec interface
func (FlatbuffersCodec) Name() string {
	return Codec
}

type flatbuffersInit interface {
	Init(data []byte, i UOffsetT)
}


text:
package org.drools.verifier.report.components;

import java.util.Collection;

/**
 *
 * Cause for a Reason.
 */
public interface Cause {

    public Collection<Cause> getCauses();

}


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:foreground="?android:attr/selectableItemBackground"
    android:clickable="true"
    android:focusable="true"
    app:cardCornerRadius="8dp"
    >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/image_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            tools:ignore="ContentDescription" />

        <CheckBox
            android:id="@+id/check_box"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <ImageView
            android:id="@+id/marker_view"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_alignParentEnd="true"
            android:layout_marginEnd="6dp"
            android:layout_marginTop="6dp"
            android:alpha="0.9"
            android:src="@drawable/ic_baseline_bookmark_24px"
            android:tint="@color/marker"
            tools:ignore="ContentDescription" />

        <ImageView
            android:id="@+id/synced_view"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:padding="8dp"
            android:alpha="0.8"
            android:src="@drawable/ic_baseline_cloud_24px"
            tools:ignore="ContentDescription" />

    </RelativeLayout>
</androidx.cardview.widget.CardView>


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package p2pchat.mock;

import p2pchat.connection.server.IConnectionManagerServer;
import p2pchat.connection.server.TransmissionRequest;

/**
 *
 * @author USER
 */
public class ConnectionManagerServerMock implements IConnectionManagerServer {

    public int sendToClientCounter = 0;
    public TransmissionRequest sendToClientRequests[] = new TransmissionRequest[10];

    @Override
    public void sendToClient(TransmissionRequest data) {
        sendToClientRequests[sendToClientCounter] = data;
        sendToClientCounter++;
    }

    @Override
    public void startServer() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int getServerPort() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String getServerAddress() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void receiveFromClient(TransmissionRequest data) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}


text:
Template.api.rendered = function () {
	var opts = {
		value: 800,
		theme: 'train-station'
	};
	Odometeor.create('epicodometeor', 'beforethis', opts);
	randomChange();
};


text:
#ifndef __STREAMIO_H__
#define __STREAMIO_H__

#include "forward.h"
#include "buffio.h"
#include "fileio.h"

#ifdef __cplusplus
extern "C"
{
#endif
typedef enum
{
  FileIO,
  BufferIO,
  UserIO
} IOType;

/* states for ISO 2022

 A document in ISO-2022 based encoding uses some ESC sequences called
 "designator" to switch character sets. The designators defined and
 used in ISO-2022-JP are:

    "ESC" + "(" + ?     for ISO646 variants

    "ESC" + "$" + ?     and
    "ESC" + "$" + "(" + ?   for multibyte character sets
*/
typedef enum
{
  FSM_ASCII,
  FSM_ESC,
  FSM_ESCD,
  FSM_ESCDP,
  FSM_ESCP,
  FSM_NONASCII
} ISO2022State;

/************************
** Source
************************/

enum
{
    CHARBUF_SIZE=5,
    LASTPOS_SIZE=64
};

/* non-raw input is cleaned up*/
struct _StreamIn
{
    ISO2022State    state;     /* FSM for ISO2022 */
    Bool   pushed;
    TidyAllocator *allocator;
    tchar* charbuf;
    uint   bufpos;
    uint   bufsize;
    int    tabs;
    int    lastcols[LASTPOS_SIZE];
    unsigned short curlastpos; /* current last position in lastcols */
    unsigned short firstlastpos; /* first valid last position in lastcols */
    int    curcol;
    int    curline;
    int    encoding;
    IOType iotype;

    TidyInputSource source;

#ifdef TIDY_WIN32_MLANG_SUPPORT
    void* mlang;
#endif

#ifdef TIDY_STORE_ORIGINAL_TEXT
    tmbstr otextbuf;
    size_t otextsize;
    uint   otextlen;
#endif

    /* Pointer back to document for error reporting */
    TidyDocImpl* doc;
};

StreamIn* TY_(initStreamIn)( TidyDocImpl* doc, int encoding );
void TY_(freeStreamIn)(StreamIn* in);

StreamIn* TY_(FileInput)( TidyDocImpl* doc, FILE* fp, int encoding );
StreamIn* TY_(BufferInput)( TidyDocImpl* doc, TidyBuffer* content, int encoding );
StreamIn* TY_(UserInput)( TidyDocImpl* doc, TidyInputSource* source, int encoding );

int       TY_(ReadBOMEncoding)(StreamIn *in);
uint      TY_(ReadChar)( StreamIn* in );
void      TY_(UngetChar)( uint c, StreamIn* in );
Bool      TY_(IsEOF)( StreamIn* in );

/************************
** Sink
************************/

struct _StreamOut
{
    int   encoding;
    ISO2022State   state;     /* for ISO 2022 */
    uint  nl;

#ifdef TIDY_WIN32_MLANG_SUPPORT
    void* mlang;
#endif

    IOType iotype;
    TidyOutputSink sink;
};

StreamOut* TY_(FileOutput)( TidyDocImpl *doc, FILE* fp, int encoding, uint newln );
StreamOut* TY_(BufferOutput)( TidyDocImpl *doc, TidyBuffer* buf, int encoding, uint newln );
StreamOut* TY_(UserOutput)( TidyDocImpl *doc, TidyOutputSink* sink, int encoding, uint newln );

StreamOut* TY_(StdErrOutput)();
/* StreamOut* StdOutOutput(); */
void       TY_(ReleaseStreamOut)( TidyDocImpl *doc, StreamOut* out );

void TY_(WriteChar)( uint c, StreamOut* out );
void TY_(outBOM)( StreamOut *out );

ctmbstr TY_(GetEncodingNameFromTidyId)(uint id);
ctmbstr TY_(GetEncodingOptNameFromTidyId)(uint id);
int TY_(GetCharEncodingFromOptName)(ctmbstr charenc);

/************************
** Misc
************************/

/* character encodings
*/
#define RAW         0
#define ASCII       1
#define LATIN0      2
#define LATIN1      3
#define UTF8        4
#define ISO2022     5
#define MACROMAN    6
#define WIN1252     7
#define IBM858      8

#if SUPPORT_UTF16_ENCODINGS
#define UTF16LE     9
#define UTF16BE     10
#define UTF16       11
#endif

/* Note that Big5 and SHIFTJIS are not converted to ISO 10646 codepoints
** (i.e., to Unicode) before being recoded into UTF-8. This may be
** confusing: usually UTF-8 implies ISO10646 codepoints.
*/
#if SUPPORT_ASIAN_ENCODINGS
#if SUPPORT_UTF16_ENCODINGS
#define BIG5        12
#define SHIFTJIS    13
#else
#define BIG5        9
#define SHIFTJIS    10
#endif
#endif

#ifdef TIDY_WIN32_MLANG_SUPPORT
/* hack: windows code page numbers start at 37 */
#define WIN32MLANG  36
#endif

/* char encoding used when replacing illegal SGML chars,
** regardless of specified encoding.  Set at compile time
** to either Windows or Mac.
*/
extern const int TY_(ReplacementCharEncoding);

/* Function for conversion from Windows-1252 to Unicode */
uint TY_(DecodeWin1252)(uint c);

/* Function to convert from MacRoman to Unicode */
uint TY_(DecodeMacRoman)(uint c);

#ifdef __cplusplus
}
#endif

/* Use numeric constants as opposed to escape chars (\r, \n)
** to avoid conflict Mac compilers that may re-define these.
*/
#define CR    0xD
#define LF    0xA

#if   defined(MAC_OS_CLASSIC)
#define DEFAULT_NL_CONFIG TidyCR
#elif defined(_WIN32) || defined(OS2_OS)
#define DEFAULT_NL_CONFIG TidyCRLF
#else
#define DEFAULT_NL_CONFIG TidyLF
#endif

#endif /* __STREAMIO_H__ */


text:
title: Repository Wrapper Plugin
layout: default
summary: A plugin that provides an OSGi Capability Repository on top of bnd repositories
---

The Repository Wrapper plugin supports bnd Repository Plugin plugins that implement the `InfoRepository` interface. These repositories do not have to create an OSGi Repository with resources but only have to maintain a SHA-1 for each entry they hold. The Wrapper then uses the SHA-1 to maintain a cache of fully indexed resources. There is only one wrapper necessary, it automatically finds all  `InfoRepository` interfaces.

The name of the plugin is `aQute.bnd.deployer.repository.wrapper.Plugin`

It has the following configuration properties:

| Property                  | Type          | Default  | Description |
|-------------------------------------------|----------|-------------|
| `location`                | `PATH`        |          | A path to a directory to be used as cache. |
|                           |               |          | This cache must be unique for the workspace. There is no default,|
|                           |               |          | the parameter must be set.|
| `reindex`                 | `true|false`  | `false`  | If the resources need to be reindexed at start up |

## Example

	-plugin.wrapper = \
        aQute.bnd.deployer.repository.wrapper.Plugin; \
            location            =	"${build}/cache/wrapper"; \
            reindex				=	true, \


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

    <title>YUI: Grids T</title>
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.2.0/build/reset-fonts-grids/reset-fonts-grids.css">

YUI: CSS Grids T

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sit amet metus. Nunc quam elit, posuere nec, auctor in, rhoncus quis, dui. Aliquam erat volutpat. Ut dignissim, massa sit amet dignissim cursus, quam lacus feugiat.

Footer is here.


text:
package pacman.definition.scriptable.notEqual;

import pacman.definition.NotEqualDefinition;
import pacman.definition.scriptable.DefinitionAdapter;
import pacman.definition.scriptable.ScriptableUtil;

public class NotEqualDefinitionAdapter extends DefinitionAdapter<NotEqualDefinition> {
	private static final long serialVersionUID = -1L;

	public NotEqualDefinitionAdapter() {
		this(null, null, null);
	}

	public NotEqualDefinitionAdapter(Object definition, DefinitionAdapter<?> parent, String extensionName) {
		super(definition, parent, extensionName);
	}

	@Override
	public DefinitionAdapter<?> jsFunction_End() {
		return this.end();
	}

	@Override
	public void jsFunction_addActivity(Object activity) {
		ScriptableUtil.throwNotSupportTheExtension(this, activity);
	}

	public NotEqualDefinitionAdapter jsFunction_Left(Object value) {
		this.setValue("Left", value);
		return this;
	}

	public NotEqualDefinitionAdapter jsFunction_Right(Object value) {
		this.setValue("Right", value);
		return this;
	}

	public NotEqualDefinitionAdapter jsFunction_Result(Object value) {
		this.setValue("Result", value);
		return this;
	}
}


text:
<?php

namespace common\models\query;

/**
 * This is the ActiveQuery class for [[\common\models\ParametrosHasMuestrasHasCostopredeterminados]].
 *
 * @see \common\models\ParametrosHasMuestrasHasCostopredeterminados
 */
class CostopredeterminadosHasQuery extends \yii\db\ActiveQuery
{
    /*public function active()
    {
        $this->andWhere('[[status]]=1');
        return $this;
    }*/

    /**
     * @inheritdoc
     * @return \common\models\ParametrosHasMuestrasHasCostopredeterminados[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return \common\models\ParametrosHasMuestrasHasCostopredeterminados|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }
}


text:
qTox
======

Powerful Tox client that tries to follow the Tox UI mockup while running on all major systems.

This GUI uses code from @nurupo'tos ProjectTox-Qt-GUI, in particular the "Core" Toxcore wrapper.

However, it is not a fork.

Features

- One to one chat with friends
- Group chats
- File transfers, with previewing of images
- Audio calls
- Video calls (alpha)
- Tox DNS
- Translations in various languages

Requirements

This client runs on Windows, Linux and Mac natively, but is not build regularly for Linux

Linux users will have to compile the source code themselves if they want the latest updates.

Windows download

Mac download

Linux download (12st July 2014 20:30 GMT)

Note that the Linux download has not been tested and may not be up to date.

Screenshots

Note: The screenshots may not always be up to date, but they should give a good idea of the general look and features

Compiling

Compiling toxgui requires Qt 5.2 with the Qt Multimedia module and a C++11 compatible compiler.
It also requires the toxcore and toxav libraries.

To compile, first clone or download the qTox repository and open a terminal in the qTox folder.
Then run the script bootstrap.sh (for Linux and Mac) or bootsrap.bat (for Windows) to download an up-to-date toxcore.
And finally run the commands "qmake" and "make" to start building qTox.

OSX Install Guide

This guide is intended for people who wish to use an existing or new ProjectTox-Core installation separate to the bundled installation with qTox, if you do not wish to use a separate installation you can skip to the section titled 'Final Steps'.

Installation on OSX, isn't quite straight forward, here is a quick guide on how to install;

The first thing you need to do is install ProjectTox-Core with a/v support. Refer to the INSTALL guide in the ProjectTox-Core github repo.

Next you need to download QtTools (http://qt-project.org/downloads), at the time of writing this is at version 5.3.0.
Make sure you deselect all the unnecessary components from the 5.3 checkbox (iOS/Android libs) otherwise you will end up with a very large download.

Once that is installed you will most likely need to set the path for qmake. To do this, open up terminal and paste in the following;

```bash
export PATH=/location/to/qmake/binary:$PATH
```

For myself, the qmake binary was located in /Users/mouseym/Qt/5.3/clang_64/bin/.

This is not a permanent change, it will revert when you close the terminal window, to add it permanently you will need to add echo the above line to your .profile/.bash_profile.

Once this is installed, do the following;

```bash
git clone https://github.com/tux3/qTox
cd toxgui
qmake
```

Now, we need to create a symlink to /usr/local/lib/ and /usr/local/include/
```
mkdir -p $HOME/qTox/libs
sudo ln -s /usr/local/lib $HOME/qTox/libs/lib
sudo ln -s /usr/local/include  $HOME/qTox/libs/include
```

Final Steps

The final step is to run
```bash
make
```
in the qTox directory, or if you are using the bundled tox core installation, you can use
```bash
./bootstrap.sh
```
Assuming all went well you should now have a qTox.app file within the directory. Double click and it should open!


text:
package fake

import (
	policy "k8s.io/api/policy/v1beta1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	core "k8s.io/client-go/testing"
)

func (c *FakeEvictions) Evict(eviction *policy.Eviction) error {
	action := core.CreateActionImpl{}
	action.Verb = "create"
	action.Namespace = c.ns
	action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"}
	action.Subresource = "eviction"
	action.Object = eviction

	_, err := c.Fake.Invokes(action, eviction)
	return err
}


text:
package net.chocolapod.lwjgfont.packager;

import java.io.IOException;

import net.chocolapod.lwjgfont.packager.CharacterFile;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class TestCharacterFile {

	@Test
	public void readAllCharacters() throws IOException {
		char[]				expecteds = new char[] {'a', 'b', 'C', 'D', 'に', '本', '語'};

		CharacterFile		file = getCaracterFile("TestCharacterFile_readAllCharacters.txt");
		int					i = 0;
		Character			actual;

		try {
			file.open();
			while ((actual = file.next()) != null) {
				assertTrue(i < expecteds.length);
				assertEquals(expecteds[i], actual.charValue());
				i++;
			}
		} finally {
			try {
				file.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	@Test
	public void readNoCharacters() throws IOException {
		CharacterFile		file = getCaracterFile("TestCharacterFile_readNoCharacters.txt");

		try {
			file.open();
			assertEquals(file.next(), null);
		} finally {
			try {
				file.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	private CharacterFile getCaracterFile(String fileName) {
		return new CharacterFile(
				"src/test/resources/" +
				TestCharacterFile.class.getPackage().getName().replaceAll("\\.", "/") +
				"/" +
				fileName);
	}

}


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var i2c_bus_1 = require('i2c-bus');
var child_process_1 = require('child_process');
var raspi_peripheral_1 = require('raspi-peripheral');
var raspi_board_1 = require('raspi-board');
function checkAddress(address) {
    if (typeof address !== 'number' || address < 0 || address > 0x7f) {
        throw new Error("Invalid I2C address " + address + ". Valid addresses are 0 through 0x7f.");
    }
}
function checkRegister(register) {
    if (register !== undefined &&
        (typeof register !== 'number' || register < 0 || register > 0xff)) {
        throw new Error("Invalid I2C register " + register + ". Valid registers are 0 through 0xff.");
    }
}
function checkLength(length, hasRegister) {
    if (typeof length !== 'number' || length < 0 || (hasRegister && length > 32)) {
        // Enforce 32 byte length limit only for SMBus.
        throw new Error("Invalid I2C length " + length + ". Valid lengths are 0 through 32.");
    }
}
function checkBuffer(buffer, hasRegister) {
    if (!Buffer.isBuffer(buffer) || buffer.length < 0 || (hasRegister && buffer.length > 32)) {
        // Enforce 32 byte length limit only for SMBus.
        throw new Error("Invalid I2C buffer. Valid lengths are 0 through 32.");
    }
}
function checkByte(byte) {
    if (typeof byte !== 'number' || byte < 0 || byte > 0xff) {
        throw new Error("Invalid I2C byte " + byte + ". Valid values are 0 through 0xff.");
    }
}
function checkWord(word) {
    if (typeof word !== 'number' || word < 0 || word > 0xffff) {
        throw new Error("Invalid I2C word " + word + ". Valid values are 0 through 0xffff.");
    }
}
function checkCallback(cb) {
    if (typeof cb !== 'function') {
        throw new Error('Invalid I2C callback');
    }
}
function createReadCallback(suppliedCallback) {
    return function (err, resultOrBytesRead, result) {
        if (suppliedCallback) {
            if (err) {
                suppliedCallback(err, null);
            }
            else if (typeof result !== 'undefined') {
                suppliedCallback(null, result);
            }
            else {
                suppliedCallback(null, resultOrBytesRead);
            }
        }
    };
}
function createWriteCallback(suppliedCallback) {
    return function (err) {
        if (suppliedCallback) {
            suppliedCallback(err || null);
        }
    };
}
function getPins(config) {
    var pins;
    if (Array.isArray(config)) {
        pins = config;
    }
    else if (typeof config === 'object' && Array.isArray(config.pins)) {
        pins = config.pins;
    }
    else {
        pins = ['SDA0', 'SCL0'];
    }
    return pins;
}
var I2C = (function (_super) {
    __extends(I2C, _super);
    function I2C(config) {
        _super.call(this, getPins(config));
        this.devices = [];
        child_process_1.execSync('modprobe i2c-dev');
    }
    I2C.prototype.destroy = function () {
        this.devices.forEach(function (device) { return device.closeSync(); });
        this.devices = [];
        _super.prototype.destroy.call(this);
    };
    I2C.prototype.getDevice = function (address) {
        var device = this.devices[address];
        if (device === undefined) {
            device = i2c_bus_1.openSync(raspi_board_1.getBoardRevision() === raspi_board_1.VERSION_1_MODEL_B_REV_1 ? 0 : 1);
            this.devices[address] = device;
        }
        return device;
    };
    I2C.prototype.read = function (address, registerOrLength, lengthOrCb, cb) {
        this.validateAlive();
        var length;
        var register;
        if (typeof cb === 'function' && typeof lengthOrCb === 'number') {
            length = lengthOrCb;
            register = registerOrLength;
        }
        else if (typeof lengthOrCb === 'function') {
            cb = lengthOrCb;
            length = registerOrLength;
            register = undefined;
        }
        else {
            throw new TypeError('Invalid I2C read arguments');
        }
        checkAddress(address);
        checkRegister(register);
        checkLength(length, !!register);
        checkCallback(cb);
        var buffer = new Buffer(length);
        if (register === undefined) {
            this.getDevice(address).i2cRead(address, length, buffer, createReadCallback(cb));
        }
        else {
            this.getDevice(address).readI2cBlock(address, register, length, buffer, createReadCallback(cb));
        }
    };
    I2C.prototype.readSync = function (address, registerOrLength, length) {
        this.validateAlive();
        var register;
        if (typeof length === 'undefined') {
            length = +registerOrLength;
        }
        else {
            register = registerOrLength;
            length = +length;
        }
        checkAddress(address);
        checkRegister(register);
        checkLength(length, !!register);
        var buffer = new Buffer(length);
        if (register === undefined) {
            this.getDevice(address).i2cReadSync(address, length, buffer);
        }
        else {
            this.getDevice(address).readI2cBlockSync(address, register, length, buffer);
        }
        return buffer;
    };
    I2C.prototype.readByte = function (address, registerOrCb, cb) {
        this.validateAlive();
        var register;
        if (typeof registerOrCb === 'function') {
            cb = registerOrCb;
            register = undefined;
        }
        checkAddress(address);
        checkRegister(register);
        checkCallback(cb);
        if (register === undefined) {
            var buffer_1 = new Buffer(1);
            this.getDevice(address).i2cRead(address, buffer_1.length, buffer_1, function (err) {
                if (err) {
                    if (cb) {
                        cb(err, null);
                    }
                }
                else if (cb) {
                    cb(null, buffer_1[0]);
                }
            });
        }
        else {
            this.getDevice(address).readByte(address, register, createReadCallback(cb));
        }
    };
    I2C.prototype.readByteSync = function (address, register) {
        this.validateAlive();
        checkAddress(address);
        checkRegister(register);
        var byte;
        if (register === undefined) {
            var buffer = new Buffer(1);
            this.getDevice(address).i2cReadSync(address, buffer.length, buffer);
            byte = buffer[0];
        }
        else {
            byte = this.getDevice(address).readByteSync(address, register);
        }
        return byte;
    };
    I2C.prototype.readWord = function (address, registerOrCb, cb) {
        this.validateAlive();
        var register;
        if (typeof registerOrCb === 'function') {
            cb = registerOrCb;
        }
        checkAddress(address);
        checkRegister(register);
        checkCallback(cb);
        if (register === undefined) {
            var buffer_2 = new Buffer(2);
            this.getDevice(address).i2cRead(address, buffer_2.length, buffer_2, function (err) {
                if (cb) {
                    if (err) {
                        return cb(err, null);
                    }
                    cb(null, buffer_2.readUInt16LE(0));
                }
            });
        }
        else {
            this.getDevice(address).readWord(address, register, createReadCallback(cb));
        }
    };
    I2C.prototype.readWordSync = function (address, register) {
        this.validateAlive();
        checkAddress(address);
        checkRegister(register);
        var byte;
        if (register === undefined) {
            var buffer = new Buffer(2);
            this.getDevice(address).i2cReadSync(address, buffer.length, buffer);
            byte = buffer.readUInt16LE(0);
        }
        else {
            byte = this.getDevice(address).readWordSync(address, register);
        }
        return byte;
    };
    I2C.prototype.write = function (address, registerOrBuffer, bufferOrCb, cb) {
        this.validateAlive();
        var buffer;
        var register;
        if (Buffer.isBuffer(registerOrBuffer)) {
            cb = bufferOrCb;
            buffer = registerOrBuffer;
            register = undefined;
        }
        else if (typeof registerOrBuffer === 'number' && Buffer.isBuffer(bufferOrCb)) {
            register = registerOrBuffer;
            buffer = bufferOrCb;
        }
        else {
            throw new TypeError('Invalid I2C write arguments');
        }
        checkAddress(address);
        checkRegister(register);
        checkBuffer(buffer, !!register);
        if (register === undefined) {
            this.getDevice(address).i2cWrite(address, buffer.length, buffer, createWriteCallback(cb));
        }
        else {
            this.getDevice(address).writeI2cBlock(address, register, buffer.length, buffer, createWriteCallback(cb));
        }
    };
    I2C.prototype.writeSync = function (address, registerOrBuffer, buffer) {
        this.validateAlive();
        var register;
        if (Buffer.isBuffer(registerOrBuffer)) {
            buffer = registerOrBuffer;
        }
        else if (!buffer) {
            throw new Error('Invalid I2C write arguments');
        }
        checkAddress(address);
        checkRegister(register);
        checkBuffer(buffer, !!register);
        if (register === undefined) {
            this.getDevice(address).i2cWriteSync(address, buffer.length, buffer);
        }
        else {
            this.getDevice(address).writeI2cBlockSync(address, register, buffer.length, buffer);
        }
    };
    I2C.prototype.writeByte = function (address, registerOrByte, byteOrCb, cb) {
        this.validateAlive();
        var byte;
        var register;
        if (typeof byteOrCb === 'number') {
            byte = byteOrCb;
            register = registerOrByte;
        }
        else {
            cb = byteOrCb;
            byte = registerOrByte;
        }
        checkAddress(address);
        checkRegister(register);
        checkByte(byte);
        if (register === undefined) {
            this.getDevice(address).i2cWrite(address, 1, new Buffer([byte]), createWriteCallback(cb));
        }
        else {
            this.getDevice(address).writeByte(address, register, byte, createWriteCallback(cb));
        }
    };
    I2C.prototype.writeByteSync = function (address, registerOrByte, byte) {
        this.validateAlive();
        var register;
        if (byte === undefined) {
            byte = registerOrByte;
        }
        else {
            register = registerOrByte;
        }
        checkAddress(address);
        checkRegister(register);
        checkByte(byte);
        if (register === undefined) {
            this.getDevice(address).i2cWriteSync(address, 1, new Buffer([byte]));
        }
        else {
            this.getDevice(address).writeByteSync(address, register, byte);
        }
    };
    I2C.prototype.writeWord = function (address, registerOrWord, wordOrCb, cb) {
        this.validateAlive();
        var register;
        var word;
        if (typeof wordOrCb === 'number') {
            register = registerOrWord;
            word = wordOrCb;
        }
        else if (typeof wordOrCb === 'function') {
            word = registerOrWord;
            cb = wordOrCb;
        }
        else {
            throw new Error('Invalid I2C write arguments');
        }
        checkAddress(address);
        checkRegister(register);
        checkWord(word);
        if (register === undefined) {
            var buffer = new Buffer(2);
            buffer.writeUInt16LE(word, 0);
            this.getDevice(address).i2cWrite(address, buffer.length, buffer, createWriteCallback(cb));
        }
        else {
            this.getDevice(address).writeWord(address, register, word, createWriteCallback(cb));
        }
    };
    I2C.prototype.writeWordSync = function (address, registerOrWord, word) {
        this.validateAlive();
        var register;
        if (word === undefined) {
            word = registerOrWord;
        }
        else {
            register = registerOrWord;
        }
        checkAddress(address);
        checkRegister(register);
        checkWord(word);
        if (register === undefined) {
            var buffer = new Buffer(2);
            buffer.writeUInt16LE(word, 0);
            this.getDevice(address).i2cWriteSync(address, buffer.length, buffer);
        }
        else {
            this.getDevice(address).writeWordSync(address, register, word);
        }
    };
    return I2C;
}(raspi_peripheral_1.Peripheral));
exports.I2C = I2C;
//# sourceMappingURL=index.js.map


text:
package org.apache.coyote.http2;

/**
 * Exception that is thrown when the HPACK compress context is broken. In this
 * case the connection must be closed.
 */
class HpackException extends Exception {

    private static final long serialVersionUID = 1L;

    HpackException(String message) {
        super(message);
    }
    HpackException() {
        super();
    }
}


text:
package com.google.android.apps.dashclock.ui;

import com.umang.dashnotifier.R;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * A helper class for creating swipeable tabs without the use of {@link android.app.ActionBar} APIs.
 */
public class SimplePagedTabsHelper {
    private Context mContext;
    private ViewGroup mTabContainer;
    private ViewPager mPager;
    private Map<View, Integer> mTabPositions = new HashMap<View, Integer>();
    private List<Integer> mTabContentIds = new ArrayList<Integer>();

    public SimplePagedTabsHelper(Context context, ViewGroup tabContainer, ViewPager pager) {
        mContext = context;
        mTabContainer = tabContainer;
        mPager = pager;

        pager.setAdapter(mAdapter);
        pager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
            @Override
            public void onPageSelected(int position) {
                for (int i = 0; i < mTabContainer.getChildCount(); i++) {
                    mTabContainer.getChildAt(i).setSelected(i == position);
                }
            }
        });
    }

    public void addTab(int labelResId, int contentViewId) {
        addTab(mContext.getString(labelResId), contentViewId);
    }

    public void addTab(CharSequence label, int contentViewId) {
        View tabView = LayoutInflater.from(mContext).inflate(R.layout.tab, mTabContainer, false);
        ((TextView) tabView.findViewById(R.id.tab)).setText(label);
        tabView.setOnClickListener(mTabClickListener);
        int position = mTabContentIds.size();
        tabView.setSelected(mPager.getCurrentItem() == position);
        mTabPositions.put(tabView, position);
        mTabContainer.addView(tabView);
        mTabContentIds.add(contentViewId);
        mAdapter.notifyDataSetChanged();
    }

    private View.OnClickListener mTabClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            mPager.setCurrentItem(mTabPositions.get(view));
        }
    };

    private PagerAdapter mAdapter = new PagerAdapter() {
        @Override
        public int getCount() {
            return mTabContentIds.size();
        }

        @Override
        public boolean isViewFromObject(View view, Object o) {
            return view == o;
        }

        @Override
        public Object instantiateItem(ViewGroup container, int position) {
            return mPager.findViewById(mTabContentIds.get(position));
        }

        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
            // No-op
        }
    };
}


text:
#if !defined(BOOST_SPIRIT_CALC8_AST_HPP)
#define BOOST_SPIRIT_CALC8_AST_HPP

#include <boost/config/warning_disable.hpp>
#include <boost/variant/recursive_variant.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/fusion/include/io.hpp>
#include <boost/optional.hpp>
#include <list>

namespace client { namespace ast
{
    ///////////////////////////////////////////////////////////////////////////
    //  The AST
    ///////////////////////////////////////////////////////////////////////////
    struct tagged
    {
        int id; // Used to annotate the AST with the iterator position.
                // This id is used as a key to a map<int, Iterator>
                // (not really part of the AST.)
    };

    struct nil {};
    struct unary;
    struct expression;

    struct variable : tagged
    {
        variable(std::string const& name = "") : name(name) {}
        std::string name;
    };

    typedef boost::variant<
            nil
          , bool
          , unsigned int
          , variable
          , boost::recursive_wrapper<unary>
          , boost::recursive_wrapper<expression>
        >
    operand;

    enum optoken
    {
        op_plus,
        op_minus,
        op_times,
        op_divide,
        op_positive,
        op_negative,
        op_not,
        op_equal,
        op_not_equal,
        op_less,
        op_less_equal,
        op_greater,
        op_greater_equal,
        op_and,
        op_or
    };

    struct unary
    {
        optoken operator_;
        operand operand_;
    };

    struct operation
    {
        optoken operator_;
        operand operand_;
    };

    struct expression
    {
        operand first;
        std::list<operation> rest;
    };

    struct assignment
    {
        variable lhs;
        expression rhs;
    };

    struct variable_declaration
    {
        assignment assign;
    };

    struct if_statement;
    struct while_statement;
    struct statement_list;

    typedef boost::variant<
            variable_declaration
          , assignment
          , boost::recursive_wrapper<if_statement>
          , boost::recursive_wrapper<while_statement>
          , boost::recursive_wrapper<statement_list>
        >
    statement;

    struct statement_list : std::list<statement> {};

    struct if_statement
    {
        expression condition;
        statement then;
        boost::optional<statement> else_;
    };

    struct while_statement
    {
        expression condition;
        statement body;
    };

    // print functions for debugging
    inline std::ostream& operator<<(std::ostream& out, nil) { out << "nil"; return out; }
    inline std::ostream& operator<<(std::ostream& out, variable const& var) { out << var.name; return out; }
}}

BOOST_FUSION_ADAPT_STRUCT(
    client::ast::unary,
    (client::ast::optoken, operator_)
    (client::ast::operand, operand_)
)

BOOST_FUSION_ADAPT_STRUCT(
    client::ast::operation,
    (client::ast::optoken, operator_)
    (client::ast::operand, operand_)
)

BOOST_FUSION_ADAPT_STRUCT(
    client::ast::expression,
    (client::ast::operand, first)
    (std::list<client::ast::operation>, rest)
)

BOOST_FUSION_ADAPT_STRUCT(
    client::ast::variable_declaration,
    (client::ast::assignment, assign)
)

BOOST_FUSION_ADAPT_STRUCT(
    client::ast::assignment,
    (client::ast::variable, lhs)
    (client::ast::expression, rhs)
)

BOOST_FUSION_ADAPT_STRUCT(
    client::ast::if_statement,
    (client::ast::expression, condition)
    (client::ast::statement, then)
    (boost::optional<client::ast::statement>, else_)
)

BOOST_FUSION_ADAPT_STRUCT(
    client::ast::while_statement,
    (client::ast::expression, condition)
    (client::ast::statement, body)
)

#endif


text:
sap.ui.define(['sap/ui/core/XMLComposite'],
	function (XMLComposite) {
		"use strict";
		var MySelect = sap.ui.core.XMLComposite.extend("composites.MySelect", {
			metadata: {
				aggregations: {
					myItems: {
						type: "sap.ui.core.Item",
						multiple: true,
						bindable: "bindable",
						forwarding: { idSuffix: "--itemList", aggregation: "items"}
					}
				},
				defaultAggregation: "myItems"
			}
		});

		return MySelect;
	}, /* bExport= */true);


text:
<?php

namespace slc\MVC;

use slc\twig_currency_symbols\ReplaceCurrencySymbol;
use slc\twig_relative_directory\RelativePath;

class RenderEngine_Twig extends RenderEngine {
	protected $Twig = null;
	protected function initialize() {
		\Twig_Autoloader::register();
		$this->Twig = new \Twig_Environment(
			new \Twig_Loader_Filesystem(Base::Factory()->getConfig('Paths', 'View')),
			array_merge(
				array(
					'cache' => Base::Factory()->getConfig('Paths', 'Cache') + DIRECTORY_SEPARATOR + 'RenderEngine_Twig/',
					'auto_reload' => true,
					'strict_variables' => true,
					'charset' => 'utf-8',
					'debug' => (DEPLOYMENT_STATE!='stable'?true:false)
				),
				(array)Base::Factory()->getConfig('RenderEngine_Twig', null)
			)
		);
		if(function_exists('gettext')) {
			$this->Twig->addExtension(new \Twig_Extensions_Extension_I18n());
			$this->Twig->getExtension('core')->setNumberFormat(0, gettext('DECIMAL_SEPERATOR'), gettext('THOUSANDS_SEPERATOR'));
		}
        if(class_exists('slc\twig_relative_directory\RelativePath')) {
            $this->Twig->addExtension(new RelativePath());
        }
		if(class_exists('slc\twig_currency_symbols\ReplaceCurrencySymbol')) {
			$this->Twig->addExtension(new ReplaceCurrencySymbol());
		}
	}
	public function getInstance() {
		return $this->Twig;
	}
	public function Fetch() {
		try {
			return $this->Twig->render(
				$this->getViewPath(),
				$this->getTemplateValues()
			);
		} catch(\Twig_Error_Loader $ex) {
			// wrap twig error message to make it handlebar for common mistakes / errors
			throw new RenderEngine_Exception(RenderEngine_Exception::INVALID_VIEW, array(
				'View' => $this->getViewPath(),
				'OriginalMessage' => $ex->getMessage()
			), $ex);
		}
	}

}

?>


text:
namespace ecto
{
  template<typename T>
  bounded<T>::bounded(const T& value, const T& min, const T& max)
      :
        min(min),
        max(max),
        has_bounds(true)
  {
    *this = value;
  }

  template<typename T>
  bounded<T>::bounded(const T& value)
      :
        value(value),
        min(),
        max(),
        has_bounds(false)
  {
  }
  template<typename T>
  void
  bounded<T>::set(const T& value)
  {
    if (!check(value))
      throw std::runtime_error(
          "Bad bounds! " + boost::lexical_cast<std::string>(value) + " is not within: " + bounds());
    this->value = value;
  }

  template<typename T>
  bounded<T>&
  bounded<T>::operator=(const T& value)
  {
    set(value);
    return *this;
  }

  template<typename T>
  bool
  bounded<T>::check(const T& value) const
  {
    if (!has_bounds)
      return true;
    if (min >= value || max <= value)
      return false;
    return true;
  }

  template<typename T>
  std::string
  bounded<T>::bounds() const
  {
    return boost::str(
        boost::format("(%s,%s)") % boost::lexical_cast<std::string>(min) % boost::lexical_cast<std::string>(max));
  }

  template<typename T>
  bounded<T>::operator T() const
  {
    return value;
  }
}