text:
<?php /* Smarty version Smarty-3.1.19, created on 2016-04-11 10:23:28
         compiled from "/Applications/MAMP/htdocs/victor_espinet/prestashop/admin312fiugpn/themes/default/template/controllers/groups/helpers/tree/tree_node_folder_radio.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1531230921570b5f00f386d5-05235322%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' =>
  array (
    'c9d4b9bbbb42020573016adb611fb23150bf094e' =>
    array (
      0 => '/Applications/MAMP/htdocs/victor_espinet/prestashop/admin312fiugpn/themes/default/template/controllers/groups/helpers/tree/tree_node_folder_radio.tpl',
      1 => 1452091828,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1531230921570b5f00f386d5-05235322',
  'function' =>
  array (
  ),
  'variables' =>
  array (
    'node' => 0,
    'children' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.19',
  'unifunc' => 'content_570b5f0100c3f0_72784150',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_570b5f0100c3f0_72784150')) {function content_570b5f0100c3f0_72784150($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_escape')) include '/Applications/MAMP/htdocs/victor_espinet/prestashop/tools/smarty/plugins/modifier.escape.php';
?>

	<span class="tree-folder-name<?php if (isset($_smarty_tpl->tpl_vars['node']->value['disabled'])&&$_smarty_tpl->tpl_vars['node']->value['disabled']==true) {?> tree-folder-name-disable<?php }?>">
		<input type="radio" name="id_category" value="<?php echo $_smarty_tpl->tpl_vars['node']->value['id_category'];?>
"<?php if (isset($_smarty_tpl->tpl_vars['node']->value['disabled'])&&$_smarty_tpl->tpl_vars['node']->value['disabled']==true) {?> disabled="disabled"<?php }?> />

		<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['node']->value['name'], ENT_QUOTES, 'UTF-8', true);?>

		<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['children']->value, 'UTF-8');?>

<?php }} ?>


text:
package tsingularity.lolexplorer.Model;

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

import cupboard.annotation.Index;
import tsingularity.lolexplorer.Model.Constants.ConstantsCommon;
import tsingularity.lolexplorer.Model.Constants.QueueType;
import tsingularity.lolexplorer.Model.DTO.Game.BannedChampion;
import tsingularity.lolexplorer.Model.DTO.Match.MatchDTO;
import tsingularity.lolexplorer.Model.DTO.Match.MatchTeam;
import tsingularity.lolexplorer.Model.DTO.Match.Participant;
import tsingularity.lolexplorer.Model.DTO.Match.ParticipantIdentity;

public class Match {

    @Index
    public long matchId;

    public int       mapId;
    public long      matchCreation;
    public long      matchDuration;
    public QueueType queueType;
    public String    matchVersion;

    public boolean bottom_team_winner;
    public boolean bottom_team_firstBlood;
    public boolean bottom_team_firstBaron;
    public boolean bottom_team_firstDrake;

    public int  bottom_team_kills;
    public int  bottom_team_deaths;
    public int  bottom_team_assists;
    public long bottom_team_ban1;
    public long bottom_team_ban2;
    public long bottom_team_ban3;
    public int  bottom_team_barons;
    public int  bottom_team_drakes;
    public int  bottom_team_towers;

    public int  upper_team_kills;
    public int  upper_team_deaths;
    public int  upper_team_assists;
    public long upper_team_ban1;
    public long upper_team_ban2;
    public long upper_team_ban3;
    public int  upper_team_barons;
    public int  upper_team_drakes;
    public int  upper_team_towers;

    public static Match fromDTO(MatchDTO matchDTO) {

        Match match = new Match();

        match.matchId = matchDTO.matchId;
        match.mapId = matchDTO.mapId;
        match.matchCreation = matchDTO.matchCreation;
        match.matchDuration = matchDTO.matchDuration;
        match.queueType = matchDTO.queueType;
        match.matchVersion = matchDTO.matchVersion;

        for (Participant participant : matchDTO.participants) {
            if (participant.teamId == ConstantsCommon.TEAM_BOTTOM) {
                match.bottom_team_kills += participant.stats.kills;
                match.bottom_team_deaths += participant.stats.deaths;
                match.bottom_team_assists += participant.stats.assists;
            } else {
                match.upper_team_kills += participant.stats.kills;
                match.upper_team_deaths += participant.stats.deaths;
                match.upper_team_assists += participant.stats.assists;
            }
        }

        for (MatchTeam team : matchDTO.teams) {
            if (team.teamId == ConstantsCommon.TEAM_BOTTOM) {
                match.bottom_team_winner = team.winner;
                match.bottom_team_firstBlood = team.firstBlood;
                match.bottom_team_firstBaron = team.firstBaron;
                match.bottom_team_firstDrake = team.firstDragon;
                match.bottom_team_barons = team.baronKills;
                match.bottom_team_drakes = team.dragonKills;
                match.bottom_team_towers = team.towerKills;

                if (team.bans != null) {
                    ListIterator banIterator = team.bans.listIterator();
                    while (banIterator.hasNext()) {
                        BannedChampion bannedChampion = (BannedChampion) banIterator.next();
                        switch (banIterator.nextIndex()) {
                            case 1:
                                match.bottom_team_ban1 = bannedChampion.championId;
                                break;
                            case 2:
                                match.bottom_team_ban2 = bannedChampion.championId;
                                break;
                            case 3:
                                match.bottom_team_ban3 = bannedChampion.championId;
                                break;
                        }
                    }
                }
            } else {
                match.upper_team_barons = team.baronKills;
                match.upper_team_drakes = team.dragonKills;
                match.upper_team_towers = team.towerKills;

                if (team.bans != null) {
                    ListIterator banIterator = team.bans.listIterator();
                    while (banIterator.hasNext()) {
                        BannedChampion bannedChampion = (BannedChampion) banIterator.next();
                        switch (banIterator.nextIndex()) {
                            case 1:
                                match.upper_team_ban1 = bannedChampion.championId;
                                break;
                            case 2:
                                match.upper_team_ban2 = bannedChampion.championId;
                                break;
                            case 3:
                                match.upper_team_ban3 = bannedChampion.championId;
                                break;
                        }
                    }
                }
            }
        }

        return match;
    }

    public static List<MatchParticipant> participantListFromDTO(MatchDTO matchDTO) {

        List<MatchParticipant> matchParticipantList = new ArrayList<MatchParticipant>(matchDTO.participants.size());

        for (Participant participant : matchDTO.participants) {

            MatchParticipant matchParticipant = new MatchParticipant();

            matchParticipant.matchId = matchDTO.matchId;
            matchParticipant.participantId = participant.participantId;
            matchParticipant.teamId = participant.teamId;
            matchParticipant.championId = participant.championId;
            matchParticipant.highestAchievedSeasonTier = participant.highestAchievedSeasonTier;
            matchParticipant.spell1Id = participant.spell1Id;
            matchParticipant.spell2Id = participant.spell2Id;

            matchParticipant.item0 = participant.stats.item0;
            matchParticipant.item1 = participant.stats.item1;
            matchParticipant.item2 = participant.stats.item2;
            matchParticipant.item3 = participant.stats.item3;
            matchParticipant.item4 = participant.stats.item4;
            matchParticipant.item5 = participant.stats.item5;
            matchParticipant.item6 = participant.stats.item6;

            matchParticipant.kills = participant.stats.kills;
            matchParticipant.deaths = participant.stats.deaths;
            matchParticipant.assists = participant.stats.assists;
            matchParticipant.champLevel = participant.stats.champLevel;
            matchParticipant.goldEarned = participant.stats.goldEarned;
            matchParticipant.totalDamageDealtToChampions = participant.stats.totalDamageDealtToChampions;
            matchParticipant.wardsPlaced = participant.stats.wardsPlaced;
            matchParticipant.totalCreepsKilled = participant.stats.minionsKilled + participant.stats.neutralMinionsKilled;
            matchParticipant.pentaKills = participant.stats.pentaKills;
            matchParticipant.quadraKills = participant.stats.quadraKills;
            matchParticipant.unrealKills = participant.stats.unrealKills;

            for (ParticipantIdentity participantIdentity : matchDTO.participantIdentities) {
                if (participantIdentity.player == null) continue;
                if (participantIdentity.participantId == participant.participantId) {
                    matchParticipant.summonerId = participantIdentity.player.summonerId;
                    matchParticipant.summonerName = participantIdentity.player.summonerName;
                }
            }

            matchParticipantList.add(matchParticipant);

        }

        return matchParticipantList;
    }

}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _IconBase = require('./../components/IconBase/IconBase');

var _IconBase2 = _interopRequireDefault(_IconBase);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var AndroidStarOutline = function (_React$Component) {
	_inherits(AndroidStarOutline, _React$Component);

	function AndroidStarOutline() {
		_classCallCheck(this, AndroidStarOutline);

		return _possibleConstructorReturn(this, Object.getPrototypeOf(AndroidStarOutline).apply(this, arguments));
	}

	_createClass(AndroidStarOutline, [{
		key: 'render',
		value: function render() {
			if (this.props.bare) {
				return _react2.default.createElement(
					'g',
					null,
					_react2.default.createElement('path', { d: 'M458,210.409l-145.267-12.476L256,64l-56.743,133.934L54,210.409l110.192,95.524L131.161,448L256,372.686L380.83,448 l-33.021-142.066L458,210.409z M272.531,345.286L256,335.312l-16.53,9.973l-59.988,36.191l15.879-68.296l4.369-18.79l-14.577-12.637 l-52.994-45.939l69.836-5.998l19.206-1.65l7.521-17.75l27.276-64.381l27.27,64.379l7.52,17.751l19.208,1.65l69.846,5.998 l-52.993,45.939l-14.576,12.636l4.367,18.788l15.875,68.299L272.531,345.286z' })
				);
			}return _react2.default.createElement(
				_IconBase2.default,
				null,
				_react2.default.createElement('path', { d: 'M458,210.409l-145.267-12.476L256,64l-56.743,133.934L54,210.409l110.192,95.524L131.161,448L256,372.686L380.83,448 l-33.021-142.066L458,210.409z M272.531,345.286L256,335.312l-16.53,9.973l-59.988,36.191l15.879-68.296l4.369-18.79l-14.577-12.637 l-52.994-45.939l69.836-5.998l19.206-1.65l7.521-17.75l27.276-64.381l27.27,64.379l7.52,17.751l19.208,1.65l69.846,5.998 l-52.993,45.939l-14.576,12.636l4.367,18.788l15.875,68.299L272.531,345.286z' })
			);
		}
	}]);

	return AndroidStarOutline;
}(_react2.default.Component);

exports.default = AndroidStarOutline;
;AndroidStarOutline.defaultProps = { bare: false };


text:
/*
var semver = require('semver'),
  cmd = 'node bin/showdown.js';

describe('showdown cli', function () {
  'use strict';
  if (semver.gt(process.versions.node, '0.12.0')) {
    var execSync = require('child_process').execSync;
    it('basic stdin stdout', function () {
      var otp = execSync(cmd + ' makehtml', {
        encoding: 'utf8',
        input: '**foo**'
      });
      otp.trim().should.equal('
foo
');
    });
  }
});
*/


