text:
package ru.job4j.chess2;

import org.junit.Test;
//import org.junit.Before;
//import org.junit.After;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * class TuraTest.
 *
 * @author Evgeniy Ulanov (komrad1812@yandex.ru).
 * @version $Id$.
 * @since 0.1.
 */

public class TuraTest {

	/**
	 * test impossible move.
	 */
	@Test (expected = ImpossibleMoveException.class)
	public void whenPawnMovedWrongDestThanIvalideMoveExeption() {
		Cell[][] cells = new Cell[8][8];
		for (int x = 0; x < 8; x++) {
			for (int y = 0; y < 8; y++) {
				cells[x][y] = new Cell(x, y);
			}
		}
		Figure[] figures = {new Tura(cells[2][1])};
		Board board = new Board(cells, figures);
		board.move(board.getCell(2, 1), board.getCell(3, 3));
	}

	/**
	 * test can move straight right, left, up, down.
	 */
	@Test
	public void whenTuraMovedStraightThanTrue() {
		Cell[][] cells = new Cell[8][8];
		for (int x = 0; x < 8; x++) {
			for (int y = 0; y < 8; y++) {
				cells[x][y] = new Cell(x, y);
			}
		}
		Figure[] figures = {new Tura(cells[2][1])};
		Board board = new Board(cells, figures);
		// Tura moving down.
		assertThat(board.move(board.getCell(2, 1), board.getCell(2, 3)), is(true));
		// Tura moving up.
		assertThat(board.move(board.getCell(2, 3), board.getCell(2, 1)), is(true));
		// Tura moving right.
		assertThat(board.move(board.getCell(2, 1), board.getCell(7, 1)), is(true));
		// Tura moving left.
		assertThat(board.move(board.getCell(7, 1), board.getCell(0, 1)), is(true));
	}

	/**
	 * test cannot move throw another figure.
	 */
	@Test (expected = OccupiedWayException.class)
	public void whenTuraMoveThrowAnotherFigureThanOccupiedWayExeption() {
		Cell[][] cells = new Cell[8][8];
		for (int x = 0; x < 8; x++) {
			for (int y = 0; y < 8; y++) {
				cells[x][y] = new Cell(x, y);
			}
		}
		Figure[] figures = {new Tura(cells[4][0]),
							new Pawn(cells[4][5], true)};
		Board board = new Board(cells, figures);
		board.move(board.getCell(4, 0), board.getCell(4, 7));
	}
}


text:
{% if messages %}
    {% for message in messages %}
        {% if 'success' in message.tags %}

        {% elif 'info' in message.tags %}

        {% elif 'warning' in message.tags %}

        {% elif 'error' in message.tags %}

        {% endif %}
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
            {{ message|safe }}

    {% endfor %}
{% endif %}

redpajama_set_name: RedPajamaGithub


text:
package io.github.mzmine.modules.dataprocessing.id_lipididentification.lipids.customlipidclass;

import com.google.gson.Gson;
import io.github.mzmine.main.MZmineCore;
import io.github.mzmine.modules.dataprocessing.id_lipididentification.lipidutils.LipidChainType;
import io.github.mzmine.parameters.Parameter;
import io.github.mzmine.parameters.ParameterSet;
import io.github.mzmine.parameters.impl.SimpleParameterSet;
import io.github.mzmine.parameters.parametertypes.ComboParameter;
import io.github.mzmine.util.ExitCode;
import jakarta.json.Json;
import jakarta.json.JsonArray;
import jakarta.json.JsonReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Orientation;
import javafx.scene.control.Button;
import javafx.scene.control.ListView;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
import org.json.JSONArray;
import org.json.JSONObject;

public class CustomLipidChainChoiceComponent extends BorderPane {

  // Logger.
  private final Logger logger = Logger.getLogger(this.getClass().getName());

  private final ListView<LipidChainType> checkList = new ListView<>();
  private final FlowPane buttonsPane = new FlowPane(Orientation.VERTICAL);
  private final Button addButton = new Button("Add...");
  private final Button importButton = new Button("Import...");
  private final Button exportButton = new Button("Export...");
  private final Button removeButton = new Button("Remove");

  // Filename extension.
  private static final String FILENAME_EXTENSION = "*.json";

  public CustomLipidChainChoiceComponent(LipidChainType[] choices) {

    ObservableList<LipidChainType> choicesList = FXCollections.observableArrayList(
        Arrays.asList(choices));
    checkList.setItems(choicesList);
    setCenter(checkList);
    setMaxHeight(100);
    checkList.setMinWidth(300);
    addButton.setOnAction(e -> {
      final ParameterSet parameters = new AddLipidChainTypeParameters();
      if (parameters.showSetupDialog(true) != ExitCode.OK) {
        return;
      }

      // Create new custom lipid class
      LipidChainType lipidChainType = parameters.getParameter(
          AddLipidChainTypeParameters.lipidChainType).getValue();

      // Add to list of choices
      checkList.getItems().add(lipidChainType);
    });

    importButton.setTooltip(new Tooltip("Import Chains for Custom Lipid Class from a CSV file"));
    importButton.setOnAction(e -> {

      // Create the chooser if necessary.
      FileChooser chooser = new FileChooser();
      chooser.setTitle("Select Lipid Chain JSON File");
      chooser.getExtensionFilters().add(new ExtensionFilter("JSON", FILENAME_EXTENSION));

      // Select a file.
      final File file = chooser.showOpenDialog(this.getScene().getWindow());
      if (file == null) {
        return;
      }

      try {
        FileInputStream fileInputStream = new FileInputStream(file);
        JsonReader reader = Json.createReader(fileInputStream);
        JsonArray jsonArray = reader.readArray();
        reader.close();
        Gson gson = new Gson();
        for (int i = 0; i < jsonArray.size(); i++) {
          LipidChainType lipidChainType = gson.fromJson(
              jsonArray.get(i).asJsonObject().getString("Lipid Chain Type"), LipidChainType.class);
          checkList.getItems().add(lipidChainType);
        }
      } catch (FileNotFoundException ex) {
        logger.log(Level.WARNING, "Could not open Lipid Chain .json file");
        ex.printStackTrace();
      }

    });

    exportButton.setTooltip(new Tooltip("Export Lipid Chains to a JSON file"));
    exportButton.setOnAction(e -> {
      FileChooser chooser = new FileChooser();
      chooser.setTitle("Select Lipid Chain file");
      chooser.getExtensionFilters().add(new ExtensionFilter("JSON", FILENAME_EXTENSION));

      final File file = chooser.showSaveDialog(this.getScene().getWindow());
      if (file == null) {
        return;
      }

      try {
        FileWriter fileWriter = new FileWriter(file);
        JSONArray chainTypeList = new JSONArray();
        for (final LipidChainType chainType : checkList.getItems()) {
          JSONObject chainTypeJson = new JSONObject();
          chainTypeJson.put("Lipid Chain Type", chainType);
          chainTypeList.put(chainTypeJson);
        }
        fileWriter.write(chainTypeList.toString());
        fileWriter.close();
      } catch (IOException ex) {
        final String msg = "There was a problem writing the Custom Lipid Class file.";
        MZmineCore.getDesktop().displayErrorMessage(msg + "\n(" + ex.getMessage() + ')');
        logger.log(Level.SEVERE, msg, ex);
      }
    });

    removeButton.setTooltip(new Tooltip("Remove all Lipid Chains"));
    removeButton.setOnAction(e -> {
      checkList.getItems().clear();
    });

    buttonsPane.getChildren().addAll(addButton, importButton, exportButton, removeButton);
    setRight(buttonsPane);

  }

  void setValue(List<LipidChainType> checkedItems) {
    checkList.getSelectionModel().clearSelection();
    for (LipidChainType chain : checkedItems) {
      checkList.getSelectionModel().select(chain);
    }
  }

  public List<LipidChainType> getChoices() {
    return checkList.getItems();
  }

  public List<LipidChainType> getValue() {
    return checkList.getSelectionModel().getSelectedItems();
  }

  /**
   * Represents a fragmentation rule of a custom lipid class.
   */
  private static class AddLipidChainTypeParameters extends SimpleParameterSet {

    private static final ComboParameter<LipidChainType> lipidChainType = new ComboParameter<>(
        "Select lipid chain type", "Select lipid chain type",
        new LipidChainType[]{LipidChainType.ACYL_CHAIN, LipidChainType.ALKYL_CHAIN});

    private AddLipidChainTypeParameters() {
      super(new Parameter[]{lipidChainType});
    }
  }
}


text:
package org.apache.felix.dm.context;

import java.util.Collection;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Map;
import java.util.Set;

import org.apache.felix.dm.ComponentDependencyDeclaration;
import org.apache.felix.dm.Dependency;
import org.apache.felix.dm.ServiceDependency;

/**
 * Abstract class for implementing Dependencies.
 * You can extends this class in order to supply your own custom dependencies to any Dependency Manager Component.
 *
 * @param <T> The type of the interface representing a Dependency Manager Dependency (must extends the Dependency interface).
 * @author Felix Project Team
 */
