text:
package eu.lunisolar.magma.func.build.consumer;

import eu.lunisolar.magma.basics.Null;
import eu.lunisolar.magma.func.build.*;
import eu.lunisolar.magma.func.Function4U; // NOSONAR
import eu.lunisolar.magma.basics.builder.*; // NOSONAR
import javax.annotation.Nonnull; // NOSONAR
import javax.annotation.Nullable; // NOSONAR
import eu.lunisolar.magma.basics.exceptions.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.type.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.domain.*; // NOSONAR
import java.util.function.*;

import eu.lunisolar.magma.func.action.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.bi.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.obj.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.tri.*; // NOSONAR
import eu.lunisolar.magma.func.function.*; // NOSONAR
import eu.lunisolar.magma.func.function.conversion.*; // NOSONAR
import eu.lunisolar.magma.func.function.from.*; // NOSONAR
import eu.lunisolar.magma.func.function.to.*; // NOSONAR
import eu.lunisolar.magma.func.operator.binary.*; // NOSONAR
import eu.lunisolar.magma.func.operator.ternary.*; // NOSONAR
import eu.lunisolar.magma.func.operator.unary.*; // NOSONAR
import eu.lunisolar.magma.func.predicate.*; // NOSONAR
import eu.lunisolar.magma.func.supplier.*; // NOSONAR

/**
 * Builder for LTriConsumer.
 */
public final class LTriConsumerBuilder<T1, T2, T3> extends PerCaseBuilder.Base<LTriConsumerBuilder<T1, T2, T3>, LTriPredicate<T1, T2, T3>, LTriConsumer<T1, T2, T3>> {
	// extends PER_CASE_BUILDER<BUILDER_NAME func.B(the_case.class_args_ref), CASE_PREDICATE func.B(the_case.domain_class_argsX_ref), the_case.name_ref RRR> {

	private Consumer<LTriConsumer<T1, T2, T3>> consumer;

	private @Nullable HandlingInstructions handling;

	public static final LTriConsumer OTHERWISE_THROW = LTriConsumer.triCons((a1, a2, a3) -> {
		throw new IllegalStateException("There is no case configured for the arguments (if any).");
	});

	public LTriConsumerBuilder(@Nullable Consumer<LTriConsumer<T1, T2, T3>> consumer) {
		super(OTHERWISE_THROW, () -> new LTriConsumerBuilder(null));

		this.consumer = consumer;
	}

	/** One of ways of creating builder. In most cases (considering all _functional_ builders) it requires to provide generic parameters (in most cases redundantly) */
	public LTriConsumerBuilder() {
		this(null);
	}

	/** One of ways of creating builder. In most cases (considering all _functional_ builders) it requires to provide generic parameters (in most cases redundantly) */
	@Nonnull
	public static <T1, T2, T3> LTriConsumerBuilder<T1, T2, T3> triConsumer() {
		return new LTriConsumerBuilder();
	}

	/** One of ways of creating builder. This is possibly the least verbose way where compiler should be able to guess the generic parameters. */
	@Nonnull
	public static <T1, T2, T3> LTriConsumer<T1, T2, T3> triConsumerFrom(Consumer<LTriConsumerBuilder<T1, T2, T3>> buildingFunction) {
		LTriConsumerBuilder builder = new LTriConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}

	/** One of ways of creating builder. This might be the only way (considering all _functional_ builders) that might be utilize to specify generic params only once. */
	@Nonnull
	public static <T1, T2, T3> LTriConsumerBuilder<T1, T2, T3> triConsumer(Consumer<LTriConsumer<T1, T2, T3>> consumer) {
		return new LTriConsumerBuilder(consumer);
	}

	/** One of ways of creating builder. In most cases (considering all _functional_ builders) it requires to provide generic parameters (in most cases redundantly) */
	@Nonnull
	public final LTriConsumerBuilder<T1, T2, T3> withHandling(@Nonnull HandlingInstructions<Throwable, RuntimeException> handling) {
		Null.nonNullArg(handling, "handling");
		if (this.handling != null) {
			throw new UnsupportedOperationException("Handling is already set for this builder.");
		}
		this.handling = handling;
		return fluentCtx();
	}

	/** Allows to specify additional cases for a specific type of generic arguments (matched by instanceOf). Null classes can be provided in case of arguments that do not matter. */
	@Nonnull
	public <V1 extends T1, V2 extends T2, V3 extends T3> LTriConsumerBuilder<T1, T2, T3> casesOf(Class<V1> argC1, Class<V2> argC2, Class<V3> argC3, Consumer<LTriConsumerBuilder<V1, V2, V3>> pcpConsumer) {
		PartialCase.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)) && (argC3 == null || argC3.isInstance(a3)));

		pc.specifySubCases((Consumer) pcpConsumer);
		return fluentCtx();
	}

	/** Adds full new case for the argument that are of specific classes (matched by instanceOf, null is a wildcard). */
	@Nonnull
	public <V1 extends T1, V2 extends T2, V3 extends T3> LTriConsumerBuilder<T1, T2, T3> aCase(Class<V1> argC1, Class<V2> argC2, Class<V3> argC3, LTriConsumer<V1, V2, V3> function) {
		PartialCase.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)) && (argC3 == null || argC3.isInstance(a3)));

		pc.evaluate(function);
		return fluentCtx();
	}

	/** Builds the functional interface implementation and if previously provided calls the consumer. */
	@Nonnull
	public final LTriConsumer<T1, T2, T3> build() {

		final LTriConsumer<T1, T2, T3> otherwiseFinal = this.otherwise;

		LTriConsumer<T1, T2, T3> retval;

		final Case<LTriPredicate<T1, T2, T3>, LTriConsumer<T1, T2, T3>>[] casesArray = cases.toArray(new Case[cases.size()]);
		retval = LTriConsumer.<T1, T2, T3> triCons((a1, a2, a3) -> {
			try {
				for (Case<LTriPredicate<T1, T2, T3>, LTriConsumer<T1, T2, T3>> aCase : casesArray) {
					if (aCase.casePredicate().test(a1, a2, a3)) {
						aCase.caseFunction().accept(a1, a2, a3);
						return;
					}
				}

				otherwiseFinal.accept(a1, a2, a3);
			} catch (Error e) { // NOSONAR
					throw e;
				} catch (Throwable e) { // NOSONAR
					throw Handler.handleOrPropagate(e, handling);
				}
			});

		if (consumer != null) {
			consumer.accept(retval);
		}
		return retval;
	}

	public final LTriConsumer<T1, T2, T3> build(@Nonnull HandlingInstructions<Throwable, RuntimeException> handling) {
		this.withHandling(handling);
		return build();
	}

}


text:
#import <iWorkImport/TSDMediaLayout.h>

@class TSDInfoGeometry;

// Not exported
@interface TSDMovieLayout : TSDMediaLayout
{
    TSDInfoGeometry *mDynamicInfoGeometry;
}

- (void)p_destroyDynamicCopies;
- (void)p_createDynamicCopies;
- (struct CGRect)computeAlignmentFrameInRoot:(_Bool)arg1;
- (id)computeLayoutGeometry;
- (struct CGRect)fullReflectionFrame;
- (struct CGRect)fullReflectionBoundsForRect:(struct CGRect)arg1;
- (void)endDynamicOperation;
- (void)takeSizeFromTracker:(id)arg1;
- (void)beginDynamicOperation;
- (void)takeRotationFromTracker:(id)arg1;
- (id)movieInfo;
- (id)layoutGeometryFromInfo;
- (_Bool)supportsRotation;
- (id)i_computeWrapPath;
- (void)processChangedProperty:(int)arg1;
- (void)dealloc;
- (id)initWithInfo:(id)arg1;

@end

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var request = require('request'),
    fs = require('fs'),
    Yeezus = require('./kingyeezus.js'),
    mentionBot = require('./tweetyeezus.js'),
    dotenv = require('dotenv');

dotenv.load();

var yeezusBot = new Yeezus();

var getReply = function (message, cb) {
  var postvals = {
    'message': message
  };

  request.post('http://chat.digitalyeezus.com:8888/yeezus',
    { form: postvals },
    function (error, response, body) {
      if (error) { console.log(error); }
      if (!error && response.statusCode === 200) {
        console.log('reply: ', JSON.parse(body).reply);
        cb(JSON.parse(body).reply);
      }
    });
};

exports.handlePost = function (req, res) {
  var message = req.body.message;
  var send = function (reply) {
    res.json({'reply': reply});
  };
  console.log('message:', message);
  getReply(message, send);
};

exports.sendTweet = function(req, res) {
  if(req.query && req.query.p === process.env.TWEET_WORD) { yeezusBot.tweet(); }
  res.json({'msg': 'Got my niggas in Paris and they going to carry it down to egypt.'});
};

exports.reply = function(req, res) {
  console.log(req.query);
  if(!req.query || req.query.p !== process.env.REPLY_WORD) {
    res.json({'msg': 'Got my niggas in Paris and they going to carry it down to egypt.'});
    return;
  }

  var type = req.query.t;

  switch(type) {
    case process.env.MENTIONS:
      mentionBot.y33zusMentions();
      res.json({'msg': 'Got my niggas in Paris and they going to carry it down to egypt.'});
      break;
    case process.env.MINIONS:
      mentionBot.kanyeMentions();
      res.json({'msg': 'Got my niggas in Paris and they going to carry it down to egypt.'});
      break;
  }
};


text:
@interface UIView (RDXHierarchy)

- (UIViewController *)rdx_viewController;

@end


text:
<?php

namespace HIBP;

/**
 * Defines a constant for the base URL of the HaveIBeenPwned API.
 *     GET https://haveibeenpwned.com/api/{service}/{parameter}
 *     api-version: 2
 */
const API_URL = 'https://haveibeenpwned.com/api/';

/**
 * Defines the current API version.
 */
const API_VERSION = '2';

/**
 * Determines whether the API version should be specified by supplying a custom
 * 'api-version' header or by using content negotiation. The default value of
 * false indicates that requests should use the custom header.
 */
const USE_CONTENT_NEGOTIATION = false;

/**
 * If content negotiation is implemented, specifies the value for the accept header.
 */
const ACCEPT_HEADER = 'application/vnd.haveibeenpwned.v2+json';

/**
 * Each request to the API must be accompanied by a user agent request header.
 * Typically, this should be the name of the app consuming the service. For
 * example, "Pwnage-Checker-For-PHP". A missing user agent header will result
 * in an HTTP 403 response.
 */
const USER_AGENT = '';

/**
 * Boolean value indicating whether responses should be returned as arrays. The default
 * is to parse them into PHP objects.
 */
const RESULT_AS_ARRAY = false;

/**
 * The error message that is returned when the supplied input type does not match an
 * acceptable format.
 */
const BAD_INPUT_TYPE_ERROR = 'Account must be an email address or user name.';

/**
 * The error message that is returned when the "USER_AGENT" setting is no set in
 * the settings.php file.
 */
const NO_USER_AGENT_ERROR = 'No user agent supplied in settings.php';

/**
 * The success message that is returned when no breach information is found for a
 * supplied account.
 */