text:
package com.google.gerrit.server.config;

import com.google.inject.Inject;
import com.google.inject.Provider;

import org.eclipse.jgit.lib.Config;

public class AllProjectsNameProvider implements Provider<AllProjectsName> {
  public static final String DEFAULT = "All-Projects";

  private final AllProjectsName name;

  @Inject
  AllProjectsNameProvider(@GerritServerConfig Config cfg) {
    String n = cfg.getString("gerrit", null, "allProjects");
    if (n == null || n.isEmpty()) {
      n = DEFAULT;
    }
    name = new AllProjectsName(n);
  }

  public AllProjectsName get() {
    return name;
  }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.undergrowth</groupId>
    <artifactId>learntest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>learnwebservice</artifactId>
  <name>learn webservice</name>
  <description>learn webservice</description>
  <dependencies>
  	<dependency>
  		<groupId>com.undergrowth</groupId>
  		<artifactId>learncommon</artifactId>
  		<version>0.0.1-SNAPSHOT</version>
  	</dependency>
  	<dependency>
  		<groupId>com.undergrowth</groupId>
  		<artifactId>learnsqlmapper</artifactId>
  		<version>0.0.1-SNAPSHOT</version>
  	</dependency>
  </dependencies>
</project>


text:
BrightnessShader Scene::bright;

float GodRayShader::exposure = 0.1 / 100;
float GodRayShader::decay = 1;
float GodRayShader::density = 0.5;
float GodRayShader::weight = 6.0;
float GodRayShader::x=100;
float GodRayShader::y=100;

//--------------------------------------------------------------
void ofApp::setup(){
    ofSetFrameRate(30);
    ofEnableAlphaBlending();
    ofSetLogLevel(OF_LOG_VERBOSE);

    int projectorWidth = 1024, projectorHeight = 768;

    // setup secondary window for projection, primary for gui
    projector.setup("Projector", 0, 0, projectorWidth, projectorHeight, false);

    // setup blend shader
    blendfx = new BlendShader();
    blendfx->allocate(projectorWidth, projectorHeight);

    // load sandbox shader
    sandbox = new ofxFXObject();
    loadSandboxShader("test.frag");

    sceneGraph = new SceneGraph();

//    scene = new SceneTest();
//    scene1 = new Scene1();

//    black = new Black();

//    throneRoom = new ThroneRoom();
//    charlesRoom = new CharlesRoom();

//    scenes.push_back(throneRoom);

    //
    // Init GUI
    //
    gui1 = new ofxUISuperCanvas("PANEL 1: Switch Videos");
    gui1->setPosition(0, 0);
    gui1->setHeight(800);
    gui1->setName("Switch");
    gui1->addLabel("Toggle Videos");
    gui1->addSpacer();
    gui1->addSlider("transition", 0.0f, 1.0f, &sceneGraph->transition);
    gui1->addSlider("transition length", 0.1f, 10.0f, &sceneGraph->transitionLength);
    gui1->addSpacer();
    gui1->addRadio("RADIO VERTICAL", sceneGraph->names, OFX_UI_ORIENTATION_VERTICAL);

    gui2 = new ofxUISuperCanvas("PANEL 2: Transforms");
    gui2->setPosition(210,0);
    gui2->setHeight(800);
    gui2->setName("Transform");
    gui2->addLabel("pos color");
    gui2->addSpacer();
    gui2->addSlider("x", -2000.0f, 2000.0f, &sceneGraph->x);
    gui2->addSlider("y", -2000.0f, 2000.0f, &sceneGraph->y);
    gui2->addSlider("scale", 0, 2.0f, &sceneGraph->scale);
    gui2->addSlider("scale-x", -1.0f, 1.0f, &sceneGraph->scalex);
    gui2->addSlider("scale-y", -1.0f, 1.0f, &sceneGraph->scaley);
    gui2->addSlider("rotate", -90.0f, 90.0f, &sceneGraph->rotate);

    gui2->addSpacer();

    gui2->addSlider("brightness", 0.0f, 3.0f, &sceneGraph->brightness);
    gui2->addSlider("red", 0.0f, 3.0f, &sceneGraph->r);
    gui2->addSlider("green", 0.0f, 3.0f, &sceneGraph->g);
    gui2->addSlider("blue", 0.0f, 3.0f, &sceneGraph->b);
    gui2->addSpacer();
    std::vector<std::string> names;
    names.push_back("save");
    names.push_back("load");
    names.push_back("smoke");
    gui2->addRadio("config", names, OFX_UI_ORIENTATION_HORIZONTAL);
    gui2->addSpacer();
    gui2->addSlider("smoke X", -500.0f, 500.0f, &sceneGraph->smokeScene->smokex);
    gui2->addSlider("smoke Y", -500.0f, 500.0f, &sceneGraph->smokeScene->smokey);

    ofAddListener(gui1->newGUIEvent,this,&ofApp::guiEvent);
    ofAddListener(gui2->newGUIEvent,this,&ofApp::guiEvent);

    receiver.setup(8000);

}

//--------------------------------------------------------------
void ofApp::update(){

//    scene->update();
//    scene1->update();
//    throneRoom->update();
//    charlesRoom->update();
//    blendfx->setTexture(black->getTextureReference(), 0);
//    blendfx->setTexture(throneRoom->getTextureReference(), 1);
//    blendfx->update();

//    video.update();

//    sandbox.begin();
//    ofClear(255, 255);
//    sandbox.draw();
//    ofSetColor(0,255);
//    ofCircle(mouseX, mouseY, 5);
//    sandbox.end();

//    glow.setRadius(sin(beat)*15);
//    glow << video.getTextureReference();
//    glow.update();

//    sandbox.update();
//    beat += (1.0/ofGetFrameRate())*2;

    while(receiver.hasWaitingMessages()) {
        ofxOscMessage message;
        receiver.getNextMessage(&message);

        auto addr = message.getAddress();
        cout << "OSCl: " << addr << endl;

        if(addr == "/1/toggle1") {
            sceneGraph->prev();
            ((ofxUIRadio *) gui1->getWidget("RADIO VERTICAL"))->activateToggle(sceneGraph->names[sceneGraph->currentScene]);
        } else if(addr == "/1/toggle2") {
            sceneGraph->next();
            ((ofxUIRadio *) gui1->getWidget("RADIO VERTICAL"))->activateToggle(sceneGraph->names[sceneGraph->currentScene]);
        } else if(addr == "/3/xy1"){
            float x = message.getArgAsFloat(0);
            float y = message.getArgAsFloat(1);
            sceneGraph->x = x * 2000 - 1000;
            sceneGraph->y = y * 2000 - 1000;
        } else if( addr == "/3/xy2"){
            float x = message.getArgAsFloat(0);
            float y = message.getArgAsFloat(1);
            sceneGraph->scale = y * 2;

        } else if( addr == "/1/rotary1"){
            float x = message.getArgAsFloat(0);
            sceneGraph->r = x * 3;
        } else if( addr == "/1/rotary2"){
            float x = message.getArgAsFloat(0);
            sceneGraph->g = x * 3;
        } else if( addr == "/1/rotary3"){
            float x = message.getArgAsFloat(0);
            sceneGraph->b = x * 3;
        } else if( addr == "/1/rotary4"){
            float x = message.getArgAsFloat(0);
            sceneGraph->brightness = x * 3;

        } else if( addr == "/1/push1"){
            sceneGraph->saveSceneConfig();
        } else if( addr == "/1/push3"){
            sceneGraph->loadSceneConfig();
        }
        else if( addr == "/1/smoke")
        {
            //sceneGraph->ascend = true;
            //sceneGraph->dock->smoke =true;
            sceneGraph->smokeScene->smokeGo = true;
            cout << "SMSOKE!!"<< endl;
        }

        else if( addr == "/1/ascend")
        {
            //sceneGraph->ascend = true;
            //sceneGraph->dock->smoke =true;
            sceneGraph->dock->ascend = true;
            cout << "ASCEND!!!!"<< endl;
        }

    }

    sceneGraph->update();

}

//--------------------------------------------------------------
void ofApp::draw(){

    projector.begin();
    ofClear(0);
//    blendfx->draw();
//    ofEnableBlendMode(OF_BLENDMODE_ALPHA);
//    ofSetColor(255,255,255,blendfx->blend*255);
//    throneRoom->draw();
//    ofSetColor(255,255,255,(1.0-blendfx->blend)*255);
//    charlesRoom->draw();
//    glow.draw();
//    sandbox.draw();
    sceneGraph->draw();
    projector.end();

    ofSetColor(0, 0, 200);
    ofCircle(ofGetMouseX(), ofGetMouseY(), 20);

    ofSetColor(255, 255, 255);

}

void ofApp::loadSandboxShader(const char* path){

    sandbox->allocate(projectorWidth, projectorHeight);
    sandbox->setPasses(1);

//    sandbox.load(std::string(path));
    ofBuffer buffer = ofBufferFromFile(path);
    sandbox->setCode(buffer.getText());
//    sandbox.setTexture(video.getTextureReference());

}

//--------------------------------------------------------------
void ofApp::guiEvent(ofxUIEventArgs &e){
    string name = e.getName();
    int kind = e.getKind();
//    cout << "got event from: " << name << endl;

    if(name == "RADIO VERTICAL"){
        ofxUIRadio *radio = (ofxUIRadio *) e.widget;
        sceneGraph->setScene(radio->getValue());
        cout << radio->getName() << " value: " << radio->getValue() << " active name: " << radio->getActiveName() << endl;
    } else if( name == "config"){
        ofxUIRadio *radio = (ofxUIRadio *) e.widget;
        auto s = radio->getActiveName();
        if(s == "save") sceneGraph->saveSceneConfig();
        else if(s == "load") sceneGraph->loadSceneConfig();
        else if(s == "smoke") sceneGraph->smokeScene->smokeGo = true;
    }

}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
    if( key == ' '){
//        if(!video.isPlaying()) video.play();
//        else video.stop();
    } else if( key == 'r'){
        loadSandboxShader("test.frag");
    } else if( key == OF_KEY_LEFT){
        sceneGraph->prev();
        ((ofxUIRadio *) gui1->getWidget("RADIO VERTICAL"))->activateToggle(sceneGraph->names[sceneGraph->currentScene]);
    } else if ( key == OF_KEY_RIGHT){
        sceneGraph->next();
        ((ofxUIRadio *) gui1->getWidget("RADIO VERTICAL"))->activateToggle(sceneGraph->names[sceneGraph->currentScene]);
    }
}