public abstract class AbstractDependency<T extends Dependency> implements
    Dependency, DependencyContext, ComponentDependencyDeclaration {

    /**
     * The Component implementation is exposed to Dependencies through this interface.
     */
    protected ComponentContext m_component;

    /**
     * Is this Dependency available ? Volatile because the getState method (part of the
     * {@link ComponentDependencyDeclaration} interface) may be called by any thread, at any time.
     */
    protected volatile boolean m_available;

    /**
     * Is this Dependency "instance bound" ? A dependency is "instance bound" if it is defined within the component's
     * init method, meaning that it won't deactivate the component if it is not currently available when being added
     * from the component's init method.
     */
    protected boolean m_instanceBound;

    /**
     * Is this dependency required (false by default) ?
     */
    protected volatile boolean m_required;

    /**
     * Component callback used to inject an added dependency.
     */
    protected volatile String m_add;

    /**
     * Component callback invoked when the dependency has changed.
     */
    protected volatile String m_change;

    /**
     * Component callback invoked when the dependency becomes unavailable.
     */
    protected volatile String m_remove;

    /**
     * Can this Dependency be auto configured in the component instance fields ?
     */
    protected volatile boolean m_autoConfig = true;

    /**
     * The Component field name where the Dependency can be injected (null means any field with a compatible type
     * will be injected).
     */
    protected volatile String m_autoConfigInstance;

    /**
     * Indicates if the setAutoConfig method has been invoked. This flag is used to force autoconfig to "false"
     * when the setCallbacks method is invoked, unless the setAutoConfig method has been called.
     */
    protected volatile boolean m_autoConfigInvoked;

    /**
     * Has this Dependency been started by the Component implementation ? Volatile because the getState method
     * (part of the {@link ComponentDependencyDeclaration} interface) may be called by any thread, at any time.
     */
    protected volatile boolean m_isStarted;

    /**
     * The object instance on which the dependency callbacks are invoked on. Null means the dependency will be
     * injected to the Component implementation instance(s).
     */
    protected volatile Object m_callbackInstance;

    /**
     * Tells if the dependency service properties have to be propagated to the Component service properties.
     */
    protected volatile boolean m_propagate;

    /**
      * Tells if the dependency service properties should override default component service properties (false by default).
      */
    protected volatile boolean m_propagateOverrides;

    /**
     * The propagate callback instance that is invoked in order to supply dynamically some dependency service properties.
     */
    protected volatile Object m_propagateCallbackInstance;

    /**
     * The propagate callback method that is invoked in order to supply dynamically some dependency service properties.
     * @see {@link #m_propagateCallbackInstance}
     */
    protected volatile String m_propagateCallbackMethod;

    /**
     * Default empty dependency properties.
     */
    protected final static Dictionary<Object, Object> EMPTY_PROPERTIES = new Hashtable<>(0);

    /**
     * Creates a new Dependency. By default, the dependency is optional and autoconfig.
     */
    public AbstractDependency() {
    }

    /**
     * Create a clone of a given Dependency.
     * @param prototype all the fields of the prototype will be copied to this dependency.
     */
    public AbstractDependency(AbstractDependency<T> prototype) {
        m_instanceBound = prototype.m_instanceBound;
        m_required = prototype.m_required;
        m_add = prototype.m_add;
        m_change = prototype.m_change;
        m_remove = prototype.m_remove;
        m_autoConfig = prototype.m_autoConfig;
        m_autoConfigInstance = prototype.m_autoConfigInstance;
        m_autoConfigInvoked = prototype.m_autoConfigInvoked;
        m_callbackInstance = prototype.m_callbackInstance;
        m_propagate = prototype.m_propagate;
        m_propagateCallbackInstance = prototype.m_propagateCallbackInstance;
        m_propagateCallbackMethod = prototype.m_propagateCallbackMethod;
        m_propagateOverrides = prototype.m_propagateOverrides;
    }

    @Override
    public String toString() {
        return new StringBuilder(getType()).append(" dependency [").append(getName()).append("]").toString();
    }

    // ----------------------- Dependency interface -----------------------------

    /**
     * Is this Dependency required (false by default) ?
     */
    @Override
    public boolean isRequired() {
        return m_required;
    }

    /**
     * Is this Dependency satisfied and available ?
     */
    @Override
    public boolean isAvailable() {
        return m_available;
    }

    /**
     * Can this dependency be injected in a component class field (by reflexion, true by default) ?
     */
    @Override
    public boolean isAutoConfig() {
        return m_autoConfig;
    }

    /**
     * Returns the field name when the dependency can be injected to.
     */
    @Override
    public String getAutoConfigName() {
        return m_autoConfigInstance;
    }

    /**
     * Returns the propagate callback method that is invoked in order to supply dynamically some dependency service properties.
     * @see {@link #m_propagateCallbackInstance}
     */
    @Override
    public boolean isPropagated() {
        return m_propagate;
    }

    @Override
    public boolean overrideServiceProperties() {
    	return m_propagateOverrides;
    }

    /**
     * Returns the dependency service properties (empty by default).
     */
    @SuppressWarnings("unchecked")
    @Override
    public <K,V> Dictionary<K, V> getProperties() {
        return (Dictionary<K, V>) EMPTY_PROPERTIES;
    }

    // -------------- DependencyContext interface -----------------------------------------------

    /**
     * Called by the Component implementation before the Dependency can be started.
     */
    @Override
    public void setComponentContext(ComponentContext component) {
        m_component = component;
    }

    /**
     * A Component callback must be invoked with dependency event(s).
     * @param type the dependency event type
     * @param events the dependency service event to inject in the component.
     * The number of events depends on the dependency event type: ADDED/CHANGED/REMOVED types only has one event parameter,
     * but the SWAPPED type has two event parameters: the first one is the old event which must be replaced by the second one.
     */
    @Override
    public void invokeCallback(EventType type, Event ... events) {
    }

    /**
     * Starts this dependency. Subclasses can override this method but must then call super.start().
     */
    @Override
    public void start() {
        m_isStarted = true;
    }

    /**
     * Starts this dependency. Subclasses can override this method but must then call super.stop().
     */
    @Override
    public void stop() {
        m_isStarted = false;
        m_available = false;
    }

    /**
     * Indicates if this dependency has been started by the Component implementation.
     */
    @Override
    public boolean isStarted() {
        return m_isStarted;
    }

    /**
     * Called by the Component implementation when the dependency is considered to be available.
     */
    @Override
    public void setAvailable(boolean available) {
        m_available = available;
    }

    /**
     * Is this Dependency "instance bound" (has been defined within the component's init method) ?
     */
    public boolean isInstanceBound() {
        return m_instanceBound;
    }

    /**
     * Called by the Component implementation when the dependency is declared within the Component's init method.
     */
    public void setInstanceBound(boolean instanceBound) {
        m_instanceBound = instanceBound;
    }

    /**
     * Tells if the Component must be first instantiated before starting this dependency (false by default).
     */
    @Override
    public boolean needsInstance() {
        return false;
    }

    /**
     * Returns the type of the field where this dependency can be injected (auto config), or return null
     * if autoconfig is not supported.
     */
    @Override
    public abstract Class<?> getAutoConfigType();

    /**
     * Get the highest ranked available dependency service, or null.
     */
    @Override
    public Event getService() {
        Event event = m_component.getDependencyEvent(this);
        if (event == null) {
            Object defaultService = getDefaultService(true);
            if (defaultService != null) {
                event = new Event(defaultService);
            }
        }
        return event;
    }

    /**
     * Copy all dependency service instances to the given collection.
     */
    @Override
    public void copyToCollection(Collection<Object> services) {
        Set<Event> events = m_component.getDependencyEvents(this);
        if (events.size() > 0) {
            for (Event e : events) {
                services.add(e.getEvent());
            }
        } else {
            Object defaultService = getDefaultService(false);
            if (defaultService != null) {
                services.add(defaultService);
            }
        }
    }

    /**
     * Copy all dependency service instances to the given map (key = dependency service, value = dependency service properties.
     */
    @Override
    public void copyToMap(Map<Object, Dictionary<?, ?>> map) {
        Set<Event> events = m_component.getDependencyEvents(this);
        if (events.size() > 0) {
            for (Event e : events) {
                map.put(e.getEvent(), e.getProperties());
            }
        } else {
            Object defaultService = getDefaultService(false);
            if (defaultService != null) {
                map.put(defaultService, EMPTY_PROPERTIES);
            }
        }
    }

    /**
     * Creates a copy of this Dependency.
     */
    @Override
    public abstract DependencyContext createCopy();

    // -------------- ComponentDependencyDeclaration -----------------------------------------------

    /**
     * Returns a description of this dependency (like the dependency service class name with associated filters)
     */
    @Override
    public String getName() {
        return getSimpleName();
    }

    /**
     * Returns a simple name for this dependency (like the dependency service class name).
     */
    @Override
    public abstract String getSimpleName();

    /**
     * Returns the dependency symbolic type.
     */
    @Override
    public abstract String getType();

    /**
     * Returns the dependency filter, if any.
     */
    @Override
    public String getFilter() {
        return null;
    }

    /**
     * Returns this dependency state.
     */
    @Override
    public int getState() { // Can be called from any threads, but our class attributes are volatile
        if (m_isStarted) {
            return (isAvailable() ? 1 : 0) + (isRequired() ? 2 : 0);
        } else {
            return isRequired() ? ComponentDependencyDeclaration.STATE_REQUIRED
                : ComponentDependencyDeclaration.STATE_OPTIONAL;
        }
    }

    // -------------- Methods common to sub interfaces of Dependendency

    /**
     * Activates Dependency service properties propagation (to the service properties of the component to which this
     * dependency is added).
     *
     * @param propagate true if the dependency service properties must be propagated to the service properties of
     * the component to which this dependency is added.
     * @return this dependency instance
     */
    @SuppressWarnings("unchecked")
    public T setPropagate(boolean propagate) {
        ensureNotActive();
        m_propagate = propagate;
        return (T) this;
    }

    @SuppressWarnings("unchecked")
    public T setPropagate(boolean propagate, boolean overrideServiceProperties) {
        ensureNotActive();
        m_propagate = propagate;
        m_propagateOverrides = overrideServiceProperties;
        return (T) this;
    }

    /**
     * Sets a callback instance which can ba invoked with the given method in order to dynamically retrieve the
     * dependency service properties.
     *
     * @param instance the callback instance
     * @param method the method to invoke on the callback instance
     * @return this dependency instance
     */
    @SuppressWarnings("unchecked")
    public T setPropagate(Object instance, String method) {
        setPropagate(instance != null && method != null);
        m_propagateCallbackInstance = instance;
        m_propagateCallbackMethod = method;
        return (T) this;
    }

    /**
     * Sets the add/remove callbacks.
     * @param add the callback to invoke when a dependency is added
     * @param remove the callback to invoke when a dependency is removed
     * @return this dependency instance
     */
    public T setCallbacks(String add, String remove) {
        return setCallbacks(add, null, remove);
    }

    /**
     * Sets the add/change/remove callbacks.
     * @param add the callback to invoke when a dependency is added
     * @param change the callback to invoke when a dependency has changed
     * @param remove the callback to invoke when a dependency is removed
     * @return this dependency instance
     */
    public T setCallbacks(String add, String change, String remove) {
        return setCallbacks(null, add, change, remove);
    }

    /**
     * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
     * dependency is added or removed. They are called on the instance you provide. When you
     * specify callbacks, the auto configuration feature is automatically turned off, because
     * we're assuming you don't need it in this case.
     *
     * @param instance the instance to call the callbacks on
     * @param add the method to call when a service was added
     * @param remove the method to call when a service was removed
     * @return this service dependency
     */
    public T setCallbacks(Object instance, String add, String remove) {
        return setCallbacks(instance, add, null, remove);
    }

    /**
     * Sets the callbacks for this service. These callbacks can be used as hooks whenever a
     * dependency is added, changed or removed. They are called on the instance you provide. When you
     * specify callbacks, the auto configuration feature is automatically turned off, because
     * we're assuming you don't need it in this case.
     *
     * @param instance the instance to call the callbacks on
     * @param add the method to call when a service was added
     * @param change the method to call when a service was changed
     * @param remove the method to call when a service was removed
     * @return this service dependency
     */
    @SuppressWarnings("unchecked")
    public T setCallbacks(Object instance, String add, String change, String remove) {
        if ((add != null || change != null || remove != null) && !m_autoConfigInvoked) {
            setAutoConfig(false);
        }
        m_callbackInstance = instance;
        m_add = add;
        m_change = change;
        m_remove = remove;
        return (T) this;
    }

    /**
     * Returns the dependency callback instances
     * @return the dependency callback instances
     */
    public Object[] getInstances() {
        if (m_callbackInstance == null) {
            return m_component.getInstances();
        } else {
            return new Object[] { m_callbackInstance };
        }
    }

    /**
     * @see {@link ServiceDependency#setRequired(boolean)}
     */
    @SuppressWarnings("unchecked")
    public T setRequired(boolean required) {
        m_required = required;
        return (T) this;
    }

    /**
     * @see {@link ServiceDependency#setAutoConfig(boolean)}
     */
    @SuppressWarnings("unchecked")
    public T setAutoConfig(boolean autoConfig) {
        if (autoConfig && getAutoConfigType() == null) {
            throw new IllegalStateException("Dependency does not support auto config mode");
        }
        m_autoConfig = autoConfig;
        m_autoConfigInvoked = true;
        return (T) this;
    }

    /**
     * @see {@link ServiceDependency#setAutoConfig(String instanceName)}
     */
    @SuppressWarnings("unchecked")
    public T setAutoConfig(String instanceName) {
        if (instanceName != null && getAutoConfigType() == null) {
            throw new IllegalStateException("Dependency does not support auto config mode");
        }
        m_autoConfig = (instanceName != null);
        m_autoConfigInstance = instanceName;
        m_autoConfigInvoked = true;
        return (T) this;
    }

    /**
     * Returns the component implementation context
     * @return the component implementation context
     */
    public ComponentContext getComponentContext() {
        return m_component;
    }

    /**
     * Returns the default service, or null.
     * @param nullObject if true, a null object may be returned.
     * @return the default service
     */
    protected Object getDefaultService(boolean nullObject) {
        return null;
    }

    /**
     * Checks if the component dependency is not started.
     */
    protected void ensureNotActive() {
        if (isStarted()) {
            throw new IllegalStateException("Cannot modify state while active.");
        }
    }
}


