text:
import scala.collection.mutable
import scala.annotation.*
import util.CommandLineParser.FromString

@myMain()("A")
def foo1(): Unit = println("I was run!")

@myMain(0)("This should not be printed")
def foo2() = throw new Exception("This should not be run")

@myMain(1)("Purple smart", "Blue fast", "White fashion", "Yellow quiet", "Orange honest", "Pink loud")
def foo3() = println("Here are some colors:")

@myMain()()
def foo4() = println("This will be printed, but nothing more.")

object Test:
  val allClazzes: Seq[Class[?]] =
    LazyList.from(1).map(i => scala.util.Try(Class.forName("foo" + i.toString))).takeWhile(_.isSuccess).map(_.get)

  def callMains(): Unit =
    for (clazz <- allClazzes)
      val method = clazz.getMethod("main", classOf[Array[String]])
      method.invoke(null, Array[String]())

  def main(args: Array[String]) =
    callMains()
end Test

// This is a toy example, it only works with positional args
@experimental
class myMain(runs: Int = 3)(after: String*) extends MainAnnotation[FromString, Any]:
  import MainAnnotation.*

  def command(info: Info, args: Seq[String]): Option[Seq[String]] = Some(args)

  def argGetter[T](param: Parameter, arg: String, defaultArgument: Option[() => T])(using p: FromString[T]): () => T =
    () => p.fromString(arg)

  def varargGetter[T](param: Parameter, args: Seq[String])(using p: FromString[T]): () => Seq[T] =
    () => for arg <- args yield p.fromString(arg)

  def run(f: () => Any): Unit =
    for (_ <- 1 to runs)
      f()
      if after.length > 0 then println(after.mkString(", "))
  end run

end myMain

redpajama_set_name: RedPajamaGithub


text:
package net.oneandone.troilus;

import net.oneandone.troilus.java7.BatchMutation;

import com.datastax.driver.core.ConsistencyLevel;
import com.datastax.driver.core.Statement;
import com.datastax.driver.core.policies.RetryPolicy;
import com.google.common.util.concurrent.ListenableFuture;

class Mutations {

    private Mutations() {  }

    /**
     * @param batchable the batchable to map
     * @return the mapped batchable
     */
    public static net.oneandone.troilus.java7.Batchable<?> toJava7Mutation(Batchable<?> mutation) {
        return new MutationToJava7MutationAdapter(mutation);
    }

    @SuppressWarnings("rawtypes")
    private static class MutationToJava7MutationAdapter implements net.oneandone.troilus.java7.Batchable {
        private final Batchable<?> mutation;

        public MutationToJava7MutationAdapter(Batchable<?> mutation) {
            this.mutation = mutation;
        }

        @Override
        public Object withConsistency(ConsistencyLevel consistencyLevel) {
            return mutation.withConsistency(consistencyLevel);
        }

        @Override
        public Object withoutTracking() {
            return mutation.withoutTracking();
        }

        @Override
        public Object withRetryPolicy(RetryPolicy policy) {
            return mutation.withRetryPolicy(policy);
        }

        @Override
        public Object withSerialConsistency(ConsistencyLevel consistencyLevel) {
            return mutation.withSerialConsistency(consistencyLevel);
        }

        @Override
        public Object withTracking() {
            return mutation.withTracking();
        }

        @Override
        public BatchMutation combinedWith(net.oneandone.troilus.java7.Batchable other) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Object execute() {
            return mutation.execute();
        }

        @Override
        public ListenableFuture executeAsync() {
            return CompletableFutures.toListenableFuture(mutation.executeAsync());
        }

        @Override
        public ListenableFuture<Statement> getStatementAsync() {
            return CompletableFutures.toListenableFuture(mutation.getStatementAsync());
        }
    }
}


text:
package org.apache.commons.io.filefilter;

import java.io.File;
import java.io.Serializable;

/**
 * This filter accepts Files that are files (not directories).
 *

 * For example, here is how to print out a list of the real files
 * within the current directory:
 *
 *

 * File dir = new File(".");
 * String[] files = dir.list( FileFileFilter.FILE );
 * for ( int i = 0; i < files.length; i++ ) {
 *     System.out.println(files[i]);
 * }
 *

 *
 * @since 1.3
 * @version $Id: FileFileFilter.java 1304052 2012-03-22 20:55:29Z ggregory $
 * @see FileFilterUtils#fileFileFilter()
 */
public class FileFileFilter extends AbstractFileFilter implements Serializable {

    /** Singleton instance of file filter */
    public static final IOFileFilter FILE = new FileFileFilter();

    /**
     * Restrictive consructor.
     */
    protected FileFileFilter() {
    }

    /**
     * Checks to see if the file is a file.
     *
     * @param file  the File to check
     * @return true if the file is a file
     */
    @Override
    public boolean accept(File file) {
        return file.isFile();
    }

}


text:
"use strict";

module.exports = function massageExpressionDomain(ed){
    if(!ed) // undefined and null cases
        return ed;

    if(Array.isArray(ed.keywords))
        return ed;

    var keywords = ed.keywords || '';
    keywords = keywords
       .trim()
       .replace(/^\{/, '')
       .replace(/}$/g, '');

    keywords = keywords
        .split(',')
        .map(function(s){
            return s.trim()
        })
        .filter(function(s){
            return s.length >= 1;
        })
        .map(function(s){
            return s.slice(s.indexOf('"')+1, s.lastIndexOf('"'));
        });

    ed.keywords = keywords;
    return ed;
}


text:
var _ = require('lodash');
var baseConf = require('./protractor.conf').config;

// overrides to the base protractor.conf to use gecko.driver on mac
exports.config = _.extend({}, baseConf, {
  seleniumArgs: ['-Dwebdriver.gecko.driver=./node_modules/geckodriver/geckodriver'],
  capabilities: {
    name: 'Unnamed Job',
    count: 1,
    shardTestFiles: false,
    maxInstances: 1,
    marionette: true,
    acceptInsecureCerts: true
  }
});


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Host;

namespace Microsoft.CodeAnalysis.Remote.Diagnostics
{
    internal interface IPerformanceTrackerService : IWorkspaceService
    {
        void AddSnapshot(IEnumerable<AnalyzerPerformanceInfo> snapshot, int unitCount);
        void GenerateReport(List<ExpensiveAnalyzerInfo> badAnalyzers);

        event EventHandler SnapshotAdded;
    }

    internal struct ExpensiveAnalyzerInfo
    {
        public readonly bool BuiltIn;
        public readonly string AnalyzerId;
        public readonly string AnalyzerIdHash;
        public readonly double LocalOutlierFactor;
        public readonly double Average;
        public readonly double AdjustedStandardDeviation;

        public ExpensiveAnalyzerInfo(bool builtIn, string analyzerId, double lof_value, double average, double stddev) : this()
        {
            BuiltIn = builtIn;
            AnalyzerId = analyzerId;
            AnalyzerIdHash = analyzerId.GetHashCode().ToString();
            LocalOutlierFactor = lof_value;
            Average = average;
            AdjustedStandardDeviation = stddev;
        }

        public string PIISafeAnalyzerId => BuiltIn ? AnalyzerId : AnalyzerIdHash;
    }
}


text:
package me.tatarka.bindingcollectionadapter.sample;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import me.tatarka.bindingcollectionadapter.sample.databinding.ListViewBinding;

/**
 * Created by evan on 5/31/15.
 */
public class FragmentListView extends Fragment {
    private static final String TAG = "BindingList";
    private ViewModel viewModel;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);
        viewModel = new ViewModel(true);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        ListViewBinding binding = ListViewBinding.inflate(inflater, container, false);
        binding.setViewModel(viewModel);
        binding.setListeners(new Listeners(viewModel));
        binding.executePendingBindings();
        return binding.getRoot();
    }
}


text:
/// <reference path="../src/vs/vscode.d.ts" />
/// <reference path="../src/typings/mocha.d.ts" />
/// <reference path="./node.d.ts" />

declare var define: {
	(moduleName: string, dependencies: string[], callback: (...args: any[]) => any): any;
	(moduleName: string, dependencies: string[], definition: any): any;
	(moduleName: string, callback: (...args: any[]) => any): any;
	(moduleName: string, definition: any): any;
	(dependencies: string[], callback: (...args: any[]) => any): any;
	(dependencies: string[], definition: any): any;
};

declare var require: {
	toUrl(path: string): string;
	(moduleName: string): any;
	(dependencies: string[], callback: (...args: any[]) => any, errorback?: (err: any) => void): any;
	config(data: any): any;
	onError: Function;
	__$__nodeRequire<T>(moduleName: string): T;
};

// Declaring the following because the code gets compiled with es5, which lack definitions for console and timers.
declare var console: {
	info(message?: any, ...optionalParams: any[]): void;
	profile(reportName?: string): void;
	assert(test?: boolean, message?: string, ...optionalParams: any[]): void;
	clear(): void;
	dir(value?: any, ...optionalParams: any[]): void;
	warn(message?: any, ...optionalParams: any[]): void;
	error(message?: any, ...optionalParams: any[]): void;
	log(message?: any, ...optionalParams: any[]): void;
	profileEnd(): void;
};

declare function clearTimeout(handle: number): void;
declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;
declare function clearInterval(handle: number): void;
declare function setInterval(handler: any, timeout?: any, ...args: any[]): number;


text:
package com.company;

public class Main {

    public static void main(String[] args) {
	// write your code here
        int passcode = 312;
        String coffeeType;

        switch(passcode)    {
            case 555: coffeeType = "Espresso";
            break;

            case 312: coffeeType = "Vanilla latte";
            break;

            case 629: coffeeType = "Drip coffee";
            break;

            default:  coffeeType = "Unknown";
            break;
        }
        System.out.println(coffeeType);
    }
}


text:
package com.animsample;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.nineoldandroids.animation.Animator;
import com.nineoldandroids.animation.AnimatorListenerAdapter;
import com.nineoldandroids.view.ViewHelper;
import com.nineoldandroids.view.ViewPropertyAnimator;

/**
 * Demo, play the View Property Animations pre 3.1.
 */
public final class PreHCViewPropertyAnimActivity extends AppCompatActivity {