//--------------------------------------------------------------
void ofApp::keyReleased(int key){

}

//--------------------------------------------------------------
void ofApp::mouseMoved(int x, int y ){

}

//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mouseReleased(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){

}

//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){

}

//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){

}


text:
package org.wso2.carbon.apimgt.impl.workflow;

public class WorkflowException extends Exception{

    public WorkflowException(String message){
        super(message);
    }

    public WorkflowException(String message, Throwable e){
        super(message, e);
    }
}


text:
module PolymorphicAttacher

  module ClassMethods
    class MissingConnectorDef < StandardError; end;

    def create_polymorphic_attacher_on(key, params={})
      params.assert_valid_keys([:find_scope, :connector, :connector_source, :validate, :poly_getter, :context_key, :context])
      raise MissingConnectorDef, "need a connector" unless params[:connector]
      raise MissingConnectorDef, "need a connector source" unless params[:connector_source]
      raise MissingConnectorDef, "need a context" unless params[:context]
      raise MissingConnectorDef, "need a context key" unless params[:context_key]

      key = key.to_s
      write_inheritable_attribute(:polymorphic_attachers, {}) if read_inheritable_attribute(:polymorphic_attachers).nil?
      read_inheritable_attribute(:polymorphic_attachers)[key] = params.merge({:key => key})

      include PolymorphicAttacher::InstanceMethods

      connector = params.delete(:connector)
      connector_source = params.delete(:connector_source)

      if params.delete(:validate)
        validate "proper_#{key}_association".to_sym
      end

      context_key = params[:context_key]
      context = params[:context]

      after_save :attach_polymorphic_associations

      if poly_getter = params.delete(:poly_getter)
        class_eval <<-HERE
          # convenience getter for the current collection of final association objects
          def #{poly_getter.to_s}(include_unsaved = true)
            collection = #{connector.to_s}.find(:all,
              :conditions => ["#{context_key} = ?", '#{context}']).collect {|c| c.#{connector_source.to_s}}

            if include_unsaved
              collection += #{key}.to_a
            end
            collection.uniq
          end
        HERE
      end

      class_eval <<-HERE
        # provided key will serve as temporary storage
        attr_accessor :#{key.to_s}

        # delegative proxy setter
        def #{key}=(val)
          if val.is_a?(Array)
            val.each {|v| attach_polymorphic_to('#{key}', v)}
          else
            attach_polymorphic_to('#{key}', val)
          end
        end

        # ensure that there is at least one association
        def proper_#{key}_association
          errors.add('#{key}', :chosen) if @#{key}.blank? && #{connector}.blank?
        end
      HERE

    end
  end

  module InstanceMethods

    # Proxy setter to temporarily store the association
    # When provided from a web form, it is convenient to pass an ID string
    # Make sure type is in class form. Ex: GoodProduct_784573
    def attach_polymorphic_to(key, val)
      attacher_key = key
      key = key.to_s

      # turn key into an instance parameter
      key = "@#{key}" unless key.match("@")

      # initialize an empty array if the storage is nil
      instance_variable_set(key, []) if instance_variable_get(key).nil?

      find_scope = self.class.read_inheritable_attribute(:polymorphic_attachers)[attacher_key][:find_scope]

      if val == false
        instance_variable_set(key, [])
      elsif val.blank?
        # do nothing

      # if val is a string, then it must be in serialized record form
      elsif val.is_a?(String)
        type, record_id = val.split("_")
        klass = type.classify.constantize
        record_id = record_id.to_i

        record = case find_scope
        when Proc
          find_scope.call(klass).find(record_id)
        when Symbol
          klass.scopes[find_scope].call(klass).find(record_id)
        when String
          klass.scoped(instance_eval(find_scope)).find(record_id)
        when nil
          klass.find(record_id)
        end

        instance_variable_get(key) << record

      # If an active record object has been provided directly, just accept it
      elsif val.class.respond_to?(:base_class) && val.class.base_class.descends_from_active_record?
        instance_variable_get(key) << val
      else
        raise ActiveRecord::MissingAttributeError, "#attach_polymorphic_to -> val needs to be a string or an ActiveRecord::Base descendant"
      end
    end

    # cycle through all associations that were defined and replace their new values
    # only works if there is a non-nil #key attribute set
    def attach_polymorphic_associations
      self.class.read_inheritable_attribute(:polymorphic_attachers).values.each do |attacher_hash|

        # get some variables for convenience
        key = attacher_hash[:key].to_sym
        source = attacher_hash[:connector_source].to_sym
        connector = attacher_hash[:connector].to_sym
        context_key = attacher_hash[:context_key].to_s
        context = attacher_hash[:context].to_s

        # if the proxy object is nil, don't touch associations
        next if self.send(key).nil?

        # reflect on the connector association to figure out a few implementation details
        klass = self.class.reflect_on_association(connector).klass
        as = self.class.reflect_on_association(connector).options[:as]

        # collect the ids for current collection of join-table objects
        old_ids = self.send(attacher_hash[:connector]).find(:all,
          :conditions => ["#{context_key} = ?", context]).collect {|r| r.id}.uniq

        # delete the old join-table set of objects
        klass.delete(old_ids)

        # build the necessary join-table objects that will establish the linkage
        collection = self.send(key).flatten.uniq.compact.map {|record| klass.new(source => record, as => self, context_key.to_sym => context)}

        # save and attach the join-table objects - use the Rails <<, as it minimizes issues with the callback chain
        # self.send(attacher_hash[:connector]) << collection
        collection.each {|c| c.save!}
      end
      true
    end

  end

end


text:
// Generated on Wed Nov 07 17:26:02 MSK 2007
// DTD/Schema  :    plugin.dtd

package org.jetbrains.idea.devkit.dom;

import com.intellij.ide.presentation.Presentation;
import com.intellij.util.xml.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * plugin.dtd:idea-plugin interface.
 */
@DefinesXml
@Presentation(icon = "AllIcons.Nodes.Plugin", typeName = "Plugin")
@Stubbed
public interface IdeaPlugin extends DomElement {
  @Nullable
  String getPluginId();

  @NotNull
  @NameValue
  @Stubbed
  GenericDomValue<String> getId();

  /**
   * @deprecated Unused.
   */
  @SuppressWarnings("DeprecatedIsStillUsed")
  @NotNull
  @Attribute("version")
  @Deprecated
  GenericAttributeValue<Integer> getIdeaPluginVersion();

  @NotNull
  GenericAttributeValue<String> getUrl();

  @NotNull
  GenericAttributeValue<Boolean> getUseIdeaClassloader();

  @NotNull
  @Stubbed
  GenericDomValue<String> getName();

  @NotNull
  GenericDomValue<String> getDescription();

  @NotNull
  GenericDomValue<String> getVersion();

  @NotNull
  Vendor getVendor();

  @NotNull
  GenericDomValue<String> getChangeNotes();

  @NotNull
  IdeaVersion getIdeaVersion();

  @NotNull
  GenericDomValue<String> getCategory();

  @NotNull
  GenericDomValue<String> getResourceBundle();

  @NotNull
  @Stubbed
  @SubTagList("depends")
  List<Dependency> getDependencies();

  @SubTagList("depends")
  Dependency addDependency();

  @NotNull
  @Stubbed
  @SubTagList("module")
  List<PluginModule> getModules();

  @NotNull
  @SubTagList("extensions")
  @Stubbed
  List<Extensions> getExtensions();

  Extensions addExtensions();

  @NotNull
  @Stubbed
  @SubTagList("extensionPoints")
  List<ExtensionPoints> getExtensionPoints();

  ExtensionPoints addExtensionPoints();

  @NotNull
  @SubTagList("application-components")
  List<ApplicationComponents> getApplicationComponents();

  ApplicationComponents addApplicationComponents();

  @NotNull
  @SubTagList("project-components")
  List<ProjectComponents> getProjectComponents();

  ProjectComponents addProjectComponents();

  @NotNull
  @SubTagList("module-components")
  List<ModuleComponents> getModuleComponents();

  ModuleComponents addModuleComponents();

  @NotNull
  @SubTagList("actions")
  @Stubbed
  List<Actions> getActions();

  Actions addActions();

  @NotNull
  List<Helpset> getHelpsets();

  Helpset addHelpset();
}


text:
> ## tl;dr ##
> **Melodia is a mulitplayer game written in Java, inspired by games like Zelda and Secret of Mana.**

This project is what has become of a little experiment gone out of hand. While learning my first steps in Java, I was wondering how a game would work. A while later I had a static image moving on top of another image by pressing the arrow keys.

*Fast forward a few years and this is the result;*

![Alt text](screenshot.png "Screenshot")

Melodia has become a multiplayer game, making the player able to walk across different maps (of which two are realised in the proof of concept). Players are able to kill monsters, die themselves only to be respawned anew. Change the colours of their tunics to any given colour and chat with each other.

This all wrapped up in a little proof of concept game called Melodia, with background music taken from Ragnarok Online and maps, sprites taken from Zelda: blabla and Secret of Mana.

Important; read the disclaimer about the use of these sprites and images.

### Source code is licensed under the MIT License. ###
#####  *Images/sprites/audio etc. belong to their respective owners!* #####

## Usage ##

- Navigation with arrow keys or WASD.
- Attack with 'F'
- 'Enter' to enable Chat for commands;
 - /nick <name> to change your name
 - /color shows a screen where you can change your sprite's colour.
 - /server <port> makes the current instance the server
 - /connect <serverip:port> to connect to this instance from another client.
 - /list shows a list of connected clients and players.
 - /loc shows the current location.
 - /dev <on|off> for developer mode, this will show the *walkmap*.
 - /walkcheck to turn off the walkcheck, enabling you to walk anywhere.
 - /bg <on|off> to turn on/off the background music.

## Demo / PoC ##

I also made a demo proof of concept in HTML5 & JavaScript, which is hosted here <http://www.nickmeessen.nl/melodia>

## Disclaimer ##

Being a programmer first, I took these sprites from Shyguy Kingdom to realise a simple game that looked good as well. These images and other resources used belong to their respective owners. The source code written in Java and XML is licensed under the MIT License, which means you are free to fork and build upon this game. I have abandonded it, so feel free but give credit where due. It has gained some sentimental value in my early years of learning how to code ;-)