text:
/**
 * Week collection
 */

var Backbone = require('backbone');

var WeekDay = require('../models/weekday');

module.exports = Backbone.Collection.extend({
  model : WeekDay
});


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Padland</string>
    <string name="pref_header_general">設定</string>
    <string name="title_activity_settings">設定</string>
    <string name="action_settings">設定</string>
    <string name="go_pad">作成または移動</string>
    <string name="title_activity_pad_view">Padland ビューアー</string>
    <string name="write_pad_name">パッド名</string>
    <string name="action_newpad">ドキュメントを追加</string>
    <string name="action_go_to_list">パッドリストに戻る</string>
    <string name="title_activity_new_pad">パッドを作成</string>
    <string name="new_pad_explanation">パッドの名前を導入します。 存在しない場合は作成します。 それ以外の場合はパッドを表示します。</string>
    <string name="save_pad">パッドを作成</string>
    <string name="download_pad">パッドを保存</string>
    <string name="title_activity_about">アプリについて</string>
    <string name="about">アプリについて</string>
    <string name="about_text">

Licensed under the Apache ライセンス.

    </string>
    <string name="settings_save_new_pads_title">新しいドキュメントを自動保存</string>
    <string name="settings_save_new_pads_desc">新しく訪問したドキュメントを自動的にリストに追加します</string>
    <string name="share">共有</string>
    <string name="delete">削除</string>
    <string name="no_pads">保存したドキュメントはありません。</string>
    <string name="sure_to_delete_pad">選択したドキュメントを削除してもよろしいですか?</string>
    <string name="sure_to_delete_group">選択したグループを削除してもよろしいですか?</string>
    <string name="ok">OK</string>
    <string name="cancel">キャンセル</string>
    <string name="share_document">ドキュメントを共有</string>
    <string name="share_auto_text">"Padland に参加しよう! "</string>
    <string name="user_preferences">ユーザー設定</string>
    <string name="settings_default_username">デフォルトのユーザー名</string>
    <string name="settings_default_username_explanation">PadLand は、開いたすべてのドキュメントにデフォルトのユーザー名を設定しようとします。</string>
    <string name="settings_default_color">デフォルトの色</string>
    <string name="settings_default_color_explanation">PadLand は、開いたすべてのドキュメントにデフォルトの色を設定しようとします。</string>
    <string name="settings_default_color_dialogtitle">色の選択</string>
    <string name="settings_default_color_dialogdesc">書式の例 (hex): #FF0000</string>
    <string name="activity_padlist_implicitintent_text_copied">テキストをクリップボードにコピーしました。クリップボードのデータを貼り付けて使用してください。</string>
    <string name="network_is_unreachable">ネットワークが到達できません。</string>
    <string name="title_activity_padlist">Padland ドキュメント</string>
    <string name="choose_a_server">サーバーの選択 (任意):</string>
    <string name="default_pad_server">デフォルトのパッド サーバー</string>
    <string name="choose_default_pad_server">新しいサーバーを開くときの、デフォルトのパッド サーバーを選択してください。</string>
    <string name="about_support_text">

このアプリは開発中です。 フィードバックやバグ報告は、開発者 mikifus@gmail.com までご連絡ください。
\n
        \n

貢献していただける場合は、こちらのリポジトリまで:\n
            https://github.com/mikifus/padland

    </string>
    <string name="padinfo_view_pad_button">パッドを表示</string>
    <string name="title_activity_pad_info">ドキュメント情報</string>
    <string name="title_activity_pad_land_data">PadLandDataActivity</string>

    <string name="padinfo_pad_info">ドキュメント情報</string>
    <string name="padinfo_pad_url">ドキュメント URL</string>
    <string name="padinfo_createdate">リストに追加しました</string>
    <string name="padinfo_lastuseddate">最後に表示</string>

    <string name="newpad_noname_warning">ドキュメントの名前を指定する必要があります。</string>

    <string name="padlist_empty_createnew">新しいドキュメントを作成</string>
    <string name="padlist_document_deleted">ドキュメントを削除しました</string>
    <string name="padlist_group_deleted">グループを削除しました</string>
    <string name="padlist_dialog_new_padgroup_title">新しいグループ</string>
    <string name="padlist_dialog_new_padgroup_label">新しいグループの名前を入力してください</string>
    <string name="padlist_dialog_new_padgroup_invalid">グループ名が正しくありません。</string>
    <string name="padlist_group_unclassified_name">未分類</string>
    <string name="padlist_group_select_dialog">グループの選択</string>

    <string name="unexpected_error">予期しないエラーが発生しました。</string>
    <string name="settings_miscellaneous">その他</string>
    <string name="padinfo_times_accessed">アクセス回数</string>
    <string name="pref_default_display_name">匿名</string>

</resources>


text:
package org.devocative.ares.web.dpage;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.event.Broadcast;
import org.apache.wicket.event.IEvent;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.devocative.ares.entity.oservice.ERemoteMode;
import org.devocative.ares.entity.oservice.OSIUser;
import org.devocative.ares.iservice.ITerminalConnectionService;
import org.devocative.ares.iservice.oservice.IOSIUserService;
import org.devocative.ares.web.TerminalTabInfo;
import org.devocative.ares.web.panel.ShellTerminalPanel;
import org.devocative.ares.web.panel.SqlTerminalPanel;
import org.devocative.demeter.web.DPage;
import org.devocative.demeter.web.DPanel;
import org.devocative.wickomp.html.WAjaxLink;
import org.devocative.wickomp.html.tab.OTab;
import org.devocative.wickomp.html.tab.OTabbedPanel;
import org.devocative.wickomp.html.tab.WTabbedPanel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import java.util.*;

public class TerminalConsoleDPage extends DPage {
	private static final long serialVersionUID = -2200966618262815151L;

	private static final Logger logger = LoggerFactory.getLogger(TerminalConsoleDPage.class);

	@Inject
	private IOSIUserService osiUserService;

	@Inject
	private ITerminalConnectionService terminalConnectionService;

	private WTabbedPanel tabPanel;
	private Map<String, Long> tabId2ConnId = new HashMap<>();

	// ------------------------------

	public TerminalConsoleDPage(String id, List<String> params) {
		super(id, params);
	}

	// ------------------------------

	@Override
	protected void onInitialize() {
		super.onInitialize();

		OTabbedPanel oTabbedPanel = new OTabbedPanel();
		oTabbedPanel
			.setGlobalHotkeyEnabled(true)
			.setCloseTabKeyCode(190)
			.setOnSelect("function(title,index){$(this).tabs('getTab', index).find('textarea').focus();}") //NOTE: WOW! I don't know how it worked!
			.setFit(true);
		tabPanel = new WTabbedPanel("tabPanel", oTabbedPanel) {
			private static final long serialVersionUID = 3302863870173680811L;

			@Override
			protected void onTabClose(AjaxRequestTarget target, OTab closedTab) {
				String tabId = closedTab.getTabId();
				Long connId = tabId2ConnId.get(tabId);
				terminalConnectionService.closeConnection(connId);
				tabId2ConnId.remove(tabId);
				logger.info("Closing Terminal Tab: tabId=[{}] connId=[{}]", tabId, connId);
			}

			@Override
			public void onEvent(IEvent<?> event) {
				Object payload = event.getPayload();
				if (event.getType() == Broadcast.BUBBLE && payload instanceof TerminalTabInfo) {
					event.dontBroadcastDeeper();
					TerminalTabInfo tabInfo = (TerminalTabInfo) payload;
					logger.info("Registering tab with terminal connection: {}", tabInfo);
					tabId2ConnId.put(tabInfo.getTabId(), tabInfo.getConnectionId());
				}
			}
		};
		add(tabPanel);

		Map<ERemoteMode, List<OSIUser>> allowedOnes = osiUserService.findAllowed();

		add(new ListView<ERemoteMode>("terminals", new ArrayList<>(allowedOnes.keySet())) {
			private static final long serialVersionUID = 1416116347227236048L;

			@Override
			protected void populateItem(ListItem<ERemoteMode> item) {
				ERemoteMode remoteMode = item.getModelObject();
				item.add(new AttributeModifier("title", remoteMode.getName()));

				item.add(new ListView<OSIUser>("terminal", new ArrayList<>(allowedOnes.get(remoteMode))) {
					private static final long serialVersionUID = -6470792116062021736L;

					@Override
					protected void populateItem(ListItem<OSIUser> item) {
						OSIUser osiUser = item.getModelObject();
						IModel<String> title = new Model<>(osiUser.toString());

						item.add(new WAjaxLink("osiUser", title) {
							private static final long serialVersionUID = -2582918546272510666L;

							@Override
							public void onClick(AjaxRequestTarget target) {
								DPanel panel;
								String tabId = UUID.randomUUID().toString().replaceAll("[-]", "");

								if (ERemoteMode.SSH.equals(remoteMode)) {
									logger.info("Creating ShellTerminalPanel: OSIUser=[{}] tabId=[{}]", osiUser.toString(), tabId);
									panel = new ShellTerminalPanel(tabPanel.getTabContentId(), osiUser, tabId);
								} else if (ERemoteMode.JDBC.equals(remoteMode)) {
									logger.info("Creating SqlTerminalPanel: OSIUser=[{}] tabId=[{}]", osiUser.toString(), tabId);
									panel = new SqlTerminalPanel(tabPanel.getTabContentId(), osiUser.getId(), tabId);
								} else {
									throw new RuntimeException("Invalid Remote Mode: " + remoteMode);
								}

								tabPanel.addTab(target, panel, new OTab(title, true).setTabId(tabId));
							}
						});

					}
				});
			}
		});

		add(new Label("message", "No Accessible Terminal!").setVisible(allowedOnes.isEmpty()));
	}
}


