text:
#region license

#endregion

using System.Collections.Generic;
using ContractsWindow.Unity.Interfaces;
using UnityEngine;
using UnityEngine.UI;

namespace ContractsWindow.Unity.Unity
{
	public class CW_BodyNode : MonoBehaviour
	{
		[SerializeField]
		private TextHandler BodyTitle = null;
		[SerializeField]
		private CW_StandardNode StandardPrefab = null;
		[SerializeField]
		private Transform StandardTransform = null;
		[SerializeField]
		private Toggle BodyToggle = null;

		private List<CW_StandardNode> nodes = new List<CW_StandardNode>();
		private string bodyName;

		public string BodyName
		{
			get { return bodyName; }
		}

		public void setBodyType(string body, List<IStandardNode> nodes)
		{
			if (nodes.Count <= 0)
				return;

			bodyName = body;

			if (BodyTitle != null)
				BodyTitle.OnTextUpdate.Invoke(body);

			CreateBodyNodes(nodes);

			if (StandardTransform != null)
				StandardTransform.gameObject.SetActive(false);
		}

		public void Refresh()
		{
			if (BodyToggle != null && BodyToggle.isOn)
				NodesOn(true);
		}

		public void NodesOn(bool isOn)
		{
			//if (CW_ProgressPanel.Instance == null)
			//	return;

			//if (CW_ProgressPanel.Instance.PanelInterface == null)
			//	return;

			//if (!CW_ProgressPanel.Instance.PanelInterface.AnyBodyNode(bodyName))
			//	return;

			if (StandardTransform == null)
				return;

			StandardTransform.gameObject.SetActive(isOn);

			if (!isOn)
				return;

			for (int i = nodes.Count - 1; i >= 0; i--)
			{
				CW_StandardNode node = nodes[i];

				if (node == null)
					continue;

				node.UpdateText();

				node.gameObject.SetActive(isOn && node.IsComplete);
			}
		}

		private void CreateBodyNodes(IList<IStandardNode> nodes)
		{
			if (nodes == null)
				return;

			if (StandardTransform == null || StandardPrefab == null)
				return;

			for (int i = nodes.Count - 1; i >= 0; i--)
			{
				IStandardNode node = nodes[i];

				if (node == null)
					continue;

				CreateBodyNode(node);
			}
		}

		private void CreateBodyNode(IStandardNode node)
		{
            CW_StandardNode nodeObject = Instantiate(StandardPrefab, StandardTransform, false);

			nodeObject.setNode(node);

			nodes.Add(nodeObject);
		}

		public void AddBodyNode(IStandardNode node)
		{
			if (node == null)
				return;

			CreateBodyNode(node);
		}
	}
}


text:
import { type, resolver } from './mutation';

export default { resolver, type };

redpajama_set_name: RedPajamaGithub


text:
.class Lcom/google/android/gms/maps/internal/b$a$a;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/google/android/gms/maps/internal/b;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/google/android/gms/maps/internal/b$a;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "a"
.end annotation

# instance fields
.field private dU:Landroid/os/IBinder;