**Excerpt from <http://tsgk.captainn.net>**

> The Shyguy Kingdom does not own the sprites contained on the pages within this site. The sprites on this site are the works of countless others whose names would be too many to mention and, in the case of the sprites from games, are often unknown. The Shyguy Kingdom presents these sprites as an archive and gallery of game and pixel art and to promote these games, just as game websites present screenshots to do the same. At the request of any artist or company responsible for any of the artwork in the The Shyguy Kingdom's pages, the sprites of that artist or company will be immediately removed.

> However, in regards to the sprite sheets in the pages of The Shyguy Kingdom, there are also features which extend beyond the properties of their respective artists: the layout, the organization, and additional data contained within the sprite sheets that is the intellectual property of The Shyguy Kingdom excludes the publishing of these images without the permission of The Shyguy Kingdom without exhibited modification. This is not due to any attempted ownership of artwork that are not the property of The Shyguy Kingdom, but rather of the data other than the artwork in the sheets.

> The Shyguy Kingdom believes that the artwork of games is meant to be seen and that its use and display on this site ultimately benefit the artists and companies behind them through the created fandom and publicity. The Shyguy Kingdom exists to promote pixel-based sprite artwork in its varied forms and the great forces behind them.


text:
using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace Amazon.S3.Model
{
    /// <summary>
    /// Contains information about a successful delete operation against a specific S3 object.
    /// </summary>
    public class DeletedObject
    {
        private string key;
        private string versionId;
        private bool isDeleteMarker;
        private string deleteMarkerVersionId;

        /// <summary>
        /// The key of the deleted S3 object.
        /// </summary>
        public string Key
        {
            get { return this.key; }
            set { this.key = value; }
        }

        /// <summary>
        /// The version of the deleted S3 object.
        /// </summary>
        public string VersionId
        {
            get { return this.versionId; }
            set { this.versionId = value; }
        }

        /// <summary>
        /// Specifies whether the versioned object that was permanently deleted was (true) or was not (false) a
        /// delete marker. In a simple DELETE, this header indicates whether (true) or not (false) a delete
        /// marker was created.
        /// </summary>
        [XmlElement("DeleteMarker")]
        public bool IsDeleteMarker
        {
            get { return this.isDeleteMarker; }
            set { this.isDeleteMarker = value; }
        }

        /// <summary>
        /// The version ID of the delete marker created as a result of the DELETE operation. If you delete a
        /// specific object version, the value returned by this header is the version ID of the object version
        /// deleted.
        /// </summary>
        public string DeleteMarkerVersionId
        {
            get { return this.deleteMarkerVersionId; }
            set { this.deleteMarkerVersionId = value; }
        }
    }
}


text:
package dmtest