text:
<?php _e('Search Customer', 'wc_point_of_sale'); ?>

            <input type="text" id="search-customer-input" placeholder="<?php _e('Enter customer name', 'wc_point_of_sale'); ?>" autocompleate="off" >


text:
namespace base {

// A convenient wrapper for an OS specific critical section.  The only real
// intelligence in this class is in debug mode for the support for the
// AssertAcquired() method.
class LOCKABLE BASE_EXPORT Lock {
 public:
#if !DCHECK_IS_ON()
  // Optimized wrapper implementation
  Lock() : lock_() {}
  ~Lock() {}

  // TODO(lukasza): https://crbug.com/831825: Add EXCLUSIVE_LOCK_FUNCTION
  // annotation to Acquire method and similar annotations to Release, Try and
  // AssertAcquired methods (here and in the #else branch).
  void Acquire() { lock_.Lock(); }
  void Release() { lock_.Unlock(); }

  // If the lock is not held, take it and return true. If the lock is already
  // held by another thread, immediately return false. This must not be called
  // by a thread already holding the lock (what happens is undefined and an
  // assertion may fail).
  bool Try() { return lock_.Try(); }

  // Null implementation if not debug.
  void AssertAcquired() const {}
#else
  Lock();
  ~Lock();

  // NOTE: We do not permit recursive locks and will commonly fire a DCHECK() if
  // a thread attempts to acquire the lock a second time (while already holding
  // it).
  void Acquire() {
    lock_.Lock();
    CheckUnheldAndMark();
  }
  void Release() {
    CheckHeldAndUnmark();
    lock_.Unlock();
  }

  bool Try() {
    bool rv = lock_.Try();
    if (rv) {
      CheckUnheldAndMark();
    }
    return rv;
  }

  void AssertAcquired() const;
#endif  // DCHECK_IS_ON()

  // Whether Lock mitigates priority inversion when used from different thread
  // priorities.
  static bool HandlesMultipleThreadPriorities() {
#if defined(STARBOARD)
    return false;
#else
#if defined(OS_WIN)
    // Windows mitigates priority inversion by randomly boosting the priority of
    // ready threads.
    // https://msdn.microsoft.com/library/windows/desktop/ms684831.aspx
    return true;
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
    // POSIX mitigates priority inversion by setting the priority of a thread
    // holding a Lock to the maximum priority of any other thread waiting on it.
    return internal::LockImpl::PriorityInheritanceAvailable();
#else
#error Unsupported platform
#endif
#endif
  }

  // Both Windows and POSIX implementations of ConditionVariable need to be
  // able to see our lock and tweak our debugging counters, as they release and
  // acquire locks inside of their condition variable APIs.
  friend class ConditionVariable;

 private:
#if DCHECK_IS_ON()
  // Members and routines taking care of locks assertions.
  // Note that this checks for recursive locks and allows them
  // if the variable is set.  This is allowed by the underlying implementation
  // on windows but not on Posix, so we're doing unneeded checks on Posix.
  // It's worth it to share the code.
  void CheckHeldAndUnmark();
  void CheckUnheldAndMark();

  // All private data is implicitly protected by lock_.
  // Be VERY careful to only access members under that lock.
  base::PlatformThreadRef owning_thread_ref_;
#endif  // DCHECK_IS_ON()

  // Platform specific underlying lock implementation.
  internal::LockImpl lock_;

  DISALLOW_COPY_AND_ASSIGN(Lock);
};

// A helper class that acquires the given Lock while the AutoLock is in scope.
class SCOPED_LOCKABLE AutoLock {
 public:
  struct AlreadyAcquired {};

  explicit AutoLock(Lock& lock) EXCLUSIVE_LOCK_FUNCTION(lock) : lock_(lock) {
    lock_.Acquire();
  }

  AutoLock(Lock& lock, const AlreadyAcquired&) EXCLUSIVE_LOCKS_REQUIRED(lock)
      : lock_(lock) {
    lock_.AssertAcquired();
  }

  ~AutoLock() UNLOCK_FUNCTION() {
    lock_.AssertAcquired();
    lock_.Release();
  }

 private:
  Lock& lock_;
  DISALLOW_COPY_AND_ASSIGN(AutoLock);
};

// AutoUnlock is a helper that will Release() the |lock| argument in the
// constructor, and re-Acquire() it in the destructor.
class AutoUnlock {
 public:
  explicit AutoUnlock(Lock& lock) : lock_(lock) {
    // We require our caller to have the lock.
    lock_.AssertAcquired();
    lock_.Release();
  }

  ~AutoUnlock() {
    lock_.Acquire();
  }

 private:
  Lock& lock_;
  DISALLOW_COPY_AND_ASSIGN(AutoUnlock);
};

}  // namespace base

#endif  // BASE_SYNCHRONIZATION_LOCK_H_


text:
js2coffee 2.0 (aka js2coffee-redux) aims to have these improvements over the
js2coffee 0.x series:

 * ✓ __Use a new JS parser.__

   The new js2coffee is built upon Esprima, which uses the standardized
   ECMAScript Parser API.

 * ✓ __Cleaner repository.__

   [js2coffee/js2coffee] has way too much boilerplate and DocPad-related things
   in it. There should be no Cakefiles or anything, just package.json.

 * ✓ __Be fully browserify-compatible with minimal cruft.__

   Building a browesrify build is as easy as `browserify -t coffeeify .`.
   Everything will work with minimal fuzz.

 * ✓ __More maintainable.__

   Carefully think out the API and the structure of the repository so to
   minimize boilerplates and dependencies.

## New features

 - ✓ __Compatibility warnings.__

   Give warnings for things that may break, such as `==` being converted to
   `is`.

 - ✓ __Source maps.__

   The new js2coffee website will feature a new editor that will allow you to
   see what each point of the source compiles to.

 - __More configurable options.__

   This will allow you to select if you would like `and` vs `&&`, or `is` vs
   `===`, and so on.

 - ✓ __Better error messages.__

   Error messages now show a preview of the source where errors happen, such as
   what you'd expect in CoffeeScriptRedux.

[js2coffee/js2coffee]: https://github.com/js2coffee/js2coffee


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FellSky.Game.Campaign.Bases
{
    public class AsteroidBase: Base
    {
        public string SpriteId { get; set; }
    }
}


text:
Orden de servicio

Listar

    <link rel="stylesheet" type="text/css" href="public/admin/jqueryui/css/smoothness/jquery-ui-1.8.16.custom.css"/>

		<?php if (validation_errors()){ ?>

            <?php echo validation_errors(); ?>

        <?php } ?>
			<form method="post" action="ordenes/agregar" enctype="multipart/form-data" id="form_new_p" name="form_new_p" >
            	<input required type="hidden" id="id_cliente" name="id_cliente" />
                <input required type="hidden" id="id_empleado" name="id_empleado" />

Número orden
 <input required type="text" name="numero"  class="text"  value="<?php echo $cod ?>">

Fecha
 <input required type="text" name="fecha" disabled="disabled" class="text required"  value="<?php echo date("d/m/Y") ?>">

Operador

                        <select class="styled" name="id_empleado">
                            <option value=" ">- Seleccionar</option>
                            <?php 	foreach($empleados as $key){
                                ?>
                                <option value="<?php echo $key['id_empleado'] ?>"><?php echo $key['nom_empleado'] ?></option>
                            <?php
                            }
                            ?>
                        </select>

 Solicitado por
 <input required type="text" name="solicitado_por" class="text "  value="<?php echo $data[0]['solicitado_por'] ?>">

 Cliente
 <input required type="text" name="cliente"  id="cliente" style="width:350px" class="text required">

 Teléfono
 <input required type="text" name="tel" id="tel" style="width:250px"  class="text required"  value="">

 Dirección
 <input required type="text"  disabled="disabled" class="text "  value="<?php echo $data[0]['tel_cliente'] ?>">

 Maquina No
 <input required type="text" name="maquina_nro" class="text "  value="<?php echo $data[0]['maquina_nro'] ?>">

 Capacidad Ton
 <input required type="text" name="capacidad_ton" class="text "  value="<?php echo $data[0]['capacidad_ton'] ?>">

 Valor Hora
 <input required type="text"   name="valor_hora" class="text "  value="<?php echo $data[0]['valor_hora'] ?>">

 Hora de salida
 <input required type="time" name="hora_salida" class="text time"  value="<?php echo $data[0]['hora_salida'] ?>">

 Hora de llegada al cliente
 <input required id="timep2" type="text" name="hora_llegada_cliente" class="text time"  value="<?php echo $data[0]['hora_llegada_cliente'] ?>">

 Hora salida cliente
 <input required id="timep3" type="text"   name="hora_salida_cliente" class="text time"  value="<?php echo $data[0]['hora_salida_cliente'] ?>">

 Hora llegada
 <input required id="timep4" type="text"   name="hora_llegada" class="text time"  value="<?php echo $data[0]['hora_llegada'] ?>">

<link href="public/admin/css/jquery.ui.timepicker.css" type="text/css" rel="stylesheet">

 Duración del servicio
 34

 Valor del servicio  34

 Observaciones
 34

                    <textarea name="observaciones">oas</textarea>

                <input  type="submit" class="submit mid" value="Guardar" />

      </form>


text:
package cl.json.social;

import android.content.ActivityNotFoundException;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableMap;

/**
 * Created by disenodosbbcl on 23-07-16.
 */
public class FacebookPagesManagerShare extends SingleShareIntent {

    private static final String PACKAGE = "com.facebook.pages.app";
    private static final String DEFAULT_WEB_LINK = "https://www.facebook.com/sharer/sharer.php?u={url}";

    public FacebookPagesManagerShare(ReactApplicationContext reactContext) {
        super(reactContext);
    }
    @Override
    public void open(ReadableMap options) throws ActivityNotFoundException {
        super.open(options);
        //  MORE DATA
        this.openIntentChooser();
    }
    @Override
    protected String getPackage() {
        return PACKAGE;
    }

