text:
angular.module('ledita-app')
.controller('ActCreateCtrl',
['$scope', '$rootScope', 'TypeaheadHelper', '$log', 'LDEditService', 'ActivityService',
	function($scope, $rootScope, TypeaheadHelper, $log, LDEditService, ActivityService) {

	$scope.selectedTechnologies = [];
	$scope.resourcesForDisplay = ActivityService.getResources();

    $scope.getTechnologies = function(technology) {
    	return TypeaheadHelper.getTechnologies(technology);
  	};

  	var addTechnology = function(technology) {
  		$scope.selectedTechnologies.push(technology);
  	};

  	var clearCurrentTechnology = function() {
  		$scope.technology = " ";
  	};

  	$scope.addTechnologyFromSuggestion = function() {
  		addTechnology($scope.technology);
  		clearCurrentTechnology();
  	};

  	$scope.addTechnologyFromUserInput = function($event) {
        $event.preventDefault();
        addTechnology($scope.technology);
        clearCurrentTechnology();
    };

    var removeItem = function(item, list) {
		var index = list.indexOf(item);
    	if(index >-1){
    		list.splice(index,1);
		}
    };

    $scope.removeTechnology = function(technology) {
    	removeItem(technology, $scope.selectedTechnologies);
    };

    $scope.appendInputToItems = function(item, items) {
    	if(item && item.length > 0 && item !== " ") {
    		return items.concat(item);
    	} else {
    		return items;
    	};
    };

    $scope.submitActivity = function() {
    	var currentLdId = LDEditService.getCurrentLdId();
    	ActivityService.createActivity(currentLdId, $scope.buildActivityData(),
	        function(res) {
	        	ActivityService.resetResources();
	        	$log.info('Activity created successfully');
	        	$rootScope.$broadcast('closeActivityModal');
	        	$rootScope.$broadcast('activityCreated');
	        },
	        function(err) {
	        	$log.error(err);
	        	$scope.activityCreateError = err; // TODO UI to display this
	        }
	    );
    };

    $scope.buildActivityData = function() {
    	var activityData = {
    		actName: getValueOrNull($scope.actName),
    		modality: getValueOrNull($scope.modality),
    		dur_mon: getValueOrNull($scope.dur_mon),
    		dur_d: getValueOrNull($scope.dur_d),
    		dur_h: getValueOrNull($scope.dur_h),
    		dur_min: getValueOrNull($scope.dur_min),
    		org: getValueOrNull($scope.org),
    		group_number: getValueOrNull($scope.group_number),
    		people_per_group: getValueOrNull($scope.people_per_group),
    		technologies: $scope.appendInputToItems($scope.technology, $scope.selectedTechnologies),
    		pract_descr: getValueOrNull($scope.pract_descr),
    		edu_descr: getValueOrNull($scope.edu_descr),
    		resources: ActivityService.getResources()
    	};
    	$log.info('buildActivityData: ' + JSON.stringify(activityData));
    	return activityData;
    };

    var getValueOrNull = function(value) {
    	return getValueOrDefault(value, null);
    };

    var getValueOrDefault = function(value, defaultVal) {
    	return value ? value : defaultVal;
    }

    $scope.addResource = function() {
    	var resourceData = {
    		name: getValueOrNull($scope.resourceName),
    		type: getValueOrNull($scope.resourceType),
    		descr: getValueOrNull($scope.resourceDescr),
    		link: getValueOrNull($scope.resourceLink)
    	}
    	ActivityService.addResource(resourceData);
    	$rootScope.$broadcast('closeResourceModal');
    };

}]);


text:
package com.jeppeman.highlite;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

/**
 * Subclasses of this class have the ability to specify raw queries that are used for their
 * corresponding database operations.
 *
 * @param <T> a class extending this class.
 * @author jesper
 */