class DataBufferTest extends DMTestSuite {
  test("make random byte buffer") {
    val a = DataBuffer.random(1024)
    assert(a isSameAs a)
    val b = DataBuffer.random(1024)
    assert(!a.isSameAs(b))
  }
  test("two rand buffers are not equal") {
    val a = DataBuffer.random(1000)
    val b = DataBuffer.random(1000)
    assert(!a.isSameAs(b))
  }
  test("rand buffer is not zeroed") {
    assert(!DataBuffer.random(1000).isZeroed)
  }
  test("overwrite") {
    val a = DataBuffer.random(1000)
    val b = DataBuffer.random(100)
    val c = a.overwrite(30, b)
    assert(!a.isSameAs(c))
  }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using LiteDB;

namespace LiteDB_V6
{
    internal class DbReader : LiteDB.IDbReader
    {
        private PageService _pager;
        private CollectionService _collections;
        private FileDiskService _disk;
        private IndexService _indexer;
        private DataService _data;

        /// <summary>
        /// Initialize database reader with database stream file and password
        /// </summary>
        public bool Initialize(Stream stream, string password)
        {
            // test if current stream is V6
            if (stream.ReadByte(25 + 27) != 6) return false;

            _disk = new FileDiskService(stream, password);
            _pager = new PageService(_disk);
            _indexer = new IndexService(_pager);
            _data = new DataService(_pager);
            _collections = new CollectionService(_pager);

            return true;
        }

        /// <summary>
        /// Get all collections names from header
        /// </summary>
        public IEnumerable<string> GetCollections()
        {
            var header = _pager.GetPage<HeaderPage>(0);

            return header.CollectionPages.Keys;
        }

        /// <summary>
        /// List all unique indexes (excluding _id index)
        /// </summary>
        public IEnumerable<string> GetUniqueIndexes(string collection)
        {
            var col = _collections.Get(collection);

            foreach(var index in col.Indexes.Where(x => x.Field != "_id" && x.Unique))
            {
                yield return index.Field;
            }
        }

        /// <summary>
        /// List all documents inside an collections. Use PK to get all documents in order
        /// </summary>
        public IEnumerable<BsonDocument> GetDocuments(string collection)
        {
            var col = _collections.Get(collection);

            foreach(var node in _indexer.FindAll(col.PK))
            {
                var bytes = _data.Read(node.DataBlock);

                yield return new BsonReader(false).Deserialize(bytes);
            }
        }

        public void Dispose()
        {
            if (_disk != null)
            {
                _disk.Dispose();
            }
        }
    }
}


text:
package com.perforce.p4java.tests.dev.unit.bug.r141;

import com.perforce.p4java.core.file.FileAction;
import com.perforce.p4java.core.file.FileSpecBuilder;
import com.perforce.p4java.core.file.FileSpecOpStatus;
import com.perforce.p4java.core.file.IFileSpec;
import com.perforce.p4java.exception.P4JavaException;
import com.perforce.p4java.tests.SimpleServerRule;
import com.perforce.p4java.tests.dev.annotations.Jobs;
import com.perforce.p4java.tests.dev.annotations.TestId;
import com.perforce.p4java.tests.dev.unit.P4JavaRshTestCase;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;

import java.util.List;

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

/**
 * Test "p4 sync" deleted files.
 */
@Jobs({"job074183"})
@TestId("Dev141_SyncDeletedFilesTest")
public class SyncDeletedFilesTest extends P4JavaRshTestCase {

	@ClassRule
	public static SimpleServerRule p4d = new SimpleServerRule("r16.1", SyncDeletedFilesTest.class.getSimpleName());

	@BeforeClass
	public static void beforeAll() throws Exception {

		setupServer(p4d.getRSHURL(), "p4jtestuser", "p4jtestuser", true, null);
		server.setCurrentClient(server.getClient("p4TestUserWS"));
	}

	/**
	 * Test "p4 sync" deleted files.
	 */
	@Test
	public void testSyncDeletedFiles() {

		List<IFileSpec> files = null;

		String depotPath = "//depot/112Dev/Attributes1358938299/test02.txt";

		try {
			client = server.getCurrentClient();
			files = client.sync(FileSpecBuilder.makeFileSpecList(depotPath), true, false, false, false);
			assertNotNull(files);
			assertTrue(files.size() > 0);
			assertEquals(1, files.size());
			assertNotNull(files.get(0));
			assertEquals(FileAction.DELETED, files.get(0).getAction());
			assertEquals(FileSpecOpStatus.VALID, files.get(0).getOpStatus());
		} catch (P4JavaException e) {
			fail("Unexpected exception: " + e.getLocalizedMessage());
		}
	}
}


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var method_expression_1 = require('../expressions/method_expression');
var ToUpper = (function (_super) {
    __extends(ToUpper, _super);
    function ToUpper(ex) {
        _super.call(this);
        this.methodName = 'toupper';
        this.expressions = [ex];
    }
    return ToUpper;
}(method_expression_1.MethodExpression));
exports.ToUpper = ToUpper;
//# sourceMappingURL=to_upper.js.map


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

  <string name="app_name">RxAppState</string>
  <string name="app_description">Put this app into background and bring it back into foreground.\nOr toggle the screen on/off.\n\nA toast will be shown for every event.</string>
  <string name="pick_image">Pick image</string>
  <string name="start_activity_for_result">Or test\nstartActivityForResult()\nwhich pauses monitoring temporarily</string>

</resources>


text:
<?php

if (!defined('APPLICATION'))
   exit();

// Define the plugin:
$PluginInfo['StopForumSpam'] = array(
    'Name' => 'Stop Forum Spam',
    'Description' => "Integrates the spammer blacklist from stopforumspam.com",
    'Version' => '1.0.1b',
    'RequiredApplications' => array('Vanilla' => '2.0.18b1'),
    'Author' => 'Todd Burry',
    'AuthorEmail' => 'todd@vanillaforums.com',
    'AuthorUrl' => 'http://www.vanillaforums.org/profile/todd',
    'SettingsUrl' => '/settings/stopforumspam'
);

class StopForumSpamPlugin extends Gdn_Plugin {

   /// Properties ///
   /// Methods ///

   public static function Check(&$Data, &$Options) {
      // Make the request.
      $Get = array();

      if (isset($Data['IPAddress'])) {
         $AddIP = TRUE;
         // Don't check against the localhost.
         foreach (array(
            '127.0.0.1/0',
            '10.0.0.0/8',
            '172.16.0.0/12',
            '192.168.0.0/16') as $LocalCIDR) {

            if (Gdn_Statistics::CIDRCheck($Data['IPAddress'], $LocalCIDR)) {
               $AddIP = FALSE;
               break;
            }
         }
         if ($AddIP)
            $Get['ip'] = $Data['IPAddress'];
      }
      if (isset($Data['Username'])) {
         $Get['username'] = $Data['Username'];
      }
      if (isset($Data['Email'])) {
         $Get['email'] = $Data['Email'];
      }

      if (empty($Get))
         return FALSE;

      $Get['f'] = 'json';

      $Url = "http://www.stopforumspam.com/api?" . http_build_query($Get);

      $Curl = curl_init();
      curl_setopt($Curl, CURLOPT_URL, $Url);
      curl_setopt($Curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($Curl, CURLOPT_TIMEOUT, 4);
      curl_setopt($Curl, CURLOPT_FAILONERROR, 1);
      $ResultString = curl_exec($Curl);
      curl_close($Curl);

      if ($ResultString) {
         $Result = json_decode($ResultString, TRUE);

         $IPFrequency = GetValueR('ip.frequency', $Result, 0);
         $EmailFrequency = GetValueR('email.frequency', $Result, 0);

         $IsSpam = FALSE;

         // Flag registrations as spam above a certain threshold.
         if ($IPFrequency >= C('Plugins.StopForumSpam.IPThreshold1', 5) || $EmailFrequency >= C('Plugins.StopForumSpam.EmailThreshold1', 20)) {
            $IsSpam = TRUE;
         }

         // Don't even log registrations that are above another threahold.
         if ($IPFrequency >= C('Plugins.StopForumSpam.IPThreshold2', 20) || $EmailFrequency >= C('Plugins.StopForumSpam.EmailThreshold2', 50)) {
            $Options['Log'] = FALSE;
         }

         if ($Result) {
            $Data['_Meta']['IP Frequency'] = $IPFrequency;
            $Data['_Meta']['Email Frequency'] = $EmailFrequency;
         }
         return $IsSpam;
      }

      return FALSE;
   }

   public function Setup() {
      $this->Structure();
   }

   public function Structure() {
      // Get a user for operations.
      $UserID = Gdn::SQL()->GetWhere('User', array('Name' => 'StopForumSpam', 'Admin' => 2))->Value('UserID');

      if (!$UserID) {
         $UserID = Gdn::SQL()->Insert('User', array(
            'Name' => 'StopForumSpam',
            'Password' => RandomString('20'),
            'HashMethod' => 'Random',
            'Email' => 'stopforumspam@domain.com',
            'DateInserted' => Gdn_Format::ToDateTime(),
            'Admin' => '2'
         ));
      }
      SaveToConfig('Plugins.StopForumSpam.UserID', $UserID, array('CheckExisting' => TRUE));
   }

   public function UserID() {
      return C('Plugins.StopForumSpam.UserID', NULL);
   }

   /// Event Handlers ///

   public function Base_CheckSpam_Handler($Sender, $Args) {
      // Don't check for spam if another plugin has already determined it is.
      if ($Sender->EventArguments['IsSpam'])
         return;

      $RecordType = $Args['RecordType'];
      $Data =& $Args['Data'];
      $Options =& $Args['Options'];

      $Result = FALSE;
      switch ($RecordType) {
         case 'Registration':
            $Result = self::Check($Data, $Options);
            if ($Result) {
               $Data['Log_InsertUserID'] = $this->UserID();
               $Data['RecordIPAddress'] = Gdn::Request()->IpAddress();
            }
            break;
         case 'Comment':
         case 'Discussion':
         case 'Activity':
//            $Result = $this->CheckTest($RecordType, $Data) || $this->CheckStopForumSpam($RecordType, $Data) || $this->CheckAkismet($RecordType, $Data);
            break;
      }
      $Sender->EventArguments['IsSpam'] = $Result;
   }

   public function SettingsController_StopForumSpam_Create($Sender, $Args = array()) {
      $Sender->Permission('Garden.Settings.Manage');
      $Conf = new ConfigurationModule($Sender);
		$Conf->Initialize(array(
			'Plugins.StopForumSpam.IPThreshold1' => array('Type' => 'int', 'Control' => 'TextBox', 'Default' => 5, 'Description' => 'IP addresses reported this many times will be flagged as spam.'),
			'Plugins.StopForumSpam.EmailThreshold1' => array('Type' => 'int', 'Control' => 'TextBox', 'Default' => 20, 'Description' => 'Email addresses reported this many times will be flagged as spam.'),
         'Plugins.StopForumSpam.IPThreshold2' => array('Type' => 'int', 'Control' => 'TextBox', 'Default' => 20, 'Description' => 'IP addresses reported this many times will be completely rejected.'),
			'Plugins.StopForumSpam.EmailThreshold2' => array('Type' => 'int', 'Control' => 'TextBox', 'Default' => 50, 'Description' => 'Email addresses reported this many times will be completely rejected.'),
		));

     $Sender->AddSideMenu('dashboard/settings/plugins');
     $Sender->SetData('Title', T('Stop Forum Spam Settings'));
     $Sender->ConfigurationModule = $Conf;
     $Conf->RenderAll();
   }
}


text:
namespace aslam {

}  // namespace aslam


text:
package org.robbins.flashcards.repository.batch;

import java.util.stream.IntStream;

import javax.sql.DataSource;

import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.JdbcTemplate;

import com.google.common.base.Preconditions;

public abstract class AbstractBatchCustomRepositoryImpl
{
	private JdbcTemplate jdbcTemplate = null;