# direct methods
.method constructor <init>(Landroid/os/IBinder;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/google/android/gms/maps/internal/b$a$a;->dU:Landroid/os/IBinder;

    return-void
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 1

    iget-object v0, p0, Lcom/google/android/gms/maps/internal/b$a$a;->dU:Landroid/os/IBinder;

    return-object v0
.end method

.method public onCancel()V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    :try_start_0
    const-string v0, "com.google.android.gms.maps.internal.ICancelableCallback"

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/google/android/gms/maps/internal/b$a$a;->dU:Landroid/os/IBinder;

    const/4 v1, 0x2

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    return-void

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5
.end method

.method public onFinish()V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    :try_start_0
    const-string v0, "com.google.android.gms.maps.internal.ICancelableCallback"

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/google/android/gms/maps/internal/b$a$a;->dU:Landroid/os/IBinder;

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    return-void

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5
.end method


text:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Use the custom server? -->
    <CheckBoxPreference
        android:key="server_use_custom"
        android:title="@string/perf_server_use_custom"
        android:summary="@string/pref_server_use_custom_summary"
        android:defaultValue="false" />

    <EditTextPreference
        android:dependency="server_use_custom"
        android:key="server_custom_url"
        android:title="@string/pref_server_custom_url"
        android:defaultValue="https://api.pushjet.io"
        android:selectAllOnFocus="true"
        android:singleLine="true"
        android:maxLines="1"
        android:inputType="textUri"/>

    <EditTextPreference
        android:dependency="server_use_custom"
        android:key="server_custom_sender_id"
        android:title="@string/pref_server_custom_sender_id"
        android:defaultValue="509878466986"
        android:selectAllOnFocus="true"
        android:singleLine="true"
        android:inputType="number"/>

    <Preference
        android:key="server_register"
        android:title="@string/pref_server_register"
        android:summary="@string/pref_server_register_summary" />

</PreferenceScreen>


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Test timeline list</title>
    <meta name="description" content="Example of the component.">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />

    <link rel="stylesheet" href="//cdn.jsdelivr.net/bootstrap.material-design/0.3.0/css/material-wfont.min.css">
    <link rel="stylesheet" href="//cdn.jsdelivr.net/bootstrap.material-design/0.3.0/css/material.min.css">
    <link rel="stylesheet" href="//cdn.jsdelivr.net/bootstrap.material-design/0.3.0/css/ripples.min.css">

    <link rel="stylesheet" href="/focus-components/dist/css/focus-components.css"/>


text:
package fr.ird.osmose.web.api;

import org.junit.Test;

import java.util.Arrays;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;

public class ValueSelectorFactoryMedianTest {

    @Test
    public void selectMedian() {
        ValueSelector valueSelector = new ValueSelectorFactoryMedian(Arrays.asList("mickey"))
                .valueSelectorFor("mickey");
        valueSelector.accept("1");
        valueSelector.accept("2");
        valueSelector.accept("3");

        assertThat(valueSelector.select(), is("2.0"));
    }

    @Test
    public void selectLast() {
        ValueSelector valueSelector = new ValueSelectorFactoryMedian(Arrays.asList("mickey"))
                .valueSelectorFor("not.mickey");
        valueSelector.accept("1");
        valueSelector.accept("2");
        valueSelector.accept("3");

        assertThat(valueSelector.select(), is("3"));

    }

    @Test
    public void selectMedianWithNull() {
        ValueSelector valueSelector = new ValueSelectorFactoryMedian(Arrays.asList("mickey"))
                .valueSelectorFor("mickey");
        valueSelector.accept(null);
        assertThat(valueSelector.select(), is(nullValue()));
    }

}


text:
package com.greenhouseci.launchpad;

import java.io.File;

public class GHLaunchpad {

    public static String CCMENU_TOKEN;
    public static String GIT_HOOK_TOKEN;

    public static void main(String[] args) {

        if (args.length == 2) {
            CCMENU_TOKEN = args[0];
            GIT_HOOK_TOKEN = args[1];
        } else {
            System.out.println("Usage: " +
                    new File(GHLaunchpad.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getName() +
                    " <CCMENU_TOKEN> <GIT_HOOK_TOKEN>");
            System.exit(0);
        }

        LaunchpadController ghLaunchpad = new LaunchpadController();
        try {
            ghLaunchpad.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}


text:
namespace Teaq
{
    /// <summary>
    /// Container class for global parameter info.
    /// </summary>
    public class EmbeddedParameter
    {
        /// <summary>
        /// Gets or sets the name of the source column.
        /// </summary>
        /// <value>
        /// The name of the source column.
        /// </value>
        public string SourceColumnName { get; set; }

        /// <summary>
        /// Gets or sets the name of the parameter.
        /// </summary>
        /// <value>
        /// The name of the parameter.
        /// </value>
        public string ParameterName { get; set; }
    }
}


text:
namespace Valo
{
	class Vector2;

	enum class FilterType { BOX, TENT, BELL, GAUSSIAN, MITCHELL, LANCZOS_SINC };

	class Filter
	{
	public:

		explicit Filter(FilterType type = FilterType::MITCHELL);

		CUDA_CALLABLE float getWeight(float s) const;
		CUDA_CALLABLE float getWeight(const Vector2& point) const;

		CUDA_CALLABLE Vector2 getRadius() const;

		std::string getName() const;

		FilterType type = FilterType::MITCHELL;

		BoxFilter boxFilter;
		TentFilter tentFilter;
		BellFilter bellFilter;
		GaussianFilter gaussianFilter;
		MitchellFilter mitchellFilter;
		LanczosSincFilter lanczosSincFilter;
	};
}


text:
package tobleminer.mfw.config;

import java.io.File;
import java.io.InputStream;
import java.util.logging.Level;

import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;

import tobleminer.mfw.Main;
import tobleminer.mfw.config.weapon.explosive.ConfC4;
import tobleminer.mfw.config.weapon.explosive.ConfClaymore;
import tobleminer.mfw.config.weapon.explosive.ConfFrag;
import tobleminer.mfw.config.weapon.explosive.missile.ConfRPG;
import tobleminer.mfw.config.weapon.stationary.ConfIMS;
import tobleminer.mfw.config.weapon.stationary.ConfTurret;
import tobleminer.minefight.util.io.file.FileUtil;

public class Conf
{

	private YamlConfiguration conf;
	public ConfClaymore claymore;
	public ConfC4 c4;
	public ConfTurret turret;
	public ConfFrag frag;
	public ConfRPG rpg;
	public ConfIMS ims;

	public Conf(File plugindir)
	{
		File confdir = new File(plugindir, "config");
		File confFile = new File(plugindir, "config.conf");
		if(!confdir.exists())
		{
			confdir.mkdirs();
		}
		if(!confFile.exists())
		{
			this.initConfig(confFile);
		}
		this.conf= new YamlConfiguration();
		try
		{
			this.conf.load(confFile);
			if(this.conf.getBoolean("reset", true))
			{
				confFile.delete();
				this.initConfig(confFile);
				this.conf.load(confFile);
			}
			boolean resetAll = this.resetAll();
			if(resetAll)
			{
				this.conf.set("resetAll", false);
				this.conf.save(confFile);
			}
			this.claymore = new ConfClaymore(confdir, resetAll);
			this.c4 = new ConfC4(confdir, resetAll);
			this.turret = new ConfTurret(confdir, resetAll);
			this.frag = new ConfFrag(confdir, resetAll);
			this.rpg = new ConfRPG(confdir, resetAll);
			this.ims = new ConfIMS(confdir, resetAll);
		}
		catch(Exception ex)
		{
			if(ex instanceof InvalidConfigurationException)
			{
				Main.logger.log(Level.SEVERE, String.format("Oops, looks like the configuration '%s' contains errors:", confFile.getAbsolutePath()));
				ex.printStackTrace();
			}
		}
	}

	private boolean resetAll()
	{
		return this.conf.getBoolean("resetAll", false);
	}

	private void initConfig(File confFile)
	{
		InputStream is = this.getClass().getResourceAsStream("conf.conf");
		try
		{
			FileUtil.copyFromInputStreamToFileUtf8(confFile, is);
		}
		catch(Exception ex)
		{
			Main.logger.log(Level.SEVERE, "Failed writing default config file. Make sure that the server has write permissions for the plugin folder.");
		}
	}

	public String getLang()
	{
		return this.conf.getString("langfile", "EN_us.lang");
	}
}


text:
package git4idea.push;

import git4idea.repo.GitRemote;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public interface GitPushParams {
  @NotNull
  GitRemote getRemote();

  @NotNull
  String getSpec();

  boolean isForce();

  boolean shouldSetupTracking();

  boolean shouldSkipHooks();

  @Nullable
  String getTagMode();

  @NotNull
  List<ForceWithLease> getForceWithLease();

  interface ForceWithLease {
    @Nullable
    String getParameter();
  }
}


text:
You can have multiple snapshots of / in OpenIndiana thanks to ZFS, a typical
use case for needing to boot into a new image is after pkg updates

* Go to the ```System``` menu,
  * Press ```Shut Down...```

![system menu](../images/boot/PSD.png)

* Press the arrow next to ```More Options```
  * Select ```openindiana-1```

![more options](../images/boot/MOM.png)

* Press ```Restart```

* Be sure "openindiana-1" is selected in the boot menu.

![boot menu](../images/boot/BM.png)

* Wait for it to boot, and you should be in your shiny new updated system.

[![video](http://img.youtube.com/vi/NdWwEP2vfQE/0.jpg)](https://www.youtube.com/watch?v=NdWwEP2vfQE)


text:
namespace ExactOnline.Client.Models.Activities
{
    using System;
    using System.Collections.Generic;

    using Newtonsoft.Json;

    [SupportedActionsSDK(true, true, false, false)]
    [DataServiceKey("ID")]
    public class Complaint
    {
        /// The account that is related to the complaint
        public Guid? Account { get; set; }
        /// The name of the account
        [SDKFieldType(FieldType.ReadOnly)]
        public string AccountName { get; set; }
        /// The user that the complaint is assigned to
        public Guid? AssignedTo { get; set; }
        /// The user name
        public string AssignedToFullName { get; set; }
        /// Attachments linked to the complaint
        [SDKFieldType(FieldType.ReadOnly)]
        public IEnumerable<Workflow.RequestAttachment> Attachments { get; set; }
        /// A short description of the complaint
        [JsonProperty(PropertyName = "complaint")]
        public string ComplaintName { get; set; }
        /// The contact person that is related to the complaint
        public Guid? Contact { get; set; }
        /// The name of the contact person
        [SDKFieldType(FieldType.ReadOnly)]
        public string ContactFullName { get; set; }
        /// Creation date
        [SDKFieldType(FieldType.ReadOnly)]
        public DateTime? Created { get; set; }
        /// User ID of the creator
        [SDKFieldType(FieldType.ReadOnly)]
        public Guid? Creator { get; set; }
        /// Name of the creator
        [SDKFieldType(FieldType.ReadOnly)]
        public string CreatorFullName { get; set; }
        /// The division
        [SDKFieldType(FieldType.ReadOnly)]
        public Int32? Division { get; set; }
        /// The document that is linked to the complaint
        public Guid? Document { get; set; }
        /// The subject of the document
        public string DocumentSubject { get; set; }
        /// The human readable key
        public Int32? HID { get; set; }
        /// The Primary key
        public Guid ID { get; set; }
        /// Last modified date
        [SDKFieldType(FieldType.ReadOnly)]
        public DateTime? Modified { get; set; }
        /// User ID of the last modifier
        [SDKFieldType(FieldType.ReadOnly)]
        public Guid? Modifier { get; set; }
        /// Name of the last modifier
        [SDKFieldType(FieldType.ReadOnly)]
        public string ModifierFullName { get; set; }
        /// The date indicating by when the next action has to be taken
        public DateTime? NextAction { get; set; }
        /// The notes of the complaint
        public string Notes { get; set; }
        /// The date the complaint was received
        public DateTime? ReceiptDate { get; set; }
        /// Status: 0 = Void, 5 = Rejected, 10 = Draft, 20 = Open, 30 = Approved, 40 = Realized, 50 = Processed
        [SDKFieldType(FieldType.ReadOnly)]
        public Int32? Status { get; set; }
        /// The description of the status
        [SDKFieldType(FieldType.ReadOnly)]
        public string StatusDescription { get; set; }
    }
}


text:
package com.hortonworks.streamline.streams.layout.component.impl.splitjoin;

import com.hortonworks.streamline.streams.layout.component.impl.RulesProcessor;
import com.hortonworks.streamline.streams.layout.component.impl.Utils;

import java.util.Collections;

/**
 * Stage has a list of transforms to be applied and send the output to a given stream.
 */
public class StageProcessor extends RulesProcessor {

    public static final String CONFIG_KEY_STAGE = "stage-config";

    public StageProcessor() {
    }

    public void setStageAction(StageAction stageAction) {
        setRules(Collections.singletonList(Utils.createTrueRule(stageAction)));
    }

    @Override
    public String toString() {
        return "StageProcessor{}"+super.toString();
    }
}


text:
package io.github.jokoframework.rx;

import android.content.Context;
import android.util.Log;

import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.util.List;

import io.github.jokoframework.activity.BaseActivity;
import io.github.jokoframework.activity.LoginActivity;
import io.github.jokoframework.mboehaolib.rx.RetrofitException;
import io.github.jokoframework.mboehaolib.util.Utils;
import io.github.jokoframework.singleton.MboehaoApp;
import io.github.jokoframework.utilities.AppUtils;
import retrofit2.Call;
import retrofit2.CallAdapter;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.HttpException;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import rx.Observable;
import rx.Scheduler;
import rx.Subscriber;
import rx.functions.Func1;

public class RxErrorHandlingCallAdapterFactory extends CallAdapter.Factory {

    private final RxJavaCallAdapterFactory original;
    private Context context;

    private RxErrorHandlingCallAdapterFactory() {
        original = RxJavaCallAdapterFactory.create();
    }

    private RxErrorHandlingCallAdapterFactory(Scheduler scheduler) {
        original = RxJavaCallAdapterFactory.createWithScheduler(scheduler);
    }

    public static CallAdapter.Factory create() {
        return new RxErrorHandlingCallAdapterFactory();
    }

    public static CallAdapter.Factory createWithScheduler(Scheduler scheduler) {
        return new RxErrorHandlingCallAdapterFactory(scheduler);
    }

    @Override
    public CallAdapter<?, ?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) {
        return new RxCallAdapterWrapper(retrofit, original.get(returnType, annotations, retrofit));
    }

    private static class RxCallAdapterWrapper<R> implements CallAdapter<R, Object> {
        private static final String LOG_TAG = RxCallAdapterWrapper.class.getName();
        private final Retrofit retrofit;
        private final CallAdapter<R, Object> wrapped;

        public RxCallAdapterWrapper(Retrofit retrofit, CallAdapter<R, Object> wrapped) {
            this.retrofit = retrofit;
            this.wrapped = wrapped;
        }

        @Override
        public Type responseType() {
            return wrapped.responseType();
        }

        @SuppressWarnings("unchecked")
        @Override
        public Object adapt(Call<R> call) {
            final Observable observable = ((Observable) wrapped.adapt(call)).onErrorResumeNext(new Func1<Throwable, Observable>() {
                @Override
                public Observable call(final Throwable throwable) {
                    if (throwable instanceof SocketTimeoutException || throwable instanceof UnknownHostException
                            || throwable instanceof HttpException
                            || throwable instanceof ConnectException) {
                        Observable observableWithError = Observable.create(new Observable.OnSubscribe<Object>() {
                            @Override
                            public void call(Subscriber<? super Object> subscriber) {
                                final String msg = String.format("Exception en el Observable: %s", throwable);
                                Log.d(LOG_TAG, msg);
                                if (throwable instanceof HttpException) {
                                    int code = ((HttpException) throwable).code();
                                    if (code == 401) {
                                        // Una excepción con código 401 nos indica que no hay autorización
                                        // para realizar la petición. Si llegó a este punto significa
                                        // que no se pudo renovar el access token (lo más probable es que
                                        // haya iniciado sesión en otro dispositivo lo que hizo que se
                                        // revocara el refresh token que tenía anteriormente), por lo tanto hay
                                        // que volver a autenticar al usuario.
                                        Log.d(LOG_TAG, "Se detectó una petición no autorizada. Se solicita de vuelta el login.");
                                        if (!(MboehaoApp.getApp().getBaseActivity() instanceof LoginActivity)) {
                                            //Sólo mostramos de nuevo el login, sino proviene del LoginActivity
                                            AppUtils.showLogin(MboehaoApp.getSingletonApplicationContext(), (HttpException) throwable);
                                        }
                                        showErrorMessage("Credenciales incorrectas");
                                    } else if (code >= 500 && code <= 599) {
                                        final String message = String.format("No se puede contactar con el servidor en estos momentos: %s",
                                                throwable.getMessage());
                                        Log.e(LOG_TAG, message, throwable);
                                        showErrorMessage(message);
                                    } else if (throwable instanceof SocketTimeoutException) {
                                        String message = "La conexión con el servidor es inestable, intente de vuelta en unos momentos";
                                        showErrorMessage(message);
                                        AppUtils.showTimeOutError(MboehaoApp.getSingletonApplicationContext(), (SocketTimeoutException) throwable);
                                    } else {
                                        showGenericError(throwable);
                                    }
                                } else {
                                    showGenericError(throwable);
                                }

                            }
                        });
                        return observableWithError;
                    } else {
                        Log.d(LOG_TAG, String.format("Exception en el ErrorHandler: %s", throwable));
                        final RetrofitException retrofitException = asRetrofitException(throwable);
                        //PP Esto hace explotar la PP si es un exception no capturado
                        return Observable.error(retrofitException).first();
                        //return Observable.empty();
                    }
                }
            });

            return observable;
        }

        private void showGenericError(Throwable throwable) {
            final String message = String.format("No se puede contactar con el servidor en estos momentos: %s",
                    throwable.getMessage());
            Log.e(LOG_TAG, message, throwable);
            showErrorMessage(message);
        }

        private void showErrorMessage(String message, boolean isBackgroundOperation) {
            final BaseActivity baseActivity = MboehaoApp.getApp().getBaseActivity();
            if (isBackgroundOperation) {
                baseActivity.setProgressMessage(message);
            } else {
                baseActivity.showProgress(false);
            }
            Utils.showStickyMessage(baseActivity, message);
        }

        private void showErrorMessage(String message) {
            showErrorMessage(message, false);
        }

        private RetrofitException asRetrofitException(Throwable throwable) {
            // We had non-200 http error
            if (throwable instanceof HttpException) {
                HttpException httpException = (HttpException) throwable;
                Response response = httpException.response();
                return RetrofitException.httpError(response.raw().request().url().toString(), response, retrofit);
            } else {// A network error happened
                if (throwable instanceof IOException) {
                    //PP: Nadie hace catch de esto y hace explotar la APP
                    return RetrofitException.networkError((IOException) throwable);
                }
            }
            // We don't know what happened. We need to simply convert to an unknown error
            return RetrofitException.unexpectedError(throwable);
        }
    }

    public Context getContext() {
        return context;
    }

    public void setContext(Context context) {
        this.context = context;
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core.Pipeline;

namespace Azure.Core.TestFramework
{
    public class RecordTransport : HttpPipelineTransport
    {
        private readonly HttpPipelineTransport _innerTransport;

        private readonly Func<RecordEntry, EntryRecordModel> _filter;

        private readonly Random _random;

        private readonly RecordSession _session;

        public RecordTransport(RecordSession session, HttpPipelineTransport innerTransport, Func<RecordEntry, EntryRecordModel> filter, Random random)
        {
            _innerTransport = innerTransport;
            _filter = filter;
            _random = random;
            _session = session;
        }

        public override void Process(HttpMessage message)
        {
            _innerTransport.Process(message);
            Record(message);
        }

        public override async ValueTask ProcessAsync(HttpMessage message)
        {
            await _innerTransport.ProcessAsync(message);
            Record(message);
        }

        private void Record(HttpMessage message)
        {
            RecordEntry recordEntry = CreateEntry(message.Request, message.Response);

            switch (_filter(recordEntry))
            {
                case EntryRecordModel.Record:
                    _session.Record(recordEntry);
                    break;
                case EntryRecordModel.RecordWithoutRequestBody:
                    recordEntry.Request.Body = null;
                    _session.Record(recordEntry);
                    break;
                default:
                    break;
            }
        }

        public override Request CreateRequest()
        {
            Request request = _innerTransport.CreateRequest();

            lock (_random)
            {
                // Override ClientRequestId to avoid excessive diffs
                request.ClientRequestId = _random.NewGuid().ToString("N");
            }

            return request;
        }

        public static RecordEntry CreateEntry(Request request, Response response)
        {
            var entry = new RecordEntry
            {
                RequestUri = request.Uri.ToString(),
                RequestMethod = request.Method,
                Request =
                {
                    Body = ReadToEnd(request.Content),
                },
            };

            foreach (HttpHeader requestHeader in request.Headers)
            {
                var gotHeader = request.Headers.TryGetValues(requestHeader.Name, out IEnumerable<string> headerValues);
                Debug.Assert(gotHeader);
                entry.Request.Headers.Add(requestHeader.Name, headerValues.ToArray());
            }

            // Make sure we record Content-Length even if it's not set explicitly
            if (!request.Headers.TryGetValue("Content-Length", out _) && request.Content != null && request.Content.TryComputeLength(out long computedLength))
            {
                entry.Request.Headers.Add("Content-Length", new[] { computedLength.ToString(CultureInfo.InvariantCulture) });
            }

            if (response != null)
            {
                entry.Response.Body = ReadToEnd(response);
                entry.StatusCode = response.Status;
                foreach (HttpHeader responseHeader in response.Headers)
                {
                    var gotHeader = response.Headers.TryGetValues(responseHeader.Name, out IEnumerable<string> headerValues);
                    Debug.Assert(gotHeader);
                    entry.Response.Headers.Add(responseHeader.Name, headerValues.ToArray());
                }
            }

            return entry;
        }

        private static byte[] ReadToEnd(Response response)
        {
            Stream responseContentStream = response.ContentStream;
            if (responseContentStream == null)
            {
                return null;
            }

            var memoryStream = new NonSeekableMemoryStream();
            responseContentStream.CopyTo(memoryStream);
            responseContentStream.Dispose();

            memoryStream.Reset();
            response.ContentStream = memoryStream;
            return memoryStream.ToArray();
        }

        private static byte[] ReadToEnd(RequestContent requestContent)
        {
            if (requestContent == null)
            {
                return null;
            }

            using var memoryStream = new MemoryStream();
            requestContent.WriteTo(memoryStream, CancellationToken.None);
            return memoryStream.ToArray();
        }
    }
}


text:
/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <stdlib.h>

#include "Ecore.h"
#include "ecore_private.h"

struct _Ecore_Poller
{
   EINA_INLIST;
   ECORE_MAGIC;
   int           ibit;
   unsigned char delete_me : 1;
   Eina_Bool    (*func) (void *data);
   void          *data;
};

static Ecore_Timer    *timer = NULL;
static int             min_interval = -1;
static int             interval_incr = 0;
static int             at_tick = 0;
static int             just_added_poller = 0;
static int             poller_delete_count = 0;
static int             poller_walking = 0;
static double          poll_interval = 0.125;
static double          poll_cur_interval = 0.0;
static double          last_tick = 0.0;
static Ecore_Poller   *pollers[16] =
{
   NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
   NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
};
static unsigned short  poller_counters[16] =
{
   0,0,0,0,0,0,0,0,
   0,0,0,0,0,0,0,0
};

static void _ecore_poller_next_tick_eval(void);
static Eina_Bool _ecore_poller_cb_timer(void *data);

static void
_ecore_poller_next_tick_eval(void)
{
   int i;
   double interval;

   min_interval = -1;
   for (i = 0; i < 15; i++)
     {
	if (pollers[i])
	  {
	     min_interval = i;
	     break;
	  }
     }
   if (min_interval < 0)
     {
	/* no pollers */
	if (timer)
	  {
	     ecore_timer_del(timer);
	     timer = NULL;
	  }
	return;
     }
   interval_incr = (1 << min_interval);
   interval = interval_incr * poll_interval;
   /* we are at the tick callback - so no need to do inter-tick adjustments
    * so we can fasttrack this as t -= last_tick in theory is 0.0 (though
    * in practice it will be a very very very small value. also the tick
    * callback will adjust the timer interval at the end anyway */
   if (at_tick)
     {
	if (!timer)
	  timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
     }
   else
     {
	double t;

	if (!timer)
	  timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
	else
	  {
	     t = ecore_time_get();
	     if (interval != poll_cur_interval)
	       {
		  t -= last_tick; /* time since we last ticked */
		  /* delete the timer and reset it to tick off in the new
		   * time interval. at the tick this will be adjusted */
		  ecore_timer_del(timer);
		  timer = ecore_timer_add(interval - t,
					  _ecore_poller_cb_timer, NULL);
	       }
	  }
     }
   poll_cur_interval = interval;
}

static Eina_Bool
_ecore_poller_cb_timer(void *data __UNUSED__)
{
   int i;
   Ecore_Poller *poller, *l;
   int changes = 0;

   at_tick++;
   last_tick = ecore_time_get();
   /* we have 16 counters - each incriments every time the poller counter
    * "ticks". it incriments by the minimum interval (which can be 1, 2, 4,
    * 7, 16 etc. up to 32768) */
   for (i = 0; i < 15; i++)
     {
	poller_counters[i] += interval_incr;
	/* wrap back to 0 if we exceed out loop count for the counter */
	if (poller_counters[i] >= (1 << i)) poller_counters[i] = 0;
     }

   just_added_poller = 0;
   /* walk the pollers now */
   poller_walking++;
   for (i = 0; i < 15; i++)
     {
	/* if the counter is @ 0 - this means that counter "went off" this
	 * tick interval, so run all pollers hooked to that counter */
	if (poller_counters[i] == 0)
	  {
	     EINA_INLIST_FOREACH(pollers[i], poller)
	       {
		  if (!poller->delete_me)
		    {
		       if (!poller->func(poller->data))
			 {
			    if (!poller->delete_me)
			      {
				 poller->delete_me = 1;
				 poller_delete_count++;
			      }
			 }
		    }
	       }
	  }
     }
   poller_walking--;

   /* handle deletes afterwards */
   if (poller_delete_count > 0)
     {
	/* FIXME: walk all pollers and remove deleted ones */
	for (i = 0; i < 15; i++)
	  {
             for (l = pollers[i]; l;)
	       {
                  poller = l;
		  l = (Ecore_Poller *) EINA_INLIST_GET(l)->next;
		  if (poller->delete_me)
		    {
		       pollers[i] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(poller));
		       free(poller);
		       poller_delete_count--;
		       changes++;
		       if (poller_delete_count <= 0) break;
		    }
	       }
	     if (poller_delete_count <= 0) break;
	  }
     }
   /* if we deleted or added any pollers, then we need to re-evaluate our
    * minimum poll interval */
   if ((changes > 0) || (just_added_poller > 0))
     _ecore_poller_next_tick_eval();

   just_added_poller = 0;
   poller_delete_count = 0;

   at_tick--;

   /* if the timer was deleted then there is no point returning 1 - ambiguous
    * if we do as it im plies "keep running me" but we have been deleted
    * anyway */
   if (!timer) return ECORE_CALLBACK_CANCEL;

   /* adjust interval */
   ecore_timer_interval_set(timer, poll_cur_interval);
   return ECORE_CALLBACK_RENEW;
}

/**
 * @defgroup Ecore_Poll_Group Ecore Poll Functions
 *
 * These functions are for the need to poll information, but provide a shared
 * abstracted API to pool such polling to minimise wakeup and ensure all the
 * polling happens in as few spots as possible areound a core poll interval.
 * For now only 1 core poller type is supprted: ECORE_POLLER_CORE
 */

/**
 * Sets the time between ticks (in seconds) for the given ticker clock.
 * @param   type The ticker type to adjust
 * @param   poll_time The time (in seconds) between ticks of the clock
 * @ingroup Ecore_Poller_Group
 *
 * This will adjust the time between ticks of the given ticker type defined
 * by @p type to the time period defined by @p poll_time.
 */
EAPI void
ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__, double poll_time)
{
   poll_interval = poll_time;
   _ecore_poller_next_tick_eval();
}

/**
 * Gets the time between ticks (in seconds) for the given ticker clock.
 * @param   type The ticker type to query
 * @return  The time in seconds between ticks of the ticker clock
 * @ingroup Ecore_Poller_Group
 *
 * This will get the time between ticks of the specifider ticker clock.
 */
EAPI double
ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
{
   return poll_interval;
}

/**
 * Creates a poller to call the given function at a particular tick interval.
 * @param   type The ticker type to attach the poller to
 * @param   interval The poll interval
 * @param   func The given function.  If @p func returns 1, the poller is
 *               rescheduled for the next tick interval.
 * @param   data Data to pass to @p func when it is called.
 * @return  A poller object on success.  @c NULL on failure.
 * @ingroup Ecore_Poller_Group
 *
 * This function adds a poller callback that is to be called regularly
 * along with all other poller callbacks so the pollers are synchronized with
 * all other pollers running off the same poller type and at the same tick
 * interval. This should be used for polling things when polling is desired
 * or required, and you do not have specific requirements on the exact times
 * to poll and want to avoid extra process wakeups for polling. This will
 * save power as the CPU has more of a chance to go into a low power state
 * the longer it is asleep for, so this should be used if you are at all
 * power conscious.
 *
 * The @p type parameter defines the poller tick type (there is a virtual
 * clock ticking all the time - though ecore avoids making it tick when
 * there will not be any work to do at that tick point). There is only one
 * ticker at the moment - that is ECORE_POLLER_CORE. This is here for future
 * expansion if multiple clocks with different frequencies are really required.
 * The default time between ticks for the ECORE_POLLER_CORE ticker is 0.125
 * seconds.
 *
 * The @p interval is the number of ticker ticks that will pass by in between
 * invocations of the @p func callback. This must be between 1 and 32768
 * inclusive, and must be a power of 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768).
 * If it is 1, then the function will be called every tick. if it is 2, then it
 * will be called every 2nd tick, if it is 8, then every 8th tick etc. Exactly
 * which tick is undefined, as only the interval between calls can be defined.
 * Ecore will endeavour to keep pollers synchronised and to call as many in
 * 1 wakeup event as possible.
 *
 * This function adds a poller and returns its handle on success and NULL on
 * failure. The function @p func will be called at tick intervals described
 * above. The function will be passed the @p data pointer as its parameter.
 *
 * When the poller @p func is called, it must return a value of either
 * 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it
 * returns 1, it will be called again at the next tick, or if it returns
 * 0 it will be deleted automatically making any references/handles for it
 * invalid.
 */
EAPI Ecore_Poller *
ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, Eina_Bool (*func) (void *data), const void *data)
{
   Ecore_Poller *poller;
   int ibit;

   if (!func) return NULL;
   if (interval < 1) interval = 1;

   poller = calloc(1, sizeof(Ecore_Poller));
   if (!poller) return NULL;
   ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER);
   /* interval MUST be a power of 2, so enforce it */
   if (interval < 1) interval = 1;
   ibit = -1;
   while (interval != 0)
     {
	ibit++;
	interval >>= 1;
     }
   /* only allow up to 32768 - i.e. ibit == 15, so limit it */
   if (ibit > 15) ibit = 15;

   poller->ibit = ibit;
   poller->func = func;
   poller->data = (void *)data;
   pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_prepend(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
   if (poller_walking)
     just_added_poller++;
   else
     _ecore_poller_next_tick_eval();
   return poller;
}

/**
 * Changes the polling interval rate of @p poller.
 *
 * @param poller The Ecore_Poller to change the interval of
 * @param interval The tick interval to set; must be a power of 2 but <= 32768
 * @return Returns true on success, false on failure
 *
 * This allows the changing of a poller's polling interval.  It is useful when you want to alter
 * a poll rate without deleting and re-creating a poller.
 * @ingroup Ecore_Poller_Group
 */
EAPI Eina_Bool
ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
{
   int ibit;

   if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
     {
        ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
           "ecore_poller_poller_interval_set");
        return EINA_FALSE;
     }

   /* interval MUST be a power of 2, so enforce it */
   if (interval < 1) interval = 1;
   ibit = -1;
   while (interval != 0)
     {
       ibit++;
       interval >>= 1;
     }
   /* only allow up to 32768 - i.e. ibit == 15, so limit it */
   if (ibit > 15) ibit = 15;
   /* if interval specified is the same as interval set, return true without wasting time */
   if (poller->ibit == ibit)
     return EINA_TRUE;
   pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
   poller->ibit = ibit;
   pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_prepend(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
   if (poller_walking)
     just_added_poller++;
   else
     _ecore_poller_next_tick_eval();
   return EINA_TRUE;
}

/**
 * Gets the polling interval rate of @p poller.
 *
 * @param poller The Ecore_Poller to change the interval of
 * @return Returns the interval, in ticks, that @p poller polls at
 *
 * This returns a poller's polling interval, or 0 on error.
 * @ingroup Ecore_Poller_Group
 */
EAPI int
ecore_poller_poller_interval_get(Ecore_Poller *poller)
{
   int ibit, interval = 1;

   if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
     {
        ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
           "ecore_poller_poller_interval_get");
        return 0;
     }

   ibit = poller->ibit;
   while (ibit != 0)
     {
       ibit--;
       interval <<= 1;
     }
   return interval;
}

/**
 * Delete the specified poller from the timer list.
 * @param   poller The poller to delete.
 * @return  The data pointer set for the timer when @ref ecore_poller_add was
 *          called.  @c NULL is returned if the function is unsuccessful.
 * @ingroup Ecore_Poller_Group
 *
 * Note: @p poller must be a valid handle. If the poller function has already
 * returned 0, the handle is no longer valid (and does not need to be delete).
 */
EAPI void *
ecore_poller_del(Ecore_Poller *poller)
{
   void *data;

   if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
     {
        ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
           "ecore_poller_del");
        return NULL;
     }
   /* we are walking the poller list - a bad idea to remove from it while
    * walking it, so just flag it as delete_me and come back to it after
    * the loop has finished */
   if (poller_walking > 0)
     {
        poller_delete_count++;
        poller->delete_me = 1;
        return poller->data;
     }
   /* not in loop so safe - delete immediately */
   data = poller->data;
   pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
   free(poller);
   _ecore_poller_next_tick_eval();
   return data;
}

void
_ecore_poller_shutdown(void)
{
   int i;
   Ecore_Poller *poller;

   for (i = 0; i < 15; i++)
     {
	while ((poller = pollers[i]))
	  {
	     pollers[i] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(pollers[i]));
	     free(poller);
	  }
     }
}


text:
LOCALE=$(getarg locale.LANG)

if [ "$LOCALE" == "" ] ; then
  echo "No locale specified"
  echo "Example: locale.LANG=de_DE.UTF-8"
else
# Set the language
cat > "${NEWROOT}"/etc/locale.conf <<EOF
LANG=$LOCALE
LC_NUMERIC=$LOCALE
LC_TIME=$LOCALE
LC_MONETARY=$LOCALE
LC_PAPER=$LOCALE
LC_MEASUREMENT=$LOCALE
EOF
. "${NEWROOT}"/etc/locale.conf
fi


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2014-2022 Philip Helger (www.helger.com)
    philip[at]helger[dot]com

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<translationitems count="46">
  <item id="com.helger.webbasics.EWebBasicsText.DOWNLOAD">
    <sk>Stiahnuť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.FILE_SELECT">
    <sk>Výber dát</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_ACTIONS">
    <sk>Činnosti</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BACK_TO_OVERVIEW">
    <sk>Späť na prehľad</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_BACK">
    <sk>Späť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_CANCEL">
    <sk>Zrušiť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_DELETE">
    <sk>Vymyzať</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_EDIT">
    <sk>Spracovať</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_NEXT">
    <sk>Ďalej</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_NO">
    <sk>Nie</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_RESET">
    <sk>Obnovenie</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_SAVE">
    <sk>Uložiť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_SAVE_ALL">
    <sk>Uložiť všeko</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_SAVE_AS">
    <sk>Uložiť ako...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_SAVE_CLOSE">
    <sk>Uložiť a zatvoriť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_SELECT">
    <sk>Vybrať...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_UPLOAD">
    <sk>Prenos</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_BUTTON_YES">
    <sk>Ano</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_ERR_INCORRECT_INPUT">
    <sk>Na základe chybného alebo nesprávneho zadania sa nedá uložiť! Prosím skontrolujte Vaše zadanie a nasledujte výzvy k odstráneniu chyby.</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_FALSE">
    <sk>Chybné</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.MSG_TRUE">
    <sk>Správne</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.OPEN_CALENDAR">
    <sk>Kalendár</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGE_HELP_TITLE">
    <sk>Zobraziť pomoc pre ''{0}''</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_LABEL_PAGE_SIZE">
    <sk>Záznamy cez stránku: </sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_OF">
    <sk> od {0}</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_PAGE">
    <sk> Strana </sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_SHOW_RANGE">
    <sk>Záznamy {0} - {1} z celkom {2}</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_TOOLTIP_ACCEPT">
    <sk>Použiť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_TOOLTIP_PAGE_END">
    <sk>Posledná strana</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_TOOLTIP_PAGE_NEXT">
    <sk>Ďalšia strana</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_TOOLTIP_PAGE_PREV">
    <sk>Predošlá strana</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PAGING_TOOLTIP_PAGE_START">
    <sk>Prvá strana</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.PLEASE_SELECT">
    <sk>(Prosím zvoľte záznam)</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.SELECT_NONE">
    <sk>(Žiadny)</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.SELECT_SHOW_ALL">
    <sk>ukázať všetky</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TAB_PROGRESS_MSG">
    <sk>Ukladajú sa dáta...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_COLLAPSE">
    <sk>Ukladajú sa dáta...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_COLLAPSE_ALL">
    <sk>Ukladajú sa dáta...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_EXPAND">
    <sk>Ukladajú sa dáta...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_EXPAND_ALL">
    <sk>Ukladajú sa dáta...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_FILTER">
    <sk>Záznamy budú filtrované...</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_LABEL_FILTER">
    <sk>Filtrovať záznamy</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_TREEITEMS_COLLAPSE">
    <sk>Všetky záznamy zbaliť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_TREEITEMS_EXPAND">
    <sk>Všetky záznamy rozbaliť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_TREEITEM_COLLAPSE">
    <sk>Záznam zbaliť</sk>
  </item>
  <item id="com.helger.webbasics.EWebBasicsText.TREE_TREEITEM_EXPAND">
    <sk>Záznam rozbaliť</sk>
  </item>
</translationitems>


text:
from puzzle.heuristics import analyze_number
from spec.mamba import *

with description('analyze_number'):
  with before.each:
    def run(fn, n, base):
      digits = analyze_number._get_digits_in_base(n, base)
      min_digit = min(digits)
      max_digit = max(digits)
      for result in fn(digits, min_digit, max_digit):
        yield result

    def first(fn, n, base):
      return next(run(fn, n, base))[0]

    self.run = lambda fn, n, base=10: call(run, fn, n, base)
    self.first = lambda fn, n, base=10: call(first, fn, n, base)

  with description('_get_digits_in_base'):
    with it('converts base'):
      expect(analyze_number._get_digits_in_base(
          0x5072697A776172646564746F61757468, 256
      )).to(equal([
        0x50, 0x72, 0x69, 0x7A, 0x77, 0x61, 0x72, 0x64,
        0x65, 0x64, 0x74, 0x6F, 0x61, 0x75, 0x74, 0x68
      ]))

  with description('_convert_digits_to_base'):
    with it('converts base with gaps'):
      results = analyze_number._convert_digits_to_base([
        0x500072, 0x69007A, 0x770061, 0x720064, 0x650064, 0x74006F, 0x610075,
        0x740068
      ], 256)
      next(results)  # Burn first result.
      expect(next(results)).to(equal(
          ([
            0x50, 0x72, 0x69, 0x7A, 0x77, 0x61, 0x72, 0x64,
            0x65, 0x64, 0x74, 0x6F, 0x61, 0x75, 0x74, 0x68
          ], ['base256', 'filtered 0 (+1%3)'])))

  with description('alphabet'):
    with it('rejects invalid input'):
      expect(self.run(analyze_number._alphabet, 101)).to(be_empty)

    with it('accepts input'):
      expect(self.first(analyze_number._alphabet, 312)).to(equal('cab'))

    with it('accepts base 100 input'):
      expect(self.first(analyze_number._alphabet, 152312, 100)).to(equal('owl'))

  with description('ascii'):
    with it('rejects invalid input'):
      expect(self.run(analyze_number._ascii, 101)).to(be_empty)

    with it('accepts input'):
      expect(self.first(analyze_number._ascii, 0x636162, 256)).to(equal('cab'))

    with it('accepts sufficiently long input even with punctuation'):
      expect(self.first(
          analyze_number._ascii,
          0x63616220636162206361622e,
          256)
      ).to(equal('cab cab cab.'))

  with description('ascii_nibbles'):
    with it('accepts input'):
      expect(self.first(analyze_number._ascii_nibbles, 0x6f776c, 16)).to(
          equal('owl'))

    with it('accepts delimited input'):
      expect(next(analyze_number._ascii_nibbles([
        0x6, 0xf, 16, 0x7, 0x7, 16, 0x6, 0xc,
      ], 6, 16))[0]).to(equal('owl'))

    with it('ignores unusual input'):
      expect(list(analyze_number._ascii_nibbles([
        16
      ], 16, 16))).to(be_empty)

  with description('base_n'):
    with it('rejects invalid input'):
      expect(self.run(analyze_number._base_n, 100)).to(be_empty)

    with it('accepts hex input (A-F)'):
      expect(self.first(analyze_number._base_n, 0xCAB, 16)).to(equal('cab'))

    with it('accepts higher base values (A-Z)'):
      expect(next(analyze_number._base_n([
        14 + 10, 22 + 10, 11 + 10
      ], 22, 32))[0]).to(equal('owl'))

  with description('braille'):
    with it('rejects decreasing input'):
      expect(self.run(analyze_number._braille, 6543)).to(be_empty)

    with it('accepts increasing input'):
      expect(self.first(analyze_number._braille, 135024560123)).to(equal('owl'))

  with description('hex'):
    with it('understands hexspeak'):
      expect(self.first(analyze_number._hexspeak, 0xDEAD, 16)).to(equal('dead'))

  with description('keyboard intersection'):
    with it('rejects odd digit counts'):
      expect(self.run(analyze_number._keyboard_intersection, 101)).to(be_empty)

    with it('accepts valid input'):
      expect(self.first(analyze_number._keyboard_intersection, 361358)).to(
          equal('cab'))

  with description('lexicographical ordering'):
    with it('rejects input with incorrect length'):
      expect(self.run(analyze_number._lexicographical_ordering, 10101)).to(
          be_empty)

    with it('rejects repeated input'):
      expect(self.run(analyze_number._lexicographical_ordering, 1011)).to(
          be_empty)

    with it('accepts lexicographical ordering'):
      # Ordering: 012, 021, 102, 120, 201, 210.
      # Alphabet:   a,   b,   c,   d,   e,   f.
      expect(self.first(
          analyze_number._lexicographical_ordering, 102012021)).to(equal('cab'))

  with description('morse'):
    with it('rejects invalid sequences'):
      expect(self.run(analyze_number._morse, 22222222)).to(be_empty)

    with it('accepts ambiguous sequences'):
      owls = [
        222012201211,  # 012 = ' .-'
        111021102122,  # 012 = ' -.'
        111201120100,  # 012 = '-. '
      ]
      for owl in owls:
        expect(self.first(analyze_number._morse, owl)).to(equal('owl'))

  with description('phone numbers'):
    with it('rejects invalid numbers'):
      samples = [
        123,  # Too short.
        180012345678,  # Too long.
        1234560,  # Contains a zero.
      ]
      for sample in samples:
        expect(self.run(analyze_number._phone_number, sample)).to(be_empty)

    with it('accepts phone numbers'):
      expect(self.first(analyze_number._phone_number, 18006694373)).to(
          be_one_of(
              '1800nowhere',
              '1800no where',
              '1800now here',
          ))

  with description('positional'):
    with it('rejects short positional numbers'):
      expect(self.run(analyze_number._positional, 3)).to(be_empty)

    with it('rejects positional with duplicated numbers'):
      expect(self.run(
          analyze_number._positional,
          12345678901234567890123456,
      )).to(be_empty)

    with it('accepts positional'):
      expect(self.first(
          analyze_number._positional,
          23100000000000000000000000,
      )).to(equal('cab'))

  with description('runlength'):
    with it('rejects random input'):
      expect(self.run(analyze_number._runlength, 651322333143)).to(be_empty)

    with it('accepts input'):
      # 11000000000000000111111111111111 = boo
      expect(self.first(analyze_number._runlength, 3221258239, 2)).to(
          equal('boo'))

    with it('accepts delimited input'):
      # 1101111111111111110111111111111111
      expect(self.first(analyze_number._runlength, 15032352767, 2)).to(
          equal('boo'))

  with description('t9'):
    with it('accepts t9'):
      expect(self.first(analyze_number._t9, 6669555)).to(equal('owl'))

    with it('rejects invalid t9'):
      expect(self.run(analyze_number._t9, 666666)).to(be_empty)

  with description('solutions'):
    with before.all:
      def solutions(n):
        (solution, weight), notes = next(analyze_number.solutions_with_notes(n))
        return solution, notes

      self.solutions = solutions

    with it('ignores empty input'):
      expect(analyze_number.solutions(0)).to(be_empty)

    with it('solves alphabet'):
      expect(self.solutions(312)).to(equal(('cab', ['alphabet', 'base10'])))

    with it('solves ascii nibbles'):
      expect(self.solutions(0x6f776c)).to(
          equal(('owl', ['ascii nibbles', 'base16'])))

    with it('solves base 36'):
      expect(self.solutions(0xCAB)).to(equal(('cab', ['base n', 'base16'])))

    with it('solves braille'):
      expect(self.solutions(135024560123)).to(
          equal(('owl', ['braille', 'base10'])))

    with it('solves morse'):
      expect(self.solutions(222012201211)).to(
          equal(('owl', ['morse', 'base10'])))

    with it('solves positional'):
      expect(self.solutions(23100000000000000000000000)).to(
          equal(('cab', ['positional', 'base10'])))

    with it('solves hexspeak'):
      expect(self.solutions(0xDEAD)).to(equal(('dead', ['base n', 'base16'])))

    with it('solves keyboard intersection'):
      expect(self.solutions(361358)).to(
          equal(('cab', ['keyboard intersection', 'base10'])))

    with it('solves lexicographical ordering'):
      expect(self.solutions(102012021)).to(
          equal(('cab', ['lexicographical ordering', 'base10'])))

    with it('solves runlength'):
      expect(self.solutions(15032352767)).to(
          equal(('boo', ['runlength', 'base2'])))

    with it('solves t9'):
      expect(self.solutions(6669555)).to(equal(('owl', ['t9', 'base10'])))


text:
require 'open-uri'
require 'net/http'
require 'timeout'

# NOTE: This feature is experimental, and missing tests!
#
# Helps you spinning up and shutting down your own sinatra app. This is especially helpful for running
# real network tests against a sinatra backend.
#
# The backend server could look like the following (in test/server.rb).
#
#   require "sinatra"
#
#   get "/" do
#     "Cheers from test server"
#   end
#
#   get "/ping" do
#     "1"
#   end
#
# Note that you need to implement a ping action for internal use.
#
# Next, you need to write your runner.
#
#   require 'sinatra/runner'
#
#   class Runner < Sinatra::Runner
#     def app_file
#       File.expand_path("../server.rb", __FILE__)
#     end
#   end
#
# Override Runner#app_file, #command, #port, #protocol and #ping_path for customization.
#
# **Don't forget to override #app_file specific to your application!**
#
# Whereever you need this test backend, here's how you manage it. The following example assumes you
# have a test in your app that needs to be run against your test backend.
#
#   runner = ServerRunner.new
#   runner.run
#
#   # ..tests against localhost:4567 here..
#
#   runner.kill
#
# For an example, check https://github.com/apotonick/roar/blob/master/test/integration/runner.rb
module Sinatra
  class Runner
    def app_file
      File.expand_path("../server.rb", __FILE__)
    end

    def run
      @pipe     = start
      @started  = Time.now
      warn "#{server} up and running on port #{port}" if ping
    end

    def kill
      return unless pipe
      Process.kill("KILL", pipe.pid)
    rescue NotImplementedError
      system "kill -9 #{pipe.pid}"
    rescue Errno::ESRCH
    end

    def get(url)
      Timeout.timeout(1) { get_url("#{protocol}://127.0.0.1:#{port}#{url}") }
    end

    def get_stream(url = "/stream", &block)
      Net::HTTP.start '127.0.0.1', port do |http|
        request = Net::HTTP::Get.new url
        http.request request do |response|
          response.read_body(&block)
        end
      end
    end

    def get_response(url)
      Net::HTTP.start '127.0.0.1', port do |http|
        request = Net::HTTP::Get.new url
        http.request request do |response|
          response
        end
      end
    end

    def log
      @log ||= ""
      loop { @log <<  pipe.read_nonblock(1) }
    rescue Exception
      @log
    end

  private
    attr_accessor :pipe

    def start
      IO.popen(command)
    end

    def command # to be overwritten
      "bundle exec ruby #{app_file} -p #{port} -e production"
    end

    def ping(timeout=30)
      loop do
        return if alive?
        if Time.now - @started > timeout
          $stderr.puts command, log
          fail "timeout"
        else
          sleep 0.1
        end
      end
    end

    def alive?
      3.times { get(ping_path) }
      true
    rescue Errno::ECONNREFUSED, Errno::ECONNRESET, EOFError, SystemCallError, OpenURI::HTTPError, Timeout::Error
      false
    end

    def ping_path # to be overwritten
      '/ping'
    end

    def port # to be overwritten
      4567
    end

    def protocol
      "http"
    end

    def get_url(url)
      uri = URI.parse(url)

      return uri.read unless protocol == "https"
      get_https_url(uri)
    end

    def get_https_url(uri)
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl      = true
      http.verify_mode  = OpenSSL::SSL::VERIFY_NONE
      request = Net::HTTP::Get.new(uri.request_uri)
      http.request(request).body
    end
  end
end


text:
package uk.me.mjt.ch;

import org.junit.Test;
import static org.junit.Assert.*;

public class AdjustGraphForRestrictionsTest {

    public AdjustGraphForRestrictionsTest() {
    }

    @Test
    public void testAvoidAccessOnlySegmentOfRing() {
        MapData graph = MakeTestData.makePartlyAccessOnlyRing();
        assertDijkstraResult(graph,2,6,"2--1000-->3--1000-->4--1000-->5--1000-->6");
        assertDijkstraResult(graph,1,6,"1--1000-->7--1000-->6");
    }

    @Test
    public void testEnterAccessOnlyWhenUnavoidable() {
        MapData graph = MakeTestData.makePartlyAccessOnlyRing();
        assertDijkstraResult(graph,1,6,"1--1000-->7--1000-->6");
        assertDijkstraResult(graph,2,7,"2--1000-->1--1000-->7");
    }

    @Test
    public void testPathTouchingBorderOfAccessOnlyRegion() {
        MapData graph = MakeTestData.makePartlyAccessOnlyThorn();
        assertDijkstraResult(graph,1,5,"1--1000-->2--1000-->3--1000-->4--1000-->5");
    }

    @Test
    public void testLongRouteTakenOnTurnRestrictedA() {
        MapData graph = MakeTestData.makeTurnRestrictedA();
        assertDijkstraResult(graph,3,6,"3--1000-->2--1000-->1--1000-->4--1000-->5--1000-->6");
    }

    @Test
    public void testGoThroughGateWhenItsTheOnlyOption() {
        MapData graph = MakeTestData.makeGatedRow();
        assertDijkstraResult(graph,1,3,"1--1000-->2--1000-->3");
    }

    @Test
    public void testImplicitWorksOnDoubleGatedRow() {
        MapData graph = MakeTestData.makeDoubleGatedRow();
        assertDijkstraResult(graph,1,7,"1--1000-->2--1000-->3--1000-->4--1000-->5--1000-->6--1000-->7");
        assertDijkstraResult(graph,1,6,"1--1000-->2--1000-->3--1000-->4--1000-->5--1000-->6");
        assertDijkstraResult(graph,1,4,"1--1000-->2--1000-->3--1000-->4");
        assertDijkstraResult(graph,1,2,"1--1000-->2");
    }

    @Test
    public void testImplicitWorksOnDoubleAccessOnlyRow() {
        MapData graph = MakeTestData.makeDoubleAccessOnlyRow();
        assertDijkstraResult(graph,1,7,"1--1000-->2--1000-->3--1000-->4--1000-->5--1000-->6--1000-->7");
        assertDijkstraResult(graph,1,6,"1--1000-->2--1000-->3--1000-->4--1000-->5--1000-->6");
        assertDijkstraResult(graph,1,5,"1--1000-->2--1000-->3--1000-->4--1000-->5");
        assertDijkstraResult(graph,1,4,"1--1000-->2--1000-->3--1000-->4");
        assertDijkstraResult(graph,1,3,"1--1000-->2--1000-->3");
        assertDijkstraResult(graph,1,2,"1--1000-->2");
    }

    @Test
    public void testImplicitWorksOnDoubleAccessOnlyRow2() {
        MapData graph = MakeTestData.makeDoubleAccessOnlyRow();
        graph = AdjustGraphForRestrictions.makeNewGraph(graph, graph.getNodeById(4));

        ColocatedNodeSet startNodes = graph.getNodeBySourceDataId(1);
        ColocatedNodeSet endNodes = graph.getNodeBySourceDataId(7);
        DijkstraSolution ds = Dijkstra.dijkstrasAlgorithm(startNodes, endNodes, Dijkstra.Direction.FORWARDS);

        String expected="1--1000-->2--1000-->3--1000-->4--1000-->5--1000-->6--1000-->7";
        assertEquals(expected,solutionToSimpleString(ds));
    }

    @Test(expected=IllegalArgumentException.class)
    public void testAdjustMayNotStartAtGateNode() {
        MapData graph = MakeTestData.makeDoubleGatedRow();
        AdjustGraphForRestrictions.makeNewGraph(graph, graph.getNodeById(3));
    }

    @Test
    public void testAvoidGateWhenPossible() {
        MapData graph = MakeTestData.makeGatedThorn();
        assertDijkstraResult(graph,1,5,"1--1000-->2--1000-->3--1000-->4--1000-->5");
    }

    @Test
    public void testDelayedUTurnOnTurnRestrictedH() {
        MapData graph = MakeTestData.makeTurnRestrictedH();
        assertDijkstraResult(graph,3,6,"3--1000-->2--1000-->1--60000-->1--1000-->2--1000-->5--1000-->6");
    }

    @Test
    public void testTurnRestrictionsDontBreakStraightOn() {
        MapData graph = MakeTestData.makeTurnRestrictedThorn();
        assertDijkstraResult(graph,1,4,"1--1000-->2--1000-->3--1000-->4");
    }

    @Test
    public void testOnlyRestriction() {
        MapData graph = MakeTestData.makeOffsetCrossroadWithOnlyStraightOn();

        assertDijkstraResult(graph,1,4,"1--1000-->2--1000-->3--1000-->4");
        assertDijkstraResult(graph,1,5,"1--1000-->2--2000-->5");
        assertDijkstraResult(graph,5,6,"5--2000-->2--1000-->3--1000-->6");
        assertDijkstraResult(graph,1,6,"1--1000-->2--1000-->3--1000-->4--60000-->4--1000-->3--1000-->6");
    }

    private void assertDijkstraResult(MapData graph, long startNodeId, long endNodeId, String expected) {
        Node startNode = graph.getNodeById(startNodeId);
        Node endNode = graph.getNodeById(endNodeId);

        String result = AdjustGraphForRestrictions.testRestrictedDijkstra(graph, startNode, endNode);

        assertNotNull(result);
        assertEquals(expected, result);

        assertModifiedGraph(AdjustGraphForRestrictions.makeNewGraph(graph, startNode),startNodeId,endNodeId,expected);
        assertModifiedGraph(AdjustGraphForRestrictions.makeNewGraph(graph, endNode),startNodeId,endNodeId,expected);

    }

    @Test
    public void testTrivialDoesntCrash() {
        MapData graph = MakeTestData.makeSimpleFiveEntry();
        Node startNode = graph.getNodeById(1);
        AdjustGraphForRestrictions.makeNewGraph(graph, startNode);
    }

    @Test
    public void testSpuriousUturnsRemoved() {
        MapData graph = MakeTestData.makeSimpleFiveEntry();
        Node startNode = graph.getNodeById(1);
        MapData adjusted = AdjustGraphForRestrictions.makeNewGraph(graph, startNode);
        assertEquals(10, adjusted.getNodeCount());
    }

    private void assertModifiedGraph(MapData modifiedGraph, long startNodeId, long endNodeId, String expected) {
        ColocatedNodeSet startNodes = modifiedGraph.getNodeBySourceDataId(startNodeId);
        ColocatedNodeSet endNodes = modifiedGraph.getNodeBySourceDataId(endNodeId);
        DijkstraSolution ds = Dijkstra.dijkstrasAlgorithm(startNodes, endNodes, Dijkstra.Direction.FORWARDS);

        if (ds==null) {
            System.out.println("Unable to route between " + startNodeId + " and " + endNodeId);
        } else {
            System.out.println("Successfully routed between " + startNodeId + " and " + endNodeId);
        }

        assertNotNull(ds);
        assertEquals(expected,solutionToSimpleString(ds));

        ds = Dijkstra.dijkstrasAlgorithm(endNodes, startNodes, Dijkstra.Direction.BACKWARDS);
        assertNotNull(ds);
        assertEquals(expected,backwardsSolutionToSimpleString(ds));
    }

    private String solutionToSimpleString(DijkstraSolution ds) {
        StringBuilder sb = new StringBuilder();
        sb.append(ds.edges.get(0).from.sourceDataNodeId);
        for (DirectedEdge de : ds.edges) {
            sb.append("--").append(de.driveTimeMs)
                    .append("-->")
                    .append(de.to.sourceDataNodeId);
        }
        return sb.toString();
    }

    private String backwardsSolutionToSimpleString(DijkstraSolution ds) {
        StringBuilder sb = new StringBuilder();
        sb.append(ds.edges.get(0).to.sourceDataNodeId);
        for (DirectedEdge de : ds.edges) {
            sb.insert(0, de.from.sourceDataNodeId+"--"+de.driveTimeMs+"-->");
        }
        return sb.toString();
    }

}


text:
package discovery

import "reflect"

// A Trigger is a simple multi-channel receiver. It triggers callbacks
// when it receives signals from the corresponding channels.
// Each callback will run only once and run in a separate goroutine.
type Trigger struct {
	addCh chan *addRequest
}

type addRequest struct {
	callback func()
	sc       reflect.SelectCase
}

// Add enqueues callback to be invoked on the next event on ch.
func (tr *Trigger) Add(callback func(), ch <-chan struct{}) {
	sc := reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(ch)}
	tr.addCh <- &addRequest{callback, sc}
}