    @Override
    protected String getDefaultWebLink() {
        return DEFAULT_WEB_LINK;
    }

    @Override
    protected String getPlayStoreLink() {
        return null;
    }
}


text:
---
layout: next-page
title: Next Fest Opening party
---

  <video playsinline autoplay muted loop class="c-next__hero-video">
    <source src="{{ "/assets/images/reservoirdogs.mp4" | relative_url }}" type="video/mp4">
  </video>

NEXT FEST After Dark

A summer celebration benefiting Sundance Institute and its artists

Thursday, August 10

        7:30 p.m. Screening

        9:30 p.m. Party

        The Theatre at Ace Hotel, 929 S. Broadway, Los Angeles, CA

      Get Tickets
      More Info
      Watch Trailer

Join us for our opening night celebration at Sundance NEXT FEST, a summer festival where movies, music, and mischief collide. The evening will kick off the festival with a special 35mm screening of Quentin Tarantino's cult classic Reservoir Dogs, followed by an outdoor party with music, drinks, food trucks, games, and more—all while benefiting Sundance Institute and the artists we support year-round.

Presented by Acura.

Tickets & Packages

Premium Party & Screening Ticket Package—$500 (Tax-Exempt $60 )

2 priority seats at the opening night screening of Reservoir Dogs

2 tickets to NEXT FEST After Dark, our opening night party

1 NEXT FEST Weekender Package for Two

NEXT FEST gift bag

NEXT DOOR outdoor venue access all weekend

Complimentary valet

Party & Screening Ticket—$150 (Tax-Exempt $80 )

1 priority seat at the opening night screening of Reservoir Dogs

1 ticket to NEXT FEST After Dark, our opening night party

1 ticket to a preselected daytime screening

NEXT DOOR outdoor venue access all weekend

Donations

Sponsor an Artist—$500 (Tax-Exempt $500)

I cannot attend, but I would like to support the attendance of a Sundance artist and their guest to the event with a contribution of $500.

Support the Artist Fund

I cannot attend, but I would like to show my support of Sundance Institute by making a tax-deductible contribution in the amount of: __

For questions or additional information on the NEXT FEST After Dark Party, please contact events@sundance.org or (310) 492-2325.   For a printable version of the invitation, click here.


text:
Les élèves de 1ère année d'Hétic sont amenés à effectuer un stage durant l'été. Afin d'être recruté, il leur faut établir un CV qualitatif qui présentera les compétences de chaque élève.

Pour faciliter la création de ce CV, nous vous proposons un template Web qu'il vous suffira de remplir avec vos coordonnées, formations, expériences, etc.

## SOMMAIRE