const NO_BREACHES_FOUND_MSG = 'Good news! This account is not associated with any known breaches.';

// END


text:
> `npm install --save @types/mime`

# Summary
This package contains type definitions for mime (https://github.com/broofa/node-mime).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime/v1.

### Additional Details
 * Last updated: Mon, 18 Jan 2021 14:32:15 GMT
 * Dependencies: none
 * Global values: `mime`, `mimelite`

# Credits
These definitions were written by [Jeff Goddard](https://github.com/jedigo), and [Daniel Hritzkiv](https://github.com/dhritzkiv).


text:
package org.anderes.edu.client.rest.jersey;

import static javax.ws.rs.core.MediaType.APPLICATION_JSON_TYPE;
import static javax.ws.rs.core.Response.Status.OK;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

import java.util.List;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;

import org.anderes.edu.client.rest.jersey.dto.Recipe;
import org.anderes.edu.client.rest.jersey.dto.RecipeShort;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class MoxyPojoRestClientTest {

    private UriBuilder restUrl;
    private Client client;

    @Before
    public void setUp() throws Exception {

        restUrl = UriBuilder.fromPath("resources-api").path("recipes").host("www.anderes.org").scheme("http");

        /**
         * Hier wird das MOXy Feature automatisch registriert.
         * siehe https://jersey.github.io/documentation/latest/user-guide.html#json.moxy
         */
        client = ClientBuilder.newClient();

    }

    @After
    public void tearDown() throws Exception {
        client.close();
    }

    @Test
    public void shouldBeFindAll() {
        final Response response = client.target(restUrl).request(APPLICATION_JSON_TYPE).get();
        assertThat(response.getStatus(), is(OK.getStatusCode()));
        assertThat(response.hasEntity(), is(true));
        final List<RecipeShort> recipes = response.readEntity(new GenericType<List<RecipeShort>>() {});
        assertThat(recipes, is(notNullValue()));
        recipes.forEach(element -> assertThat(((RecipeShort)element).getId(), is(notNullValue())));
    }

    @Test
    public void shouldBeOneRecipe() {
        final Response response = client.target(restUrl.path("c0e5582e-252f-4e94-8a49-e12b4b047afb")).request(APPLICATION_JSON_TYPE).get();
        assertThat(response.getStatus(), is(OK.getStatusCode()));
        assertThat(response.hasEntity(), is(true));
        final Recipe recipe = response.readEntity(Recipe.class);
        assertThat(recipe.getId(), is(notNullValue()));
        assertThat(recipe.getId(), is("c0e5582e-252f-4e94-8a49-e12b4b047afb"));
        assertThat(recipe.getTitle(), is("Arabische Pasta"));
    }
}


text:
"""Extension module support methods

This module provides the tools required to check whether
an extension is available
"""
from OpenGL.latebind import LateBind
from OpenGL._bytes import bytes,as_8_bit
import OpenGL as root
import sys
import logging
log = logging.getLogger( 'OpenGL.extensions' )
VERSION_PREFIX = 'GL_VERSION_GL_'
CURRENT_GL_VERSION = None
AVAILABLE_GL_EXTENSIONS = []
AVAILABLE_GLU_EXTENSIONS = []

def getGLVersion( ):
    """Retrieve 2-int declaration of major/minor GL version

    returns [int(major),int(minor)] or False if not loaded
    """
    global CURRENT_GL_VERSION
    if not CURRENT_GL_VERSION:
        from OpenGL.GL import glGetString, GL_VERSION
        new = glGetString( GL_VERSION )
        log.info( 'OpenGL Version: %s', new )
        if new:
            CURRENT_GL_VERSION = [
                int(x) for x in new.split(as_8_bit(' '),1)[0].split( as_8_bit('.') )
            ]
        else:
            return False # not yet loaded/supported
    return CURRENT_GL_VERSION

def hasGLExtension( specifier ):
    """Given a string specifier, check for extension being available"""
    global AVAILABLE_GL_EXTENSIONS
    specifier = specifier.replace(as_8_bit('.'),as_8_bit('_'))
    if specifier.startswith( VERSION_PREFIX ):
        specifier = [
            int(x)
            for x in specifier[ len(VERSION_PREFIX):].split(as_8_bit('_'))
        ]
        version = getGLVersion()
        if not version:
            return version
        return specifier <= version
    else:
        from OpenGL.GL import glGetString, GL_EXTENSIONS
        from OpenGL import error
        if not AVAILABLE_GL_EXTENSIONS:
            try:
                AVAILABLE_GL_EXTENSIONS[:] = glGetString( GL_EXTENSIONS ).split()
            except error.GLError, err:
                # OpenGL 3.0 deprecates glGetString( GL_EXTENSIONS )
                from OpenGL.GL import GL_NUM_EXTENSIONS, glGetStringi, glGetIntegerv
                count = glGetIntegerv( GL_NUM_EXTENSIONS )
                for i in range( count ):
                    AVAILABLE_GL_EXTENSIONS.append(
                        glGetStringi( GL_EXTENSIONS, i )
                    )
        result = specifier in AVAILABLE_GL_EXTENSIONS
        log.info(
            'GL Extension %s %s',
            specifier,
            ['unavailable','available'][bool(result)]
        )
        return result

def hasGLUExtension( specifier ):
    """Given a string specifier, check for extension being available"""
    from OpenGL.GLU import gluGetString, GLU_EXTENSIONS
    if not AVAILABLE_GLU_EXTENSIONS:
        AVAILABLE_GLU_EXTENSIONS[:] = gluGetString( GLU_EXTENSIONS )
    return specifier.replace(as_8_bit('.'),as_8_bit('_')) in AVAILABLE_GLU_EXTENSIONS

class _Alternate( LateBind ):
    def __init__( self, name, *alternates ):
        """Initialize set of alternative implementations of the same function"""
        self.__name__ = name
        self._alternatives = alternates
        if root.MODULE_ANNOTATIONS:
            frame = sys._getframe().f_back
            if frame and frame.f_back and '__name__' in frame.f_back.f_globals:
                self.__module__ = frame.f_back.f_globals['__name__']
    def __nonzero__( self ):
        from OpenGL import error
        try:
            return bool( self.getFinalCall())
        except error.NullFunctionError, err:
            return False
    def finalise( self ):
        """Call, doing a late lookup and bind to find an implementation"""
        for alternate in self._alternatives:
            if alternate:
                log.info(
                    """Chose alternate: %s from %s""",
                    alternate.__name__,
                    ", ".join([x.__name__ for x in self._alternatives])
                )
                return alternate
        from OpenGL import error
        raise error.NullFunctionError(
            """Attempt to call an undefined alternate function (%s), check for bool(%s) before calling"""%(
                ', '.join([x.__name__ for x in self._alternatives]),
                self.__name__,
            )
        )
def alternate( name, *functions ):
    """Construct a callable that functions as the first implementation found of given set of alternatives

    if name is a function then its name will be used....
    """
    if not isinstance( name, (str,unicode)):
        functions = (name,)+functions
        name = name.__name__
    return type( name, (_Alternate,), {} )( name, *functions )


text:
module InContact
  class TokenAuthenticatedResource

    attr_reader :connection

    def initialize(connection)
      @connection = connection
    end
  end
end


text:
Function Get-UnityroleMapping {

  <#
      .SYNOPSIS
      Information about role mappings in the storage system.

 Each role mapping associates a local user, LDAP user, or LDAP group with a role, granting that user or group administrative privileges on the system.

 When you create a local user through the REST API, the appropriate role mapping between the new user and the specified role is created implicitly by the storage system. When you create an LDAP user or group through the REST API, you must explicitly specify a role mapping for that user or group by creating a new roleMapping resource.

 For information about creating local users, see the Help topic for the user resource type.
      .DESCRIPTION
      Information about role mappings in the storage system.

 Each role mapping associates a local user, LDAP user, or LDAP group with a role, granting that user or group administrative privileges on the system.

 When you create a local user through the REST API, the appropriate role mapping between the new user and the specified role is created implicitly by the storage system. When you create an LDAP user or group through the REST API, you must explicitly specify a role mapping for that user or group by creating a new roleMapping resource.

 For information about creating local users, see the Help topic for the user resource type.
      You need to have an active session with the array.
      .NOTES
      Written by Erwan Quelin under MIT licence - https://github.com/equelin/Unity-Powershell/blob/master/LICENSE
      .LINK
      https://github.com/equelin/Unity-Powershell
      .PARAMETER Session
      Specifies an UnitySession Object.
      .PARAMETER Name
      Specifies the object name.
      .PARAMETER ID
      Specifies the object ID.
      .EXAMPLE
      Get-UnityroleMapping

      Retrieve information about all UnityroleMapping
      .EXAMPLE
      Get-UnityroleMapping -ID 'id01'

      Retrieves information about a specific UnityroleMapping
  #>

  [CmdletBinding(DefaultParameterSetName='Name')]
  Param (
    [Parameter(Mandatory = $false,HelpMessage = 'EMC Unity Session')]
    $session = ($global:DefaultUnitySession | where-object {$_.IsConnected -eq $true}),
    [Parameter(Mandatory = $false,ParameterSetName='Name',ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True,HelpMessage = 'UnityroleMapping Name')]
    [String[]]$Name,
    [Parameter(Mandatory = $false,ParameterSetName='ID',ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True,HelpMessage = 'UnityroleMapping ID')]
    [String[]]$ID
  )

  Begin {
    Write-Debug -Message "[$($MyInvocation.MyCommand)] Executing function"

    #Initialazing variables
    $URI = '/api/types/roleMapping/instances' #URI
    $TypeName = 'UnityroleMapping'
  }

  Process {
    Foreach ($sess in $session) {

      Write-Debug -Message "[$($MyInvocation.MyCommand)] Processing Session: $($Session.Server) with SessionId: $($Session.SessionId)"

      Get-UnityItemByKey -Session $Sess -URI $URI -Typename $Typename -Key $PsCmdlet.ParameterSetName -Value $PSBoundParameters[$PsCmdlet.ParameterSetName]

    } # End Foreach ($sess in $session)
  } # End Process
} # End Function


text:
package opendct.nanohttpd.servlets;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import fi.iki.elonen.NanoHTTPD;
import fi.iki.elonen.router.RouterNanoHTTPD;
import opendct.config.Config;
import opendct.config.StaticConfig;
import opendct.consumer.SageTVConsumer;
import opendct.nanohttpd.serializer.ConsumerSerializer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class VersionJsonServlet {
    private static final Logger logger = LogManager.getLogger(VersionJsonServlet.class);
    /**
     * Increment this value whenever any breaking changes are made. Do not increment if a feature
     * was added, but all previous functionality has not changed.
     */
    public final static int JSON_VERSION = 2;

    private static final GsonBuilder gsonBuilder = new GsonBuilder();
    private static final Gson gson;

    static {
        gsonBuilder.registerTypeAdapter(SageTVConsumer.class, new ConsumerSerializer());
        gsonBuilder.setPrettyPrinting();
        gson = gsonBuilder.create();
    }

    public static class List extends RouterNanoHTTPD.DefaultHandler {
        @Override
        public String getText() {
            JsonObject newObject = new JsonObject();

            newObject.addProperty("versionProgram", StaticConfig.VERSION_PROGRAM);
            newObject.addProperty("versionMajor", StaticConfig.VERSION_MAJOR);
            newObject.addProperty("versionMinor", StaticConfig.VERSION_MINOR);
            newObject.addProperty("versionBuild", StaticConfig.VERSION_BUILD);
            newObject.addProperty("versionConfig", StaticConfig.VERSION_CONFIG);
            newObject.addProperty("versionOS", Config.OS_VERSION.toString());
            newObject.addProperty("is64Bit", Config.IS_64BIT);
            newObject.addProperty("configDir", Config.CONFIG_DIR);
            newObject.addProperty("logDir", Config.LOG_DIR);
            newObject.addProperty("projectDir", Config.PROJECT_DIR);
            newObject.addProperty("versionJson", JSON_VERSION);

            return gson.toJson(newObject);
        }

        @Override
        public String getMimeType() {
            return "application/json";
        }

        @Override
        public NanoHTTPD.Response.IStatus getStatus() {
            return NanoHTTPD.Response.Status.OK;
        }
    }
}


text:
If you intend to contribute to the project, please make sure you've followed the instructions provided in the [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
## Project Setup
The Azure Storage development team uses Visual Studio so instructions will be tailored to that preference. However, any preferred IDE or other toolset should be usable.

### Install
* .Net 4.0
* Visual Studio 2013. If you want to work with the CoreCLR SDK, you will need Visual Studio 2015. Note not all of the non-CoreCLR SDKs work in VS 2015, so you may need to develop with both 2013 and 2015 if you take a dependency on multiple runtimes.
* [StyleCop](http://stylecop.codeplex.com/) checks your code's style – spacing, comments, etc. You can run this from the Tools menu in Visual Studio or by right clicking the project/folder you'd like to run it on.
* Clone the source code from GitHub.

### Open Solution
For non-CoreCLR solutions, you can open the project from VS using File->Open->Project/Solution and navigating to the Microsoft.WindowsAzure.Storage.sln solution file in the repo base folder.
For the CoreCLR solution, you can open the project using the AspNet_k.sln solution in the repo base folder.

## Tests

### Configuration
The only step to configure testing is to add a TestConfiguration.xml to the Test/Common/ folder. You should insert your storage account information into the file using [this](Test/Common/TestConfigurationsTemplate.xml) as a template.

### Running
To actually run tests, right click the individual test or test class in the Test Explorer panel.
*Note*: Running all tests will take many hours, so you should run a subset of tests that validate your change.

### Testing Features
As you develop a feature, you'll need to write tests to ensure quality. You should also run existing tests related to your change to address any unexpected breaks.

## Pull Requests

### Guidelines
The following are the minimum requirements for any pull request that must be met before contributions can be accepted.
* Make sure you've signed the CLA before you start working on any change.
* Discuss any proposed contribution with the team via a GitHub issue **before** starting development.
* Code must be professional quality
	* No style issues, StyleCop doesn't report any *new* issues related to your changes
	* You should strive to mimic the style with which we have written the library
	* Clean, well-commented, well-designed code
	* Try to limit the number of commits for a feature to 1-2. If you end up having too many we may ask you to squash your changes into fewer commits.
* [changelog.txt](changelog.txt) needs to be updated describing the new change
* Thoroughly test your feature

### Branching Policy
Non-breaking changes should be based on the dev branch whereas breaking changes should be based on the dev_breaking branch. Each breaking change should be recorded in [BreakingChanges.txt](BreakingChanges.txt).
We generally release any breaking changes in the next major version (e.g. 6.0, 7.0) and non-breaking changes in the next minor or major version (e.g. 6.0, 6.1, 6.2).

### Adding Features for All Platforms
We strive to release each new feature for each of our environments at the same time. Therefore, we ask that all contributions be written for both our Desktop SDK and our Window Runtime/CoreCLR SDK. This includes testing work for both platforms as well.

### Review Process
We expect all guidelines to be met before accepting a pull request. As such, we will work with you to address issues we find by leaving comments in your code. Please understand that it may take a few iterations before the code is accepted as we maintain high standards on code quality. Once we feel comfortable with a contribution, we will validate the change and accept the pull request.

Thank you for any contributions! Please let the team know if you have any questions or concerns about our contribution policy.


text:
<!DOCTYPE html>

    <title>Hello World</title>

      Name:
      <input type="text" ng-model="name" />

Hello {{ name }}


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

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Creates a standard fully connected backpropagation neural network</title>

fann_create_standard_array

fann_create_train_from_callback

Fann Functions

PHP Manual

fann_create_standard

(PECL fann >= 1.0.0)

fann_create_standard — Creates a standard fully connected backpropagation neural network

Description

   resource fann_create_standard
    ( int $num_layers
   , int $num_neurons1
   , int $num_neurons2
   [, int $...
  ] )

   Creates a standard fully connected backpropagation neural network.

   There will be a bias neuron in each layer (except the output layer),
   and this bias neuron will be connected to all neurons in the next layer.
   When running the network, the bias nodes always emits 1.

   To destroy a neural network use the fann_destroy() function.

Parameters

num_layers

      The total number of layers including the input and the output layer.

num_neurons1

      Number of neurons in the first layer.

num_neurons2

      Number of neurons in the second layer.

...

      Number of neurons in other layers.

Return Values

   Returns a neural network resource on success, or FALSE on error.

See Also

fann_create_standard_array() - Creates a standard fully connected backpropagation neural network using an array of layer sizes

fann_create_sparse() - Creates a standard backpropagation neural network, which is not fully connected

fann_create_shortcut() - Creates a standard backpropagation neural network which is not fully connectected and has shortcut connections

fann_create_standard_array

fann_create_train_from_callback

Fann Functions

PHP Manual


text:
@echo off

REM IMPORTANT VARIABLES :: you have to set them properly
set VCVARSALL_BAT="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
set VC_ARCH=amd64

call %VCVARSALL_BAT% %VC_ARCH%

set PATH=C:\externals-siconos\bin;%PATH%
set LIB=C:\externals-siconos\lib;%LIB%
set INCLUDE=C:\externals-siconos\include;%INCLUDE%

REM We might have to switch boost version --xhub
set CMAKE_INSTALL_PREFIX=C:/install-vs2015-amd64
set REL_TYPE="Release"

set PATH=%CMAKE_INSTALL_PREFIX%;%PATH%

REM does not work if you don't have msys64 at this precise place
for /f "delims=" %%a in ('C:\msys64\usr\bin\bash -lc "cygpath -m `swig -swiglib`"') do @set SWIG_DIR=%%a

call cmake %* ^
-G"NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=%REL_TYPE% ^
-DMODE=Continuous ^
-DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" ^
-DINSTALL_COMMAND="nmake;/I;install" ^
-DSWIG_DIR="%SWIG_DIR%" ^
-DBUILD_AS_CPP=1 ^
-DWITH_TESTING=1 ^
-DWITH_PYTHON_WRAPPER=0 ^
-DCMAKE_Fortran_COMPILER=gfortran ^
-DCMAKE_Fortran_COMPILER_FORCED=1;

call nmake.exe /I
call nmake.exe /I install


text:
**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.**

[v3-docs]: ../docs.md#documentation

# Upgrade etcd to 2.1

In the general case, upgrading from etcd 2.0 to 2.1 can be a zero-downtime, rolling upgrade:
 - one by one, stop the etcd v2.0 processes and replace them with etcd v2.1 processes
 - after you are running all v2.1 processes, new features in v2.1 are available to the cluster

Before [starting an upgrade](#upgrade-procedure), read through the rest of this guide to prepare.

## Upgrade Checklists

### Upgrade Requirements

To upgrade an existing etcd deployment to 2.1, you must be running 2.0. If you're running a version of etcd before 2.0, you must upgrade to [2.0][v2.0] before upgrading to 2.1.

Also, to ensure a smooth rolling upgrade, your running cluster must be healthy. You can check the health of the cluster by using `etcdctl cluster-health` command.

### Preparedness

Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment.

You might also want to [backup your data directory][backup-datastore] for a potential [downgrade](#downgrade).

etcd 2.1 introduces a new [authentication][auth] feature, which is disabled by default. If your deployment depends on these, you may want to test the auth features before enabling them in production.

### Mixed Versions

While upgrading, an etcd cluster supports mixed versions of etcd members. The cluster is only considered upgraded once all its members are upgraded to 2.1.

Internally, etcd members negotiate with each other to determine the overall etcd cluster version, which controls the reported cluster version and the supported features. For example, if you are mid-upgrade, any 2.1 features (such as the the authentication feature mentioned above) won't be available.

### Limitations

If you encounter any issues during the upgrade, you can attempt to restart the etcd process in trouble using a newer v2.1 binary to solve the problem. One known issue is that etcd v2.0.0 and v2.0.2 may panic during rolling upgrades due to an existing bug, which has been fixed since etcd v2.0.3.

It might take up to 2 minutes for the newly upgraded member to catch up with the existing cluster when the total data size is larger than 50MB (You can check the size of the existing snapshot to know about the rough data size). In other words, it is safest to wait for 2 minutes before upgrading the next member.

If you have even more data, this might take more time. If you have a data size larger than 100MB you should contact us before upgrading, so we can make sure the upgrades work smoothly.

### Downgrade

If all members have been upgraded to v2.1, the cluster will be upgraded to v2.1, and downgrade is **not possible**. If any member is still v2.0, the cluster will remain in v2.0, and you can go back to use v2.0 binary.

Please [backup your data directory][backup-datastore] of all etcd members if you want to downgrade the cluster, even if it is upgraded.

### Upgrade Procedure

#### 1. Check upgrade requirements.

```
$ etcdctl cluster-health
cluster is healthy
member 6e3bd23ae5f1eae0 is healthy
member 924e2e83e93f2560 is healthy
member a8266ecf031671f3 is healthy

$ curl http://127.0.0.1:4001/version
etcd 2.0.x
```

#### 2. Stop the existing etcd process

You will see similar error logging from other etcd processes in your cluster. This is normal, since you just shut down a member.

```
2015/06/23 15:45:09 sender: error posting to 6e3bd23ae5f1eae0: dial tcp 127.0.0.1:7002: connection refused
2015/06/23 15:45:09 sender: the connection with 6e3bd23ae5f1eae0 became inactive
2015/06/23 15:45:11 rafthttp: encountered error writing to server log stream: write tcp 127.0.0.1:53783: broken pipe
2015/06/23 15:45:11 rafthttp: server streaming to 6e3bd23ae5f1eae0 at term 2 has been stopped
2015/06/23 15:45:11 stream: error sending message: stopped
2015/06/23 15:45:11 stream: stopping the stream server...
```

You could [backup your data directory][backup-datastore] for data safety.

```
$ etcdctl backup \
      --data-dir /var/lib/etcd \
      --backup-dir /tmp/etcd_backup
```

#### 3. Drop-in etcd v2.1 binary and start the new etcd process

You will see the etcd publish its information to the cluster.

```
2015/06/23 15:45:39 etcdserver: published {Name:infra2 ClientURLs:[http://localhost:4002]} to cluster e9c7614f68f35fb2
```

You could verify the cluster becomes healthy.

```
$ etcdctl cluster-health
cluster is healthy
member 6e3bd23ae5f1eae0 is healthy
member 924e2e83e93f2560 is healthy
member a8266ecf031671f3 is healthy
```

#### 4. Repeat step 2 to step 3 for all other members

#### 5. Finish

When all members are upgraded, you will see the cluster is upgraded to 2.1 successfully:

```
2015/06/23 15:46:35 etcdserver: updated the cluster version from 2.0.0 to 2.1.0
```

```
$ curl http://127.0.0.1:4001/version
{"etcdserver":"2.1.x","etcdcluster":"2.1.0"}
```

[auth]: auth_api.md
[backup-datastore]: admin_guide.md#backing-up-the-datastore
[v2.0]: https://github.com/coreos/etcd/releases/tag/v2.0.13


text:
package org.onosproject.openflow;

import org.onosproject.net.Device;
import org.onosproject.net.driver.DriverData;
import org.onosproject.net.driver.DriverHandler;
import org.onosproject.openflow.controller.Dpid;
import org.onosproject.openflow.controller.OpenFlowSession;
import org.onosproject.openflow.controller.RoleState;
import org.onosproject.openflow.controller.driver.OpenFlowAgent;
import org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver;
import org.onosproject.openflow.controller.driver.RoleHandler;
import org.onosproject.openflow.controller.driver.SwitchStateException;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFErrorMsg;
import org.projectfloodlight.openflow.protocol.OFFactories;
import org.projectfloodlight.openflow.protocol.OFFactory;
import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFMeterFeatures;
import org.projectfloodlight.openflow.protocol.OFMeterFeaturesStatsReply;
import org.projectfloodlight.openflow.protocol.OFPortDesc;
import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply;
import org.projectfloodlight.openflow.protocol.OFVersion;

import java.util.List;
import java.util.Set;

/**
 * Testing adapter for the OpenFlow switch driver class.
 */
public class OpenflowSwitchDriverAdapter implements OpenFlowSwitchDriver {

    RoleState role = RoleState.MASTER;
    // state of the connection
    private Set<Dpid> connected;
    private Dpid myDpid;
    private boolean complete;

    public OpenflowSwitchDriverAdapter() {
    }

    public OpenflowSwitchDriverAdapter(Set<Dpid> connected, Dpid myDpid, boolean complete) {
        this.connected = connected;
        this.myDpid = myDpid;
        this.complete = complete;
    }

    @Override
    public void setAgent(OpenFlowAgent agent) {

    }

    @Override
    public void setRoleHandler(RoleHandler roleHandler) {

    }

    @Override
    public void reassertRole() {

    }

    @Override
    public boolean handleRoleError(OFErrorMsg error) {
        return false;
    }

    @Override
    public void handleNiciraRole(OFMessage m) throws SwitchStateException {

    }

    @Override
    public void handleRole(OFMessage m) throws SwitchStateException {

    }

    @Override
    public boolean connectSwitch() {
        return !connected.contains(myDpid);
    }

    @Override
    public boolean activateMasterSwitch() {
        return false;
    }

    @Override
    public boolean activateEqualSwitch() {
        return false;
    }

    @Override
    public void transitionToEqualSwitch() {

    }

    @Override
    public void transitionToMasterSwitch() {

    }

    @Override
    public void removeConnectedSwitch() {

    }

    @Override
    public void setPortDescReply(OFPortDescStatsReply portDescReply) {

    }

    @Override
    public void setPortDescReplies(List<OFPortDescStatsReply> portDescReplies) {

    }

    @Override
    public void setFeaturesReply(OFFeaturesReply featuresReply) {

    }

    @Override
    public void setMeterFeaturesReply(OFMeterFeaturesStatsReply meterFeaturesReply) {

    }

    @Override
    public void setSwitchDescription(OFDescStatsReply desc) {

    }

    @Override
    public int getNextTransactionId() {
        return 0;
    }

    @Override
    public void setOFVersion(OFVersion ofV) {

    }

    @Override
    public void setTableFull(boolean full) {

    }

    @Override
    public void setChannel(OpenFlowSession channel) {

    }

    @Override
    public void setConnected(boolean connected) {

    }

    @Override
    public void init(Dpid dpid, OFDescStatsReply desc, OFVersion ofv) {

    }

    @Override
    public Boolean supportNxRole() {
        return true;
    }

    @Override
    public void startDriverHandshake() {

    }

    @Override
    public boolean isDriverHandshakeComplete() {
        return complete;
    }

    @Override
    public void processDriverHandshakeMessage(OFMessage m) {
        complete = true;
    }

    @Override
    public void sendRoleRequest(OFMessage message) {

    }

    @Override
    public void sendHandshakeMessage(OFMessage message) {

    }

    @Override
    public DriverHandler handler() {
        return null;
    }

    @Override
    public void setHandler(DriverHandler handler) {

    }

    @Override
    public DriverData data() {
        return null;
    }

    @Override
    public void setData(DriverData data) {

    }

    @Override
    public void sendMsg(OFMessage msg) {

    }

    @Override
    public void sendMsg(List<OFMessage> msgs) {

    }

    @Override
    public void handleMessage(OFMessage fromSwitch) {

    }

    @Override
    public void setRole(RoleState role) {
        this.role = role;
    }

    @Override
    public RoleState getRole() {
        return role;
    }

    @Override
    public List<OFPortDesc> getPorts() {
        return null;
    }

    @Override
    public OFMeterFeatures getMeterFeatures() {
        return null;
    }

    @Override
    public OFFactory factory() {
        // return what-ever triggers requestPending = true
        return OFFactories.getFactory(OFVersion.OF_10);
    }

    @Override
    public String getStringId() {
        return "100";
    }

    @Override
    public long getId() {
        return 0;
    }

    @Override
    public String manufacturerDescription() {
        return null;
    }

    @Override
    public String datapathDescription() {
        return null;
    }

    @Override
    public String hardwareDescription() {
        return null;
    }

    @Override
    public String softwareDescription() {
        return null;
    }

    @Override
    public String serialNumber() {
        return null;
    }

    @Override
    public boolean isConnected() {
        return false;
    }

    @Override
    public void disconnectSwitch() {

    }

    @Override
    public void returnRoleReply(RoleState requested, RoleState response) {

    }

    @Override
    public Device.Type deviceType() {
        return Device.Type.SWITCH;
    }

    @Override
    public String channelId() {
        return null;
    }
}


text:
package sumologicexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumologicexporter"

import (
	"context"
	"fmt"

	"go.opentelemetry.io/collector/component"
	"go.opentelemetry.io/collector/config"
	"go.opentelemetry.io/collector/exporter/exporterhelper"
)

const (
	// The value of "type" key in configuration.
	typeStr = "sumologic"
	// The stability level of the exporter.
	stability = component.StabilityLevelBeta
)

// NewFactory returns a new factory for the sumologic exporter.
func NewFactory() component.ExporterFactory {
	return component.NewExporterFactory(
		typeStr,
		createDefaultConfig,
		component.WithLogsExporter(createLogsExporter, stability),
		component.WithMetricsExporter(createMetricsExporter, stability),
	)
}

func createDefaultConfig() component.ExporterConfig {
	qs := exporterhelper.NewDefaultQueueSettings()
	qs.Enabled = false

	return &Config{
		ExporterSettings: config.NewExporterSettings(component.NewID(typeStr)),

		CompressEncoding:   DefaultCompressEncoding,
		MaxRequestBodySize: DefaultMaxRequestBodySize,
		LogFormat:          DefaultLogFormat,
		MetricFormat:       DefaultMetricFormat,
		SourceCategory:     DefaultSourceCategory,
		SourceName:         DefaultSourceName,
		SourceHost:         DefaultSourceHost,
		Client:             DefaultClient,
		GraphiteTemplate:   DefaultGraphiteTemplate,

		HTTPClientSettings: CreateDefaultHTTPClientSettings(),
		RetrySettings:      exporterhelper.NewDefaultRetrySettings(),
		QueueSettings:      qs,
	}
}

func createLogsExporter(
	_ context.Context,
	params component.ExporterCreateSettings,
	cfg component.ExporterConfig,
) (component.LogsExporter, error) {
	exp, err := newLogsExporter(cfg.(*Config), params)
	if err != nil {
		return nil, fmt.Errorf("failed to create the logs exporter: %w", err)
	}

	return exp, nil
}

func createMetricsExporter(
	_ context.Context,
	params component.ExporterCreateSettings,
	cfg component.ExporterConfig,
) (component.MetricsExporter, error) {
	exp, err := newMetricsExporter(cfg.(*Config), params)
	if err != nil {
		return nil, fmt.Errorf("failed to create the metrics exporter: %w", err)
	}

	return exp, nil
}


text:
package android.filterpacks.imageproc;

import android.filterfw.core.Filter;
import android.filterfw.core.FilterContext;
import android.filterfw.core.Frame;
import android.filterfw.core.FrameFormat;
import android.filterfw.core.KeyValueMap;
import android.filterfw.core.MutableFrameFormat;
import android.filterfw.core.NativeProgram;
import android.filterfw.core.NativeFrame;
import android.filterfw.core.Program;
import android.filterfw.core.ShaderProgram;
import android.filterfw.format.ImageFormat;

import android.util.Log;

/**
 * @hide
 */
public class ToRGBFilter extends Filter {

    private int mInputBPP;
    private Program mProgram;
    private FrameFormat mLastFormat = null;

    public ToRGBFilter(String name) {
        super(name);
    }

    @Override
    public void setupPorts() {
        MutableFrameFormat mask = new MutableFrameFormat(FrameFormat.TYPE_BYTE,
                                                         FrameFormat.TARGET_NATIVE);
        mask.setDimensionCount(2);
        addMaskedInputPort("image", mask);
        addOutputBasedOnInput("image", "image");
    }

    @Override
    public FrameFormat getOutputFormat(String portName, FrameFormat inputFormat) {
        return getConvertedFormat(inputFormat);
    }

    public FrameFormat getConvertedFormat(FrameFormat format) {
        MutableFrameFormat result = format.mutableCopy();
        result.setMetaValue(ImageFormat.COLORSPACE_KEY, ImageFormat.COLORSPACE_RGB);
        result.setBytesPerSample(3);
        return result;
    }

    public void createProgram(FilterContext context, FrameFormat format) {
        mInputBPP = format.getBytesPerSample();
        if (mLastFormat != null && mLastFormat.getBytesPerSample() == mInputBPP) return;
        mLastFormat = format;
        switch (mInputBPP) {
            case 1:
                mProgram = new NativeProgram("filterpack_imageproc", "gray_to_rgb");
                break;
            case 4:
                mProgram = new NativeProgram("filterpack_imageproc", "rgba_to_rgb");
                break;
            default:
                throw new RuntimeException("Unsupported BytesPerPixel: " + mInputBPP + "!");
        }
    }

    @Override
    public void process(FilterContext context) {
        // Get input frame
        Frame input = pullInput("image");
        createProgram(context, input.getFormat());

        // Create output frame
        Frame output = context.getFrameManager().newFrame(getConvertedFormat(input.getFormat()));

        // Process
        mProgram.process(input, output);

        // Push output
        pushOutput("image", output);

        // Release pushed frame
        output.release();
    }

}


text:
@interface CDCoreDataManager : NSObject

//used to begin and end CDCoreDatManager lifecycle
- (void)openDocument;
- (void)closeDocument;

//print data for debuggin purposes
- (void)printData;

//add student schedule at welcome screen
- (void)addScheduleToDatabaseWithSchedule:(NSDictionary *)schedule;

- (NSArray *)getClasses;

@end


text:
namespace Uncas.Core.Data.Migration
{
    /// <summary>
    /// Represents a migration change.
    /// </summary>
    public interface IMigrationChange
    {
        /// <summary>
        /// Gets the id of the migration change.
        /// </summary>
        /// <value>The id of the migration change.</value>
        string Id { get; }
    }
}


text:
'use strict';

angular.module('wuw.controllers')

/*
 * The mensa controller.
 */
.controller('MensaCtrl', function($scope, $ionicPopup, $timeout, $filter, Dishes, Settings) {

    var moreCounter = 0;
    $scope.infoVisible = false;

    $scope.loadDishes = function() {
        moreCounter = 0;
        Dishes.getDishes().then(function(dishes){
            $scope.dishes = dishes;
            $scope.$broadcast('czErrorMessage.hide'); //hide an eventually shown error message
        }, function() {
            // show the error message with some delay to prevent flickering
            $timeout(function() {
                $scope.$broadcast('czErrorMessage.show');
            }, 300);
        }).finally(function () {
            // remove the refresh spinner a little bit later to prevent flickering
            $timeout(function() {
                $scope.$broadcast('scroll.refreshComplete');
            }, 400);
        });
    };

    $scope.doRefresh = function() {
        $scope.loadDishes();
    };

    $scope.loadMore = function() {
        moreCounter++;
        var moreDishes = Dishes.getMoreDishes(moreCounter);
        $scope.dishes = moreDishes;
        $scope.$broadcast('scroll.infiniteScrollComplete');
    };

    $scope.toggleInfoVisible = function() {
        if (ionic.Platform.isIOS() && ionic.Platform.isWebView()) {
            navigator.notification.alert(
                $filter('translate')('mensa.infoTextiOS'),  // message
                null,                                    // callback
                $filter('translate')('mensa.infoTitle'), // title
                $filter('translate')('global.done')      // buttonName
            );
        } else {
            var alertPopup = $ionicPopup.alert({
                title: $filter('translate')('mensa.infoTitle'),
                template: $filter('translate')('mensa.infoText')
            });
        }
    };

    $scope.$on('$ionicView.loaded', function(){
        $scope.dishes = Dishes.fromCache();
    });

    $scope.$on('$ionicView.afterEnter', function(){
        // If the cache is older then 'cacheMensa' seconds, load new data from API.
        if (Dishes.secondsSinceCache() > Settings.getSetting('cacheMensa')) {
            $scope.loadDishes();
        }
    });
})

.controller('MensaDetailCtrl', function($scope, $stateParams, Dishes) {
    $scope.dish = Dishes.get($stateParams.dishId);
});


text:
@interface HXMLoginMainView : UIView

//@property (nonatomic, weak) id<loginVCDelegate> delegate;
//@property (nonatomic, copy) void (^ _Nullable dismissCompletion)();
@property (nonatomic, copy) void(^ successLoginBlock)();
//输入手机号视图
@property (weak, nonatomic) IBOutlet UIView *phoneNumberView;
//输入验证码视图
@property (weak, nonatomic) IBOutlet UIView *VerificationCodeView;
//登录按钮
@property (weak, nonatomic) IBOutlet UIButton *loginButton;
//输入手机号输入框
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField;
//输入验证码输入框
@property (weak, nonatomic) IBOutlet UITextField *VerificationCodeTextField;
//联系我们
@property (weak, nonatomic) IBOutlet UIButton *contactMeButton;
//获取验证码按钮
@property (weak, nonatomic) IBOutlet UIButton *getVerficationCodeButton;
//清除按钮
@property (weak, nonatomic) IBOutlet UIButton *clearButton;
@property (weak, nonatomic) IBOutlet UIButton *clearCodeButton;
- (void)resetLogin;
+ (instancetype)shareLoginMainView;

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="white_smoke">#F7F7F7</color>
    <color name="white">#FFFFFF</color>
    <color name="black">#000000</color>
    <color name="transparent">#00000000</color>
    <color name="main_color_green">#00B863</color>
    <color name="main_color_grey_dk">#3B3B3B</color>
    <color name="main_color_grey_lt">#ACACAC</color>
    <color name="main_color_grey">#7D7D7D</color>
    <color name="grey_light">#E8E8E8</color>

</resources>


text:
/*jslint asi: true, vars: true, plusplus: true, devel: true, nomen: true,  maxerr: 50 */
/*global define, $, brackets */

define(function (require, exports, module) {
    var CommandManager  = brackets.getModule("command/CommandManager"),
        Menus           = brackets.getModule("command/Menus"),
        EditorManager   = brackets.getModule("editor/EditorManager"),
        LiveDevelopmentUtils = brackets.getModule("LiveDevelopment/LiveDevelopmentUtils");

    var JavaScriptBuffer = require('./light-refactor.js/type-inference');

    var ModalBar = brackets.getModule('widgets/ModalBar').ModalBar;

    var lastFailedAttemptKey = ''; // A hash to determine if this is a repeated CTRL-R, and should jump to syntax error.

    function convertPos(pos) {
        return {line: pos.line, ch: pos.column}
    }

    CommandManager.register("Rename JavaScript Identifier", "javascript.renameIdentifier", function () {
        var editor = EditorManager.getFocusedEditor()
        if (editor === null)
            return
        var cm = editor._codeMirror

        var text = editor.document.getText()
        var pos = editor.indexFromPos(editor.getCursorPos())

        var filename = editor.document.file ? editor.document.file.name : "";
        var isHtml = LiveDevelopmentUtils.isStaticHtmlFileExt(filename)

        var jsb = new JavaScriptBuffer;
        try {
            jsb.add("main", text, {type: isHtml ? "html" : "js"})
        } catch (e) {
            var msg;
            if (e.lineNumber) {
                var failedAttemptKey = e.toString() + '~' + filename + '~' + pos
                if (failedAttemptKey === lastFailedAttemptKey) {
                    editor.setCursorPos(e.lineNumber-1, e.column, true);
                    msg = e.description;
                } else {
                    lastFailedAttemptKey = failedAttemptKey;
                    msg = 'syntax error (CTRL-R again to jump)';
                }
            } else {
                msg = e.toString()
            }
            editor.displayErrorMessageAtCursor('JS Rename: ' + msg)
            return;
        }
        lastFailedAttemptKey = '';

        var questions = jsb.renameTokenAt("main", pos) // TODO: run in background?
        if (!questions) {
            editor.displayErrorMessageAtCursor('JS Rename: place cursor in a name')
            return
        }

        var initialRange = questions[0][0];
        var oldName = text.substring(initialRange.start.offset, initialRange.end.offset)

        // We need to highlight groups of tokens. We use an array to keep track of the text markers we've inserted.
        var markers = []
        function setHighlighting(ranges) {
            cm.operation(function() {
                markers.forEach(function(x) { x.clear() }) // remove any existing markers
                markers.length = 0
                $(cm.getWrapperElement()).addClass("find-highlighting");
                for (var j=0; j<ranges.length; j++) {
                    var range = ranges[j]
                    var marker = editor._codeMirror.markText(convertPos(range.start), convertPos(range.end), {className:"CodeMirror-searching"})
                    markers.push(marker)
                }
            })
        }
        function clearHighlighting() {
            $(cm.getWrapperElement()).removeClass("find-highlighting");
            cm.operation(function() {
                markers.forEach(function(x) { x.clear() })
                markers.length = 0
            })
        }

        // Highlight token related to the selected token while asking for the new name
        setHighlighting(questions[0])
        // ModalBar args: html, autoclose, animate
        var nameBar = new ModalBar('New name: <input type="text" style="width: 14em" value="'+oldName+'"/>', true, false);
        $("input[type='text']", nameBar.getRoot()).select();

        var selected = {0:true} // indices of selected renamings (auto-answer first question)

        var newName;
        var confirmBar = null;

        function handleCommit() {
            newName = $("input[type='text']", nameBar.getRoot()).val()
            nameBar = null
            askQuestion(1)
        }

        nameBar.getRoot().keydown(function (ev) {
            if (ev.keyCode === 13) { // enter
                ev.preventDefault()
                nameBar.close()
                handleCommit()
            }
        })
        nameBar.on("close", clearHighlighting)

        function askQuestion(i) {
            if (i === questions.length) {
                finishRenaming()
            } else {
                if (confirmBar === null) {
                    confirmBar = new ModalBar(
                          'Rename this token? ' +
                          '<button id="rename-yes" class="btn">Yes</button> ' +
                          '<button id="rename-no" class="btn">No</button> ' +
                          '<button class="btn">Abort</button>' +
                          '
' +
                            'Question ' + (i+1-1) + ' / ' + (questions.length-1) + ' ' +
                            '<button id="rename-yes-all" class="btn">Yes to Rest</button> ' +
                            '<button id="rename-no-all" class="btn">No to Rest</button> ' +
                          '
',
                          false, false) // false=dont auto-close, false=dont animate
                    confirmBar.on("close", clearHighlighting);
                    confirmBar.getRoot().keydown(function (ev) {
                        if (ev.keyCode === 27) { // escape
                            ev.preventDefault()
                            confirmBar.close(false, false);
                        }
                    });
                    $("button", confirmBar.getRoot()).first().focus();
                }
                $("#rename-question-num").text(""+i);
                var token = questions[i][0]
                editor.setSelection(convertPos(token.start), convertPos(token.start), true) // true=center viewport on selection
                setHighlighting(questions[i])
                confirmBar.getRoot().off("click")
                confirmBar.getRoot().on("click", "button", function(e) {
                    switch (e.target.id) {
                        case 'rename-yes':
                            selected[i] = true
                            askQuestion(i+1)
                            break;
                        case 'rename-no':
                            selected[i] = false
                            askQuestion(i+1)
                            break;
                        case 'rename-yes-all':
                            for (var j=i; j<questions.length; j++) {
                                selected[j] = true;
                            }
                            finishRenaming();
                            break;
                        case 'rename-no-all':
                            finishRenaming();
                            break;
                        default:
                            clearUI();
                            break;
                    }
                })
            }
        }

        function clearUI() {
            clearHighlighting();
            if (nameBar) {
                nameBar.close(false, false)
                nameBar = null
            }
            if (confirmBar) {
                confirmBar.close(false, false)
                confirmBar = null
            }
        }

        function finishRenaming() {
            clearUI();
            // After renaming, zoom back to original position. We need to keep track of the exact
            // column offset in case it changes due to renaming
            var zoomCol = initialRange.start.column;
            var zoomLine = initialRange.start.line;
            var oldNameLength = initialRange.end.column - initialRange.start.column;
            var zoomScreen = questions.length > 1; // don't zoom if renaming was completely automatic

            // collect all ranges to update
            var ranges = []
            for (var i=0; i<questions.length; i++) {
                if (!selected[i])
                    continue
                for (var j=0; j<questions[i].length; j++) {
                    var range = questions[i][j]
                    ranges.push(range)

                    // check if this renaming pushes the zoom offset
                    if (range.start.line === initialRange.start.line && range.start.column < initialRange.start.column) {
                        zoomCol += newName.length - oldNameLength;
                    }
                }
            }

            // sort ranges from back to front to avoid changing offset during replaceRange
            ranges.sort(function(x,y) { return y.start.offset - x.start.offset })

            // apply changes
            editor.document.batchOperation(function() {
                ranges.forEach(function (range) {
                    editor.document.replaceRange(newName, convertPos(range.start), convertPos(range.end))
                })
                // zoom back to original token and select it
                editor.setSelection({line:zoomLine, ch:zoomCol}, {line:zoomLine, ch:zoomCol+newName.length}, zoomScreen)
            })
        }

    });

    // Use Find menu if present (Sprint 39+), otherwise use Edit menu.
    var menuLocation = Menus.AppMenuBar.FIND_MENU || Menus.AppMenuBar.EDIT_MENU;
    var menuItemLocation = Menus.MenuSection.FIND_REPLACE_COMMANDS || Menus.MenuSection.EDIT_REPLACE_COMMANDS;

    var keys = [
        {key: "Ctrl-R", platform:"mac"}, // don't translate to Cmd-R on mac
        {key: "Ctrl-R", platform:"win"},
        {key: "Ctrl-R", platform:"linux"}
    ];

    Menus.getMenu(menuLocation).addMenuItem("javascript.renameIdentifier", keys, Menus.LAST_IN_SECTION, menuItemLocation);
});


text:
Spree::Variant.class_eval do
  attr_accessible :recommended_price, :minimum_price
  validates :recommended_price, :numericality => { :greater_than_or_equal_to => 0 }, :presence => true, :if => proc { Spree::Config[:require_master_price] }
  validates :minimum_price, :numericality => { :greater_than_or_equal_to => 0 }, :presence => true, :if => proc { Spree::Config[:require_master_price] }
end


text:
namespace RoutesSystem.Model.SQLServerModels
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    public class Route
    {
        public Route()
        {
            this.VehicleRoutes = new HashSet<VehicleRoute>();
        }

        public int Id { get; set; }

        [Required]
        public int StartTownId { get; set; }

        public virtual Town StartTown { get; set; }

        [Required]
        public int EndTownId { get; set; }

        public virtual Town EndTown { get; set; }

        [Required]
        public float Distance { get; set; }

        public virtual ICollection<VehicleRoute> VehicleRoutes { get; set; }
    }
}


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [("eventstore", "0024_auto_20200407_1242")]

    operations = [
        migrations.AddField(
            model_name="covid19triage",
            name="difficulty_breathing",
            field=models.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="covid19triage",
            name="province",
            field=models.CharField(
                choices=[
                    ("ZA-EC", "Eastern Cape"),
                    ("ZA-FS", "Free State"),
                    ("ZA-GT", "Gauteng"),
                    ("ZA-LP", "Limpopo"),
                    ("ZA-MP", "Mpumalanga"),
                    ("ZA-NC", "Northern Cape"),
                    ("ZA-NL", "Kwazulu-Natal"),
                    ("ZA-NW", "North-West (South Africa)"),
                    ("ZA-WC", "Western Cape"),
                ],
                max_length=6,
            ),
        ),
    ]


text:
#include <opencv2/core/core.hpp>

using namespace cv;

int intersectLineCircle(Point2f a, Point2f b, Point2f c, double r, Point2f& p1, Point2f& p2);
int intersectLineSegment(Point2f a, Point2f b, Point2f c, double r, Point2f& p1, Point2f& p2);


text:
package com.itbuzzpress.jsf.bean;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.enterprise.inject.Model;
import javax.enterprise.inject.Produces;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;

import com.itbuzzpress.jsf.model.User;

@Model
public class Manager {

	List<User> userList;

	@PostConstruct
	public void retrieveAllItems() {
		user = new User();

		userList = new ArrayList<User>();
	    userList.add(new User("John","Smith","jsmith@gmail.com"));
	    userList.add(new User("Frank","Walker","jwalker@gmail.com"));
	    userList.add(new User("Fiona","Middleton","fmiddleton@gmail.com"));
	}

	@Produces
	@Named
	User user;

	@Produces
	@Named
	public List<User> getUserList() {
		return userList;
	}

	public void save() {
		userList.add(user);
		FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Added user "+user.getName(), null);
				FacesContext.getCurrentInstance().addMessage(null, facesMsg);
		user = new User();

	}
}


text:
from __future__ import unicode_literals

from django.shortcuts import render
from django.dispatch import receiver
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.conf import settings
# local imports
from notebook.models import PaddleUser
import notebook.forms
import account.views
import tls
import utils
# libraries
import os
import json
import logging
import hashlib
import kubernetes
import zipfile
import cStringIO as StringIO
import base64
from wsgiref.util import FileWrapper
from rest_framework.authtoken.models import Token
from rest_framework import viewsets, generics, permissions
from rest_framework.response import Response
from rest_framework.views import APIView

def healthz(request):
    return HttpResponse("OK")

class SampleView(APIView):
    permission_classes = (permissions.IsAuthenticated,)

    def get(self, request, format=None):
        content = {
            'user': unicode(request.user),  # `django.contrib.auth.User` instance.
            'auth': unicode(request.auth),  # None
            'result': "sample api result",
        }
        return Response(content)

@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_auth_token(sender, instance=None, created=False, **kwargs):
    if created:
        Token.objects.create(user=instance)

@receiver(post_save, sender=User)
def handle_user_save(sender, instance, created, **kwargs):
    if created:
        PaddleUser.objects.create(user=instance)

class LoginView(account.views.LoginView):

    form_class = account.forms.LoginEmailForm

class SignupView(account.views.SignupView):
    form_class = notebook.forms.SignupForm
    identifier_field = "email"

    def after_signup(self, form):
        self.update_profile(form)
        logging.info("creating default user certs...")
        tls.create_user_cert(settings.CA_PATH, form.cleaned_data["email"])
        # HACK: username is the same as user email
        # create user's default RBAC permissions
        logging.info("creating default user namespace and RBAC...")
        create_user_namespace(form.cleaned_data["email"])
        create_user_RBAC_permissions(form.cleaned_data["email"])
        # create user's cephfs storage dir
        try:
            os.mkdir(os.path.join(settings.STORAGE_PATH, form.cleaned_data["email"]))
        except Exception, e:
            # FIXME: all exception is ignored
            logging.error("create user's storage path error: %s", e)

        super(SignupView, self).after_signup(form)

    def update_profile(self, form):
        profile = self.created_user.paddleuser  # replace with your reverse one-to-one profile attribute
        data = form.cleaned_data
        profile.school = data["school"]
        profile.studentID = data["studentID"]
        profile.major = data["major"]
        profile.save()

    def generate_username(self, form):
        # do something to generate a unique username (required by the
        # Django User model, unfortunately)
        username = form.cleaned_data["email"]
        return username

class SettingsView(account.views.SettingsView):
    form_class = notebook.forms.SettingsForm

@login_required
def user_certs_view(request):
    key_exist = utils.user_certs_exist(request.user.username)
    user_keys = ["%s.pem" % request.user.username, "%s-key.pem" % request.user.username]

    return render(request, "user_certs.html",
        context={"key_exist": key_exist, "user_keys": user_keys})

@login_required
def user_certs_download(request):
    certs_file = StringIO.StringIO()
    with zipfile.ZipFile(certs_file, mode='w', compression=zipfile.ZIP_DEFLATED) as zf:
        with open(os.path.join(settings.USER_CERTS_PATH, request.user.username, "%s.pem"%request.user.username), "r") as c:
            zf.writestr('%s.pem'%request.user.username, c.read())
        with open(os.path.join(settings.USER_CERTS_PATH, request.user.username, "%s-key.pem"%request.user.username), "r") as s:
            zf.writestr('%s-key.pem'%request.user.username, s.read())

    response = HttpResponse(certs_file.getvalue(), content_type='application/zip')
    response['Content-Disposition'] = 'attachment; filename=%s.zip' % request.user.username
    response['Content-Length'] = certs_file.tell()
    return response

@login_required
def user_certs_generate(request):
    logging.info("creating default user certs...")
    try:
        tls.create_user_cert(settings.CA_PATH, request.user.email)
        messages.success(request, "X509 certificate generated and updated.")
    except Exception, e:
        messages.error(request, str(e))
        logging.error(str(e))
    return HttpResponseRedirect(request.META.get('HTTP_REFERER'))

def create_user_RBAC_permissions(username):
    namespace = utils.email_escape(username)
    rbacapi = kubernetes.client.RbacAuthorizationV1beta1Api(utils.get_admin_api_client())
    body = {
    "apiVersion": "rbac.authorization.k8s.io/v1beta1",
    "kind": "RoleBinding",
    "metadata": {
        "name": "%s-admin-binding"%namespace,
        "namespace": namespace
        },
    "roleRef": {
        "apiGroup": "rbac.authorization.k8s.io",
        "kind": "ClusterRole",
        "name": "admin"
        },
    "subjects": [{
        "apiGroup": "rbac.authorization.k8s.io",
        "kind": "User",
        "name": username
        }]
    }
    try:
        rbacapi.create_namespaced_role_binding(namespace, body)
    except Exception, e:
        logging.error("%s", str(e))
    # create service account permissions
    body = {
    "apiVersion": "rbac.authorization.k8s.io/v1beta1",
    "kind": "RoleBinding",
    "metadata": {
        "name": "%s-sa-view"%namespace,
        "namespace": namespace
        },
    "roleRef": {
        "apiGroup": "rbac.authorization.k8s.io",
        "kind": "ClusterRole",
        "name": "view"
        },
    "subjects": [{
        "kind": "ServiceAccount",
        "name": "default",
        "namespace": namespace
        }]
    }
    try:
        rbacapi.create_namespaced_role_binding(namespace, body)
    except Exception, e:
        logging.error("%s", str(e))

def create_user_namespace(username):
    v1api = kubernetes.client.CoreV1Api(utils.get_admin_api_client())
    namespaces = v1api.list_namespace()
    user_namespace_found = False
    user_namespace = utils.email_escape(username)
    for ns in namespaces.items:
        # must commit to user's namespace
        if ns.metadata.name == user_namespace:
            user_namespace_found = True
    # Create user's namespace if it does not exist
    if not user_namespace_found:
        v1api.create_namespace({"apiVersion": "v1",
            "kind": "Namespace",
            "metadata": {
                "name": user_namespace
            }})
    for dc, cfg in settings.DATACENTERS.items():
        #create DataCenter sercret if not exists
        secrets = v1api.list_namespaced_secret(user_namespace)
        secret_names = [item.metadata.name for item in secrets.items]

        # create Kubernetes Secret for ceph admin key
        if cfg["fstype"] == "cephfs" and cfg["secret"] not in secret_names:
            with open(cfg["admin_key"], "r") as f:
                key = f.read()
                encoded = base64.b64encode(key)
                v1api.create_namespaced_secret(user_namespace, {
                    "apiVersion": "v1",
                    "kind": "Secret",
                    "metadata": {
                        "name": cfg["secret"]
                    },
                    "data": {
                        "key": encoded
                    }})
    # create docker registry secret
    registry_secret = settings.JOB_DOCKER_IMAGE.get("registry_secret", None)
    if registry_secret and registry_secret not in secret_names:
        docker_config = settings.JOB_DOCKER_IMAGE["docker_config"]
        encode = base64.b64encode(json.dumps(docker_config))
        v1api.create_namespaced_secret(user_namespace, {
            "apiVersion": "v1",
            "kind": "Secret",
            "metadata": {
                "name": registry_secret
            },
            "data": {
                ".dockerconfigjson": encode
            },
            "type": "kubernetes.io/dockerconfigjson"
        })
    return user_namespace

@login_required
def notebook_view(request):
    """
        call kubernetes client to create a Deployment of jupyter notebook,
        mount user's default volume in the pod, then jump to the notebook webpage.
    """
    # NOTICE: username is the same to user's email
    # NOTICE: escape the username to safe string to create namespaces
    username = request.user.username

    # FIXME: notebook must be started under username's namespace
    user_namespace = create_user_namespace(username)

    ub = utils.UserNotebook()
    ub.start_all(username, user_namespace)

    return render(request, "notebook.html",
        context={"notebook_id": ub.get_notebook_id(username),
                 "notebook_status": ub.status(username, user_namespace)})

@login_required
def stop_notebook_backend(request):
    username = request.user.username
    utils.update_user_k8s_config(username)
    ub = utils.UserNotebook()
    ub.stop_all(username, user_namespace)
    return HttpResponseRedirect("/")


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

/**
 * @author api.anash@gmail.com (Anash P. Oommen)
 */

/**
 * @fileoverview Defines GetConversionOptimizerEligibility, a code example that
 *     shows how to check if a campaign is eligible for conversion optimizer.
 */

goog.provide('google.ads.adwords.examples.v201101.GetConversionOptimizerEligibility');

goog.require('google.ads.adwords.AdWordsService.v201101');
goog.require('google.ads.adwords.examples.ExampleBase');
goog.require('google.ads.adwords.v201101.CampaignService');
goog.require('google.ads.adwords.v201101.Predicate');
goog.require('google.ads.adwords.v201101.PredicateOperator');
goog.require('google.ads.adwords.v201101.Selector');

/**
 * This code example shows how to check if a campaign is eligible for
 * conversion optimizer.
 *
 * Tags: CampaignService.get
 *
 * @extends google.ads.adwords.examples.ExampleBase
 * @constructor
 */
google.ads.adwords.examples.v201101.GetConversionOptimizerEligibility =
    function() {
  google.ads.adwords.examples.ExampleBase.call(this);
  this.description = 'This code example shows how to check if a campaign is ' +
      'eligible for conversion optimizer.';
};
goog.inherits(
    google.ads.adwords.examples.v201101.GetConversionOptimizerEligibility,
    google.ads.adwords.examples.ExampleBase);

/**
 * Runs the code example.
 *
 * @param {google.ads.adwords.AdWordsUser} user AdWords user running the code
 *     example.
 * @param {function} callback the callback method to be called once this example
 *     is complete.
 */
google.ads.adwords.examples.v201101.GetConversionOptimizerEligibility.prototype.
    run = function(user, callback) {
  // Get the CampaignService.
  var campaignService = user.getService(
      google.ads.adwords.AdWordsService.v201101.CampaignService);

  var campaignId = this._T('INSERT_CAMPAIGN_ID_HERE');

  // Create a selector.
  var selector = new google.ads.adwords.v201101.Selector();
  selector.fields = ['Id', 'Eligible', 'RejectionReasons'];

  // Create filter conditions.
  var predicate = new google.ads.adwords.v201101.Predicate();
  predicate.field = 'Id';
  predicate.operator = google.ads.adwords.v201101.PredicateOperator.EQUALS;
  predicate.values = [campaignId];
  selector.predicates = [predicate];

  try {
    campaignService.get(selector,
      goog.bind(function(page) {
        if (page && page.entries && page.entries.length > 0) {
          var campaign = page.entries[0];
          if (campaign.conversionOptimizerEligibility.eligible == true) {
            this.writeOutput('Campaign with id = "%d" is eligible to use ' +
                'conversion optimizer.', campaign.id);
          } else {
            for (var i = 0, len = campaign.conversionOptimizerEligibility.
                rejectionReasons.length; i < len; i++) {
              var reason = campaign.conversionOptimizerEligibility.
                  rejectionReasons[i];
              this.writeOutput('Campaign with id = "%d" is not eligible to ' +
                  'use conversion optimizer for reason "%s".',
                  campaign.id, reason);
            }
          }
        } else {
          this.writeOutput('No campaigns were found.');
        }
        callback();
      }, this),
      goog.bind(function(soapException) {
        this.writeOutput('Failed to get conversion optimizer eligibility. ' +
            'Soap Fault says "%s"',
            soapException.getInnerException().getFaultString());
        callback();
      }, this)
    );
  } catch (ex) {
    this.writeOutput('An exception occurred while running the code example.');
    callback();
  }
};


text:
/*
*Created on 202015/9/14 14:32
*@author jianyong.shao
*/
package model;

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

/**
 * Created by jianyong.shao on 2015/9/14.
 *
 * @Desc 一句话说明这个类的作用
 */
public class TestPojo implements Serializable {

private static final long serialVersionUID = 1L;

    private String str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 100字节
    private int  iii = 1111;
    private long lll = 111111l;
    private boolean bool = true;

    private Map<String,String> mapTest;
    private List<String> listTest;

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    public int getIii() {
        return iii;
    }

    public void setIii(int iii) {
        this.iii = iii;
    }

    public long getLll() {
        return lll;
    }

    public void setLll(long lll) {
        this.lll = lll;
    }

    public boolean isBool() {
        return bool;
    }

    public void setBool(boolean bool) {
        this.bool = bool;
    }

    public Map<String, String> getMapTest() {
        return mapTest;
    }

    public void setMapTest(Map<String, String> mapTest) {
        this.mapTest = mapTest;
    }

    public List<String> getListTest() {
        return listTest;
    }

    public void setListTest(List<String> listTest) {
        this.listTest = listTest;
    }
}


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>invalid poster: path-tab</title>
<video poster="http://example.com/foo	bar"></video>


text:
This repository contains a collection of codemod scripts based for use with
[JSCodeshift](https://github.com/facebook/jscodeshift) that helps with Gridiron Migration

### Setup & Run

  * `npm install -g jscodeshift`
  * `jscodeshift -t <codemod-script> <file>`
  * Use the `-d` option for a dry-run and use `-p` to print the output
    for comparison

### Included Scripts
  * `convert-ad`, `convert-helmet-import`, `remove-gridiron-import`, `convert-prefetch` - import helpers
  * `convert-to-radium`, `remove-stilr` - convert from stilr to radium
  * `resolve-relative-imports` - Convert to JSPM Imports

### Recast Options

Options to [recast](https://github.com/benjamn/recast)'s printer can be provided
through the `printOptions` command line argument

 * `jscodeshift -t transform.js <file> --printOptions='{"quote":"double"}'`

 ### Credit

 This repo is based off of [reactjs-codemod](https://github.com/reactjs/react-codemod).
 Thank you [@reactjs](https://twitter.com/reactjs) and [@fbOpenSource](https://twitter.com/fbopensource)!


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hypha digitata Humb.

### Remarks
null


text:
package com.guigarage.photonia.spring.services;

import com.guigarage.photonia.service.AsyncService;
import com.guigarage.photonia.util.ObservableFutureTask;
import org.springframework.stereotype.Service;

import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.function.Consumer;

@Service
public class SpringAsyncService implements AsyncService {

    @Override
    public <V> Future<V> call(Callable<V> callable, Consumer<Future<V>> onDone) {
        ObservableFutureTask<V> task = new ObservableFutureTask<V>(callable);
        task.onDone(onDone);
        task.run();
        return task;
    }

    @Override
    public Future<Void> run(Runnable runnable, Consumer<Future<Void>> onDone) {
        ObservableFutureTask<Void> task = new ObservableFutureTask<Void>(runnable);
        task.onDone(onDone);
        task.run();
        return task;
    }

    @Override
    public <V> Future<V> call(Callable<V> callable) {
        return call(callable, null);
    }

    @Override
    public Future<Void> run(Runnable runnable) {
        return run(runnable, null);
    }
}


text:
import pdb
import re
from collections import deque, defaultdict
from itertools import product
from .components import Pred
from .util import powerset
from delphin._exceptions import XmrsError

TOP = 'TOP'

class XmrsPathError(XmrsError): pass

class XmrsPath(object):

    __slots__ = ('start', '_depth', '_distance', '_preds')

    def __init__(self, startnode):
        self.start = startnode
        self.calculate_metrics()

    def calculate_metrics(self):
        self._distance = {}
        self._depth = {}
        self._preds = {}
        self._calculate_metrics(self.start, 0, 0)

    def _calculate_metrics(self, curnode, depth, distance):
        if curnode is None:
            return
        # add pred index
        try:
            self._preds[curnode.pred].append(curnode)
        except KeyError:
            self._preds[curnode.pred] = []
            self._preds[curnode.pred].append(curnode)
        _id = id(curnode)
        # we may re-update if we're on a shorter path
        updated = False
        if _id not in self._distance or distance < self._distance[_id]:
            self._distance[_id] = distance
            updated = True
        if _id not in self._depth or abs(depth) < abs(self._depth[_id]):
            self._depth[_id] = depth
            updated = True
        if not updated:
            return
        for link in curnode.links:
            if link.endswith('>'):
                self._calculate_metrics(curnode[link], depth+1, distance+1)
            elif link.startswith('<'):
                self._calculate_metrics(curnode[link], depth-1, distance+1)
            else:
                self._calculate_metrics(curnode[link], depth, distance+1)

    def copy(self):
        return XmrsPath(self.start.copy())

    def distance(self, node=None):
        if node is None:
            return max(self._distance.values())
        else:
            return self._distance[id(node)]

    def depth(self, node=None, direction=max):
        if node is None:
            return direction(self._depth.values())
        return self._depth[id(node)]

    def select(self, pred):
        return self._preds.get(pred, [])

    def find(self, pred):
        if pred not in self._preds:
            return []
        return find(self.start, pred)

    def follow(self, connectors):
        node = self.start
        connectors = list(reversed(connectors))
        while connectors:
            node = node[connectors.pop()]
        return node

    def extend(self, extents):
        for connectors, extent in extents:
            # the final connector may be new information
            tgt = self.follow(connectors[:-1])
            if connectors:
                tgt.links.setdefault(
                    connectors[-1], XmrsPathNode(None, None)
                )
                tgt = tgt.links[connectors[-1]]
            tgt.update(extent)
        self.calculate_metrics()

class XmrsPathNode(object):

    __slots__ = ('nodeid', 'pred', 'links')

    def __init__(self, nodeid, pred, links=None):
        self.nodeid = nodeid
        self.pred = pred
        self.links = dict(links or [])

    def __getitem__(self, key):
        return self.links[key]

    def __iter__(self):
        return iter(self.links.items())

    def copy(self):
        n = XmrsPathNode(self.nodeid, self.pred)
        for connector, tgt in self.links.items():
            n.links[connector] = tgt.copy() if tgt is not None else tgt
        return n

    def update(self, other):
        self.nodeid = other.nodeid or self.nodeid
        self.pred = other.pred or self.pred
        for connector, tgt in other.links.items():
            if not self.links.get(connector):
                self.links[connector] = tgt
            else:
                self[connector].update(tgt)

# HELPER FUNCTIONS ##########################################################

def get_nodeids(path):
    yield path.nodeid
    for link, path_node in path:
        if path_node is None:
            continue
        for nid in get_nodeids(path_node):
            yield nid

def get_preds(path):
    yield path.pred
    for link, path_node in path:
        if path_node is None:
            continue
        for pred in get_preds(path_node):
            yield pred

def link_is_directed(link):
    return bool(link.argname) or link.post != 'EQ'

def headed(connector):
    # quantifiers and X/EQ links are not the heads of their subgraphs
    if connector == '<RSTR/H:' or connector.endswith('/EQ:'):
        return True
    if (connector == ':RSTR/H>' or
            connector.endswith('/EQ>') or
            connector.startswith('<')):
        return False
    return True

def connector_sort(connector):
    return (
        not connector.endswith('>'),  # forward links first
        not connector.startswith('<'),  # then backward, then undirected
        not connector[1:].startswith('LBL'),  # LBL before other args
        connector[1:].startswith('BODY'),  # BODY last
        connector[1:]  # otherwise alphabetical
    )

# WRITING PATHS #############################################################

def format(node, sort_key=connector_sort, trailing_connectors='usually'):
    if isinstance(node, XmrsPath):
        node = node.start
    return _format(
        node, sort_key=sort_key, trailing_connectors=trailing_connectors
    )

def _format(node, sort_key=connector_sort, trailing_connectors='usually'):
    if node is None:
        return ''
    #if node.nodeid is not None:
    #    symbol = '#{}'.format(node.nodeid)
    if node.pred is not None:
        symbol = str(node.pred)
    else:
        symbol = '*'
    links = []
    connectors = node.links.keys()
    if sort_key:
        connectors = sorted(connectors, key=sort_key)
    for conn in connectors:
        tgt = node.links[conn]
        if (tgt or
            trailing_connectors == 'always' or
            (trailing_connectors == 'usually' and conn != ':/EQ:') or
            (trailing_connectors == 'forward' and conn.endswith('>')) or
            (trailing_connectors == 'backward' and conn.startswith('<'))):

            links.append(
                '{}{}'.format(
                    conn,
                    _format(
                        tgt,
                        sort_key=sort_key,
                        trailing_connectors=trailing_connectors
                    )
                )
            )
    if len(links) > 1:
        subpath = '({})'.format(' & '.join(links))
    else:
        subpath = ''.join(links)  # possibly just ''
    return '{}{}'.format(symbol, subpath)

# FINDING PATHS #############################################################

def find_paths(
        xmrs,
        nodeids=None,
        method='top-down',
        allow_eq=False,
        max_distance=-1):
    if method not in ('top-down', 'bottom-up', 'headed'):
        raise XmrsPathError("Invalid path-finding method: {}".format(method))
    if nodeids is None: nodeids = [0] + xmrs.nodeids  # 0 for TOP
    links = _build_linkdict(xmrs, allow_eq)

    paths = defaultdict(list)
    for nid in nodeids:
        if nid in paths: continue  # maybe already visited in _find_paths
        for path in _find_paths(
                xmrs, nid, links, set(), method=method,
                max_distance=max_distance):
            paths[path.nodeid].append(XmrsPath(path))

    for nid in nodeids:
        for path in sorted(paths.get(nid, []), key=lambda p: p.distance()):
            yield path

def _build_linkdict(xmrs, allow_eq):
    links = defaultdict(dict)
    for link in xmrs.links:
        connector = '{}/{}'.format(link.argname or '', link.post)
        if link_is_directed(link):
            links[link.start][':{}>'.format(connector)] = link.end
            links[link.end]['<{}:'.format(connector)] = link.start
        elif allow_eq:
            links[link.start][':{}:'.format(connector)] = link.end
            #links[link.end][':{}:'.format(connector)] = link.start
    return links

def _find_paths(
        xmrs,
        nodeid,
        links,
        seen,
        method='top-down',
        max_distance=-1):
    if method not in ('top-down', 'bottom-up', 'headed'):
        raise XmrsPathError("Invalid path-finding method: {}".format(method))
    #if nodeid in seen  # currently not working
    if max_distance == 0: return None
    seen.add(nodeid)

    symbol = TOP if nodeid == 0 else xmrs.get_pred(nodeid)
    local_links = links.get(nodeid, {})
    connectors = _get_connectors(method, local_links)
    # first just use the unfilled connectors if not TOP
    if nodeid != 0:
        yield XmrsPathNode(nodeid, symbol, links=connectors)

    if connectors:
        #pdb.set_trace()
        subpaths = {}
        for connector in connectors:
            tgtnid = local_links[connector]
            if tgtnid == 0:
                subpaths[connector] = [XmrsPathNode(tgtnid, TOP)]
            else:
                subpaths[connector] = list(
                    _find_paths(
                        xmrs, tgtnid, links, seen, method=method,
                        max_distance=max_distance-1,
                    )
                )
        # beware of magic below:
        #   links maps a connector (like ARG1/NEQ) to a list of subpaths.
        #   This gets the product of subpaths for all connectors, then remaps
        #   the connector to the appropriate subpaths. E.g. if links is like
        #   {':ARG1/NEQ>': [def], ':ARG2/NEQ>': [ghi, jkl]} then lds is like
        #   [{':ARG1/NEQ>': def, 'ARG2/NEQ>': ghi},
        #    {':ARG1/NEQ>': def, 'ARG2/NEQ>': jkl}]
        lds = map(
            lambda z: dict(zip(subpaths.keys(), z)),
            product(*subpaths.values())
        )
        for ld in lds:
            yield XmrsPathNode(nodeid, symbol, links=ld)

def _get_connectors(method, links):
    # top-down: :X/Y> or :X/Y: (the latter only if added)
    if method == 'top-down':
        return dict((c, None) for c in links if c.startswith(':'))
    elif method == 'bottom-up':
        return dict((c, None) for c in links if c.endswith(':'))
    elif method == 'headed':
        return dict((c, None) for c in links if headed(c))

# READING PATHS #############################################################

tokenizer = re.compile(
    r'(?P<dq_string>"[^"\\]*(?:\\.[^"\\]*)*")'  # quoted strings
    r"|(?P<sq_string>'[^ \\]*(?:\\.[^ \\]*)*)"  # single-quoted 'strings
    r'|(?P<fwd_connector>:[^/]*/(?:EQ|NEQ|HEQ|H)>)'  # :X/Y> connector
    r'|(?P<bak_connector><[^/]*/(?:EQ|NEQ|HEQ|H):)'  # <X/Y: connector
    r'|(?P<und_connector>:[^/]*/(?:EQ|NEQ|HEQ|H):)'  # :X/Y: connector
    r'|(?P<symbol>[^\s*:/><@()\[\]=&|]+)'  # non-breaking characters
    r'|(?P<punc>[*()&|])'  # meaningful punctuation
)

def read_path(path_string):
    toks = deque((mo.lastgroup, mo.group())
                 for mo in tokenizer.finditer(path_string))
    try:
        startnode = _read_node(toks)
    except IndexError:
        raise XmrsPathError('Unexpected termination for path: {}'
            .format(path_string))
    if startnode is None:
        raise XmrsPathError('Error reading path: {}'
            .format(path_string))
    elif toks:
        raise XmrsPathError('Unconsumed tokens: {}'
            .format(', '.join(tok[1] for tok in toks)))
    path = XmrsPath(startnode)
    return path

def _read_node(tokens):
    if not tokens: return None
    mtype, mtext = tokens.popleft()
    if mtype in ('dq_string', 'sq_string', 'symbol'):
        links = _read_links(tokens)
        return XmrsPathNode(
            None,
            Pred.stringpred(mtext),
            links
        )
    else:
        tokens.appendleft((mtype, mtext))  # put it back
    return None  # current position isn't a path node

def _read_links(tokens):
    if not tokens: return None
    mtype, mtext = tokens.popleft()
    if mtype in ('fwd_connector', 'bak_connector', 'und_connector'):
        return {mtext: _read_node(tokens)}
    elif mtext == '(':
        links = {}
        mtype, mtext = tokens.popleft()
        while mtext != ')':
            links[mtext] = _read_node(tokens)
            mtype, mtext = tokens.popleft()
            if mtext in ('&', '|'):
                mtype, mtext = tokens.popleft()
            elif mtext != ')':
                raise XmrsPathError('Unexpected token: {}'.format(mtext))
        return links
    else:
        tokens.appendleft((mtype, mtext))  # put it back
    return None  # not a link

# SEARCHING PATHS ###########################################################

def find(node, pred, connectors=[]):
    matches = []
    if node and node.pred == pred:
        matches.append((connectors, node))
    for connector, tgt in node.links.items():
        if not tgt:
            continue
        for match in find(tgt, pred, connectors + [connector]):
            matches.append(match)
    return matches

def find_extents(node1, node2):
    exts = []
    for (connectors, first_node) in find(node1, node2.pred):
        for (ext_connections, ext) in extents(first_node, node2):
            exts.append((connectors + ext_connections, ext))
    return exts

def extents(node1, node2):
    assert node1.pred == node2.pred
    exts = []
    # if a constraint is violated, raise XmrsPathError
    # if a constraint exists on node1 and node2, dive
    # if one is on node1 but not node2, ignore
    # if one is on node2 but not node1, return
    for connector, tgt2 in node2.links.items():
        if connector in node1.links:
            tgt1 = node1.links[connector]
            if tgt1.pred == tgt2.pred:
                for connectors, ext in extents(tgt1, tgt2):
                    exts.append(([connector] + connectors, ext))
            else:
                raise XmrsPathError('Incompatible paths.')
        else:
            exts.append(([connector], tgt2))
    return exts