// Stop stops the trigger.
func (tr *Trigger) Stop() {
	close(tr.addCh)
}

func (tr *Trigger) loop() {
	callbacks := make([]func(), 1, 4)
	cases := make([]reflect.SelectCase, 1, 4)
	cases[0] = reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(tr.addCh)}

	for {
		chosen, recv, ok := reflect.Select(cases)
		switch chosen {
		case 0:
			if !ok {
				// The trigger has been stopped.
				return
			}
			// Add a new callback.
			req := recv.Interface().(*addRequest)
			callbacks = append(callbacks, req.callback)
			cases = append(cases, req.sc)
		default:
			go callbacks[chosen]()
			n := len(callbacks) - 1
			callbacks[chosen], callbacks[n] = callbacks[n], nil
			callbacks = callbacks[:n]
			cases[chosen], cases[n] = cases[n], reflect.SelectCase{}
			cases = cases[:n]
		}
	}
}

func NewTrigger() *Trigger {
	tr := &Trigger{addCh: make(chan *addRequest)}
	go tr.loop()
	return tr
}


text:
"""
Represents an EC2 Elastic IP Snapshot
"""
from boto.ec2.ec2object import TaggedEC2Object

class Snapshot(TaggedEC2Object):

    def __init__(self, connection=None):
        TaggedEC2Object.__init__(self, connection)
        self.id = None
        self.volume_id = None
        self.status = None
        self.progress = None
        self.start_time = None
        self.owner_id = None
        self.volume_size = None
        self.description = None

    def __repr__(self):
        return 'Snapshot:%s' % self.id

    def endElement(self, name, value, connection):
        if name == 'snapshotId':
            self.id = value
        elif name == 'volumeId':
            self.volume_id = value
        elif name == 'status':
            self.status = value
        elif name == 'startTime':
            self.start_time = value
        elif name == 'ownerId':
            self.owner_id = value
        elif name == 'volumeSize':
            try:
                self.volume_size = int(value)
            except:
                self.volume_size = value
        elif name == 'description':
            self.description = value
        else:
            setattr(self, name, value)

    def _update(self, updated):
        self.progress = updated.progress
        self.status = updated.status

    def update(self, validate=False):
        """
        Update the data associated with this snapshot by querying EC2.

        :type validate: bool
        :param validate: By default, if EC2 returns no data about the
                         snapshot the update method returns quietly.  If
                         the validate param is True, however, it will
                         raise a ValueError exception if no data is
                         returned from EC2.
        """
        rs = self.connection.get_all_snapshots([self.id])
        if len(rs) > 0:
            self._update(rs[0])
        elif validate:
            raise ValueError('%s is not a valid Snapshot ID' % self.id)
        return self.progress

    def delete(self):
        return self.connection.delete_snapshot(self.id)

    def get_permissions(self):
        attrs = self.connection.get_snapshot_attribute(self.id,
                                                       attribute='createVolumePermission')
        return attrs.attrs

    def share(self, user_ids=None, groups=None):
        return self.connection.modify_snapshot_attribute(self.id,
                                                         'createVolumePermission',
                                                         'add',
                                                         user_ids,
                                                         groups)

    def unshare(self, user_ids=None, groups=None):
        return self.connection.modify_snapshot_attribute(self.id,
                                                         'createVolumePermission',
                                                         'remove',
                                                         user_ids,
                                                         groups)

    def reset_permissions(self):
        return self.connection.reset_snapshot_attribute(self.id, 'createVolumePermission')