1. [Langages et Versions](#langages-et-versions)
1. [Fonctionnement](#fonctionnement)
1. [Hébergement](#hebergement)
1. [Exemples](#exemples)

## Langages et Versions

Pour un hébergement facile et gratuit (ou peu coûteux), notre template n'est codé qu'avec des langages orientés front-end :
* HTML5
* CSS3
* Vanilla JS

## Fonctionnement

Le template est simple d'utilisation et facilement modifiable. Pour une prise en main rapide, tous les éléments modifiables se trouvent sur un seul et même fichier HTML.
Ce fichier est rempli de commentaires décrivant les différentes informations à renseigner.

## Hébergement

#### Si vous installez ce template sur un site existant :

Nous vous conseillons de copier les fichiers dans un dossier dédié (par exemple "CV") et de le lier grâce à un lien ou un bouton dans le fichier html voulu.

* Exemple d'arborescence
```
• index.html
• styles/
• js/
• cv/
  · cv.html
  · styles/
  · img-content/
```
* Exemple de lien
```
<a href='cv/cv.html'>Mon CV</a>
```

#### Si vous décidez d'héberger le template seul :

Vous pouvez copier directement les fichiers du template à la racine de votre dossier.

* Exemple d'arborescence
```
• cv.html
• styles/
• img-content/
```

## Exemple

Le fichier HTML est rempli de commentaires présentant tous les champs
```
<div class="address">
		<h3>Adresse</h3>
				<span><!-- 27 bis rue du Progrès --></span>
				<span><!-- 93100 Montreuil --></span>
</div>
```
Il vous suffit de les effacer pour remplir avec vos propres informations
```
<div class="address">
		<h3>Adresse</h3>
				<span>72 Boulevard de Magenta</span>
				<span>75010 Paris</span>
</div>
```


text:
package FixEntryPreference::L10N;

use strict;
use base 'MT::Plugin::L10N';

1;


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.doubleclickbidmanager.model;

/**
 * A Rule defines a name, and a boolean expression in [conjunctive normal form](http:
 * //mathworld.wolfram.com/ConjunctiveNormalForm.html){.external} that can be // applied to a path
 * event to determine if that name should be applied.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the DoubleClick Bid Manager API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Rule extends com.google.api.client.json.GenericJson {

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<DisjunctiveMatchStatement> disjunctiveMatchStatements;

  static {
    // hack to force ProGuard to consider DisjunctiveMatchStatement used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(DisjunctiveMatchStatement.class);
  }

  /**
   * Rule name.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * @return value or {@code null} for none
   */
  public java.util.List<DisjunctiveMatchStatement> getDisjunctiveMatchStatements() {
    return disjunctiveMatchStatements;
  }

  /**
   * @param disjunctiveMatchStatements disjunctiveMatchStatements or {@code null} for none
   */
  public Rule setDisjunctiveMatchStatements(java.util.List<DisjunctiveMatchStatement> disjunctiveMatchStatements) {
    this.disjunctiveMatchStatements = disjunctiveMatchStatements;
    return this;
  }

  /**
   * Rule name.
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Rule name.
   * @param name name or {@code null} for none
   */
  public Rule setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  @Override
  public Rule set(String fieldName, Object value) {
    return (Rule) super.set(fieldName, value);
  }

  @Override
  public Rule clone() {
    return (Rule) super.clone();
  }

}


text:
package com.amazonaws.services.backup.model;

import javax.annotation.Generated;

/**
 *

 * The required resource already exists.
 *

 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AlreadyExistsException extends com.amazonaws.services.backup.model.AWSBackupException {
    private static final long serialVersionUID = 1L;

    private String code;
    /**
 */
    private String creatorRequestId;
    /**
 */
    private String arn;
    /**
 */
    private String type;
    /**
 */
    private String context;

    /**
     * Constructs a new AlreadyExistsException with the specified error message.
     *
     * @param message
     *        Describes the error encountered.
     */
    public AlreadyExistsException(String message) {
        super(message);
    }

    /**
     * @param code
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Code")
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * @return
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Code")
    public String getCode() {
        return this.code;
    }

    /**
     * @param code
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AlreadyExistsException withCode(String code) {
        setCode(code);
        return this;
    }

    /**
     *

     *
     * @param creatorRequestId
     */

    @com.fasterxml.jackson.annotation.JsonProperty("CreatorRequestId")
    public void setCreatorRequestId(String creatorRequestId) {
        this.creatorRequestId = creatorRequestId;
    }

    /**
     *

     *
     * @return
     */

    @com.fasterxml.jackson.annotation.JsonProperty("CreatorRequestId")
    public String getCreatorRequestId() {
        return this.creatorRequestId;
    }

    /**
     *

     *
     * @param creatorRequestId
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AlreadyExistsException withCreatorRequestId(String creatorRequestId) {
        setCreatorRequestId(creatorRequestId);
        return this;
    }

    /**
     *

     *
     * @param arn
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Arn")
    public void setArn(String arn) {
        this.arn = arn;
    }

    /**
     *

     *
     * @return
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Arn")
    public String getArn() {
        return this.arn;
    }

    /**
     *

     *
     * @param arn
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AlreadyExistsException withArn(String arn) {
        setArn(arn);
        return this;
    }

    /**
     *

     *
     * @param type
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Type")
    public void setType(String type) {
        this.type = type;
    }

    /**
     *

     *
     * @return
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Type")
    public String getType() {
        return this.type;
    }

    /**
     *

     *
     * @param type
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AlreadyExistsException withType(String type) {
        setType(type);
        return this;
    }

    /**
     *

     *
     * @param context
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Context")
    public void setContext(String context) {
        this.context = context;
    }

    /**
     *

     *
     * @return
     */

    @com.fasterxml.jackson.annotation.JsonProperty("Context")
    public String getContext() {
        return this.context;
    }

    /**
     *

     *
     * @param context
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public AlreadyExistsException withContext(String context) {
        setContext(context);
        return this;
    }

}


text:
import libfhqcli
import fhqtest
import sys, traceback
import base64
import json
from pprint import pprint

test_name = 'Testing Users'

# scoreboard
# users
# user
# user_change_password
# user_create
# user_delete
# user_skills
# user_update
user2_session = None
try:
    fhqtest.print_header(" > > > " + test_name + ": begin ")
    fhqtest.init_enviroment()

    # Cleanup
    user1 = None
    user2 = None
    user3 = None
    user3_test = None

    fhqtest.print_bold("Clean up test data... ")
    users = fhqtest.admin_session.users({"onpage": 10, "page": 0, "filter_text": "user1"})
    users_count = users["count"]
    for usr in users["data"]:
        if usr['email'] == "user1":
            user1 = usr
        if usr['created'] == '':
            fhqtest.log_err("Field created could not be empty for user #" + str(usr['id']))
            exit(-1)

    users = fhqtest.admin_session.users({"onpage": 10, "page": 0, "filter_text": "user2"})
    users_count = users["count"]
    for usr in users["data"]:
        if usr['email'] == "user2":
            user2 = usr
        if usr['created'] == '':
            fhqtest.log_err("Field created could not be empty for user #" + str(usr['id']))
            exit(-1)

    users = fhqtest.admin_session.users({"onpage": 10, "page": 0, "filter_text": "user3"})
    users_count = users["count"]
    for usr in users["data"]:
        if usr['email'] == "user3":
            user3 = usr
        if usr['created'] == '':
            fhqtest.log_err("Field created could not be empty for user #" + str(usr['id']))
            exit(-1)

    users = fhqtest.admin_session.users({"onpage": 10, "page": 0, "filter_text": "user3_test"})
    users_count = users["count"]
    for usr in users["data"]:
        if usr['email'] == "user3_test":
            user3_test = usr
        if usr['created'] == '':
            fhqtest.log_err("Field created could not be empty for user #" + str(usr['id']))
            exit(-1)

    if user1 != None:
        user1_delete = fhqtest.admin_session.user_delete({
            "userid": user1['id'],
            "password": fhqtest.ADMIN_PASSWORD
        })
        fhqtest.check_response(user1_delete, "User1 succesfull removed")
        user1 = None

    if user2 != None:
        fhqtest.admin_session.user_delete({"userid": user2['id'], "password": fhqtest.ADMIN_PASSWORD})
        user2 = None

    if user3 != None:
        fhqtest.admin_session.user_delete({"userid": user3['id'], "password": fhqtest.ADMIN_PASSWORD})
        user3 = None

    if user3_test != None:
        fhqtest.admin_session.user_delete({"userid": user3_test['id'], "password": fhqtest.ADMIN_PASSWORD})
        user3_test = None
    fhqtest.print_success("Cleaned")

    # test create users
    fhqtest.print_bold("Try create user1...")
    user1 = fhqtest.admin_session.users_add({
        "uuid": fhqtest.USER1_UUID,
        "email": "user1",
        "nick": "nick_user1",
        "password": "user1",
        "role": "user"
    })

    fhqtest.alert(user1 == None, 'Could not get response (users_add/user1)')
    fhqtest.check_response(user1, "User1 succesfull created")

    fhqtest.print_bold("Try create user2...")
    user2 = fhqtest.admin_session.users_add({
        "uuid": fhqtest.USER2_UUID,
        "email": "user2",
        "nick": "nick_user2",
        "password": "user2",
        "role": "user"
    })

    fhqtest.alert(user2 == None, 'Could not get response (users_add/user2)')
    fhqtest.check_response(user1, "User2 succesfull created")

    fhqtest.print_bold("Try create user3...")
    user3 = fhqtest.admin_session.users_add({
        "uuid": fhqtest.USER3_UUID,
        "email": "user3",
        "nick": "nick_user3",
        "password": "user3",
        "role": "user"
    })

    fhqtest.alert(user3 == None, 'Could not get response (users_add/user3)');
    fhqtest.check_response(user1, "User3 succesfull created")

    fhqtest.print_bold("Check unique user3 by email...")
    user3_again = fhqtest.admin_session.users_add({
        "uuid": fhqtest.USER3_UUID,
        "email": "user3",
        "nick": "nick_user3_again",
        "password": "user3",
        "role": "user"
    })

    fhqtest.alert(user3_again == None, 'Could not get response (users_add/user3 again)')
    if user3_again['result'] == "DONE":
        fhqtest.log_err("Wrong creating user email must be unique")
    else:
        fhqtest.print_success("User3 again - OK")

    fhqtest.print_bold("Check unique user by uuid...")
    user3_again2 = fhqtest.admin_session.users_add({"uuid": fhqtest.USER3_UUID, "email": "user3_test", "nick": "nick_user3_again", "password": "user3", "role": "user"})
    fhqtest.alert(user3_again2 == None, 'Could not get response (users_add/user3 again2)')
    if user3_again2['result'] == "DONE":
        fhqtest.log_err("Wrong creating user uuid must be unique")
    else:
        fhqtest.print_success("User3 again - OK")

    fhqtest.print_bold("Find user by nick...")
    users = fhqtest.admin_session.users({"onpage": 10, "page": 0, "filter_text": "nick_user2"})
    users_count = users["count"]
    user_found = None
    for usr in users["data"]:
        if usr['email'] == "user2":
            user_found = usr
    fhqtest.alert(user_found == None, 'Could not find user2')
    if user_found != None:
        fhqtest.print_success("User2 found success - OK")

    fhqtest.print_bold("Update user country... ")
    fhqtest.alert(user_found["country"] != "", 'User country must be empty ')

    user2_update = fhqtest.admin_session.user_update({
        "userid": user_found["id"],
        "country": "Some country",
        "university": "Some university",
    })
    fhqtest.alert(user2_update == None, 'Could not find user2')
    fhqtest.check_response(user2_update, "User2 succesfull updated")
    user2_update = user2_update["data"]
    if "country" not in user2_update:
        fhqtest.log_err("Not found field 'country' in response after user update")
        exit(-1)
    elif user2_update["country"] != "Some country":
        fhqtest.log_err("Field 'country' expected value of 'Some country'")
        exit(-1)
    if "university" not in user2_update:
        fhqtest.log_err("Not found field 'university' in response after user update")
        exit(-1)
    elif  user2_update["university"] != "Some university":
        fhqtest.log_err("Field 'university' expected value of 'Some university'")
        exit(-1)
    if "nick" not in user2_update:
        fhqtest.log_err("Not found field 'nick' in response after user update")
        exit(-1)
    if "about" not in user2_update:
        fhqtest.log_err("Not found field 'about' in response after user update")
        exit(-1)
    if "created" not in user2_update:
        fhqtest.log_err("Not found field 'created' in response after user update")
        exit(-1)
    if "region" not in user2_update:
        fhqtest.log_err("Not found field 'region' in response after user update")
        exit(-1)
    if "email" not in user2_update:
        fhqtest.log_err("Not found field 'email' in response after user update")
        exit(-1)
    if "role" not in user2_update:
        fhqtest.log_err("Not found field 'role' in response after user update")
        exit(-1)
    # TODO
    # if "updated" not in user2_update:
    #     fhqtest.log_err("Not found field 'updated' in response after user update")
    #     exit(-1)
    if "uuid" not in user2_update:
        fhqtest.log_err("Not found field 'uuid' in response after user update")
        exit(-1)

    fhqtest.print_bold("Login by user2... ")
    user2_session = libfhqcli.FHQCli(fhqtest.TEST_SERVER)
    user2_login = user2_session.login({"email": "user2", "password": "user2"})
    fhqtest.alert(user2_login == None, 'Could not login as user2')
    fhqtest.alert(user2_login['result'] == 'FAIL', 'Could not login as user2 (fail)')
    if user2_login['result'] == 'DONE':
        fhqtest.print_success("User2 login success - OK")
        user2_session.close()
        user2_session = None

    # deprecated method
    user2_found1 = fhqtest.admin_session.user({"userid": user_found["id"]})
    fhqtest.alert(user2_found1 == None, 'Could not get user2')
    fhqtest.check_response(user2_found1, "User2 succesfull got (1)")
    user2_found1 = user2_found1['data']
    if "email" not in user2_found1:
        fhqtest.log_err("Not found field 'email' in response user2_found1")
        exit(-1)
    elif user2_found1['email'] != 'user2':
        fhqtest.log_err("Expected field 'email' value 'user2', but got '" + user2_found1['email'] + "'")
        exit(-1)

    # TODO
    user2_found2 = fhqtest.admin_session.users_info({"uuid": user_found["id"]})
    fhqtest.alert(user2_found2 == None, 'Could not get user2')
    fhqtest.check_response(user2_found2, "User2 succesfull got (2)")
    if "email" not in user2_found1:
        fhqtest.log_err("Not found field 'email' in response user2_found1")
        exit(-1)
    elif user2_found1['email'] != 'user2':
        fhqtest.log_err("Expected field 'email' value 'user2', but got '" + user2_found1['email'] + "'")
        exit(-1)

    '''curr_user = fhqtest.admin_session.users_info({})
    fhqtest.alert(curr_user == None, 'Could not get user2')
    fhqtest.check_response(curr_user, "User2 succesfull got (2)")
    if "email" not in curr_user:
        fhqtest.log_err("Not found field 'email' in response curr_user")
        exit(-1)
    elif curr_user['email'] != 'user2':
        fhqtest.log_err("Expected field 'email' value 'user2', but got '" + curr_user['email'] + "'")
        exit(-1)'''

    user2_skills = fhqtest.admin_session.user_skills({"userid": user_found["id"], "password": fhqtest.ADMIN_PASSWORD})
    fhqtest.alert(user2_skills == None, 'Could not get user skills')
    fhqtest.check_response(user2_skills, "User2 succesfull got skills")
    pprint(user2_skills)

    user3_remove = fhqtest.admin_session.user_delete({"userid": user3['data']['userid'], "password": fhqtest.ADMIN_PASSWORD})
    fhqtest.alert(user3_remove == None, 'Could not remove user')
    fhqtest.check_response(user3_remove, "User3 succesfull removed")

    user2_remove = fhqtest.admin_session.user_delete({"userid": user_found["id"], "password": fhqtest.ADMIN_PASSWORD})
    fhqtest.alert(user3_remove == None, 'Could not remove user')
    fhqtest.check_response(user3_remove, "User3 succesfull removed")

    # test user_change_password

    # test user login by different password

    # will not test user_reset_password
    # test login
    # test logout
    # test user_skills
    # test scoreboard

except Exception as e:
    fhqtest.log_err(str(e))
    traceback.print_exc(file=sys.stdout)
finally:
    fhqtest.print_header(" < < < " + test_name + ": end ")
    fhqtest.deinit_enviroment()
    if user2_session != None:
        user2_session.close()


text:
#import <Foundation/Foundation.h>
#import "PNStructures.h"

NS_ASSUME_NONNULL_BEGIN

@interface PNResult: NSObject

///------------------------------------------------
/// @name Information
///------------------------------------------------

/**
 @brief Stores HTTP status code with which \c request completed processing with \b PubNub service.

 @since 4.0
 */
@property (nonatomic, readonly, assign) NSInteger statusCode;

/**
 @brief Represent type of operation which has been issued to \b PubNub service and received response stored in
        \c response and processed response in \c data.

 @since 4.0
 */
@property (nonatomic, readonly, assign) PNOperationType operation;

/**
 @brief  Stores whether secured connection has been used to send request or not.

 @since 4.0
 */
@property (nonatomic, readonly, assign, getter = isTLSEnabled) BOOL TLSEnabled;

/**
 @brief  UUID which is currently used by client to identify user on \b PubNub service.

 @since 4.0
 */
@property (nonatomic, readonly, copy) NSString *uuid;

/**
 @brief      Authorization which is used to get access to protected remote resources.
 @discussion Some resources can be protected by \b PAM functionality and access done using this authorization
             key.

 @since 4.0
 */
@property (nonatomic, nullable, readonly, copy) NSString *authKey;

/**
 @brief Stores reference on \b PubNub service host name or IP address against which \c request has been
        called.

 @since 4.0
 */
@property (nonatomic, readonly, copy) NSString *origin;

/**
 @brief Stores reference on copy of original request which has been used to fetch or push data to \b PubNub
        service.

 @since 4.0
 */
@property (nonatomic, nullable, readonly, copy) NSURLRequest *clientRequest;

/**
 @brief  Stringified \c operation value.

 @return Stringified representation for \c operation property which store value from \b PNOperationType.
 */
- (NSString *)stringifiedOperation;

#pragma mark -

@end

NS_ASSUME_NONNULL_END


text:
@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License.  You may obtain a copy of the License at
rem
rem     http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & EXIT /B 1

set "JAVA=%JAVA_HOME%\bin\java.exe"

setlocal
set BASE_DIR=%~dp0
set BASE_DIR=%BASE_DIR:~0,-1%
for %%d in (%BASE_DIR%) do set BASE_DIR=%%~dpd

set CLASSPATH=.;%BASE_DIR%conf;%CLASSPATH%

rem ===========================================================================================
rem JVM Configuration
rem ===========================================================================================
set "JAVA_OPT=%JAVA_OPT% -server -Xms1g -Xmx1g -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m"
set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs="%BASE_DIR%\lib";"%JAVA_HOME%\jre\lib\ext";"%JAVA_HOME%\lib\ext""
set "JAVA_OPT=%JAVA_OPT% -cp "%CLASSPATH%""

"%JAVA%" %JAVA_OPT% %*


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>Angular l10n Specification</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
	      <link rel="stylesheet" href="../styles/style.css">

            Angular l10n Specification
            <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>

<input type="text" placeholder="Type to search">
            <compodoc-menu></compodoc-menu>

                   <compodoc-menu mode="normal"></compodoc-menu>

Injectables

L10nDefaultMissingTranslationHandler

            Info

            Source

File

            projects/angular-l10n/src/lib/services/l10n-missing-translation-handler.ts

Index

Methods

                                    Public
                                handle

        Methods

                            Public
                            handle

                    handle(key: string, value?: string)

Defined in projects/angular-l10n/src/lib/services/l10n-missing-translation-handler.ts:20

                        Parameters :

                                    Name
                                    Type
                                    Optional

                                    key

                                                string

                                        No

                                    value

                                                string

                                        Yes

                        Returns :     string | any

import { Injectable } from '@angular/core';

/**
 * Implement this class-interface to create an handler for missing values.
 */
@Injectable() export abstract class L10nMissingTranslationHandler {

    /**
     * This method must contain the logic to handle missing values.
     * @param key The key that has been requested
     * @param value Null or empty string
     * @return The value
     */
    public abstract handle(key: string, value?: string): string | any;

}

@Injectable() export class L10nDefaultMissingTranslationHandler implements L10nMissingTranslationHandler {

    public handle(key: string, value?: string): string | any {
        return key;
    }

}

 result-matching ""

No results matching ""


text:
<!--

     Copyright 2005-2015 Red Hat, Inc.

     Red Hat licenses this file to you 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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>fabric-project</artifactId>
        <groupId>io.fabric8</groupId>
        <version>1.2.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>fabric-redirect</artifactId>
    <packaging>bundle</packaging>

    <name>Fabric8 :: Redirect</name>

    <properties>
        <fuse.osgi.export>
            io.fabric8.redirect;version="${project.version}"
        </fuse.osgi.export>
        <fuse.osgi.import>
            org.osgi.framework;version="[1.0.0,2.0.0)",
            org.osgi.service.http;version="[1.0.0,2.0.0)";resolution:=optional,
            org.osgi.service.log;version="[1.0.0,2.0.0)",
            org.osgi.util.tracker;version="[1.0.0,2.0.0)",
            *
        </fuse.osgi.import>
        <fuse.osgi.private.pkg>
            io.fabric8.utils
        </fuse.osgi.private.pkg>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric-api</artifactId>
        </dependency>

        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric-utils</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <version>1.9.0</version>
                <executions>
                    <execution>
                        <id>generate-scr-scrdescriptor</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
package com.github.mati1979.play.soyplugin.locale;

import java.util.Optional;
import play.mvc.Http;

import java.util.Locale;

/**
 * Created with IntelliJ IDEA.
 * User: mati
 * Date: 20/06/2013
 * Time: 00:07
 *
 * An interface that resolves locale needed to obtain SoyMsgBundle object.
 */
public interface LocaleProvider {

    Optional<Locale> resolveLocale(Http.Request request);

}


text:
#import "CrashReporter.h"

#import "PLCrashReportTextFormatter.h"

@interface PLCrashReportTextFormatter (PrivateAPI)
NSInteger binaryImageSort(id binary1, id binary2, void *context);
+ (NSString *) formatStackFrame: (PLCrashReportStackFrameInfo *) frameInfo
                     frameIndex: (NSUInteger) frameIndex
                         report: (PLCrashReport *) report;
@end

/**
 * Formats PLCrashReport data as human-readable text.
 */
@implementation PLCrashReportTextFormatter

/**
 * Formats the provided @a report as human-readable text in the given @a textFormat, and return
 * the formatted result as a string.
 *
 * @param report The report to format.
 * @param textFormat The text format to use.
 *
 * @return Returns the formatted result on success, or nil if an error occurs.
 */
+ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat {
	NSMutableString* text = [NSMutableString string];
	boolean_t lp64 = true; // quiesce GCC uninitialized value warning

	/* Header */

    /* Map to apple style OS nane */
    NSString *osName;
    switch (report.systemInfo.operatingSystem) {
        case PLCrashReportOperatingSystemMacOSX:
            osName = @"Mac OS X";
            break;
        case PLCrashReportOperatingSystemiPhoneOS:
            osName = @"iPhone OS";
            break;
        case PLCrashReportOperatingSystemiPhoneSimulator:
            osName = @"Mac OS X";
            break;
        default:
            osName = [NSString stringWithFormat: @"Unknown (%d)", report.systemInfo.operatingSystem];
            break;
    }

    /* Map to Apple-style code type, and mark whether architecture is LP64 (64-bit) */
    NSString *codeType = nil;
    {
        /* Attempt to derive the code type from the binary images */
        for (PLCrashReportBinaryImageInfo *image in report.images) {
            /* Skip images with no specified type */
            if (image.codeType == nil)
                continue;

            /* Skip unknown encodings */
            if (image.codeType.typeEncoding != PLCrashReportProcessorTypeEncodingMach)
                continue;

            switch (image.codeType.type) {
                case CPU_TYPE_ARM:
                    codeType = @"ARM";
                    lp64 = false;
                    break;

                case CPU_TYPE_X86:
                    codeType = @"X86";
                    lp64 = false;
                    break;

                case CPU_TYPE_X86_64:
                    codeType = @"X86-64";
                    lp64 = true;
                    break;

                case CPU_TYPE_POWERPC:
                    codeType = @"PPC";
                    lp64 = false;
                    break;

                default:
                    // Do nothing, handled below.
                    break;
            }

            /* Stop immediately if code type was discovered */
            if (codeType != nil)
                break;
        }

        /* If we were unable to determine the code type, fall back on the legacy architecture value. */
        if (codeType == nil) {
            switch (report.systemInfo.architecture) {
                case PLCrashReportArchitectureARMv6:
                case PLCrashReportArchitectureARMv7:
                    codeType = @"ARM";
                    lp64 = false;
                    break;
                case PLCrashReportArchitectureX86_32:
                    codeType = @"X86";
                    lp64 = false;
                    break;
                case PLCrashReportArchitectureX86_64:
                    codeType = @"X86-64";
                    lp64 = true;
                    break;
                case PLCrashReportArchitecturePPC:
                    codeType = @"PPC";
                    lp64 = false;
                    break;
                default:
                    codeType = [NSString stringWithFormat: @"Unknown (%d)", report.systemInfo.architecture];
                    lp64 = true;
                    break;
            }
        }
    }

    {
        NSString *hardwareModel = @"???";
        if (report.hasMachineInfo && report.machineInfo.modelName != nil)
            hardwareModel = report.machineInfo.modelName;

        [text appendFormat: @"Incident Identifier: [TODO]\n"];
        [text appendFormat: @"CrashReporter Key:   [TODO]\n"];
        [text appendFormat: @"Hardware Model:      %@\n", hardwareModel];
    }

    /* Application and process info */
    {
        NSString *unknownString = @"???";

        NSString *processName = unknownString;
        NSString *processId = unknownString;
        NSString *processPath = unknownString;
        NSString *parentProcessName = unknownString;
        NSString *parentProcessId = unknownString;

        /* Process information was not available in earlier crash report versions */
        if (report.hasProcessInfo) {
            /* Process Name */
            if (report.processInfo.processName != nil)
                processName = report.processInfo.processName;

            /* PID */
            processId = [[NSNumber numberWithUnsignedInteger: report.processInfo.processID] stringValue];

            /* Process Path */
            if (report.processInfo.processPath != nil)
                processPath = report.processInfo.processPath;

            /* Parent Process Name */
            if (report.processInfo.parentProcessName != nil)
                parentProcessName = report.processInfo.parentProcessName;

            /* Parent Process ID */
            parentProcessId = [[NSNumber numberWithUnsignedInteger: report.processInfo.parentProcessID] stringValue];
        }

        [text appendFormat: @"Process:         %@ [%@]\n", processName, processId];
        [text appendFormat: @"Path:            %@\n", processPath];
        [text appendFormat: @"Identifier:      %@\n", report.applicationInfo.applicationIdentifier];
        [text appendFormat: @"Version:         %@\n", report.applicationInfo.applicationVersion];
        [text appendFormat: @"Code Type:       %@\n", codeType];
        [text appendFormat: @"Parent Process:  %@ [%@]\n", parentProcessName, parentProcessId];
    }

    [text appendString: @"\n"];

    /* System info */
    {
        NSString *osBuild = @"???";
        if (report.systemInfo.operatingSystemBuild != nil)
            osBuild = report.systemInfo.operatingSystemBuild;

        [text appendFormat: @"Date/Time:       %@\n", report.systemInfo.timestamp];
        [text appendFormat: @"OS Version:      %@ %@ (%@)\n", osName, report.systemInfo.operatingSystemVersion, osBuild];
        [text appendFormat: @"Report Version:  104\n"];
    }

    [text appendString: @"\n"];

    /* Exception code */
    [text appendFormat: @"Exception Type:  %@\n", report.signalInfo.name];
    [text appendFormat: @"Exception Codes: %@ at 0x%" PRIx64 "\n", report.signalInfo.code, report.signalInfo.address];

    for (PLCrashReportThreadInfo *thread in report.threads) {
        if (thread.crashed) {
            [text appendFormat: @"Crashed Thread:  %ld\n", (long) thread.threadNumber];
            break;
        }
    }

    [text appendString: @"\n"];

    /* Uncaught Exception */
    if (report.hasExceptionInfo) {
        [text appendFormat: @"Application Specific Information:\n"];
        [text appendFormat: @"*** Terminating app due to uncaught exception '%@', reason: '%@'\n",
                report.exceptionInfo.exceptionName, report.exceptionInfo.exceptionReason];

        [text appendString: @"\n"];
    }

    /* Threads */
    PLCrashReportThreadInfo *crashed_thread = nil;
    NSInteger maxThreadNum = 0;
    for (PLCrashReportThreadInfo *thread in report.threads) {
        if (thread.crashed) {
            [text appendFormat: @"Thread %ld Crashed:\n", (long) thread.threadNumber];
            crashed_thread = thread;
        } else {
            [text appendFormat: @"Thread %ld:\n", (long) thread.threadNumber];
        }
        for (NSUInteger frame_idx = 0; frame_idx < [thread.stackFrames count]; frame_idx++) {
            PLCrashReportStackFrameInfo *frameInfo = [thread.stackFrames objectAtIndex: frame_idx];
            [text appendString: [self formatStackFrame: frameInfo frameIndex: frame_idx report: report]];
        }
        [text appendString: @"\n"];

        /* Track the highest thread number */
        maxThreadNum = MAX(maxThreadNum, thread.threadNumber);
    }

    /* If an exception stack trace is available, output a pseudo-thread to provide the frame info */
    if (report.exceptionInfo != nil && report.exceptionInfo.stackFrames != nil && [report.exceptionInfo.stackFrames count] > 0) {
        PLCrashReportExceptionInfo *exception = report.exceptionInfo;
        NSInteger threadNum = maxThreadNum + 1;

        /* Create the pseudo-thread header. We use the named thread format to mark this thread */
        [text appendFormat: @"Thread %ld name:  Exception Backtrace\n", (long) threadNum];
        [text appendFormat: @"Thread %ld:\n", (long) threadNum];

        /* Write out the frames */
        for (NSUInteger frame_idx = 0; frame_idx < [exception.stackFrames count]; frame_idx++) {
            PLCrashReportStackFrameInfo *frameInfo = [exception.stackFrames objectAtIndex: frame_idx];
            [text appendString: [self formatStackFrame: frameInfo frameIndex: frame_idx report: report]];
        }
        [text appendString: @"\n"];
    }

    /* Registers */
    if (crashed_thread != nil) {
        [text appendFormat: @"Thread %ld crashed with %@ Thread State:\n", (long) crashed_thread.threadNumber, codeType];

        int regColumn = 0;
        for (PLCrashReportRegisterInfo *reg in crashed_thread.registers) {
            NSString *reg_fmt;

            /* Use 32-bit or 64-bit fixed width format for the register values */
            if (lp64)
                reg_fmt = @"%6s: 0x%016" PRIx64 " ";
            else
                reg_fmt = @"%6s: 0x%08" PRIx64 " ";

            /* Remap register names to match Apple's crash reports */
            NSString *regName = reg.registerName;
            if (report.machineInfo != nil && report.machineInfo.processorInfo.typeEncoding == PLCrashReportProcessorTypeEncodingMach) {
                PLCrashReportProcessorInfo *pinfo = report.machineInfo.processorInfo;
                cpu_type_t arch_type = pinfo.type & ~CPU_ARCH_MASK;

                /* Apple uses 'ip' rather than 'r12' on ARM */
                if (arch_type == CPU_TYPE_ARM && [regName isEqual: @"r12"]) {
                    regName = @"ip";
                }
            }
            [text appendFormat: reg_fmt, [regName UTF8String], reg.registerValue];

            regColumn++;
            if (regColumn == 4) {
                [text appendString: @"\n"];
                regColumn = 0;
            }
        }

        if (regColumn != 0)
            [text appendString: @"\n"];

        [text appendString: @"\n"];
    }

    /* Images. The iPhone crash report format sorts these in ascending order, by the base address */
    [text appendString: @"Binary Images:\n"];
    for (PLCrashReportBinaryImageInfo *imageInfo in [report.images sortedArrayUsingFunction: binaryImageSort context: nil]) {
        NSString *uuid;
        /* Fetch the UUID if it exists */
        if (imageInfo.hasImageUUID)
            uuid = imageInfo.imageUUID;
        else
            uuid = @"???";

        /* Determine the architecture string */
        NSString *archName = @"???";
        if (imageInfo.codeType != nil && imageInfo.codeType.typeEncoding == PLCrashReportProcessorTypeEncodingMach) {
            switch (imageInfo.codeType.type) {
                case CPU_TYPE_ARM:
                    /* Apple includes subtype for ARM binaries. */
                    switch (imageInfo.codeType.subtype) {
                        case CPU_SUBTYPE_ARM_V6:
                            archName = @"armv6";
                            break;

                        case CPU_SUBTYPE_ARM_V7:
                            archName = @"armv7";
                            break;

                        case CPU_SUBTYPE_ARM_V7S:
                            archName = @"armv7s";
                            break;

                        default:
                            archName = @"arm-unknown";
                            break;
                    }
                    break;

                case CPU_TYPE_X86:
                    archName = @"i386";
                    break;

                case CPU_TYPE_X86_64:
                    archName = @"x86_64";
                    break;

                case CPU_TYPE_POWERPC:
                    archName = @"powerpc";
                    break;

                default:
                    // Use the default archName value (initialized above).
                    break;
            }
        }

        /* Determine if this is the main executable */
        NSString *binaryDesignator = @" ";
        if ([imageInfo.imageName isEqual: report.processInfo.processPath])
            binaryDesignator = @"+";

        /* base_address - terminating_address [designator]file_name arch <uuid> file_path */
        NSString *fmt = nil;
        if (lp64) {
            fmt = @"%18#" PRIx64 " - %18#" PRIx64 " %@%@ %@  <%@> %@\n";
        } else {
            fmt = @"%10#" PRIx64 " - %10#" PRIx64 " %@%@ %@  <%@> %@\n";
        }

        [text appendFormat: fmt,
                            imageInfo.imageBaseAddress,
                            imageInfo.imageBaseAddress + (MAX(1, imageInfo.imageSize) - 1), // The Apple format uses an inclusive range
                            binaryDesignator,
                            [imageInfo.imageName lastPathComponent],
                            archName,
                            uuid,
                            imageInfo.imageName];
    }

    return text;
}

/**
 * Initialize with the request string encoding and output format.
 *
 * @param textFormat Format to use for the generated text crash report.
 * @param stringEncoding Encoding to use when writing to the output stream.
 */
- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding {
    if ((self = [super init]) == nil)
        return nil;

    _textFormat = textFormat;
    _stringEncoding = stringEncoding;

    return self;
}

// from PLCrashReportFormatter protocol
- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError {
    NSString *text = [PLCrashReportTextFormatter stringValueForCrashReport: report withTextFormat: _textFormat];
    return [text dataUsingEncoding: _stringEncoding allowLossyConversion: YES];
}

@end

@implementation PLCrashReportTextFormatter (PrivateMethods)

/**
 * Format a stack frame for display in a thread backtrace.
 *
 * @param frameInfo The stack frame to format
 * @param frameIndex The frame's index
 * @param report The report from which this frame was acquired.
 *
 * @return Returns a formatted frame line.
 */
+ (NSString *) formatStackFrame: (PLCrashReportStackFrameInfo *) frameInfo
                     frameIndex: (NSUInteger) frameIndex
                         report: (PLCrashReport *) report
{
    /* Base image address containing instrumention pointer, offset of the IP from that base
     * address, and the associated image name */
    uint64_t baseAddress = 0x0;
    uint64_t pcOffset = 0x0;
    NSString *imageName = @"\?\?\?";

    PLCrashReportBinaryImageInfo *imageInfo = [report imageForAddress: frameInfo.instructionPointer];
    if (imageInfo != nil) {
        imageName = [imageInfo.imageName lastPathComponent];
        baseAddress = imageInfo.imageBaseAddress;
        pcOffset = frameInfo.instructionPointer - imageInfo.imageBaseAddress;
    }

    return [NSString stringWithFormat: @"%-4ld%-36s0x%08" PRIx64 " 0x%" PRIx64 " + %" PRId64 "\n",
            (long) frameIndex,
            [imageName UTF8String],
            frameInfo.instructionPointer,
            baseAddress,
            pcOffset];
}

/**
 * Sort PLCrashReportBinaryImageInfo instances by their starting address.
 */
NSInteger binaryImageSort(id binary1, id binary2, void *context) {
    uint64_t addr1 = [binary1 imageBaseAddress];
    uint64_t addr2 = [binary2 imageBaseAddress];

    if (addr1 < addr2)
        return NSOrderedAscending;
    else if (addr1 > addr2)
        return NSOrderedDescending;
    else
        return NSOrderedSame;
}

@end


text:
$Title = "VSAN Configuration Maximum VMs Per VSAN Cluster Report"
$Header =  "VSAN Config Max - VMs Per VSAN Cluster"
$Display = "Table"
$Author = "William Lam"
$PluginVersion = 1.1
$PluginCategory = "vSphere"

# Start of Settings
# Percentage threshold to warn?
$vsanWarningThreshold = 50
# End of Settings

# Update settings where there is an override
$vsanWarningThreshold = Get-vCheckSetting $Title "vsanWarningThreshold" $vsanWarningThreshold

# This config maximum is different for each version of VSAN, 3200 for 5.5
$vsanTotalVMsPerClusterMaximum = 3200

foreach ($cluster in $clusviews) {
   if($cluster.ConfigurationEx.VsanConfigInfo.Enabled) {
      $totalVMs = (Get-View -ViewType VirtualMachine -SearchRoot $cluster.MoRef -Property Name).Count
      $checkValue = [int]($totalVMs/$vsanTotalVMsPerClusterMaximum * 100)

      if($checkValue -gt $vsanWarningThreshold) {
         New-Object -TypeName PSObject -Property @{
            "Cluster" = $cluster.Name
            "TotalVMCount" = $totalVMs }
      }
   }
}

$Comments = ("VSAN hosts approaching {0}% limit of {1} VMs per VSAN Cluster" -f $vsanWarningThreshold, $vsanTotalVMsPerClusterMaximum)

# Changelog
## 1.0 : Initial Release
## 1.1 : Add Get-vCheckSetting and code refactor


text:
CKEDITOR.plugins.setLang( 'pastetext', 'it', {
	button: 'Incolla come testo semplice',
	title: 'Incolla come testo semplice'
} );


text:
<?php

namespace Alood\BackBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;

class AlergenoAdmin extends Admin {
	protected function configureListFields(ListMapper $mapper){
	$mapper
		->addIdentifier('id', null, array('label' => 'ID'))
	    ->add('nombre');
	}
	protected function configureDatagridFilters(DatagridMapper $mapper){
	$mapper
	              ->add('nombre');
	}
	protected function configureFormFields(FormMapper $mapper){
	$mapper
		->add('nombre', 'text');
	}

}


text:
using UnityEngine;

/// <summary>
/// These are extensions for Vector2s
/// </summary>
public static class Vector2Extensions
{
    /// <summary>
    /// Returns the value in radians for the Vector2
    /// </summary>
    public static float ToRadians(this Vector2 vector2)
    {
        return Mathf.Atan2(vector2.x, -vector2.y);
    }

    /// <summary>
    /// Returns the value in degrees for the Vector2
    /// </summary>
    public static float ToDegrees(this Vector2 vector2)
    {
        return vector2.ToRadians() * Mathf.Rad2Deg;
    }
}