public abstract class RawQueryableOperation<T extends QueryableOperation>
        extends QueryableOperation<T> {

    String mRawQueryClause;
    Object[] mRawQueryArgs;

    RawQueryableOperation() {

    }

    /**
     * Attaches a raw query to the operating subclass. Parameters are specified as '?' in the query.
     * Example: SELECT * FROM someTable where `someInt` > ?.
     *
     * @param rawQueryClause the raw query clause.
     * @param rawQueryArgs the parameter values for the clause, each corresponding to a ? in the
     *                     clause.
     * @return itself
     */
    public T withRawQuery(final @NonNull String rawQueryClause,
                          final @Nullable Object... rawQueryArgs) {
        mQuery = null;
        mRawQueryClause = rawQueryClause;
        mRawQueryArgs = rawQueryArgs;
        return (T) this;
    }

    /**
     * @see {@link QueryableOperation#withQuery(SQLiteQuery)}
     */
    @Override
    public T withQuery(@NonNull SQLiteQuery query) {
        mRawQueryClause = null;
        mRawQueryArgs = null;
        return super.withQuery(query);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace Phan\AST\TolerantASTConverter;

use ast;
use Microsoft\PhpParser\Diagnostic;

/**
 * All details about the results of parsing.
 *
 * This can be serialized and used in a cache.
 * @phan-immutable
 */
class ParseResult
{
    /** @var ast\Node the node that was parsed */
    public $node;
    /** @var Diagnostic[] diagnostics emitted */
    public $diagnostics;

    /**
     * @param Diagnostic[] $diagnostics errors seen when parsing $node
     */
    public function __construct(ast\Node $node, array $diagnostics)
    {
        $this->node = $node;
        $this->diagnostics = $diagnostics;
    }
}


text:
package org.apache.rave.gadgets.oauth.repository;

import org.apache.rave.gadgets.oauth.model.OAuthTokenInfo;
import org.apache.rave.persistence.Repository;

/**
 * Interface for handling {@link OAuthTokenInfo} queries
 */
public interface OAuthTokenInfoRepository extends Repository<OAuthTokenInfo> {

    /**
     * Retrieves {@link OAuthTokenInfo}
     *
     * @param userId      unique identifier of gadget viewer
     * @param appUrl      URL of the gadget
     * @param moduleId    the module ID of the application
     * @param tokenName   gadget's nickname for the token to use
     * @param serviceName name of the service provider
     * @return {@link OAuthTokenInfo} or {@literal null} if none matches the criteria
     */
    OAuthTokenInfo findOAuthTokenInfo(String userId, String appUrl, String moduleId,
                                             String tokenName, String serviceName);

}


text:
set session role=usertest6;
drop language plpythonu;


text:
set names utf8;
drop table if exists test_ro;
CREATE TABLE test_ro (
  id     int    NOT NULL,
  name      VARCHAR(20) collate utf8_ro_cs);

insert into test_ro values (1,'bună');
insert into test_ro values (2,'bunĂ');
insert into test_ro values (3,'bunA');
insert into test_ro values (103,'râdeȚi');
insert into test_ro values (203,'râdeți');
insert into test_ro values (303,'râdeȚi.B');
insert into test_ro values (403,'râdețixxettin');
insert into test_ro values (4,'întîlnim');
insert into test_ro values (104,'întilnim');
insert into test_ro values (5,'întîlnin');
insert into test_ro values (105,'Întîlnim');
insert into test_ro values (205,'înțîlnim');
insert into test_ro values (6,'oră');
insert into test_ro values (106,'%oră');
insert into test_ro values (7,'Oră');
insert into test_ro values (107,'_orÂ');
insert into test_ro values (8,'_bună');
insert into test_ro values (9,'*râdeți');
insert into test_ro values (109,'?întîlnim');
insert into test_ro values (10,'oră*');
insert into test_ro values (110,'râdeȚi?');
--Test
select id, name, field ('bună',name) from test_ro order by 1;
--Test
select id, name, field (null,name) from test_ro order by 1;
--Test
select id, name, field (name,'râdeți') from test_ro order by 1;
--Test
select id, name, field (name,'întîlnim',null) from test_ro order by 1;
--Test
select id, name, field ('oră', name, 'Oră', name) from test_ro order by 1;
--Test
select id, name, field (name, 'bunĂ', 'bună', 'bunA', '_bună') from test_ro order by 1;

drop table test_ro;
--Test
SELECT FIELD('Sînt', 'SînT', 'SÎnt', 'Sînt' collate utf8_ro_cs, 'Sînt?');
--Test
SELECT FIELD('Sînt', 'SînT', to_char('SînȚ'), 'Sînt' collate utf8_ro_cs, 'sînt?');
--Test
SELECT FIELD('Sînt', '%Sînt', 'Sînt1', '*Sînt*', 'Sînt');
--Test
SELECT FIELD('Sînt' collate utf8_ro_cs, 'S', 'Sî', null, 'Sînt', 'Sîn');
--Test
SELECT FIELD(123, '123Sînt','Sînt','123', 'S123înt');
set names iso88591;
commit;
--+ holdcas off;


text:
package org.asteriskjava.fastagi;

import static org.asteriskjava.fastagi.ScriptEngineMappingStrategy.getExtension;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

import java.io.File;
import java.io.IOException;

import org.junit.Before;
import org.junit.Test;

public class ScriptEngineMappingStrategyTest
{
    private ScriptEngineMappingStrategy scriptEngineMappingStrategy;

    @Before
    public void setUp() throws Exception
    {
        this.scriptEngineMappingStrategy = new ScriptEngineMappingStrategy();
    }

    @Test
    public void testSearchFile() throws IOException
    {
        assertNull(scriptEngineMappingStrategy.searchFile(null, new String[]{"src", "test", "."}));
        assertNull(scriptEngineMappingStrategy.searchFile("pom.xml", null));
        assertNull(scriptEngineMappingStrategy.searchFile("pom.xml", new String[]{}));
        assertNull(scriptEngineMappingStrategy.searchFile("pom.xml", new String[]{"src", "test"}));
        assertEquals(new File("pom.xml").getCanonicalPath(),
                scriptEngineMappingStrategy.searchFile("pom.xml", new String[]{"bla", "src", "."}).getPath());
    }

    @Test
    public void testSearchFileOutsidePath() throws IOException
    {
        // file should not be found for security reasons if it is not below the path
        assertNull(scriptEngineMappingStrategy.searchFile("../pom.xml", new String[]{"src"}));
    }

    @Test
    public void testGetExtension()
    {
        assertEquals("txt", getExtension("hello.txt"));
        assertEquals("txt", getExtension("/some/path/hello.txt"));
        assertEquals("txt", getExtension("C:\\some\\path\\hello.txt"));
        assertEquals("txt", getExtension("C:\\some\\path\\hel.lo.txt"));
        assertEquals("txt", getExtension("C:\\some\\pa.th\\hel.lo.txt"));
        assertEquals("txt", getExtension(".txt"));

        assertEquals(null, getExtension(null));
        assertEquals(null, getExtension(""));

        assertEquals(null, getExtension("hello"));
        assertEquals(null, getExtension("/some/path/hello"));
        assertEquals(null, getExtension("/some/pa.th/hello"));
        assertEquals(null, getExtension("C:\\some\\path\\hello"));
        assertEquals(null, getExtension("C:\\some\\pa.th\\hello"));

        assertEquals(null, getExtension("/some/pa.th\\hello"));
        assertEquals(null, getExtension("C:\\some\\pa.th/hello"));
    }
}


text:
from app.puppenc import ma
from app.users.models import User

class UserSchema(ma.ModelSchema):
    class Meta:
        model = User
        # Fields to expose
        fields = ('id', 'name', 'password')


text:
<!DOCTYPE html>

  <title>JS API GeoJson Layer</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.16/esri/css/esri.css">