class SnapshotAttribute:

    def __init__(self, parent=None):
        self.snapshot_id = None
        self.attrs = {}

    def startElement(self, name, attrs, connection):
        return None

    def endElement(self, name, value, connection):
        if name == 'createVolumePermission':
            self.name = 'create_volume_permission'
        elif name == 'group':
            if self.attrs.has_key('groups'):
                self.attrs['groups'].append(value)
            else:
                self.attrs['groups'] = [value]
        elif name == 'userId':
            if self.attrs.has_key('user_ids'):
                self.attrs['user_ids'].append(value)
            else:
                self.attrs['user_ids'] = [value]
        elif name == 'snapshotId':
            self.snapshot_id = value
        else:
            setattr(self, name, value)


text:
package org.wso2.siddhi.core.util;

import org.wso2.siddhi.core.event.Event;

import java.util.Arrays;

public class EventPrinter {

    public static void print(Event[] events) {
        System.out.println(Arrays.deepToString(events));
    }

    public static void print(long timeStamp, Event[] inEvents, Event[] removeEvents) {
        StringBuilder sb = new StringBuilder();
        sb.append("Events{ @timestamp = ").append(timeStamp).
                append(", inEvents = ").append(Arrays.deepToString(inEvents)).
                append(", RemoveEvents = ").append(Arrays.deepToString(removeEvents)).append(" }");
        System.out.println(sb.toString());
    }

}