	protected int executeBatch(final String sql, final BatchPreparedStatementSetter batchPreparedStatementSetter) {
		Preconditions.checkNotNull(jdbcTemplate, "DataSource not set for batch statement.");
		final int[] rows = jdbcTemplate.batchUpdate(sql, batchPreparedStatementSetter);
		return sumRows(rows);
	}

	private int sumRows(final int[] rows) {
		return IntStream.of(rows).sum();
	}

	public void setDataSource(final DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}
}


text:
module.exports = require('./webpack.config.base')({
  target: 'isolated_renderer',
  alwaysHasNode: false
})


text:
'use strict';

import jsdiff = require('diff');

/**
 * Gets numbers of all the lines which have changed between the two strings.
 *
 * @export
 * @param {string} oldFile A string representing the old version of the file
 * @param {string} newFile A string representing the new version of the file
 * @returns {Set<number>} A set containing all line numbers which have been modified
 */
export function getModifiedLineNumbers(oldFile: string, newFile: string): Set<number> {
    let diffs: jsdiff.Change[] = jsdiff.diffLines(oldFile, newFile);
    let lineNumber: number = 0;
    let editedLines: Set<number> = new Set();
    diffs.forEach(diff => {
        if (diff.added) {
            if (diff.count) {
                for (let i = 0; i < diff.count; i++) {
                    editedLines.add(lineNumber + i);
                }
            } else {
                editedLines.add(lineNumber);
            }
        }
        if (!diff.removed && diff.count) {
            lineNumber += diff.count;
        }
    });
    return editedLines;
}


text:
LINK_ENTITY_TO_CLASS( asw_jukebox, CASW_Jukebox );

BEGIN_DATADESC( CASW_Jukebox )
	DEFINE_KEYFIELD( m_fFadeInTime, FIELD_FLOAT, "FadeInTime" ),
	DEFINE_KEYFIELD( m_fFadeOutTime, FIELD_FLOAT, "FadeOutTime" ),
	DEFINE_KEYFIELD( m_szDefaultMusic, FIELD_STRING, "DefaultMusic" ),

	DEFINE_INPUTFUNC( FIELD_VOID, "StartMusic", InputMusicStart ),
	DEFINE_INPUTFUNC( FIELD_VOID, "StopMusic", InputMusicStop ),

END_DATADESC()

void CASW_Jukebox::InputMusicStart( inputdata_t &inputdata )
{
	// Send each client the music start event
	IGameEvent * event = gameeventmanager->CreateEvent( "jukebox_play_random" );
	if ( event )
	{
		event->SetFloat( "fadeintime", m_fFadeInTime );
		event->SetString( "defaulttrack", m_szDefaultMusic );
		gameeventmanager->FireEvent( event );

		// Stop stim music if it's playing
		ASWGameRules()->m_fPreventStimMusicTime = 5.0f;
	}
}

void CASW_Jukebox::InputMusicStop( inputdata_t &inputdata )
{
	// Tell each client to stop the music
	IGameEvent * event = gameeventmanager->CreateEvent( "jukebox_stop" );
	if ( event )
	{
		event->SetFloat( "fadeouttime", m_fFadeOutTime );
		gameeventmanager->FireEvent( event );
	}
}


text:
from __future__ import absolute_import

import six
from rest_framework.response import Response

from sentry.api.bases.integration import IntegrationEndpoint
from sentry.shared_integrations.exceptions import ApiError
from sentry.models import Integration

class GitlabIssueSearchEndpoint(IntegrationEndpoint):
    def get(self, request, organization, integration_id):
        try:
            integration = Integration.objects.get(
                organizations=organization, id=integration_id, provider="gitlab"
            )
        except Integration.DoesNotExist:
            return Response(status=404)

        field = request.GET.get("field")
        query = request.GET.get("query")
        if field is None:
            return Response({"detail": "field is a required parameter"}, status=400)
        if query is None:
            return Response({"detail": "query is a required parameter"}, status=400)

        installation = integration.get_installation(organization.id)

        if field == "externalIssue":
            project = request.GET.get("project")
            if project is None:
                return Response({"detail": "project is a required parameter"}, status=400)
            try:
                iids = [int(query)]
                query = None
            except ValueError:
                iids = None

            try:
                response = installation.search_issues(query=query, project_id=project, iids=iids)
            except ApiError as e:
                return Response({"detail": six.text_type(e)}, status=400)

            return Response(
                [
                    {
                        "label": "(#%s) %s" % (i["iid"], i["title"]),
                        "value": "%s#%s" % (i["project_id"], i["iid"]),
                    }
                    for i in response
                ]
            )

        elif field == "project":
            try:
                response = installation.search_projects(query)
            except ApiError as e:
                return Response({"detail": six.text_type(e)}, status=400)
            return Response(
                [
                    {"label": project["name_with_namespace"], "value": project["id"]}
                    for project in response
                ]
            )