	public static final int LAYOUT = R.layout.activity_vpa;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(LAYOUT);
		registerReceiver(mUpdateAplhaReceiver, mUpdateAplhaFilter);
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		unregisterReceiver(mUpdateAplhaReceiver);
	}

	/**
	 * Rotate {@code v}.
	 *
	 * @param v
	 * 		{@link android.view.View} to rotate.
	 */
	public void rotateMe(final View v) {
		v.setEnabled(false);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.rotation(360).setDuration(2000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				ViewHelper.setRotation(v, 0);
				v.setEnabled(true);
			}
		}).start();
	}

	/**
	 * Rotate {@code v}.
	 *
	 * @param v
	 * 		{@link android.view.View} to rotate.
	 */
	public void rotateXMe(final View v) {
		v.setEnabled(false);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.rotationX(360).setDuration(2000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				ViewHelper.setRotationX(v, 0);
				v.setEnabled(true);
			}
		}).start();
	}

	/**
	 * Rotate {@code v}.
	 *
	 * @param v
	 * 		{@link android.view.View} to rotate.
	 */
	public void rotateYMe(final View v) {
		v.setEnabled(false);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.rotationY(360).setDuration(2000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				ViewHelper.setRotationY(v, 0);
				v.setEnabled(true);
			}
		}).start();
	}

	/**
	 * Change translation of {@code v}.
	 *
	 * @param v
	 * 		{@link android.view.View} to change.
	 */
	public void changeTranslation(final View v) {
		final float initTranX = ViewHelper.getTranslationX(v);
		final float initTranY = ViewHelper.getTranslationY(v);
		v.setEnabled(false);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.translationX(400).setDuration(2000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
				animator.translationY(400).setDuration(2000).setListener(new AnimatorListenerAdapter() {
					@Override
					public void onAnimationEnd(Animator animation) {
						super.onAnimationEnd(animation);
						ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
						animator.translationX(initTranX).translationY(initTranY).setDuration(2000).setListener(
								new AnimatorListenerAdapter() {
									@Override
									public void onAnimationEnd(Animator animation) {
										super.onAnimationEnd(animation);
										v.setEnabled(true);
									}
								}).start();
					}
				}).start();
			}
		});
	}

	/**
	 * Scale {@code v} on x-axis.
	 *
	 * @param v
	 * 		{@link android.view.View} to scale.
	 */
	public void scaleXme(final View v) {
		v.setEnabled(false);
		final float init = ViewHelper.getScaleX(v);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.scaleX(10f).setDuration(2000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
				animator.scaleX(init).setDuration(2000).setListener(new AnimatorListenerAdapter() {
					@Override
					public void onAnimationEnd(Animator animation) {
						super.onAnimationEnd(animation);
						v.setEnabled(true);
					}
				}).start();
			}
		}).start();
	}

	/**
	 * Scale {@code v} on y-axis.
	 *
	 * @param v
	 * 		{@link android.view.View} to scale.
	 */
	public void scaleYme(final View v) {
		v.setEnabled(false);
		final float init = ViewHelper.getScaleY(v);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.scaleY(10f).setDuration(2000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
				animator.scaleY(init).setDuration(2000).setListener(new AnimatorListenerAdapter() {
					@Override
					public void onAnimationEnd(Animator animation) {
						super.onAnimationEnd(animation);
						v.setEnabled(true);
					}
				}).start();
			}
		}).start();
	}

	/**
	 * Scale {@code v} on x-y-axis.
	 *
	 * @param v
	 * 		{@link android.view.View} to scale.
	 */
	public void scaleMe(final View v) {
		v.setEnabled(false);
		final float initX = ViewHelper.getScaleX(v);
		final float initY = ViewHelper.getScaleY(v);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.scaleX(10f).scaleY(10f).setDuration(2000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
				animator.scaleX(initX).scaleY(initY).setDuration(2000).setListener(new AnimatorListenerAdapter() {
					@Override
					public void onAnimationEnd(Animator animation) {
						super.onAnimationEnd(animation);
						v.setEnabled(true);
					}
				}).start();
			}
		}).start();
	}

	/**
	 * Simulate click and zoom to remove. It is only a scale-animation.
	 *
	 * @param v
	 * 		{@link android.view.View} to remove.
	 */
	public void clickToRemove(final View v) {
		v.setEnabled(false);
		ViewPropertyAnimator animator = ViewPropertyAnimator.animate(v);
		animator.scaleX(0).scaleY(0).setDuration(1000).setListener(new AnimatorListenerAdapter() {
			@Override
			public void onAnimationEnd(Animator animation) {
				super.onAnimationEnd(animation);
				v.setVisibility(View.GONE);
			}
		}).start();
	}

	/**
	 * Play aplha(transparency) on {@code v}. 1 no transparent,0 full transparent.
	 *
	 * @param v
	 * 		{@link android.view.View} to be transparent.
	 */
	public void playAplha(final View v) {
		if(v != null) {
			mAplhaV = v;
			mAplhaV.setEnabled(false);
			ViewPropertyAnimator animator = ViewPropertyAnimator.animate(mAplhaV);
			animator.alpha(mCurrentAlpha).setDuration(500).setListener(new AnimatorListenerAdapter() {
				@Override
				public void onAnimationEnd(Animator animation) {
					super.onAnimationEnd(animation);
					sendBroadcast(new Intent(ACTION_UPDATE_APLHA));
				}
			}).start();
		}
	}

	private static final String ACTION_UPDATE_APLHA = "update.aplha.action";
	private float mCurrentAlpha = 0;
	private View mAplhaV;
	private IntentFilter mUpdateAplhaFilter = new IntentFilter(ACTION_UPDATE_APLHA);
	private BroadcastReceiver mUpdateAplhaReceiver = new BroadcastReceiver() {
		@Override
		public void onReceive(Context context, Intent intent) {
			mCurrentAlpha = mCurrentAlpha == 0 ? 1 : 0;
			playAplha(mAplhaV);
		}
	};
}


text:
<module rename-to="apptbook">
  <inherits name="com.google.gwt.user.User"/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <inherits name='edu.pdx.cs410J.Projects'/>
  <entry-point class="edu.pdx.cs410J.whitlock.client.AppointmentBookGwt"/>

  <servlet path="/appointments" class="edu.pdx.cs410J.whitlock.server.AppointmentBookServiceImpl"/>
</module>


text:
package com.streamsets.pipeline.lib.io;

import com.streamsets.pipeline.api.impl.Utils;
import com.streamsets.pipeline.config.PostProcessingOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

public class ExactFileContextProvider extends BaseFileContextProvider {
  private static final Logger LOG = LoggerFactory.getLogger(ExactFileContextProvider.class);

  private final Set<String> fileKeys;

  public ExactFileContextProvider(
      List<MultiFileInfo> fileInfos,
      Charset charset,
      int maxLineLength,
      PostProcessingOptions postProcessing,
      String archiveDir,
      FileEventPublisher eventPublisher,
      boolean inPreviewMode
  ) throws IOException {
    super();
    fileContexts = new ArrayList<>();
    fileKeys = new LinkedHashSet<>();
    for (MultiFileInfo dirInfo : fileInfos) {
      fileContexts.add(new FileContext(dirInfo, charset, maxLineLength, postProcessing, archiveDir, eventPublisher, inPreviewMode));
      if (fileKeys.contains(dirInfo.getFileKey())) {
        throw new IOException(Utils.format("File '{}' already specified, it cannot be added more than once",
            dirInfo.getFileKey()));
      }
      fileKeys.add(dirInfo.getFileKey());
    }
    LOG.debug("Opening files: {}", getFileKeys());
  }

  private Set<String> getFileKeys() {
    return fileKeys;
  }

  @Override
  public void close() {
    LOG.debug("Closing files: {}", fileKeys);
    //Close File Contexts
    super.close();
  }

}


text:
<?php
/**
 * Package Builder German lexicon topic
 *
 * @package modx
 * @subpackage lexicon
 *
 * @language de
 * @namespace core
 * @topic package_builder
 *
 * MODX Revolution translated to German by Jan-Christoph Ihrens (enigmatic_user, enigma@lunamail.de)
 */
$_lang['as_system_settings'] = 'Systemeinstellungen';
$_lang['as_context_settings'] = 'Kontext-Einstellungen';
$_lang['as_lexicon_entries'] = 'Lexikon-Einträge';
$_lang['as_lexicon_topics'] = 'Lexikon-Themen';
$_lang['build'] = 'Build';
$_lang['class_key'] = 'Schlüssel der Klasse';
$_lang['class_key_desc'] = 'Der Objekttyp, den Sie mit dem Transport-Vehikel verknüpfen möchten.';
$_lang['class_key_custom'] = 'Oder benutzerdefinierte Klasse';
$_lang['class_key_custom_desc'] = 'Hier können Sie den Namen einer von xPDOObject abgeleiteten Klasse eintragen, die in der obigen Liste nicht aufgeführt ist.';
$_lang['file'] = 'Datei';
$_lang['index'] = 'Index';
$_lang['object'] = 'Objekt';
$_lang['object_id'] = 'Objekt-ID';
$_lang['object_id_desc'] = 'Das exakte Objekt, das Sie mit dem Transport-Vehikel verknüpfen möchten. Diese Angabe ist erforderlich.';
$_lang['package_autoselects'] = 'Binde Auto-Includes ein';
$_lang['package_autoselects_desc'] = 'Bitte wählen Sie die Ressourcen aus, die bei der Package-Erstellung automatisch eingebunden werden sollen. Bitte beachten Sie: Es wird empfohlen, keine dieser Ressourcen auszuwählen, wenn Sie ein Package aus dem Core erstellen.';
$_lang['package_build'] = 'Package erstellen';
$_lang['package_build_desc'] = 'Sie sind nun bereit, das Package zu erstellen. Sobald es erstellt wurde, finden Sie es im Verzeichnis core/packages/.';
$_lang['package_build_err'] = 'Ein Fehler trat auf beim Versuch, das Package zu erstellen.';
$_lang['package_build_xml'] = 'Package aus XML-Datei erstellen';
$_lang['package_build_xml_desc'] = 'Bitte wählen Sie für Ihre Komponente eine gültige XML-Datei für die Package-Erstellung aus.';
$_lang['package_builder'] = 'Package-Erstellung';
$_lang['package_built'] = 'Das Package wurde erstellt.';
$_lang['package_info'] = 'Package-Informationen';
$_lang['package_info_desc'] = 'Geben Sie zunächst die Package-Informationen ein, wie Name, Version und Release.';
$_lang['package_method'] = 'Wählen Sie eine Packaging-Methode';
$_lang['package_method_desc'] = 'Bitte wählen Sie die Methode der Package-Erstellung, die Sie verwenden möchten.';
$_lang['php_script'] = 'PHP-Skript';
$_lang['preserve_keys'] = 'Schlüssel erhalten';
$_lang['preserve_keys_desc'] = 'Ist diese Option aktiviert, bleiben die Primärschlüssel auf die Werte gesetzt, die sie in Ihrer Datenbank momentan haben.';
$_lang['release'] = 'Release';
$_lang['resolve_files'] = 'Dateien kopieren';
$_lang['resolve_files_desc'] = 'Ist diese Option aktiviert, werden die in den Datei-Resolvern angegebenen Dateien kopiert.';
$_lang['resolve_php'] = 'PHP-Skripte ausführen';
$_lang['resolve_php_desc'] = 'Ist diese Option aktiviert, werden die in den PHP-Skript-Resolvern angegebenen Skripte ausgeführt.';
$_lang['resolver_add'] = 'Resolver hinzufügen';
$_lang['resolver_create'] = 'Resolver erstellen';
$_lang['resolver_name_desc'] = 'Der Name des Resolvers. Wird für organisatorische Zwecke verwendet.';
$_lang['resolver_remove'] = 'Resolver löschen';
$_lang['resolver_remove_confirm'] = 'Sind Sie sicher, dass Sie diesen Resolver löschen möchten?';
$_lang['resolver_source_desc'] = 'Der absolute Pfad der Quelle des Resolvers. Wenn es sich um einen Datei-Resolver handelt, wählen Sie das Verzeichnis, in dem die Dateien liegen, die kopiert werden sollen. Bei einem PHP-Skript-Resolver geben Sie bitte das Skript an. Beispiel:

/public_html/modx/_build/components/demo/';
$_lang['resolver_target_desc'] = 'Der absolute Pfad des Ziels, in das der Resolver Dateien kopieren soll. Diese Einstellung muss normalerweise nicht geändert werden. Beispiel:

return MODX_ASSETS_PATH . "snippets/";';
$_lang['resolver_type_desc'] = 'Datei-Resolver stellen sicher, dass alle Dateien im Quellverzeichnis in das Zielverzeichnis kopiert werden. PHP-Skript-Resolver führen den PHP-Code der Quelldatei aus.';
$_lang['resolvers'] = 'Resolver';
$_lang['source'] = 'Quelle';
$_lang['target'] = 'Ziel';
$_lang['type'] = 'Typ';
$_lang['unique_key'] = 'Eindeutiger Schlüssel';
$_lang['unique_key_desc'] = 'Ein eindeutiger Schlüssel, der festlegt, wie nach dem Objekt gesucht wird. Dies kann ein String oder eine kommaseparierte Liste sein. Beispiele:
"name" für modPlugin
"templatename" für modTemplate
Oder, etwas komplexer: "pluginid,evtid" für modPluginEvent';
$_lang['update_object'] = 'Objekt updaten';
$_lang['update_object_desc'] = 'Ist diese Option aktiviert, wird das Objekt aktualisiert, wenn es bereits vorhanden ist. Ist die Option nicht aktiviert, wird das Objekt nicht gespeichert, wenn es bereits vorhanden ist.';
$_lang['use_wizard'] = 'Assistenten verwenden';
$_lang['use_xml'] = 'Aus einer XML-Datei erstellen';
$_lang['vehicle'] = 'Vehikel';
$_lang['vehicle_add'] = 'Vehikel hinzufügen';
$_lang['vehicle_create'] = 'Vehikel erstellen';
$_lang['vehicle_remove'] = 'Vehikel löschen';
$_lang['vehicle_remove_confirm'] = 'Sind Sie sicher, dass Sie dieses Vehikel löschen möchten?';
$_lang['vehicles'] = 'Vehikel';
$_lang['vehicles_add'] = 'Vehikel hinzufügen';
$_lang['vehicles_desc'] = 'Vehikel sind die Objekte, die in dem Package enthalten sind. Sie können Sie hier hinzufügen.';
$_lang['version'] = 'Version';
$_lang['xml_file_err_upload'] = 'Es trat ein Fehler auf beim Versuch, die XML-Datei hochzuladen.';