text:
if(ENABLE_RENDER)

include(${LIBSBML_ROOT_SOURCE_DIR}/render-package.cmake)

#build up sources
set(RENDER_SOURCES)

# go through all directtories: common, extension and sbml
foreach(dir common extension sbml util)

	# add to include directory
	include_directories(${CMAKE_CURRENT_SOURCE_DIR}/sbml/packages/render/${dir})

	# file sources
	file(GLOB current ${CMAKE_CURRENT_SOURCE_DIR}/sbml/packages/render/${dir}/*.cpp
			${CMAKE_CURRENT_SOURCE_DIR}/sbml/packages/render/${dir}/*.h)

        # Set the *Constraints.cpp files to be 'header' files so they won't be compiled--
        #  they are #included directly, instead.
        if ("${dir}" STREQUAL "validator/constraints")
            foreach(tempFile ${current})
                if ("${tempFile}" MATCHES ".*Constraints.cpp")
                    set_source_files_properties(
                        ${tempFile}
                        PROPERTIES HEADER_FILE_ONLY true
                        )
                endif()
            endforeach()
        endif()

	# add sources
	set(RENDER_SOURCES ${RENDER_SOURCES} ${current})

	# mark header files for installation
	file(GLOB render_headers ${CMAKE_CURRENT_SOURCE_DIR}/sbml/packages/render/${dir}/*.h)
    install(FILES ${render_headers} DESTINATION include/sbml/packages/render/${dir})

endforeach()

# create source group for IDEs
source_group(render_package FILES ${RENDER_SOURCES})

# add fbc sources to SBML sources
SET(LIBSBML_SOURCES ${LIBSBML_SOURCES} ${RENDER_SOURCES})

####################################################################
#
# add test scripts
#
if(WITH_CHECK)

		add_subdirectory(sbml/packages/render/sbml/test)

endif()

endif()


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Moore-Sloan Data Science Environments • MSDSE</title>

	<meta name="twitter:title" content="Moore-Sloan Data Science Environments">

	<meta name="twitter:card" content="summary_large_image">
	<meta name="twitter:image" content="http://msdse.org/images/graphic.jpg">

	<meta property="og:locale" content="">
	<meta property="og:type" content="article">
	<meta property="og:title" content="Moore-Sloan Data Science Environments">

	<meta property="og:url" content="http://msdse.org/">
	<meta property="og:site_name" content="MSDSE">

    <link rel="canonical" href="http://msdse.org/">

    <link href="http://msdse.org/atom.xml" type="application/atom+xml" rel="alternate" title="MSDSE Atom Feed">
    <link href="http://msdse.org/sitemap.xml" type="application/xml" rel="sitemap" title="Sitemap">

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="cleartype" content="on">

    <link rel="stylesheet" href="http://msdse.org/css/main.css">

    MSDSE

MSDSE

About

Environments

Themes

News

Summit

MSDSE Navigate

About

About the partnership

Environments

UW, NYU, and UC Berkeley

Themes

Themes we work around

News

DSE news and events

Summit

2016 Data Science Summit

<button type="button" id="js-menu-trigger" class="sliding-menu-button lines-button x2" role="button" aria-label="Toggle Navigation">

</button>

Moore-Sloan Data Science Environments

Although data-driven research is already accelerating scientific discovery, substantial systemic challenges in academia need to be overcome to maximize its impact and create supportive environments for researchers using develop data-intensive practices.

We seek to enhance data-driven discovery by supporting cross-disciplinary academic data scientists at research institutions. Our work is organized around six challenges, which are themes used to effectively focus our efforts to advance the future of academic data science. Learn more:

Careers

Education and training

Tools and software

Reproducibility and open science

Physical and intellectual space

Data Science studies

We have created three Data Science Environments to work toward our goal:

UC Berkeley Institute for Data Science

NYU Center for Data Science

UW eScience Institute

Other institutions are working toward similar goals. Read more about other data science initiatives.

Contact Us

Moore Foundation

Sloan Foundation

Sign up for Data Science News

© 2016 MSDSE powered by Jekyll + Skinny Bones.


text:
import { PureComponent } from "react";
import Immutable from "immutable";
import PropTypes from "prop-types";

import GroupBy from "pages/ExplorePage/components/GroupBy/GroupBy";

class GroupByController extends PureComponent {
  static propTypes = {
    dataset: PropTypes.instanceOf(Immutable.Map),
    columns: PropTypes.instanceOf(Immutable.List),
    changeFormType: PropTypes.func.isRequired,
    submit: PropTypes.func,
    cancel: PropTypes.func,
    canSelect: PropTypes.any,
  };

  static contextTypes = {
    location: PropTypes.object,
  };

  render() {
    const { canSelect, dataset, columns, submit, cancel, changeFormType } =
      this.props;

    return (
      <div className="group-by">
        <GroupBy
          dataset={dataset}
          columns={columns}
          location={this.context.location}
          submit={submit}
          onCancel={cancel}
          changeFormType={changeFormType}
          canSelect={canSelect}
        />
      </div>
    );
  }
}
export default GroupByController;


text:
FROM azul/zulu-openjdk-alpine:11
ARG DEPENDENCY=dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java", "-cp", "/app:/app/lib/*", "build.bazel.dashboard.Application"]


text:
describe "FalseClass#^" do
  it "returns false if other is nil or false, otherwise true" do
    (false ^ false).should == false
    (false ^ true).should == true
    (false ^ nil).should == false
    (false ^ "").should == true
    (false ^ 'x').should == true
  end
end


text:
.oo-ui-icon-edit {
	background-image: url("themes/mediawiki/images/icons/edit-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/edit-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/edit-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/edit-rtl.png");
}
.oo-ui-icon-editLock {
	background-image: url("themes/mediawiki/images/icons/editLock-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/editLock-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/editLock-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/editLock-rtl.png");
}
.oo-ui-icon-editUndo {
	background-image: url("themes/mediawiki/images/icons/editUndo-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/editUndo-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/editUndo-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/editUndo-rtl.png");
}
.oo-ui-icon-link {
	background-image: url("themes/mediawiki/images/icons/link-rtl.png");
	background-image: -webkit-linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/link-rtl.svg");
	background-image:         linear-gradient(transparent, transparent), /* @embed */ url("themes/mediawiki/images/icons/link-rtl.svg");
	background-image:      -o-linear-gradient(transparent, transparent), url("themes/mediawiki/images/icons/link-rtl.png");
}