        return Response({"detail": "invalid field value"}, status=400)


text:
#ifndef UCOL_UCAELEMS_H
#define UCOL_UCAELEMS_H

#include "unicode/utypes.h"
#include "unicode/uniset.h"
#include "ucol_tok.h"

#if !UCONFIG_NO_COLLATION

#include "ucol_imp.h"

#ifdef UCOL_DEBUG
#include "cmemory.h"
#include <stdio.h>
#endif

U_CDECL_BEGIN

/* This is the maximum trie capacity for the mapping trie.
Due to current limitations in genuca and the design of UTrie,
this number can't be more than 256K.
As of Unicode 5, it currently could safely go to 128K without
a problem. Normally, less than 32K are tailored.
*/
#define UCOL_ELM_TRIE_CAPACITY 0x40000

/* This is the maxmun capacity for temparay combining class
 * table.  The table will be compacted after scanning all the
 * Unicode codepoints.
*/
#define UCOL_MAX_CM_TAB  0x10000

typedef struct {
    uint32_t *CEs;
    int32_t position;
    int32_t size;
} ExpansionTable;

typedef struct {
    UChar prefixChars[128];
    UChar *prefix;
    uint32_t prefixSize;
    UChar uchars[128];
    UChar *cPoints;
    uint32_t cSize;          /* Number of characters in sequence - for contraction */
    uint32_t noOfCEs;        /* Number of collation elements                       */
    uint32_t CEs[128];      /* These are collation elements - there could be more than one - in case of expansion */
    uint32_t mapCE;         /* This is the value element maps in original table   */
    uint32_t sizePrim[128];
    uint32_t sizeSec[128];
    uint32_t sizeTer[128];
    UBool caseBit;
    UBool isThai;
} UCAElements;

typedef struct {
  uint32_t *endExpansionCE;
  UBool    *isV;
  int32_t   position;
  int32_t   size;
  uint8_t   maxLSize;
  uint8_t   maxVSize;
  uint8_t   maxTSize;
} MaxJamoExpansionTable;

typedef struct {
  uint32_t *endExpansionCE;
  uint8_t  *expansionCESize;
  int32_t   position;
  int32_t   size;
} MaxExpansionTable;

typedef struct {
    uint16_t   index[256];  /* index of cPoints by combining class 0-255. */
    UChar      *cPoints;    /* code point array of all combining marks */
    uint32_t   size;        /* total number of combining marks */
} CombinClassTable;

typedef struct {
  /*CompactEIntArray      *mapping; */
  UNewTrie                 *mapping;
  ExpansionTable        *expansions;
  struct CntTable       *contractions;
  UCATableHeader        *image;
  UColOptionSet         *options;
  MaxExpansionTable     *maxExpansions;
  MaxJamoExpansionTable *maxJamoExpansions;
  uint8_t               *unsafeCP;
  uint8_t               *contrEndCP;
  const UCollator       *UCA;
  UHashtable      *prefixLookup;
  CombinClassTable      *cmLookup;  /* combining class lookup for tailoring. */
} tempUCATable;

typedef struct {
    UChar cp;
    uint16_t cClass;   // combining class
}CompData;

typedef struct {
    CompData *precomp;
    int32_t precompLen;
    UChar *decomp;
    int32_t decompLen;
    UChar *comp;
    int32_t compLen;
    uint16_t curClass;
    uint16_t tailoringCM;
    int32_t  cmPos;
}tempTailorContext;

U_CAPI tempUCATable * U_EXPORT2 uprv_uca_initTempTable(UCATableHeader *image, UColOptionSet *opts, const UCollator *UCA, UColCETags initTag, UColCETags supplementaryInitTag, UErrorCode *status);
U_CAPI void U_EXPORT2 uprv_uca_closeTempTable(tempUCATable *t);
U_CAPI uint32_t U_EXPORT2 uprv_uca_addAnElement(tempUCATable *t, UCAElements *element, UErrorCode *status);
U_CAPI UCATableHeader * U_EXPORT2 uprv_uca_assembleTable(tempUCATable *t, UErrorCode *status);

U_CAPI int32_t U_EXPORT2
uprv_uca_canonicalClosure(tempUCATable *t, UColTokenParser *src,
                          icu::UnicodeSet *closed, UErrorCode *status);

U_CDECL_END

#endif /* #if !UCONFIG_NO_COLLATION */

#endif


text:
import copy
from forseti.formula import Symbol, Or, And, Not
from nose import runmodule
from nose.tools import assert_equal, assert_true
import util
from extra_formulas import GeneralizedAnd, GeneralizedOr

def test_helper():
    statement = Or(Or(Symbol("B"), Symbol("C")), Symbol("A"))
    new_statement, change = util.flatten(copy.deepcopy(statement))
    assert_equal(new_statement, GeneralizedOr(Symbol("B"), Symbol("C"), Symbol("A")))
    assert_true(change)

def test_helper2():
    statement = GeneralizedOr(Symbol("a"), Symbol("a"))
    # need to manually set it to this as otherwise the constructor would flatten it automatically
    statement.args[0] = Or(And(Symbol("b"), Not(Symbol("c"))), And(Symbol("c"), Not(Symbol("b"))))
    new_statement, change = util.flatten(copy.deepcopy(statement))
    assert_equal(new_statement, GeneralizedOr(Symbol("a"), And(Symbol("b"), Not(Symbol("c"))),
                                              And(Symbol("c"), Not(Symbol("b")))))
    assert_true(change)

def test_generalized_or_constructor():
    statement = GeneralizedOr(Or(Symbol("B"), Symbol("C")), Symbol("A"))
    assert_equal(statement, GeneralizedOr(Symbol("B"), Symbol("C"), Symbol("A")))

if __name__ == "__main__":
    runmodule()


text:
"""DVC command line interface"""
import argparse
import logging
import os
import sys

from ._debug import add_debugging_flags
from .command import (
    add,
    cache,
    check_ignore,
    checkout,
    commit,
    completion,
    config,
    daemon,
    dag,
    data_sync,
    destroy,
    diff,
    experiments,
    freeze,
    gc,
    get,
    get_url,
    git_hook,
    imp,
    imp_url,
    init,
    install,
    live,
    ls,
    machine,
    metrics,
    move,
    params,
    plots,
    remote,
    remove,
    repro,
    root,
    run,
    stage,
    unprotect,
    update,
    version,
)
from .command.base import fix_subparsers
from .exceptions import DvcParserError

logger = logging.getLogger(__name__)

COMMANDS = [
    init,
    get,
    get_url,
    destroy,
    add,
    remove,
    move,
    unprotect,
    run,
    repro,
    data_sync,
    gc,
    imp,
    imp_url,
    config,
    checkout,
    remote,
    cache,
    metrics,
    params,
    install,
    root,
    ls,
    freeze,
    dag,
    daemon,
    commit,
    completion,
    diff,
    version,
    update,
    git_hook,
    plots,
    stage,
    experiments,
    check_ignore,
    live,
    machine,
]

def _find_parser(parser, cmd_cls):
    defaults = parser._defaults  # pylint: disable=protected-access
    if not cmd_cls or cmd_cls == defaults.get("func"):
        parser.print_help()
        raise DvcParserError()

    actions = parser._actions  # pylint: disable=protected-access
    for action in actions:
        if not isinstance(action.choices, dict):
            # NOTE: we are only interested in subparsers
            continue
        for subparser in action.choices.values():
            _find_parser(subparser, cmd_cls)

class DvcParser(argparse.ArgumentParser):
    """Custom parser class for dvc CLI."""

    def error(self, message, cmd_cls=None):  # pylint: disable=arguments-differ
        logger.error(message)
        _find_parser(self, cmd_cls)

    def parse_args(self, args=None, namespace=None):
        # NOTE: overriding to provide a more granular help message.
        # E.g. `dvc plots diff --bad-flag` would result in a `dvc plots diff`
        # help message instead of generic `dvc` usage.
        args, argv = self.parse_known_args(args, namespace)
        if argv:
            msg = "unrecognized arguments: %s"
            self.error(msg % " ".join(argv), getattr(args, "func", None))
        return args

class VersionAction(argparse.Action):  # pragma: no cover
    # pylint: disable=too-few-public-methods
    """Shows DVC version and exits."""

    def __call__(self, parser, namespace, values, option_string=None):
        from dvc import __version__

        print(__version__)
        sys.exit(0)

def get_parent_parser():
    """Create instances of a parser containing common arguments shared among
    all the commands.

    When overwriting `-q` or `-v`, you need to instantiate a new object
    in order to prevent some weird behavior.
    """
    parent_parser = argparse.ArgumentParser(add_help=False)
    add_debugging_flags(parent_parser)
    log_level_group = parent_parser.add_mutually_exclusive_group()
    log_level_group.add_argument(
        "-q", "--quiet", action="count", default=0, help="Be quiet."
    )
    log_level_group.add_argument(
        "-v", "--verbose", action="count", default=0, help="Be verbose."
    )

    return parent_parser

def get_main_parser():
    parent_parser = get_parent_parser()

    # Main parser
    desc = "Data Version Control"
    parser = DvcParser(
        prog="dvc",
        description=desc,
        parents=[parent_parser],
        formatter_class=argparse.RawTextHelpFormatter,
        add_help=False,
    )

    # NOTE: We are doing this to capitalize help message.
    # Unfortunately, there is no easier and clearer way to do it,
    # as adding this argument in get_parent_parser() either in
    # log_level_group or on parent_parser itself will cause unexpected error.
    parser.add_argument(
        "-h",
        "--help",
        action="help",
        default=argparse.SUPPRESS,
        help="Show this help message and exit.",
    )