text:
#include "logger.h"

#include <boost/circular_buffer.hpp>
#include <boost/intrusive/set.hpp>

namespace ufw {

namespace ive = boost::intrusive;

enum class insert_mode: uint8_t
{
    OVERWRITE = 0, // new element overwrites the existing one
    MERGE,         //
    PUSH,          // new element disables conflation of the existing one,
                      but itself becomes eligible for future conflation
    NO_CONFLATION  // conflation disabled
};

enum class position_mode: uint8_t
{
    RETAIN = 0, // merge result inserted in place of the existing one
    GIVEUP      // merge result enqueued to the back (not optimal for queues with contiguous store)
};

template <class T, class Cmp = std::less<>>
struct sorted_circular_buffer
{
    sorted_circular_buffer(size_t cap): ring(cap) {}

    template <class X>
    bool put(X&& x)
    {
        if (ring.full())
            ring.set_capacity(ring.capacity() * 2);

        // TODO: VL: key extractor, etc.
        typename tree_t::insert_commit_data commit_data;
        auto res = tree.insert_check(x, CmpAdapter {}, commit_data);
        if (res.second)
        {
            ring.push_back(node{std::forward<X>(x)});
            tree.insert_commit(ring.back(), commit_data);
            return true;
        }
        else
        {
            res.first->data = std::forward<X>(x); // TODO: VL: merging policy
            return false;
        }
    }

    bool take(T& t)
    {
        if (ring.empty())
            return false;
        t = std::move(ring.front().data);
        ring.pop_front();
        return true;
    }

private:
    struct node: ive::set_base_hook<ive::link_mode<ive::auto_unlink>, ive::optimize_size<false>>
    {
        T data;
        template <class... Args>
        node(Args&&... args): data(std::forward<Args>(args)...) {}
    };

    struct CmpAdapter
    {
        Cmp cmp;
        bool operator()(node const& l, node const& r) const { return cmp(l.data, r.data); }
        bool operator()(T const& l, node const& r) const { return cmp(l, r.data); }
        bool operator()(node const& l, T const& r) const { return cmp(l.data, r); }
    };

    using ring_t = boost::circular_buffer<node>;
    ring_t ring;

    using tree_t = ive::set<node, ive::compare<CmpAdapter>, ive::constant_time_size<false>>;
    tree_t tree;
};

} // namespace ufw

int main()
{
    ufw::sorted_circular_buffer<uint64_t> buf(1024);

    buf.put(42ul);
    buf.put(42ul);
    uint64_t x;
    if (buf.take(x))
        LOG_INF << "popped: " << x;
    if (buf.take(x))
        LOG_INF << "popped: " << x;
}


text:
/*global window*/
(function (module) {
	/**
	 * Used to observe an observable object.
	 * @param object subject Contains the object that is to observe something else.
	 * @return object Containing the injected observer functionality.
	 */
	module.exports = function ($, module) {
		// Contains the base event system
		var base = {};

		// Bind the event system to the global object.
		$.onInit(module, function () {
			$.data(module, 'observable', $('thorny core observable')({}));

			// Sometimes you may went to trigger an event before its been
			//  bound this is where belated comes in to the rescue.
			$.data(module, 'belated', {});

			$.registerGlobal('event', function () {
				return base;
			});
		});

		/**
		 * Used to bind to an event
		 * @param string|object eventType Contains the type of the event that
		 * we're expecting to be called, and we want to respond to.
		 * @param function callback Contains the code that is executed when an
		 * event is triggered
		 * @reutrn void
		 */
		base.bind = function (eventType, callback) {
			var data = {};
			data[eventType] = callback;

			$.data(module, 'observable').addObserver(
				$('thorny core observer')(data)
				);

			// Check to see if there is a belated event we need to trigger.
			if ($.data(module, 'belated')[eventType]) {
				$.data(module, 'belated')[eventType] = undefined;
				this.trigger(eventType);
			}
		};

		/**
		 * Used to trigger an event
		 * @param string eventType Contains the type of event being triggered
		 * @param boolean|undefined belatable True if this event is belatable,
		 * otherwise False|undefined
		 * @return void
		 */
		base.trigger = function (eventType, belatable) {
			var executed = $.data(module, 'observable').notifyObservers(eventType);

			// If no events we're triggered then we have a belated event.
			if (belatable === true && executed === 0) {
				$.data(module, 'belated')[eventType] = true;
			}
		};

		// Return the event system
		return base;
	};
}((typeof window === 'undefined') ? module : window.thorny_path('./thorny/common/core/event')));


text:
import random
import json

from agents.mcts.node_viz import node_to_json
from agents.mcts.node import Node

__author__ = 'crainiarc'

def UCT(rootstate, itermax, verbose = False):
    """ Conduct a UCT search for itermax iterations starting from rootstate.
        Return the best move from the rootstate.
        Assumes 2 alternating players (player 1 starts), with game results in the range [0.0, 1.0]."""

    rootnode = Node(state = rootstate)

    for i in range(itermax):
        node = rootnode
        state = rootstate.clone()

        # Select
        while node.untriedMoves == [] and node.childNodes != []: # node is fully expanded and non-terminal
            node = node.UCTSelectChild()
            state.do_move(node.move)

        # Expand
        if node.untriedMoves != []: # if we can expand (i.e. state/node is non-terminal)
            m = random.choice(node.untriedMoves)
            state.do_move(m)
            node = node.AddChild(m,state) # add child and descend tree

        # Rollout - this can often be made orders of magnitude quicker using a state.GetRandomMove() function
        while state.get_moves() != []: # while state is non-terminal
            state.do_move(random.choice(state.get_moves()))

        # Backpropagate
        while node != None: # backpropagate from the expanded node and work back to the root node
            node.Update(state.get_result(node.playerJustMoved)) # state is terminal. Update node with result from POV of node.playerJustMoved
            node = node.parentNode

    # Output some information about the tree - can be omitted
    if (verbose): print rootnode.TreeToString(0)
    # else: print rootnode.ChildrenToString()
    with open('graph_file.json', 'w') as fp:
        output = json.dumps(node_to_json(rootnode), indent=4)
        fp.write(output)

    return sorted(rootnode.childNodes, key = lambda c: c.visits)[-1].move # return the move that was most visited


text: export PATH=/opt/xilinx/bin:${PATH}:/usr/local/sbin:/usr/sbin:/sbin


text:
package rhcad.touchvg.view.impl;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import rhcad.touchvg.core.Floats;
import rhcad.touchvg.core.GiContext;
import rhcad.touchvg.core.GiCoreView;
import rhcad.touchvg.core.MgFindImageCallback;
import rhcad.touchvg.core.MgOptionCallback;
import rhcad.touchvg.view.internal.BaseViewAdapter;
import rhcad.touchvg.view.internal.BaseViewAdapter.StringCallback;
import rhcad.touchvg.view.internal.ImageCache;
import rhcad.touchvg.view.internal.LogHelper;
import rhcad.touchvg.view.internal.ResourceUtil;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;

public class ContextHelper {
    private static final String KEY_BAKFILE = "bakFile";
    private static final String KEY_READONLY = "readOnly";
    private static final String KEY_PLAYFILE = "playFile";

    private ContextHelper() {
    }

    public static String getCommand(ViewCreator vc) {
        final BaseViewAdapter adapter = vc.getMainAdapter();
        return adapter != null ? adapter.getCommand() : "";
    }

    public static boolean isCommand(ViewCreator vc, String name) {
        return vc.isValid() && vc.coreView().isCommand(name);
    }

    public static boolean setCommand(ViewCreator vc, String name) {
        boolean ret = false;

        if (vc.isValid()) {
            ret = vc.coreView().setCommand(name);
            Log.d(FileUtil.TAG, "setCommand " + name + ": " + ret);
        }
        return ret;
    }

    public static boolean setCommand(ViewCreator vc, String name, String params) {
        boolean ret = false;

        if (vc.isValid()) {
            ret = vc.coreView().setCommand(name, params);
            Log.d(FileUtil.TAG, "setCommand(" + name + "): " + ret + params);
        }
        return ret;
    }

    public static boolean switchCommand(ViewCreator vc) {
        return vc.isValid() && vc.coreView().switchCommand();
    }

    private static class OptionCallback extends MgOptionCallback {
        private Map<String, String> dict;

        public OptionCallback(Map<String, String> dict) {
            this.dict = dict;
        }

        @Override
        public void onGetOptionBool(String name, boolean value) {
            dict.put(name, value ? "1" : "0");
        }

        @Override
        public void onGetOptionInt(String name, int value) {
            dict.put(name, String.valueOf(value));
        }

        @Override
        public void onGetOptionFloat(String name, float value) {
            dict.put(name, String.valueOf(value));
        }

        @Override
        public void onGetOptionString(String name, String text) {
            dict.put(name, text);
        }
    }

    public static Map<String, String> getOptions(ViewCreator vc) {
        Map<String, String> options = new HashMap<String, String>();
        if (vc.isValid()) {
            final OptionCallback c = new OptionCallback(options);
            vc.coreView().traverseOptions(c);
            c.onGetOptionBool("zoomEnabled",
                    vc.coreView().isZoomEnabled(vc.getGraphView().viewAdapter()));
            c.onGetOptionBool("contextActionEnabled",
                    vc.getMainAdapter().getContextActionEnabled());
        }
        return options;
    }

    public static int getLineWidth(ViewCreator vc) {
        return vc.isValid() ? Math.round(vc.coreView().getContext(false).getLineWidth()) : 0;
    }