text:
#pragma once
#ifndef __PAIRPLOT_H__
#define __PAIRPLOT_H__

#include "plot/abstractPlot.h"
#include "plot/mat.h"

class PairPlot
    : public AbstractPlot
{
public:

    enum Type
    {
        Scatter,
        Regression
    };

    enum DiagonalType
    {
        Histogram,
        KernelDensity
    };

    PairPlot(const PMat &mat, const std::vector< std::string > &names);

    PairPlot(const std::vector< PMat > &mats, const std::vector< std::string > &names,
             const std::vector< std::string > &hue);

    virtual std::string ToString() override;

    PairPlot &SetXVars(const std::vector< std::string > &xvars);

    PairPlot &SetYVars(const std::vector< std::string > &yvars);

    PairPlot &SetType(Type type);

    PairPlot &SetDiagonalType(DiagonalType type);

    PairPlot &SetMarker(const std::string &marker);

    PairPlot &SetMarkers(const std::vector<std::string> &marker);

    PairPlot &SetSize(double size);

    PairPlot &SetAspect(double aspect);
};

#ifndef PLOTLIB_NO_HEADER_ONLY
#   include "../../src/pairPlot.cpp"
#endif

#endif


text:
extern NSString *const DLAddDownloadTaskNotification;
extern NSString *const DLSuspendTaskNotification;
extern NSString *const DLSuspendAndRestartTaskNotification;
extern NSString *const DLAutoStartTaskNotification;