    # NOTE: On some python versions action='version' prints to stderr
    # instead of stdout https://bugs.python.org/issue18920
    parser.add_argument(
        "-V",
        "--version",
        action=VersionAction,
        nargs=0,
        help="Show program's version.",
    )

    parser.add_argument(
        "--cd",
        default=os.path.curdir,
        metavar="<path>",
        help="Change to directory before executing.",
        type=str,
    )

    # Sub commands
    subparsers = parser.add_subparsers(
        title="Available Commands",
        metavar="COMMAND",
        dest="cmd",
        help="Use `dvc COMMAND --help` for command-specific help.",
    )

    fix_subparsers(subparsers)

    for cmd in COMMANDS:
        cmd.add_parser(subparsers, parent_parser)

    return parser

def parse_args(argv=None):
    """Parses CLI arguments.

    Args:
        argv: optional list of arguments to parse. sys.argv is used by default.

    Raises:
        dvc.exceptions.DvcParserError: raised for argument parsing errors.
    """
    parser = get_main_parser()
    args = parser.parse_args(argv)
    return args


text:
package services

import (
	"fmt"

	"github.com/Sirupsen/logrus"
	"github.com/daticahealth/cli/lib/volumes"
	"github.com/daticahealth/cli/models"
	"github.com/olekukonko/tablewriter"
)

// CmdServices lists the names of all services for an environment.
func CmdServices(is IServices, v volumes.IVolumes) error {
	svcs, err := is.List()

	if err != nil {
		return err
	}
	if svcs == nil || len(*svcs) == 0 {
		logrus.Println("No services found")
		return nil
	}
	data := [][]string{{"NAME", "DNS", "RAM (GB)", "CPU", "WORKER LIMIT", "SCALE", "STORAGE (GB)"}}
	for _, s := range *svcs {

		vols, err := v.List(s.ID)
		if err != nil {
			logrus.Errorf("Failed to retrieve volume information for service %s", s.Label)
			logrus.Debugf("Volume information error for %s: %s", s.Label, err)
		}
		if vols == nil || len(*vols) == 0 {
			vols = &[]models.Volume{{ID: 0, Type: "", Size: 0}}
		}

		volume := ""
		for i, v := range *vols {
			if i > 0 {
				volume += ", "
			}
			volume += fmt.Sprintf("%d", v.Size)
		}

		data = append(data, []string{s.Label, s.DNS, fmt.Sprintf("%d", s.Size.RAM), fmt.Sprintf("%d", s.Size.CPU), fmt.Sprintf("%d", s.WorkerScale), fmt.Sprintf("%d", s.Scale), volume})

	}

	table := tablewriter.NewWriter(logrus.StandardLogger().Out)
	table.SetBorder(false)
	table.SetRowLine(false)
	table.SetCenterSeparator("")
	table.SetColumnSeparator("")
	table.SetRowSeparator("")
	table.AppendBulk(data)
	table.SetAlignment(tablewriter.ALIGN_LEFT)

	table.Render()
	return nil
}

func (s *SServices) List() (*[]models.Service, error) {
	return s.ListByEnvID(s.Settings.EnvironmentID, s.Settings.Pod)
}

func (s *SServices) ListByEnvID(envID, podID string) (*[]models.Service, error) {
	headers := s.Settings.HTTPManager.GetHeaders(s.Settings.SessionToken, s.Settings.Version, podID, s.Settings.UsersID)
	resp, statusCode, err := s.Settings.HTTPManager.Get(nil, fmt.Sprintf("%s%s/environments/%s/services", s.Settings.PaasHost, s.Settings.PaasHostVersion, envID), headers)
	if err != nil {
		return nil, err
	}
	var services []models.Service
	err = s.Settings.HTTPManager.ConvertResp(resp, statusCode, &services)
	if err != nil {
		return nil, err
	}
	return &services, nil
}

func (s *SServices) Retrieve(svcID string) (*models.Service, error) {
	headers := s.Settings.HTTPManager.GetHeaders(s.Settings.SessionToken, s.Settings.Version, s.Settings.Pod, s.Settings.UsersID)
	resp, statusCode, err := s.Settings.HTTPManager.Get(nil, fmt.Sprintf("%s%s/environments/%s/services/%s", s.Settings.PaasHost, s.Settings.PaasHostVersion, s.Settings.EnvironmentID, svcID), headers)
	if err != nil {
		return nil, err
	}
	var service models.Service
	err = s.Settings.HTTPManager.ConvertResp(resp, statusCode, &service)
	if err != nil {
		return nil, err
	}
	return &service, nil
}

func (s *SServices) RetrieveByLabel(label string) (*models.Service, error) {
	services, err := s.List()
	if err != nil {
		return nil, err
	}
	var service *models.Service
	for _, s := range *services {
		if s.Label == label {
			service = &s
			break
		}
	}
	return service, nil
}


text:
module NumbersAndWords
  module Translations
    class Hu < Base
      include NumbersAndWords::Translations::Families::Latin
      include NumbersAndWords::Translations::Extensions::FractionSignificance

      def tens_with_ones numbers, options = {}
        ones, tens = numbers
        [t(:tens_with_ones)[tens], t([options[:prefix], :ones_with_tens].join('.'))[ones]].join ''
      end

      def hundreds number, options = {}
        options[:separator] = ''
        super number, options
      end

      def micros capacity, number = nil, separator = ''
        super capacity, nil, separator
      end
    end
  end
end


text:
<?php

namespace CQRSFactory;

use CQRS\EventHandling\EventBusInterface;
use CQRS\EventHandling\EventHandlerLocator;
use CQRS\EventHandling\Exception\InvalidArgumentException;
use CQRS\EventHandling\SynchronousEventBus;
use CQRS\HandlerResolver\ContainerHandlerResolver;
use CQRS\HandlerResolver\EventHandlerResolver;
use Interop\Container\ContainerInterface;

class EventBusFactory extends AbstractFactory
{
    /**
     * @param ContainerInterface $container
     * @param string $configKey
     * @return EventBusInterface
     * @throws InvalidArgumentException
     */
    protected function createWithConfig(ContainerInterface $container, string $configKey): EventBusInterface
    {
        $config = $this->retrieveConfig($container, $configKey, 'event_bus');

        return new $config['class'](
            new EventHandlerLocator(
                $config['handlers'],
                new ContainerHandlerResolver(
                    $container,
                    new EventHandlerResolver()
                )
            ),
            is_string($config['logger'])
                ? $container->get($config['logger'])
                : $config['logger']
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function getDefaultConfig(): array
    {
        return [
            'class' => SynchronousEventBus::class,
            'handlers' => [],
            'logger' => null,
        ];
    }
}


text:
/* This is stub file for gapi.client.{{=it.name}} definition tests */
/* IMPORTANT.
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
**/
gapi.load('client', () => {
    /** now we can use gapi.client */
    gapi.client.load('customsearch', 'v1', () => {
        /** now we can use gapi.client.customsearch */

        run();
    });

    async function run() {
        /** Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. */
        await gapi.client.cse.list({
            c2coff: "c2coff",
            cr: "cr",
            cx: "cx",
            dateRestrict: "dateRestrict",
            exactTerms: "exactTerms",
            excludeTerms: "excludeTerms",
            fileType: "fileType",
            filter: "filter",
            gl: "gl",
            googlehost: "googlehost",
            highRange: "highRange",
            hl: "hl",
            hq: "hq",
            imgColorType: "imgColorType",
            imgDominantColor: "imgDominantColor",
            imgSize: "imgSize",
            imgType: "imgType",
            linkSite: "linkSite",
            lowRange: "lowRange",
            lr: "lr",
            num: 21,
            orTerms: "orTerms",
            q: "q",
            relatedSite: "relatedSite",
            rights: "rights",
            safe: "safe",
            searchType: "searchType",
            siteSearch: "siteSearch",
            siteSearchFilter: "siteSearchFilter",
            sort: "sort",
            start: 31,
        });
    }
});


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="@string/default_text_kws"
        android:id="@+id/kw_view"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginLeft="5dp"
        android:layout_marginStart="5dp" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="@string/separator"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@id/kw_view"
        android:layout_toEndOf="@id/kw_view"
        android:textSize="30sp"
        android:textColor="@android:color/secondary_text_dark"/>

    <TextView
        android:id="@+id/ps_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="@string/default_text_ps"
        android:layout_alignBottom="@+id/textView"
        android:layout_toRightOf="@+id/textView"
        android:layout_toEndOf="@+id/textView"/>

</RelativeLayout>


text:
#ifndef LM_SENSOR_COMPONENT_H
#define LM_SENSOR_COMPONENT_H

#define SAFETY_ITERATIONS 5000
#define SAFETY_NANOSECONDS 100

ComponentPtr lm_sensor_get_new_component(DagCardPtr card);

#endif  /* LM_SENSOR_COMPONENT_H */