    public static void setLineWidth(ViewCreator vc, int w) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setLineWidth(w, true);
            vc.coreView().setContext(GiContext.kLineWidth);
        }
    }

    public static int getStrokeWidth(ViewCreator vc) {
        if (!vc.isValid()) {
            return 0;
        }
        float w = vc.coreView().getContext(false).getLineWidth();
        if (w < 0) {
            return Math.round(-w);
        }
        return Math.round(vc.coreView().calcPenWidth(vc.getGraphView().viewAdapter(), w));
    }

    public static void setStrokeWidth(ViewCreator vc, int w) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setLineWidth(-Math.abs(w), true);
            vc.coreView().setContext(GiContext.kLineWidth);
        }
    }

    public static int getLineStyle(ViewCreator vc) {
        return vc.isValid() ? vc.coreView().getContext(false).getLineStyle() : 0;
    }

    public static void setLineStyle(ViewCreator vc, int style) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setLineStyle(style);
            vc.coreView().setContext(GiContext.kLineStyle);
        }
    }

    public static int getStartArrowHead(ViewCreator vc) {
        return vc.isValid() ? vc.coreView().getContext(false).getStartArrayHead() : 0;
    }

    public static void setStartArrowHead(ViewCreator vc, int style) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setStartArrayHead(style);
            vc.coreView().setContext(GiContext.kLineArrayHead);
        }
    }

    public static int getEndArrowHead(ViewCreator vc) {
        return vc.isValid() ? vc.coreView().getContext(false).getEndArrayHead() : 0;
    }

    public static void setEndArrowHead(ViewCreator vc, int style) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setEndArrayHead(style);
            vc.coreView().setContext(GiContext.kLineArrayHead);
        }
    }

    public static int getLineColor(ViewCreator vc) {
        return vc.isValid() ? vc.coreView().getContext(false).getLineColor().getARGB() : 0;
    }

    public static void setLineColor(ViewCreator vc, int argb) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setLineARGB(argb);
            vc.coreView().setContext(argb == 0 ? GiContext.kLineARGB : GiContext.kLineRGB);
        }
    }

    public static int getLineAlpha(ViewCreator vc) {
        return vc.isValid() ? vc.coreView().getContext(false).getLineColor().getA() : 0;
    }

    public static void setLineAlpha(ViewCreator vc, int alpha) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setLineAlpha(alpha);
            vc.coreView().setContext(GiContext.kLineAlpha);
        }
    }

    public static int getFillColor(ViewCreator vc) {
        return vc.isValid() ? vc.coreView().getContext(false).getFillColor().getARGB() : 0;
    }

    public static void setFillColor(ViewCreator vc, int argb) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setFillARGB(argb);
            vc.coreView().setContext(argb == 0 ? GiContext.kFillARGB : GiContext.kFillRGB);
        }
    }

    public static int getFillAlpha(ViewCreator vc) {
        return vc.isValid() ? vc.coreView().getContext(false).getFillColor().getA() : 0;
    }

    public static void setFillAlpha(ViewCreator vc, int alpha) {
        if (vc.isValid()) {
            vc.coreView().getContext(true).setFillAlpha(alpha);
            vc.coreView().setContext(GiContext.kFillAlpha);
        }
    }

    public static void setContextEditing(ViewCreator vc, boolean editing) {
        if (vc.isValid()) {
            vc.coreView().setContextEditing(editing);
        }
    }

    public static int addShapesForTest(ViewCreator vc) {
        final LogHelper log = new LogHelper();
        synchronized (vc.coreView()) {
            return log.r(vc.coreView().addShapesForTest());
        }
    }

    public static void clearCachedData(ViewCreator vc) {
        if (vc.isValid()) {
            vc.coreView().clearCachedData();
        }
    }

    public static boolean zoomToExtent(ViewCreator vc) {
        return vc.isValid() && vc.coreView().zoomToExtent();
    }

    public static boolean zoomToExtent(ViewCreator vc, float margin) {
        return vc.isValid() && vc.coreView().zoomToExtent(margin);
    }

    public static boolean zoomToModel(ViewCreator vc, float x, float y, float w, float h) {
        return vc.isValid() && vc.coreView().zoomToModel(x, y, w, h);
    }

    public static boolean zoomToModel(ViewCreator vc, float x, float y, float w, float h, float margin) {
        return vc.isValid() && vc.coreView().zoomToModel(x, y, w, h, margin);
    }

    public static boolean zoomPan(ViewCreator vc, float dxPixel, float dyPixel) {
        return vc.isValid() && vc.coreView().zoomPan(dxPixel, dyPixel);
    }

    public static boolean setViewScale(ViewCreator vc, float scale) {
        if (scale > 0 && vc.cmdView().xform().zoomScale(scale)) {
            vc.cmdView().regenAll(false);
            return true;
        }
        return false;
    }

    public static PointF displayToModel(ViewCreator vc, float x, float y) {
        final Floats pt = new Floats(x, y);
        if (vc.isValid() && vc.coreView().displayToModel(pt)) {
            return new PointF(pt.get(0), pt.get(1));
        }
        return null;
    }

    public static RectF displayToModel(ViewCreator vc, RectF rect) {
        final Floats box = new Floats(rect.left, rect.top, rect.right, rect.bottom);
        if (vc.isValid() && vc.coreView().displayToModel(box)) {
            return new RectF(box.get(0), box.get(1), box.get(2), box.get(3));
        }
        return rect;
    }

    public static String getContent(ViewCreator vc) {
        int doc = acquireFrontDoc(vc);
        if (doc == 0) {
            return null;
        }

        final LogHelper log = new LogHelper();
        final StringCallback c = new StringCallback();

        vc.coreView().getContent(doc, c);
        GiCoreView.releaseDoc(doc);

        return log.r(c.toString());
    }

    public static boolean setContent(ViewCreator vc, String content) {
        if (!vc.isValid()) {
            return false;
        }
        final LogHelper log = new LogHelper();
        synchronized (vc.coreView()) {
            vc.getGraphView().getImageCache().clear();
            return log.r(vc.coreView().setContent(content));
        }
    }

    public static boolean loadFromFile(ViewCreator vc, String vgfile, boolean readOnly) {
        if (!vc.isValid()) {
            return false;
        }
        final LogHelper log = new LogHelper();
        synchronized (vc.coreView()) {
            vc.getGraphView().getImageCache().clear();
            return log.r(vc.coreView().loadFromFile(FileUtil.addExtension(vgfile, ".vg"), readOnly));
        }
    }

    public static boolean saveToFile(ViewCreator vc, String vgfile) {
        if (!vc.isValid() || vgfile == null) {
            return false;
        }

        int doc = acquireFrontDoc(vc);
        boolean ret = saveToFile(vc, vgfile, doc);
        GiCoreView.releaseDoc(doc);
        return ret;
    }

    private static boolean saveToFile(ViewCreator vc, String vgfile, int doc) {
        final LogHelper log = new LogHelper();
        if (vc.coreView().getShapeCount(doc) == 0) {
            final File f = new File(vgfile);
            return log.r(!f.exists() || f.delete());
        } else {
            return log.r(FileUtil.createDirectory(vgfile, false)
                    && vc.coreView().saveToFile(doc, FileUtil.addExtension(vgfile, ".vg")));
        }
    }

    public static void clearShapes(ViewCreator vc, boolean showMessage) {
        if (vc.isValid()) {
            synchronized (vc.coreView()) {
                vc.getGraphView().getImageCache().clear();
                if (showMessage) {
                    vc.coreView().clear();
                } else {
                    vc.coreView().loadShapes(null);
                }
            }
        }
    }

    public static void eraseView(ViewCreator vc) {
        if (vc.isValid()) {
            synchronized (vc.coreView()) {
                vc.coreView().setCommand("erasewnd");
            }
        }
    }

    public static int acquireFrontDoc(ViewCreator vc) {
        if (!vc.isValid()) {
            return 0;
        }
        synchronized (vc.coreView()) {
            return vc.coreView().acquireFrontDoc();
        }
    }

    private static int getRawResID(ViewCreator vc, String name) {
        return ResourceUtil.getResIDFromName(vc.getContext(), "raw", name);
    }

    public static int insertSVGFromResource(ViewCreator vc, String name) {
        if (!vc.isValid()) {
            return 0;
        }

        int id = getRawResID(vc, name);
        final String sname = ImageCache.SVG_PREFIX + name;
        final Drawable d = vc.getGraphView().getImageCache().addSVG(vc.getContext().getResources(), id, sname);

        synchronized (vc.coreView()) {
            return d == null ? 0 : vc.coreView().addImageShape(sname, ImageCache.getWidth(d),
                    ImageCache.getHeight(d));
        }
    }

    public static int insertSVGFromResource(ViewCreator vc, int id) {
        return insertSVGFromResource(vc, ResourceUtil.getResName(vc.getContext(), id));
    }

    public static int insertSVGFromResource(ViewCreator vc, String name, int xc, int yc) {
        if (!vc.isValid()) {
            return 0;
        }

        int id = getRawResID(vc, name);
        final String sname = ImageCache.SVG_PREFIX + name;
        final Drawable d = vc.getGraphView().getImageCache().addSVG(vc.getContext().getResources(), id, sname);

        synchronized (vc.coreView()) {
            return d == null ? 0 : vc.coreView().addImageShape(sname, xc, yc,
                    ImageCache.getWidth(d), ImageCache.getHeight(d), 0);
        }
    }

    public static int insertSVGFromResource(ViewCreator vc, int id, int xc, int yc) {
        return insertSVGFromResource(vc, ResourceUtil.getResName(vc.getContext(), id), xc, yc);
    }

    public static int insertBitmapFromResource(ViewCreator vc, String name) {
        if (!vc.isValid()) {
            return 0;
        }

        int id = ResourceUtil.getDrawableIDFromName(vc.getContext(), name);
        final String sname = ImageCache.BITMAP_PREFIX + name;
        final Drawable d = vc.getGraphView().getImageCache().addBitmap(vc.getContext().getResources(), id, sname);

        synchronized (vc.coreView()) {
            return d == null ? 0 : vc.coreView().addImageShape(sname, ImageCache.getWidth(d),
                    ImageCache.getHeight(d));
        }
    }

    public static int insertBitmapFromResource(ViewCreator vc, int id) {
        return insertBitmapFromResource(vc, ResourceUtil.getResName(vc.getContext(), id));
    }

    public static int insertBitmapFromResource(ViewCreator vc, String name, int xc, int yc) {
        if (!vc.isValid()) {
            return 0;
        }

        int id = ResourceUtil.getDrawableIDFromName(vc.getContext(), name);
        final String sname = ImageCache.BITMAP_PREFIX + name;
        final Drawable d = vc.getGraphView().getImageCache().addBitmap(vc.getContext().getResources(), id, sname);

        synchronized (vc.coreView()) {
            return d == null ? 0 : vc.coreView().addImageShape(sname, xc, yc,
                    ImageCache.getWidth(d), ImageCache.getHeight(d), 0);
        }
    }

    public static int insertBitmapFromResource(ViewCreator vc, int id, int xc, int yc) {
        return insertBitmapFromResource(vc, ResourceUtil.getResName(vc.getContext(), id), xc, yc);
    }

    public static int insertImageFromFile(ViewCreator vc, String filename) {
        if (!vc.isValid()) {
            return 0;
        }
        return insertImageFromFile(vc, filename,
                vc.getView().getWidth() / 2, vc.getView().getHeight() / 2, 0);
    }

    public static int insertImageFromFile(ViewCreator vc, String filename, int xc, int yc, int tag) {
        final BaseViewAdapter adapter = vc.getMainAdapter();

        if (adapter == null || filename == null) {
            return 0;
        }

        final String name = filename.substring(filename.lastIndexOf('/') + 1).toLowerCase(Locale.US);
        Drawable d;

        if (name.endsWith(".svg")) {
            d = vc.getGraphView().getImageCache().addSVGFile(filename, name);
        } else {
            d = vc.getGraphView().getImageCache().addBitmapFile(vc.getContext().getResources(), filename, name);
        }
        if (d != null) {
            final String destPath = adapter.getRecordPath();
            if (destPath != null) {
                ImageCache.copyFileTo(filename, destPath);
            }
            synchronized (vc.coreView()) {
                int w = ImageCache.getWidth(d);
                int h = ImageCache.getHeight(d);
                return vc.coreView().addImageShape(name, xc, yc, w, h, tag);
            }
        }
        return 0;
    }

    public static boolean getImageSize(ViewCreator vc, float[] info, int sid) {
        final Floats box = new Floats(info.length);
        boolean ret = (vc != null && info.length >= 5 &&  vc.coreView().getImageSize(box, sid));

        for (int i = 0; i < info.length; i++) {
            info[i] = box.get(i);
        }
        return ret;
    }

    public static boolean hasImageShape(ViewCreator vc) {
        int doc = acquireFrontDoc(vc);
        boolean ret = doc != 0 && vc.coreView().hasImageShape(doc);
        GiCoreView.releaseDoc(doc);
        return ret;
    }

    public static int findShapeByImageID(ViewCreator vc, String name) {
        int doc = acquireFrontDoc(vc);
        int ret = vc.isValid() ? vc.coreView().findShapeByImageID(doc, name) : 0;
        GiCoreView.releaseDoc(doc);
        return ret;
    }

    public static int findShapeByTag(ViewCreator vc, int tag) {
        int doc = acquireFrontDoc(vc);
        int ret = vc.isValid() ? vc.coreView().findShapeByTag(doc, tag) : 0;
        GiCoreView.releaseDoc(doc);
        return ret;
    }

    private static class ImageFinder extends MgFindImageCallback {
        private ViewCreator vc;
        private List<Bundle> arr;

        public ImageFinder(ViewCreator vc, List<Bundle> arr) {
            this.vc = vc;
            this.arr = arr;
        }

        public void onFindImage(int sid, String name) {
            final Bundle b = new Bundle();
            b.putInt("id", sid);
            b.putString("name", name);
            b.putString("path", new File(ContextHelper.getImagePath(vc), name).getPath());
            b.putString("rect", ContextHelper.getShapeBox(vc, sid).toString());
            b.putParcelable("image", vc.getGraphView().getImageCache().getBitmap(name));
            this.arr.add(b);
        }
    }

    public static List<Bundle> getImageShapes(ViewCreator vc) {
        final List<Bundle> arr = new ArrayList<Bundle>();
        int doc = acquireFrontDoc(vc);
        vc.coreView().traverseImageShapes(doc, new ImageFinder(vc, arr));
        GiCoreView.releaseDoc(doc);
        return arr;
    }

    public static String getImagePath(ViewCreator vc) {
        return vc.isValid() ? vc.getGraphView().getImageCache().getImagePath() : null;
    }

    public static void setImagePath(ViewCreator vc, String path) {
        if (vc.isValid()) {
            vc.getGraphView().getImageCache().setImagePath(path);
        }
    }

    public static Rect getShapeBox(ViewCreator vc, int sid) {
        final Floats box = new Floats(4);
        if (vc != null && vc.coreView().getBoundingBox(box, sid)) {
            return new Rect(Math.round(box.get(0)), Math.round(box.get(1)), Math.round(box.get(2)),
                    Math.round(box.get(3)));
        }
        return new Rect();
    }

    public static RectF getModelBox(ViewCreator vc, int sid) {
        final Floats box = new Floats(4);
        if (vc != null && vc.coreView().getModelBox(box, sid)) {
            return new RectF(box.get(0), box.get(1), box.get(2), box.get(3));
        }
        return new RectF();
    }

    public static PointF getHandlePoint(ViewCreator vc, int sid, int index) {
        final Floats pt = new Floats(2);
        if (vc.isValid()) {
            vc.coreView().getHandlePoint(pt, sid, index);
        }
        return new PointF(pt.get(0), pt.get(1));
    }

    public static void onSaveInstanceState(ViewCreator vc, Bundle outState, String path) {
        final BaseViewAdapter adapter = vc.getMainAdapter();

        if (adapter == null) {
            Log.w(FileUtil.TAG, "onSaveInstanceState fail due to no view adapter");
        } else {
            final LogHelper log = new LogHelper();
            Bundle state = adapter.getSavedState();

            if (state == null) {
                state = new Bundle();
                adapter.onSaveInstanceState(state);
                onSaveNewState(vc, state, path);
                state.putBoolean(KEY_READONLY, vc.cmdView().isReadOnly());
            }
            outState.putBundle("vg", state);
            log.r();
        }
    }

    private static void onSaveNewState(ViewCreator vc, Bundle state, String path) {
        final String filename = new File(path, "resume.vg").getPath();
        final String playFile = new File(path, "playresume.vg").getPath();

        if (vc.coreView().isPlaying()) {
            if (saveToFile(vc, playFile)) {
                Log.d(FileUtil.TAG, "Auto save playing shapes to " + playFile);
                state.putString(KEY_PLAYFILE, playFile);
            }
            if (saveToFile(vc, filename, vc.coreView().backDoc())) {
                Log.d(FileUtil.TAG, "Auto save playing to " + filename);
                state.putString(KEY_BAKFILE, filename);
            }
        } else {
            if (saveToFile(vc, filename)) {
                Log.d(FileUtil.TAG, "Auto save to " + filename);
                state.putString(KEY_BAKFILE, filename);
            }
        }
    }

    public static void onRestoreInstanceState(ViewCreator vc, Bundle savedState) {
        final BaseViewAdapter adapter = vc.getMainAdapter();
        final Bundle state = savedState.getBundle("vg");

        if (adapter != null && state != null) {
            final LogHelper log = new LogHelper();
            final String filename = state.getString(KEY_BAKFILE);
            boolean readOnly = state.getBoolean(KEY_READONLY);

            if (filename != null && loadFromFile(vc, filename, readOnly)) {
                Log.d(FileUtil.TAG, "Auto load from " + filename);
            }
            adapter.onRestoreInstanceState(state);
            log.r();
        } else {
            Log.w(FileUtil.TAG, "onRestoreInstanceState fail, state:" + (state != null));
        }
    }
}