@interface DLCurrentDownloadViewController : UIViewController

@end


text:
IF (APPLE)
  IF (CMAKE_FIND_FRAMEWORK MATCHES "FIRST"
      OR CMAKE_FRAMEWORK_PATH MATCHES "ONLY"
      OR NOT CMAKE_FIND_FRAMEWORK)
    SET (CMAKE_FIND_FRAMEWORK_save ${CMAKE_FIND_FRAMEWORK} CACHE STRING "" FORCE)
    SET (CMAKE_FIND_FRAMEWORK "ONLY" CACHE STRING "" FORCE)
    #FIND_PATH(SQLITE3_INCLUDE_DIR SQLite3/sqlite3.h)
    FIND_LIBRARY(SQLITE3_LIBRARY SQLite3)
    IF (SQLITE3_LIBRARY)
      # FIND_PATH doesn't add "Headers" for a framework
      SET (SQLITE3_INCLUDE_DIR ${SQLITE3_LIBRARY}/Headers CACHE PATH "Path to a file.")
    ENDIF (SQLITE3_LIBRARY)
    SET (CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_save} CACHE STRING "" FORCE)
  ENDIF ()
ENDIF (APPLE)

IF ($ENV{SQLITE_HOME})
    SET(SQLITE_HOME $ENV{LIB_DIR})
    MESSAGE("SQLITE_HOME=${SQLITE_HOME}")
ELSE ()
    SET(SQLITE_HOME $ENV{SQLITE_HOME})
    MESSAGE("SQLITE_HOME=${SQLITE_HOME}")
ENDIF ()

FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
  "${SQLITE_HOME}/include"
  "${SQLITE_HOME}/include/sqlite"
  #mingw
  c:/msys/local/include
  NO_DEFAULT_PATH
  )
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h)

FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3_i PATHS
  $ENV{LIB}
  /usr/lib
  "${SQLITE_HOME}/lib"
  #mingw
  c:/msys/local/lib
  NO_DEFAULT_PATH
  )
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)

IF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
   SET(SQLITE3_FOUND TRUE)
ENDIF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)

IF (SQLITE3_FOUND)

   IF (NOT SQLITE3_FIND_QUIETLY)
      MESSAGE(STATUS "Found Sqlite3: ${SQLITE3_LIBRARY}")
   ENDIF (NOT SQLITE3_FIND_QUIETLY)

ELSE (SQLITE3_FOUND)

   IF (SQLITE3_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find Sqlite3")
   ENDIF (SQLITE3_FIND_REQUIRED)

ENDIF (SQLITE3_FOUND)


text:
"""
haproxyadmin.exceptions
~~~~~~~~~~~~~~~~~~~~~~~

This module contains the set of haproxyadmin' exceptions with the following
hierarchy::

    HAProxyBaseError
    ├── CommandFailed
    ├── HAProxyDataError
    │   ├── IncosistentData
    │   └── MultipleCommandResults
    └── HAProxySocketError
        ├── SocketApplicationError
        ├── SocketConnectionError
        ├── SocketPermissionError
        ├── SocketTimeout
        └── SocketTransportError
"""

class HAProxyBaseError(Exception):
    """haproxyadmin base exception.

    :param message: error message.
    :type message: ``string``
    """
    message = ''

    def __init__(self, message=''):
        if message:
            self.message = message
        super(HAProxyBaseError, self).__init__(self.message)

class CommandFailed(HAProxyBaseError):
    """Raised when a command to HAProxy returned an error."""

class HAProxyDataError(HAProxyBaseError):
    """Base DataError class.

    :param results: A structure which contains data returned be each socket.
    :type results: ``list`` of ``list``
    """
    def __init__(self, results):
        self.results = results
        super(HAProxyDataError, self).__init__()

class MultipleCommandResults(HAProxyDataError):
    """Command returned different results per HAProxy process."""
    message = 'Received different result per HAProxy process'

class IncosistentData(HAProxyDataError):
    """Data across all processes is not the same."""
    message = 'Received different data per HAProxy process'

class HAProxySocketError(HAProxyBaseError):
    """Base SocketError class.

    :param socket_file: socket file.
    :type socket_file: ``string``
    """
    def __init__(self, socket_file):
        self.socket_file = socket_file
        self.message = self.message + ' ' + self.socket_file
        super(HAProxySocketError, self).__init__(self.message)

class SocketTimeout(HAProxySocketError):
    """Raised when we timeout on the socket."""
    message = 'Socket timed out'

class SocketPermissionError(HAProxySocketError):
    """Raised when permissions are not granted to access socket file."""
    message = 'No permissions are granted to access socket file'

class SocketConnectionError(HAProxySocketError):
    """Raised when socket file is not bound to a process."""
    message = 'No process is bound to socket file'

class SocketApplicationError(HAProxySocketError):
    """Raised when we connect to a socket and HAProxy is not bound to it."""
    message = 'HAProxy is not bound to socket file'

class SocketTransportError(HAProxySocketError):
    """Raised when endpoint of socket hasn't closed an old connection.

    .. note::
       It only occurs in cases where HAProxy is ~90% CPU utilization for
       processing traffic and we reconnect to the socket too
       fast and as a result HAProxy doesn't have enough time to close the
       previous connection.

    """
    message = 'Transport endpoint is already connected'


text:
make clean
make

cp bin/* $PREFIX/bin

chmod +x $PREFIX/bin/MUSIC
chmod +x $PREFIX/bin/generate_multimappability_signal.csh
chmod +x $PREFIX/bin/run_MUSIC.csh


text:
package uk.ac.ncl.openlab.intake24.client.survey.scheme.sab;

import org.pcollections.PVector;
import org.pcollections.TreePVector;
import uk.ac.ncl.openlab.intake24.client.api.survey.SurveyParameters;
import uk.ac.ncl.openlab.intake24.client.api.survey.UserData;
import uk.ac.ncl.openlab.intake24.client.survey.*;
import uk.ac.ncl.openlab.intake24.client.survey.portionsize.PortionSizeScriptManager;
import uk.ac.ncl.openlab.intake24.client.survey.portionsize.StandardUnitDef;
import uk.ac.ncl.openlab.intake24.client.survey.prompts.MealOperation;
import uk.ac.ncl.openlab.intake24.client.survey.prompts.messages.PromptMessages;
import uk.ac.ncl.openlab.intake24.client.survey.rules.*;
import uk.ac.ncl.openlab.intake24.client.survey.scheme.BasicScheme;
import uk.ac.ncl.openlab.intake24.client.survey.scheme.ndns.AskIfUsualAmount;
import uk.ac.ncl.openlab.intake24.client.survey.scheme.ndns.AskIfUsualAmountReason;

import java.util.Date;

public class SAB extends BasicScheme {
    final private static SurveyMessages surveyMessages = SurveyMessages.Util.getInstance();

    public static final String ID = "sab";
    private static final double MAX_AGE_HOURS = 12.0;

    public SAB(String locale, SurveyParameters surveyParameters, final SurveyInterfaceManager interfaceManager, UserData userData) {
        super(locale, surveyParameters, interfaceManager, userData);
    }

    @Override
    protected Rules getRules(PortionSizeScriptManager scriptManager, CompoundFoodTemplateManager templateManager, RecipeManager recipeManager) {
        Rules baseRules = defaultRules(scriptManager, templateManager, recipeManager);

        return new Rules(
                TreePVector.<WithPriority<PromptRule<Meal, MealOperation>>>empty()
                        .plus(AskForMealTime.withPriority(40))
                        .plus(ShowEditMeal.withPriority(30))
                        .plus(ShowDrinkReminderPrompt.withPriority(20))
                        .plus(AskAboutAdditionalFood.withPriority(10)),
                TreePVector.<WithPriority<PromptRule<FoodEntry, FoodOperation>>>empty()
                        .plus(ShowNextPortionSizeStep.withPriority(scriptManager, 0))
                        .plus(ChoosePortionSizeMethod.withPriority(1))
                        .plus(AskForMissingFoodDescription.withPriority(2))
                        .plus(SplitFood.withPriority(4))
                        .plus(InformFoodComplete.withPriority(-100)),
                baseRules.extendedFoodPromptRules,
                baseRules.surveyPromptRules
                        .plus(RemindFrequentlyForgottenFoods.withPriority(31))
                        .plus(AskIfUsualAmount.withPriority(30))
                        .plus(AskIfUsualAmountReason.withPriority(29))
                        .plus(AskAboutDiet.withPriority(28))
                        .plus(AskAboutCookingOil.withPriority(27))
                        .plus(AskAboutSupplements.withPriority(26))
                        .plus(AskAboutDifficultiesParticipant.withPriority(25))
                        .plus(AskAboutDifficultiesInterviewer.withPriority(24)),
                baseRules.selectionRules
        );
    }

    @Override
    public String getDataVersion() {
        return "1";
    }

    @Override
    public String getSchemeId() {
        return ID;
    }

    @Override
    public Boolean getSurveyExpired(Survey survey) {
        long currentTime = System.currentTimeMillis();
        Date startDate = new Date(survey.startTime);

        long msToMidnight = ((23 - startDate.getHours()) * 3600 + (59 - startDate.getMinutes()) * 60 + (59 - startDate.getSeconds() + 1)) * 1000;
        long midnight = survey.startTime + msToMidnight;

        return (((currentTime - survey.startTime) / 3600000.0) > MAX_AGE_HOURS || currentTime > midnight);
    }

    @Override
    protected PVector<StandardUnitDef> getMilkPercentageOptions() {
        return TreePVector.<StandardUnitDef>empty()
                .plus(new StandardUnitDef(PromptMessages.INSTANCE.milkInHotDrink_amountLittle(), false, 0.15))
                .plus(new StandardUnitDef(PromptMessages.INSTANCE.milkInHotDrink_amountAverage(), false, 0.25))
                .plus(new StandardUnitDef(PromptMessages.INSTANCE.milkInHotDrink_amountLot(), false, 0.5));
    }
}


text:
var Phaser = require('phaser-unofficial');
var colors = require('./colors');

/**
 * Uri class.
 * @param {object} game
 * @param {number} x
 * @param {number} y
 * @param {string} text
 * @param {number} colorIndex
 */
Uri = function (game, x, y, text, colorIndex) {
    Phaser.Text.call(this, game, x, y, text, {
        font: '13px Roboto',
        fill: '#ffffff'
    });

    this.alive = true;
    this.alpha = 0;
    this.colorIndex = colorIndex;
    this.tint = colors.getColor(this.game, this.game.theme, this.colorIndex, true);
    this.anchor.set(0, 0.5);
    this.state = 'entering';
};

Uri.prototype = Object.create(Phaser.Text.prototype);
Uri.prototype.constructor = Uri;

/**
 * Phaser update.
 * @public
 */
Uri.prototype.update = function () {
    if (this.game.pongPaused) {
        return;
    }

    switch (this.state) {
        case 'entering':
            this.alpha += 0.05;

            if (this.alpha > 1) {
                this.alpha = 1;
                this.state = 'waiting';
                this.waitTime = 0;
            }
            break;

        case 'waiting':
            this.waitTime += this.game.time.elapsed;

            if (this.waitTime > 2000) {
                this.state = 'leaving';
            }
            break;

        case 'leaving':
            this.x += 10;
            this.alpha -= 0.03;
            if (this.alpha < 0) {
                this.alpha = 0;
            }

            if (this.x > this.game.world.bounds.width) {
                this.alive = false;
            }
            break;
    }

    this.tint = colors.getColor(this.game, this.game.theme, this.colorIndex, true);

    Phaser.Text.prototype.update.call(this);
};

module.exports = Uri;


text:
// Copyright (c) 2003-present, Jodd Team (jodd.org). All Rights Reserved.

package jodd.typeconverter.impl;

import jodd.typeconverter.TypeConversionException;
import jodd.typeconverter.TypeConverter;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * Convert given object to URI.
 * Conversion rules:
 *

 *
null value is returned as null

 *
object of destination type is simply casted

 *
File is converted

 *
URL is converted

 *
String representation is used for creating URI

 *

 */
public class URIConverter implements TypeConverter<URI> {

	public URI convert(Object value) {
		if (value == null) {
			return null;
		}

		if (value instanceof URI) {
			return (URI) value;
		}

		if (value instanceof File) {
			File file = (File) value;
			return file.toURI();
		}

		if (value instanceof URL) {
			URL url = (URL) value;
			try {
				return url.toURI();
			} catch (URISyntaxException usex) {
				throw new TypeConversionException(value, usex);
			}
		}

		try {
			return new URI(value.toString());
		} catch (URISyntaxException usex) {
			throw new TypeConversionException(value, usex);
		}
	}

}


text:
set -e

# Default SSH key to $HOME/.ssh/id_rsa if not set
test -z $SSH_KEY_PATH && SSH_KEY_PATH="$HOME/.ssh/id_rsa"
echo "Using SSH key located at: $SSH_KEY_PATH"

# Default docker tag if not specified
test -z "$DOCKER_TAG" && DOCKER_TAG="chronograf-20161121"

docker run \
       -e AWS_ACCESS_KEY_ID \
       -e AWS_SECRET_ACCESS_KEY \
       -v $SSH_KEY_PATH:/root/.ssh/id_rsa \
       -v ~/.ssh/known_hosts:/root/.ssh/known_hosts \
       -v $(pwd):/root/go/src/github.com/influxdata/influxdb/chronograf \
       quay.io/influxdb/builder:$DOCKER_TAG \
       "$@"