text:
# vox-webcompiler

**NOTA** : Este módulo está en etapa de prueba y está sujeto a cambios antes de su versión release. Por favor no use este módulo aún

** **

Vox-webcompiler utiliza webpack para empaquetar sus módulos nodejs para usar en web.
Cuando se utiliza vox-webcompiler para compilar a web, se hace referencia a los siguientes módulos preempaquetados siempre que sea necesario

Este módulo está diseñado para ejecutarse sobre vox (*una aplicación hecha para crear y ejecutar aplicaciones multiplataforma*)

Vox-webcompiler incluye los siguientes loaders:

* file-loader
* css-loader
* less-loader
* style-loader

E incluye el plugin

* extract-text-webpack-plugin

## Documentación

* [Lista de cambios](/CHANGES.md)

## Instalación

Para instalar en Windows abra una ventana del cmd como administrador:
```sh
> $ vox -install -g vox-webcompiler
```

En sistemas Unix deberá usar sudo
```sh
> $ sudo vox -install -g vox-webcompiler
```

## Como usar

Cree un archivo con la misma estructura que [webpack.config.js](https://webpack.github.io/docs/configuration.html) pero llamelo en cambio vox.webcompiler.config.js

> webpack.config.js > vox.webcompiler.config.js

vox-webcompiler automáticamente reemplazará los módulos base para hacer referencia a los archivos core-basic o core-http respectivamente como se muestra a continuación

VoxWebcompiler incluye webpack, puede omitir añadir webpack como dependencia a su proyecto, y en vez de usar:

```javascript
require("webpack")
```

puede usar

```javascript
core.VW.Web.Webpack
```

#### Desde código

```javascript
var compilation= new  core.VW.Web.Compiler.Compiler(path /*dirname o configfile*/)}

var resultado= await compilation.compile()
console.log(resultado.toString({
	colors:true
}))
```

#### Desde consola

Utilice -help para ver la ayuda
```sh
> $ vwc -help
```

Para compilar un directorio que contiene el proyecto
```sh
> $ vwc -compile path
```

## core-basic

core-basic empaqueta los siguientes módulos. Cada vez que se haga referencia a estos módulos en su código, al empaquetar se hará referencia a core-basic.
Pero no se preocupe por el rendimiento, los módulos son cargados solo la primera vez que usted los use en su código

* buffer
* path
* events
* querystring
* url
* crypto
* vm

y variables globales

* Buffer

Esto quiere decir que en su página web, si utiliza alguno de los módulos mencionados anteriormente debe añadir el script core-basic

Compile de esta manera:

```sh
> $ vwc -core-basic --out-dir outpath
```

o la versión mínima
```sh
> $ vwc -core-basic --out-dir outpath -min
```

Luego desde HTML
```html
<script type='text/javascript' src='core-basic.js'></script>
```

o la versión mínima

```html
<script type='text/javascript' src='core-basic.min.js'></script>
```

## core-http
core.http tendrá los siguientes módulos.  Cada vez que se haga referencia a estos módulos en su código, al empaquetar se hará referencia a core-http.

* http
* https

Esto quiere decir que en su página web, si utiliza alguno de los módulos mencionados anteriormente debe añadir el script core-http

Compile de esta manera:

```sh
> $ vwc -core-basic --out-dir outpath
```

o la versión mínima
```sh
> $ vwc -core-basic --out-dir outpath -min
```

Luego desde HTML
```html
<script type='text/javascript' src='core-http.js'></script>
```

o la versión mínima

```html
<script type='text/javascript' src='core-http.min.js'></script>
```

## core
core permite el uso de varias características de VW desde el navegador.

Las características implementadas son:

* Symbol
* Promise

#### Namespace: System
* System.Exception
* System.IEnum
* System.NotImplementedException

#### Namespace: VW
* Task
* TaskCancelledException
* Request (browser-request)

#### Namespace: VW.Http
* Request
* RequestArgs
* HttpStatusCode

#### Namespace: VW.Ecma2015 (runtime para usar código ES6 y async/await)
* Promise
* regeneratorRuntime
* Utils

Gracias a este módulo se puede ejecutar código ES6 y async/await de ES7 en navegadores que aún no lo soportan. Para ello debe usarse en conjunto con vox el cual permite realizar transcripción de ES6/async/await a ES5. Mírese como ejemplo core-elements

### License
MIT License


text:
require 'vimrunner'
require 'tempfile'

PWD = File.expand_path File.dirname(__FILE__)

RSpec.configure do |config|

  config.before(:suite) do
    VIM = Vimrunner.start
    VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/scala.vim')
  end

  config.after(:suite) do
    VIM.kill
  end
end

def sort_fixture_across_groups(name)
  fixture_path = "#{PWD}/fixtures/#{name}.scala"

  temp_file = Tempfile.new('vim-scala-')
  temp_file.write File.read(fixture_path)
  temp_file.rewind

  VIM.edit temp_file.path

  VIM.command "let g:scala_sort_across_groups=1"
  VIM.command "SortScalaImports"
  VIM.write

  temp_file.rewind
  output = temp_file.read

  temp_file.close
  temp_file.unlink

  output
end

def expected(name)
  path = "#{PWD}/fixtures/#{name}.expected.scala"
  File.read(path)
end


text:
require "json"
require "logjam"
require "rest_client"
require "cryptic_archive/version"
require "cryptic_archive/exceptions"
require "cryptic_archive/modules"
require "cryptic_archive/session"

module CrypticArchive
end


text:
{% extends "layout.html" %}

{% block page_title %}
What town or city will this taxi be operating in?
{% endblock %}

{% block head %}
{% include "includes/head.html" %}
{% include "includes/scripts.html" %}
{% endblock %}

{% import "templates/button.html" as button %}

{% block content %}

    {% include "includes/phase_banner_beta.html" %}
    {% include "includes/buttons/back.html" %}
    {% include "includes/buttons/log-out.html" %}

 What town or city will this taxi be operating in?

Area:North EastChange

            <form class="form">

                        Select an option

                    <fieldset>
                        <legend class="visuallyhidden"> What town or city will this taxi be operating in? </legend>

                            <input id="townCity-a1" type="radio" name="townCity" value="Carlisle">
                            Carlisle

                            <input id="townCity-a2" type="radio" name="townCity" value="Middlesbrough">
                            Middlesbrough

                            <input id="townCity-a3" type="radio" name="townCity" value="Newcastle">
                            Newcastle

                            <input id="townCity-a4" type="radio" name="townCity" value="Sunderland">
                            Sunderland

                            <input id="townCity-a5" type="radio" name="townCity" value="Other">
                            Other

                    </fieldset>

                    <fieldset id="otherCity" class="panel panel-border-narrow disclosure-question">

                            <legend class="visuallyhidden">Enter your fleet code number</legend>
                            Specify a town or city

 Provide a town or city

                        <input spellcheck="false" class="form-control" id="otherCity" name="otherCity" type="text">

                    </fieldset>

                {{ button.input(id='continue', name='continue', class='button', type='button', value='Continue') }}
            </form>

{% endblock %}


text:
/**
 * Browsable
 */
squebi.run( function($extension,SQUEBI) {

    var config = {
        showFlags : true
    }

    if(SQUEBI.browse) jQuery.extend(config, SQUEBI.browse);

    //var query_for_resource = "PREFIX ###NAME###: <###NSP###>\n\nSELECT DISTINCT ?property ?hasValue ?isValueOf WHERE {\n  { ###URI### ?property ?hasValue }\nUNION\n  { ?isValueOf ?property ###URI### }\n} ORDER BY (!BOUND(?hasValue)) ?property ?hasValue ?isValueOf";
    //var query_for_property = "PREFIX ###NAME###: <###NSP###>\n\nSELECT DISTINCT ?resource ?value WHERE {\n  ?resource ###URI### ?value\n} ORDER BY ?resource ?value";
    //var query_for_class = "PREFIX ###NAME###: <###NSP###>\n\nSELECT DISTINCT ?instance WHERE {\n  ?instance a ###URI###\n} ORDER BY ?instance";

    var query_for_resource = "SELECT DISTINCT ?property ?hasValue ?isValueOf WHERE {\n  { ###URI### ?property ?hasValue }\nUNION\n  { ?isValueOf ?property ###URI### }\n} ORDER BY (!BOUND(?hasValue)) ?property ?hasValue ?isValueOf";
    var query_for_property = "SELECT DISTINCT ?resource ?value WHERE {\n  ?resource ###URI### ?value\n} ORDER BY ?resource ?value";
    var query_for_class = "SELECT DISTINCT ?instance WHERE {\n  ?instance a ###URI###\n} ORDER BY ?instance";

    function getQuery(uri,name) {

        /*
        var namespaceIndex = Math.max(uri.lastIndexOf("/"),uri.lastIndexOf("#")) +1;
        var namespace = uri.substring(0, namespaceIndex);
        var ns_name = namespace in SQUEBI.namespaces ? SQUEBI.namespaces[namespace] : "nsp";
        var ns_uri = ns_name + ":" + uri.substring(namespaceIndex);
         */

        var ns_uri = "<"+uri+">";

        switch(name) {
            case 'property': return query_for_property.replace(/###URI###/g,ns_uri);//.replace(/###NSP###/g,namespace).replace(/###NAME###/g,ns_name);
            case 'class': return query_for_class.replace(/###URI###/g,ns_uri);//.replace(/###NSP###/g,namespace).replace(/###NAME###/g,ns_name);
            case 'type': return query_for_class.replace(/###URI###/g,ns_uri);//.replace(/###NSP###/g,namespace).replace(/###NAME###/g,ns_name);
            default : return query_for_resource.replace(/###URI###/g,ns_uri);//.replace(/###NSP###/g,namespace).replace(/###NAME###/g,ns_name);
        }

    }

    var getDisplayName = function(uri) {

        if(!uri) return "";

        var namespaceIndex = Math.max(uri.lastIndexOf("/"),uri.lastIndexOf("#")) +1;
        var namespace = uri.substring(0, namespaceIndex);

        if(namespace in SQUEBI.namespaces) {
            return SQUEBI.namespaces[namespace] + ":" + uri.substring(namespaceIndex);
        } else {
            return uri;
        }
    }

    var onsuccess = function($scope,data,$rootScope) {

        if($.inArray(data.type, ["drop", "insert", "delete"]) != -1) {

            $scope.template = SQUEBI.app + '/squebi/template/basic.html';
            $rootScope.alerts.push(data.data);

        } else if(data.type == 'construct') {
            $scope.template = SQUEBI.app + '/squebi/template/basic.html';
            $rootScope.alerts.push({type:"warning",msg:"Data Browser does not support 'Construct' queries. Use a different result writer!"});
        } else if(data.type == 'describe') {
            $scope.template = SQUEBI.app + '/squebi/template/basic.html';
            $rootScope.alerts.push({type:"warning",msg:"Data Browser does not support 'Describe' queries. Use a different result writer!"});
        } else if(data.type == 'ask') {
            $scope.template = SQUEBI.app + '/squebi/template/basic.html';
            if(data.data.boolean) {
                $rootScope.alerts.push({type:"success",msg:"The answer is YES."});
            } else {
                $rootScope.alerts.push({type:"success",msg:"The answer is NO."});
            }
        } else {

            $scope.getDisplayName = getDisplayName;

            $scope.transparent = SQUEBI.app + '/squebi/img/transparent.gif';

            $scope.headers = data.data.head.vars;
            $scope.bindings = data.data.results.bindings;

            $scope.showFlags = config.showFlags;

            $scope.template = SQUEBI.app + '/squebi/template/browse.html';

            $scope.selectURI = function(uri,name) {
                var query = getQuery(uri,name);
                $rootScope.$emit('setQuery',query);
            }
        }
    }

    var writer = $extension.createResultWriter("browse","Browse", "json", "Displays browsable SPARQL result", onsuccess);
    writer.position = 1;
    $extension.selectResultWriter(writer);
});


text:
package ro.szzsa.flashair.application;

/**
 *
 */
public class Picture {

    private String name;

    private long timestamp;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }
}


text:
if(!dojo._hasResource["dojox.charting.plot2d.Areas"]){
dojo._hasResource["dojox.charting.plot2d.Areas"]=true;
dojo.provide("dojox.charting.plot2d.Areas");
dojo.require("dojox.charting.plot2d.Default");
dojo.declare("dojox.charting.plot2d.Areas",dojox.charting.plot2d.Default,{constructor:function(){
this.opt.lines=true;
this.opt.areas=true;
}});
}


text:
package org.testng.internal;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.testng.ITestNGMethod;
import org.testng.collections.Lists;
import org.testng.collections.Maps;

public class MethodInheritance {
  /**
   * Look in map for a class that is a superclass of methodClass
   */
  private static List<ITestNGMethod> findMethodListSuperClass(Map<Class, List<ITestNGMethod>> map,
      Class< ? extends ITestNGMethod> methodClass)
  {
    for (Map.Entry<Class, List<ITestNGMethod>> entry : map.entrySet()) {
      if (entry.getKey().isAssignableFrom(methodClass)) {
        return entry.getValue();
      }
    }
    return null;
  }

  /**
   * Look in map for a class that is a subclass of methodClass
   */
  private static Class findSubClass(Map<Class, List<ITestNGMethod>> map,
      Class< ? extends ITestNGMethod> methodClass)
  {
    for (Class cls : map.keySet()) {
      if (methodClass.isAssignableFrom(cls)) {
        return cls;
      }
    }

    return null;
  }

  /**
   * Fix the methodsDependedUpon to make sure that @Configuration methods
   * respect inheritance (before methods are invoked in the order Base first
   * and after methods are invoked in the order Child first)
   *
   * @param methods the list of methods
   * @param before true if we are handling a before method (meaning, the methods
   * need to be sorted base class first and subclass last). false otherwise (subclass
   * methods first, base classes last).
   */
  public static void fixMethodInheritance(ITestNGMethod[] methods, boolean before) {
    // Map of classes -> List of methods that belong to this class or same hierarchy
    Map<Class, List<ITestNGMethod>> map = Maps.newHashMap();

    //
    // Put the list of methods in their hierarchy buckets
    //
    for (ITestNGMethod method : methods) {
      Class< ? extends ITestNGMethod> methodClass = method.getRealClass();
      List<ITestNGMethod> l = findMethodListSuperClass(map, methodClass);
      if (null != l) {
        l.add(method);
      }
      else {
        Class subClass = findSubClass(map, methodClass);
        if (null != subClass) {
          l = map.get(subClass);
          l.add(method);
          map.remove(subClass);
          map.put(methodClass, l);
        }
        else {
          l = Lists.newArrayList();
          l.add(method);
          map.put(methodClass, l);
        }
      }
    }

    //
    // Each bucket that has a list bigger than one element gets sorted
    //
    for (List<ITestNGMethod> l : map.values()) {
      if (l.size() > 1) {
        // Sort them
        sortMethodsByInheritance(l, before);

        /*
         *  Set methodDependedUpon accordingly
         *  E.g. Base class can have multiple @BeforeClass methods. Need to ensure
         *  that @BeforeClass methods in derived class depend on all @BeforeClass methods
         *  of base class. Vice versa for @AfterXXX methods
         */
        for (int i = 0; i < l.size() - 1; i++) {
          ITestNGMethod m1 = l.get(i);
          for (int j = i + 1; j < l.size(); j++) {
            ITestNGMethod m2 = l.get(j);
            if (!equalsEffectiveClass(m1, m2) && !dependencyExists(m1, m2, methods)) {
              Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
              m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
            }
          }
        }
      }
    }
  }

  private static boolean dependencyExists(ITestNGMethod m1, ITestNGMethod m2, ITestNGMethod[] methods) {
    return internalDependencyExists(m1, m2, methods) || internalDependencyExists(m2, m1, methods);
  }

  private static boolean internalDependencyExists(ITestNGMethod m1, ITestNGMethod m2, ITestNGMethod[] methods) {
    ITestNGMethod[] methodsNamed =
      MethodHelper.findDependedUponMethods(m1, methods);

    for (ITestNGMethod method : methodsNamed) {
      if (method.equals(m2)) {
        return true;
      }
    }

    for (String group : m1.getGroupsDependedUpon()) {
      ITestNGMethod[] methodsThatBelongToGroup =
        MethodGroupsHelper.findMethodsThatBelongToGroup(m1, methods, group);
      for (ITestNGMethod method : methodsThatBelongToGroup) {
         if (method.equals(m2)) {
           return true;
         }
       }
    }

    return false;
  }

  private static boolean equalsEffectiveClass(ITestNGMethod m1, ITestNGMethod m2) {
    try {
      Class c1 = m1.getRealClass();
      Class c2 = m2.getRealClass();

      return c1 == null ? c2 == null : c1.equals(c2);
    }
    catch(Exception ex) {
      return false;
    }
  }

  /**
   * Given a list of methods belonging to the same class hierarchy, orders them
   * from the base class to the child (if true) or from child to base class (if false)
   * @param methods
   */
  private static void sortMethodsByInheritance(List<ITestNGMethod> methods,
      boolean baseClassToChild)
  {
    Collections.sort(methods);
    if (! baseClassToChild) {
      Collections.reverse(methods);
    }
  }
}


text:
import { DatabaseId, DatabaseInfo } from '../core/database_info';
import { Platform } from '../platform/platform';
import { Connection } from '../remote/connection';
import { JsonProtoSerializer } from '../remote/serializer';
import { AnyJs } from '../util/misc';
export declare class NodePlatform implements Platform {
    readonly base64Available: boolean;
    readonly emptyByteString: Uint8Array;
    readonly document: null;
    readonly window: Window | null;
    loadConnection(databaseInfo: DatabaseInfo): Promise<Connection>;
    newSerializer(partitionId: DatabaseId): JsonProtoSerializer;
    formatJSON(value: AnyJs): string;
    atob(encoded: string): string;
    btoa(raw: string): string;
}


text:
from __future__ import absolute_import, print_function, unicode_literals

import codecs
import os
import pytest

from conda_kapsel.commands.bug_handler import handle_bugs

def test_no_bug_happens(capsys):
    def unbuggy_main():
        print("hi")
        return 0

    code = handle_bugs(unbuggy_main, program_name="myprogram", details_dict=dict())
    assert code is 0

    out, err = capsys.readouterr()

    assert 'hi\n' == out
    assert '' == err

def test_bug_handling(capsys):
    def buggy_main():
        raise AssertionError("It did not work")

    # we name the program something wonky to be sure we slugify
    # it, and use a non-BMP unicode char to be sure we handle that
    code = handle_bugs(buggy_main,
                       program_name=u"my$ 🌟program",
                       details_dict=dict(thing1="foo",
                                         thing2="bar",
                                         thing3=u"🌟"))

    assert code is 1
    out, err = capsys.readouterr()

    assert '' == out
    assert err.startswith(u"""An unexpected error occurred, most likely a bug in my$ 🌟program.
    (The error was: AssertionError: It did not work)
Details about the error were saved to """)
    filename = err.split()[-1]
    assert filename.endswith(".txt")
    assert os.path.basename(filename).startswith("bug_details_my---program_")
    assert os.path.isfile(filename)

    with codecs.open(filename, 'r', 'utf-8') as f:
        lines = f.readlines()
        report = "".join(lines)

    # we can't easily test the exact value (it contains line
    # numbers of full file paths), but check the major items are
    # in there.
    assert report.startswith(u"Bug details for my$ 🌟program error on ")
    assert 'sys.argv' in report
    assert 'test_bug_handler.py' in report
    assert 'Traceback' in report
    assert 'AssertionError' in report
    assert 'It did not work' in report

    os.remove(filename)

def test_bug_handling_is_buggy(capsys, monkeypatch):
    def buggy_main():
        raise AssertionError("It did not work")

    def mock_temporary_file(*args, **kwargs):
        raise IOError("no temporary file")

    monkeypatch.setattr('tempfile.NamedTemporaryFile', mock_temporary_file)

    with pytest.raises(AssertionError) as exc_info:
        handle_bugs(buggy_main, program_name=u"myprogram", details_dict=dict())
    assert 'It did not work' == str(exc_info.value)

    out, err = capsys.readouterr()

    assert '' == out
    assert """An unexpected error occurred, most likely a bug in myprogram.
    (The error was: AssertionError: It did not work)
""" == err

def test_keyboard_interrupt(capsys):
    def buggy_main():
        raise KeyboardInterrupt("ctrl-c")

    code = handle_bugs(buggy_main, program_name=u"myprogram", details_dict=dict())

    assert code is 1
    out, err = capsys.readouterr()

    assert '' == out
    assert 'myprogram was interrupted.\n' == err


text:
package org.auraframework.impl.context;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.auraframework.adapter.ComponentLocationAdapter;
import org.auraframework.impl.AuraImplTestCase;
import org.auraframework.util.test.annotation.UnAdaptableTest;

public class AuraRegistryProviderImplTest extends AuraImplTestCase {
    public AuraRegistryProviderImplTest(String name) {
        super(name);
    }

    // Stop running the test in SFDC integration build. The test includes all component location
    // adapters. It's often broke by other teams.
    @UnAdaptableTest("Prevent this test running with SFDC integration build. W-2820492")
    public void testAllRegistries() throws Exception {
        Collection<ComponentLocationAdapter> markupLocations;
        List<File> broken = new ArrayList<>();

        markupLocations = new AuraRegistryProviderImpl().getAllComponentLocationAdapters();
        for (ComponentLocationAdapter location : markupLocations) {
            if (location != null) {
                File file = location.getComponentSourceDir();
                if (file != null && (!file.canRead() || !file.canExecute() || !file.isDirectory())) {
                    broken.add(file);
                }
            }
        }
        if (broken.size() > 0) {
            StringBuffer sb = new StringBuffer("Missing Directories in registry path");
            for (File dead : broken) {
                sb.append(dead.getAbsolutePath());
                sb.append("\n");
            }
            fail(sb.toString());
        }
    }
}


text:
package org.apache.flink.runtime.resourcemanager.slotmanager;

import org.apache.flink.api.common.JobID;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.runtime.clusterframework.types.AllocationID;
import org.apache.flink.runtime.clusterframework.types.ResourceID;
import org.apache.flink.runtime.clusterframework.types.ResourceProfile;
import org.apache.flink.runtime.clusterframework.types.SlotID;
import org.apache.flink.runtime.concurrent.Executors;
import org.apache.flink.runtime.concurrent.ScheduledExecutor;
import org.apache.flink.runtime.concurrent.ScheduledExecutorServiceAdapter;
import org.apache.flink.runtime.resourcemanager.ResourceManagerId;
import org.apache.flink.runtime.resourcemanager.SlotRequest;
import org.apache.flink.runtime.resourcemanager.WorkerResourceSpec;
import org.apache.flink.runtime.resourcemanager.registration.TaskExecutorConnection;
import org.apache.flink.runtime.taskexecutor.SlotReport;
import org.apache.flink.runtime.taskexecutor.SlotStatus;
import org.apache.flink.runtime.taskexecutor.TaskExecutorGateway;
import org.apache.flink.runtime.taskexecutor.TestingTaskExecutorGatewayBuilder;
import org.apache.flink.util.ExecutorUtils;
import org.apache.flink.util.TestLogger;

import org.junit.AfterClass;
import org.junit.Test;

import java.util.Collections;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

/** Tests for the slot allocation protocol. */
public class SlotProtocolTest extends TestLogger {

    private static final long timeout = 10000L;

    private static final ScheduledExecutorService scheduledExecutorService =
            new ScheduledThreadPoolExecutor(1);

    private static final ScheduledExecutor scheduledExecutor =
            new ScheduledExecutorServiceAdapter(scheduledExecutorService);

    @AfterClass
    public static void afterClass() {
        ExecutorUtils.gracefulShutdown(timeout, TimeUnit.MILLISECONDS, scheduledExecutorService);
    }

    /**
     * Tests whether 1) SlotManager accepts a slot request. 2) SlotRequest leads to a container
     * allocation. 3) Slot becomes available and TaskExecutor gets a SlotRequest.
     */
    @Test
    public void testSlotsUnavailableRequest() throws Exception {
        final JobID jobID = new JobID();

        final ResourceManagerId rmLeaderID = ResourceManagerId.generate();

        try (SlotManager slotManager =
                SlotManagerBuilder.newBuilder()
                        .setDefaultWorkerResourceSpec(
                                new WorkerResourceSpec.Builder()
                                        .setCpuCores(1.0)
                                        .setTaskHeapMemoryMB(100)
                                        .build())
                        .setScheduledExecutor(scheduledExecutor)
                        .build()) {

            final CompletableFuture<WorkerResourceSpec> workerRequestFuture =
                    new CompletableFuture<>();
            ResourceActions resourceManagerActions =
                    new TestingResourceActionsBuilder()
                            .setAllocateResourceConsumer(workerRequestFuture::complete)
                            .build();

            slotManager.start(rmLeaderID, Executors.directExecutor(), resourceManagerActions);

            final AllocationID allocationID = new AllocationID();
            final ResourceProfile resourceProfile = ResourceProfile.fromResources(1.0, 100);
            final String targetAddress = "foobar";

            SlotRequest slotRequest =
                    new SlotRequest(jobID, allocationID, resourceProfile, targetAddress);

            slotManager.registerSlotRequest(slotRequest);

            workerRequestFuture.get();

            // slot becomes available
            final CompletableFuture<Tuple3<SlotID, JobID, AllocationID>> requestFuture =
                    new CompletableFuture<>();
            TaskExecutorGateway taskExecutorGateway =
                    new TestingTaskExecutorGatewayBuilder()
                            .setRequestSlotFunction(
                                    tuple5 -> {
                                        requestFuture.complete(
                                                Tuple3.of(tuple5.f0, tuple5.f1, tuple5.f2));
                                        return new CompletableFuture<>();
                                    })
                            .createTestingTaskExecutorGateway();

            final ResourceID resourceID = ResourceID.generate();
            final SlotID slotID = new SlotID(resourceID, 0);

            final SlotStatus slotStatus = new SlotStatus(slotID, resourceProfile);
            final SlotReport slotReport = new SlotReport(Collections.singletonList(slotStatus));
            // register slot at SlotManager
            slotManager.registerTaskManager(
                    new TaskExecutorConnection(resourceID, taskExecutorGateway),
                    slotReport,
                    ResourceProfile.ANY,
                    ResourceProfile.ANY);

            // 4) Slot becomes available and TaskExecutor gets a SlotRequest
            assertThat(requestFuture.get(), is(equalTo(Tuple3.of(slotID, jobID, allocationID))));
        }
    }

    /**
     * Tests whether 1) a SlotRequest is routed to the SlotManager. 2) a SlotRequest is confirmed.
     * 3) a SlotRequest leads to an allocation of a registered slot. 4) a SlotRequest is routed to
     * the TaskExecutor.
     */
    @Test
    public void testSlotAvailableRequest() throws Exception {
        final JobID jobID = new JobID();

        final ResourceManagerId rmLeaderID = ResourceManagerId.generate();

        final CompletableFuture<Tuple3<SlotID, JobID, AllocationID>> requestFuture =
                new CompletableFuture<>();
        TaskExecutorGateway taskExecutorGateway =
                new TestingTaskExecutorGatewayBuilder()
                        .setRequestSlotFunction(
                                tuple5 -> {
                                    requestFuture.complete(
                                            Tuple3.of(tuple5.f0, tuple5.f1, tuple5.f2));
                                    return new CompletableFuture<>();
                                })
                        .createTestingTaskExecutorGateway();

        try (SlotManager slotManager =
                SlotManagerBuilder.newBuilder().setScheduledExecutor(scheduledExecutor).build()) {

            ResourceActions resourceManagerActions = new TestingResourceActionsBuilder().build();

            slotManager.start(rmLeaderID, Executors.directExecutor(), resourceManagerActions);

            final ResourceID resourceID = ResourceID.generate();
            final AllocationID allocationID = new AllocationID();
            final ResourceProfile resourceProfile = ResourceProfile.fromResources(1.0, 100);
            final SlotID slotID = new SlotID(resourceID, 0);

            final SlotStatus slotStatus = new SlotStatus(slotID, resourceProfile);
            final SlotReport slotReport = new SlotReport(Collections.singletonList(slotStatus));
            // register slot at SlotManager
            slotManager.registerTaskManager(
                    new TaskExecutorConnection(resourceID, taskExecutorGateway),
                    slotReport,
                    ResourceProfile.ANY,
                    ResourceProfile.ANY);

            final String targetAddress = "foobar";

            SlotRequest slotRequest =
                    new SlotRequest(jobID, allocationID, resourceProfile, targetAddress);
            slotManager.registerSlotRequest(slotRequest);

            // a SlotRequest is routed to the TaskExecutor
            assertThat(requestFuture.get(), is(equalTo(Tuple3.of(slotID, jobID, allocationID))));
        }
    }
}


text:
package ru.hexletLearning.TikTakGame.controller;

import ru.hexletLearning.TikTakGame.model.Game;
import ru.hexletLearning.TikTakGame.model.Player;

public class CurrentMoveController {

    public Player currentMove(Game game) {
        Player[] players = game.getPlayers();
        int numOfPlayerWhoHaveLastMove = game.getNumOfPlayerWhoHaveLastMove();

        int currentPlayerNum = (numOfPlayerWhoHaveLastMove >= players.length - 1) ? 0 : numOfPlayerWhoHaveLastMove + 1;

        game.setNumOfPlayerWhoHaveLastMove(currentPlayerNum);

        return players[currentPlayerNum];
    }

}


text:
import React, {FC} from 'react'
import {connect} from 'react-redux'

// Components
import {Overlay, Sort} from '@influxdata/clockface'
import OrgSwitcherItem from 'src/pageLayout/components/OrgSwitcherItem'
import SortingHat from 'src/shared/components/sorting_hat/SortingHat'

// Types
import {AppState, Organization, ResourceType} from 'src/types'

// Selectors
import {getOrg} from 'src/organizations/selectors'
import {getAll} from 'src/resources/selectors'

interface ComponentProps {
  onClose: () => void
}

interface StateProps {
  orgs: Organization[]
  currentOrg: Organization
}

type Props = ComponentProps & StateProps

const OrgSwitcherOverlay: FC<Props> = ({orgs, onClose, currentOrg}) => {
  return (
    <Overlay.Container maxWidth={500}>
      <Overlay.Header
        title="Switch Organizations"
        onDismiss={onClose}
        testID="switch-overlay--header"
      />
      <Overlay.Body>

Choose an organization

        <SortingHat list={orgs} sortKey="name" direction={Sort.Ascending}>
          {sortedOrgs => (

              {sortedOrgs.map(org => (
                <OrgSwitcherItem
                  key={org.id}
                  orgID={org.id}
                  orgName={org.name}
                  selected={org.id === currentOrg.id}
                  onDismiss={onClose}
                />
              ))}

          )}
        </SortingHat>
      </Overlay.Body>
    </Overlay.Container>
  )
}

const mstp = (state: AppState) => {
  const orgs = getAll<Organization>(state, ResourceType.Orgs)
  const currentOrg = getOrg(state)

  return {
    orgs,
    currentOrg,
  }
}

export default connect<StateProps, {}, ComponentProps>(
  mstp,
  null
)(OrgSwitcherOverlay)


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitbcbaeaf19d5fb009018aff33ea29af7f::getLoader();


text:
<?xml version="1.0" encoding="utf-8"?>
<labels>
	Recordatoris
	Els meus recordatoris
	Correu
	Finestra emergent
	Recordatoris desactivats
	Recordatori per correu desactivat
	Recordatori per finestra emergent desactivat
	El recordatori per correu programat s'ha modificat.
	El recordatori per finestra emergent programat s'ha modificat.
	abans de la cita
	Quan la cita comença
	Recodatori de la cita
	Recordatori automàtic de la cita
	No m'ho recordis
	Per enviar automàticament els recordatoris per correu, s'ha d'establir un cronjob a la vostra instal·lació de todoyu. Aquí en teniu les instruccions:
</labels>


text:
package edu.psu.citeseerx.updates;

import edu.psu.citeseerx.domain.Document;

/**
 * Interface for all classes that should be notified when changes
 * to article metadata occur.  Implementing classes should be registered
 * with the UpdateManager.
 *
 * @author Isaac Councill
 * @version $Rev: 663 $ $Date: 2008-07-27 10:28:51 -0400 (Sun, 27 Jul 2008) $
 */
public interface UpdateListener {

    public void handleUpdate(Document doc);

}


text:
[![Gem Version](https://badge.fury.io/rb/kubeclient.svg)](http://badge.fury.io/rb/kubeclient)
[![Build Status](https://travis-ci.org/abonas/kubeclient.svg)](https://travis-ci.org/abonas/kubeclient)
[![Code Climate](http://img.shields.io/codeclimate/github/abonas/kubeclient.svg)](https://codeclimate.com/github/abonas/kubeclient)
[![Dependency Status](https://gemnasium.com/abonas/kubeclient.svg)](https://gemnasium.com/abonas/kubeclient)

A Ruby client for Kubernetes REST api.
The client supports GET, POST, PUT, DELETE on nodes, pods, services, replication controllers and namespaces.
The client currently supports Kubernetes REST api version v1beta1 and v1beta3.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'kubeclient'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install kubeclient

## Usage

Initialize the client:

`client = Kubeclient::Client.new 'http://localhost:8080/api/' , "v1beta1"`

or for the v3:

`client = Kubeclient::Client.new 'http://localhost:8080/api/' , "v1beta3"`

It is also possible to use https and configure ssl with:

`client = Kubeclient::Client.new 'https://localhost:8443/api/' , "v1beta3"`
`client.ssl_options(`

`  client_cert: OpenSSL::X509::Certificate.new(File.read('/path/to/client.crt')),`

`  client_key:  OpenSSL::PKey::RSA.new(File.read('/path/to/client.key')),`

`  ca_file:     '/path/to/ca.crt', `

`  verify_ssl:  OpenSSL::SSL::VERIFY_PEER`

`)`

For testing and development purpose you can disable the ssl check with:

`client.ssl_options(verify_ssl: OpenSSL::SSL::VERIFY_NONE)`

Examples:

1. Get all pods (and respectively: get_services, get_nodes, get_replication_controllers)

`pods = client.get_pods`

2. Get a specific node (and respectively: get_service "service id" , get_pod "pod id" , get_replication_controller "rc id" )

`node1 = client.get_node "127.0.0.1"`

Note - Kubernetes doesn't work with the uid, but rather with the 'id' property.
Querying with uid causes 404.

3. Delete a service (and respectively delete_pod "pod id" , delete_replication_controller "rc id", delete node "node id")

Input parameter - id (string) specifying service id, pod id, replication controller id.

`client.delete_service "redis-service"`

4. Create a service (and respectively: create_pod pod_object, create_replication_controller rc_obj)

Input parameter - object of type Service, Pod, ReplicationController.

The below example is for v1beta1

`service = Service.new`

`service.id = "redis-master"`

`service.port = 6379`

`service.containerPort  = "redis-server"`

`service.selector = {}`

`service.selector.name = "redis"`

`service.selector.role = "master"`

`client.create_service service`

5. Update entity (update pod, service, replication controller)

Input parameter - object of type Service, Pod, ReplicationController

The below example is for v1beta1

`client.update_service service1`

6. Get all entities - Returns a hash with 4 keys (node, service,pod, replication_controller). Each key points to an EntityList of same type. This method
 is a convenience method instead of calling each entity's get method separately.

`client.get_all_entities`

7. Receive entity updates

It is possible to receive live update notices watching the relevant entities:

`watcher = client.watch_pods`

`watcher.each do |notice|`

`  # process notice data`

`end`

It is possible to interrupt the watcher from another thread with:

`watcher.finish`

## Contributing

1. Fork it ( https://github.com/[my-github-username]/kubeclient/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Test your changes with `rake test rubocop`, add new tests if needed.
4. If you added a new functionality, add it to README
5. Commit your changes (`git commit -am 'Add some feature'`)
6. Push to the branch (`git push origin my-new-feature`)
7. Create a new Pull Request

## Tests

This client is tested with Minitest.
Please run all tests before submitting a Pull Request, and add new tests for new functionality.

Running tests:

`rake test`


text:
#include "camera_app.h"
#include "../klib/kgl_defines.h"

const int VERTEX_DATA_COUNT = 24;

CameraApp::CameraApp() :gpu_program_(nullptr), rectangle_primitive_(nullptr)
{
}

CameraApp::~CameraApp()
{
    KGL_SAFE_DELETE(gpu_program_);
    KGL_SAFE_DELETE(rectangle_primitive_);
    texture_1_.reset();
    texture_2_.reset();
}

void CameraApp::InitScene()
{
    gpu_program_ = new kgl::GPUProgram;
    gpu_program_->CreateFromFile("resources/shader/007_camera_vs.glsl", "resources/shader/007_camera_fs.glsl", nullptr);

    kgl::TextureParams texture_param;
    texture_param.wrap_s_mode = GL_REPEAT;
    texture_param.wrap_t_mode = GL_REPEAT;
    texture_param.mag_filter_mode = GL_LINEAR;
    texture_param.min_filter_mode = GL_LINEAR;
    texture_param.internal_format = GL_RGB;
    texture_param.src_img_px_component_type = GL_UNSIGNED_BYTE;
    texture_param.src_img_format = GL_RGB;
    texture_param.used_mipmap = false;

    texture_1_ = std::make_shared<kgl::SourceTexture>();
    texture_1_->CreateFromFile("resources/image/coordinate.bmp", texture_param);

    texture_2_ = std::make_shared<kgl::SourceTexture>();
    texture_2_->CreateFromFile("resources/image/braynzar.jpg", texture_param);

    GLfloat vertices[] =
    {
        // 位置          // 颜色           // 纹理映射坐标
        5.0f, 5.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, // 右上角
        5.0f, -5.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, // 右下角
        -5.0f, -5.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, // 左下角
        -5.0f, 5.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f  //左上角
    };

    GLuint indices[] =
    {
        0, 1, 3,
        1, 2, 3
    };

    kgl::VertexAttribute va_position;
    va_position.index = 0;
    va_position.normalized = GL_FALSE;
    va_position.type = GL_FLOAT;
    va_position.size = 3; // 一个"顶点位置"的属性由3个分量组成
    va_position.stride = 8 * sizeof(GLfloat); // 每个顶点的步长
    va_position.pointer = nullptr;

    kgl::VertexAttribute va_color;
    va_color.index = 1;
    va_color.normalized = GL_FALSE;
    va_color.type = GL_FLOAT;
    va_color.size = 3; // 一个"顶点颜色"的属性由3个分量组成
    va_color.stride = 8 * sizeof(GLfloat); //每个顶点的步长
    va_color.pointer = reinterpret_cast<GLvoid*> (3 * sizeof(GLfloat));

    kgl::VertexAttribute va_texture_coord;
    va_texture_coord.index = 2;
    va_texture_coord.normalized = GL_FALSE;
    va_texture_coord.type = GL_FLOAT;
    va_texture_coord.size = 2; // 一个"顶点坐标"的属性由3个分量组成
    va_texture_coord.stride = 8 * sizeof(GLfloat); // 每个顶点的步长
    va_texture_coord.pointer = reinterpret_cast<GLvoid*> (6 * sizeof(GLfloat)); // 纹理坐标数据在字段中的起始指针处

    std::vector<kgl::VertexAttribute> vtx_attri_array;
    vtx_attri_array.push_back(va_position);
    vtx_attri_array.push_back(va_color);
    vtx_attri_array.push_back(va_texture_coord);

    rectangle_primitive_ = new kgl::Primitive;
    rectangle_primitive_->CreateIndexed(GL_TRIANGLES, vertices, sizeof(vertices), GL_STATIC_DRAW, kgl::Primitive::UINT32, indices, sizeof(indices), GL_STATIC_DRAW, vtx_attri_array);

    //---------------------------
    main_camera_->InitViewProjection(kgl::CameraType::PERSPECTIVE, glm::vec3(0.0f, 0.0f, 40.0f));
}

void CameraApp::RenderScene()
{
    main_camera_->Update();

    gpu_program_->Use();
    gpu_program_->ApplyTexture(texture_1_, "ourTexture1", 0);
    gpu_program_->ApplyTexture(texture_2_, "ourTexture2", 1);

    // 计算变换
    glm::mat4 model_matrix = glm::identity<glm::mat4>();
    model_matrix = glm::rotate(model_matrix, (GLfloat)glfwGetTime() * 0.5f, glm::vec3(0.0f, 0.0f, 1.0f));
    gpu_program_->ApplyMatrix(glm::value_ptr(model_matrix), "model");

    const glm::mat4& view_matrix = main_camera_->GetViewMatrix();
    gpu_program_->ApplyMatrix(glm::value_ptr(view_matrix), "view");

    const glm::mat4& projection_matrix = main_camera_->GetProjectionMatrix();
    gpu_program_->ApplyMatrix(glm::value_ptr(projection_matrix), "projection");

    rectangle_primitive_->DrawIndexed();
}

void CameraApp::ProcessInput()
{
    if (key_state_[GLFW_KEY_W])
    {
        main_camera_->Move(kgl::CameraDirection::FORWARD);
    }

    if (key_state_[GLFW_KEY_S])
    {
        main_camera_->Move(kgl::CameraDirection::BACK);
    }

    if (key_state_[GLFW_KEY_A])
    {
        main_camera_->Move(kgl::CameraDirection::LEFT);
    }

    if (key_state_[GLFW_KEY_D])
    {
        main_camera_->Move(kgl::CameraDirection::RIGHT);
    }

    if (key_state_[GLFW_KEY_J])
    {
        main_camera_->Move(kgl::CameraDirection::UP);
    }

    if (key_state_[GLFW_KEY_U])
    {
        main_camera_->Move(kgl::CameraDirection::DOWN);
    }
}

void CameraApp::OnKeyAction(GLFWwindow* window, int key, int scancode, int action, int mode)
{
    App::OnKeyAction(window, key, scancode, action, mode);
}

void CameraApp::OnMouseAction(GLFWwindow* window, double xpos, double ypos)
{
    App::OnMouseAction(window, xpos, ypos);
}

void CameraApp::OnScrollAction(GLFWwindow* window, double xoffset, double yoffset)
{
    App::OnScrollAction(window, xoffset, yoffset);
}