text:
package latexstudio.editor;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.prefs.PreferenceChangeEvent;
import java.util.prefs.PreferenceChangeListener;
import java.util.prefs.Preferences;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import latexstudio.editor.remote.DbxState;
import latexstudio.editor.util.ApplicationUtils;
import org.apache.commons.io.IOUtils;
import org.fife.ui.autocomplete.AutoCompletion;
import org.fife.ui.autocomplete.BasicCompletion;
import org.fife.ui.autocomplete.CompletionProvider;
import org.fife.ui.autocomplete.DefaultCompletionProvider;
import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle.Messages;
import org.openide.util.NbPreferences;
import org.openide.windows.TopComponent;

/**
 * Top component which displays the editor window.
 */
@ConvertAsProperties(
        dtd = "-//latexstudio.editor//Editor//EN",
        autostore = false
)
@TopComponent.Description(
        preferredID = "EditorTopComponent",
        //iconBase="SET/PATH/TO/ICON/HERE",
        persistenceType = TopComponent.PERSISTENCE_ALWAYS
)
@TopComponent.Registration(mode = "editor", openAtStartup = true)
@ActionID(category = "Window", id = "latexstudio.editor.EditorTopComponent")
@ActionReference(path = "Menu/Window" /*, position = 333 */)
@TopComponent.OpenActionRegistration(
        displayName = "#CTL_EditorAction",
        preferredID = "EditorTopComponent"
)
@Messages({
    "CTL_EditorAction=Editor",
    "CTL_EditorTopComponent=Editor Window",
    "HINT_EditorTopComponent=This is a Editor window"
})
public final class EditorTopComponent extends TopComponent {

    private boolean dirty = false;
    private File currentFile;
    private DbxState dbxState;
    private String latexPath;

    private static final int AUTO_COMPLETE_DELAY = 700;

    public EditorTopComponent() {
        initComponents();
        setName(Bundle.CTL_EditorTopComponent());
        setDisplayName("welcome.tex");
        setToolTipText(Bundle.HINT_EditorTopComponent());
        putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
        putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE);

        Preferences pref = NbPreferences.forModule(LaTeXSettingsPanel.class);
        String path = pref.get("latexPath", "");
        pref.addPreferenceChangeListener(new PreferenceChangeListener() {
            public void preferenceChange(PreferenceChangeEvent evt) {
                if (evt.getKey().equals("latexPath")) {
                    latexPath = evt.getNewValue();
                }
            }
        });

        latexPath = path;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        rSyntaxTextArea = new org.fife.ui.rsyntaxtextarea.RSyntaxTextArea();

        rSyntaxTextArea.setColumns(20);
        rSyntaxTextArea.setRows(5);
        rSyntaxTextArea.setSyntaxEditingStyle(org.openide.util.NbBundle.getMessage(EditorTopComponent.class, "EditorTopComponent.rSyntaxTextArea.syntaxEditingStyle")); // NOI18N
        rSyntaxTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                rSyntaxTextAreaKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                rSyntaxTextAreaKeyTyped(evt);
            }
        });
        jScrollPane1.setViewportView(rSyntaxTextArea);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void rSyntaxTextAreaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_rSyntaxTextAreaKeyReleased
        dirty = true;
    }//GEN-LAST:event_rSyntaxTextAreaKeyReleased

    private void rSyntaxTextAreaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_rSyntaxTextAreaKeyTyped
        if (currentFile == null) return;
        setDisplayName(currentFile.getName() + '*');
    }//GEN-LAST:event_rSyntaxTextAreaKeyTyped

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private org.fife.ui.rsyntaxtextarea.RSyntaxTextArea rSyntaxTextArea;
    // End of variables declaration//GEN-END:variables

    @Override
    public void componentOpened() {
        ApplicationUtils.deleteTempFiles();
        CompletionProvider provider = createCompletionProvider();
        AutoCompletion ac = new AutoCompletion(provider);
        ac.setAutoActivationDelay(AUTO_COMPLETE_DELAY);
        ac.setAutoActivationEnabled(true);
        ac.setAutoCompleteEnabled(true);
        ac.install(rSyntaxTextArea);

        InputStream is = null;
        try {
            is = getClass().getResource("/latexstudio/editor/resources/welcome.tex").openStream();
            String welcomeMessage = IOUtils.toString(is);
            rSyntaxTextArea.setText(welcomeMessage);
            setDirty(true);
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        } finally {
            IOUtils.closeQuietly(is);
        }
    }

    @Override
    public void componentClosed() {
    }

    public String getEditorContent() {
        return rSyntaxTextArea.getText();
    }

    public void setEditorContent(String text) {
        rSyntaxTextArea.setText(text);
        dirty = true;
    }

    public boolean isDirty() {
        return dirty;
    }

    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }

    public void undoAction() {
        rSyntaxTextArea.undoLastAction();
    }

    public void redoAction() {
        rSyntaxTextArea.redoLastAction();
    }

    public File getCurrentFile() {
        return currentFile;
    }

    public void setCurrentFile(File currentFile) {
        this.currentFile = currentFile;
        setDisplayName(currentFile.getName());
    }

    public DbxState getDbxState() {
        return dbxState;
    }

    public void setDbxState(DbxState dbxState) {
        this.dbxState = dbxState;
    }

    public String getLatexPath() {
        return latexPath;
    }

    private String findStartSymbol() {
        String highlightedTextArea2 = null;
        boolean toggle = true;
        int carretCoordinates;
        while (toggle) {
            carretCoordinates = rSyntaxTextArea.getSelectionStart();
            if (rSyntaxTextArea.getSelectedText().startsWith("\n") || rSyntaxTextArea.getSelectionStart() == 0) {
                toggle = false;
                if (rSyntaxTextArea.getSelectionStart() != 0) {
                    rSyntaxTextArea.select(carretCoordinates + 1, rSyntaxTextArea.getSelectionEnd());
                    highlightedTextArea2 = rSyntaxTextArea.getSelectedText();
                    return highlightedTextArea2;
                } else {
                    rSyntaxTextArea.select(carretCoordinates, rSyntaxTextArea.getSelectionEnd());
                    highlightedTextArea2 = rSyntaxTextArea.getSelectedText();
                    return highlightedTextArea2;
                }

            } else {
                carretCoordinates--;
                rSyntaxTextArea.select(carretCoordinates, rSyntaxTextArea.getSelectionEnd());

            }

        }
        highlightedTextArea2 = rSyntaxTextArea.getSelectedText();
        return highlightedTextArea2;
    }

    public void commentOutText() {
        String highlightedTextArea = rSyntaxTextArea.getSelectedText();
        if (highlightedTextArea != null) {
            highlightedTextArea = findStartSymbol();
            if (highlightedTextArea.startsWith("%")) {
                rSyntaxTextArea.replaceSelection(highlightedTextArea.replace("%", ""));

            } else {
                String[] array = highlightedTextArea.split("\n");
                String tempStr = "";
                for (int i = 0; i < array.length; i++) {
                    if (i != array.length - 1) {
                        array[i] = "%" + array[i] + "\n";
                        tempStr = tempStr + array[i];
                    } else {
                        array[i] = "%" + array[i];
                        tempStr = tempStr + array[i];
                    }

                }
                rSyntaxTextArea.replaceSelection(tempStr);
            }
        } else {
            try {
                int currentOffsetFromLineStart = rSyntaxTextArea.getCaretOffsetFromLineStart();
                int currentCaretPosition = 0;
                int lineStartPosition = 0;
                currentCaretPosition = rSyntaxTextArea.getCaretPosition();
                lineStartPosition = currentCaretPosition - currentOffsetFromLineStart;
                int lineLength = rSyntaxTextArea.getLineEndOffsetOfCurrentLine();
                String firstChar = rSyntaxTextArea.getText(lineStartPosition, lineLength - lineStartPosition);
                if (firstChar.startsWith("%")) {
                    rSyntaxTextArea.replaceRange("", lineStartPosition, lineStartPosition + 1);
                } else {
                    rSyntaxTextArea.replaceRange("%", lineStartPosition, lineStartPosition);
                }
            } catch (BadLocationException ex) {
                Exceptions.printStackTrace(ex);
            }
        }

    }

    void writeProperties(java.util.Properties p) {
        // better to version settings since initial version as advocated at
        // http://wiki.apidesign.org/wiki/PropertyFiles
        p.setProperty("version", "1.0");
        // TODO store your settings
    }

    void readProperties(java.util.Properties p) {
        String version = p.getProperty("version");
        // TODO read your settings according to their version
    }

    private CompletionProvider createCompletionProvider() {
        DefaultCompletionProvider provider = new DefaultCompletionProvider();
        provider.setAutoActivationRules(true, "");

        URL[] urls = new URL[3];
        urls[0] = getClass().getResource("/latexstudio/editor/resources/tex.cwl");
        urls[1] = getClass().getResource("/latexstudio/editor/resources/latex-document.cwl");
        urls[2] = getClass().getResource("/latexstudio/editor/resources/latex-mathsymbols.cwl");

        for (URL url : urls) {
            InputStream is = null;
            try {
                is = url.openStream();
                BufferedReader br = new BufferedReader(new InputStreamReader(is));
                String line;
                while ((line = br.readLine()) != null) {
                    if (!line.startsWith("#")) {
                        provider.addCompletion(new BasicCompletion(provider, line.substring(1)));
                    }
                }
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            } finally {
                IOUtils.closeQuietly(is);
            }
        }

        return provider;
    }
}


text:
<?php

// {{{ requires
require_once '../require.php';
require_once CLASS_EX_REALDIR . 'page_extends/admin/basis/LC_Page_Admin_Basis_Holiday_Ex.php';

// }}}
// {{{ generate page

$objPage = new LC_Page_Admin_Basis_Holiday_Ex();
register_shutdown_function(array($objPage, 'destroy'));
$objPage->init();
$objPage->process();

redpajama_set_name: RedPajamaGithub


text:
using MvvmCross.Platform.UI;

namespace MvvmCross.Plugins.Visibility.WindowsPhone
{
    public class MvxWindowsPhoneVisibility : IMvxNativeVisibility
    {
        public object ToNative(MvxVisibility visibility)
        {
            return visibility == MvxVisibility.Visible
                       ? System.Windows.Visibility.Visible
                       : System.Windows.Visibility.Collapsed;
        }
    }
}


text:
package com.brazilianbytes.ctci.algorithm.sort;

import java.util.Comparator;

public interface SortInterface {

	public default <T extends Object> void sort(T[] array, Comparator<T> comparator) {
		throw new UnsupportedOperationException();
	}
}


text:
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto+Condensed:300">
    <link rel="stylesheet" type="text/css" href="../css/alphabase.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">

Express Caller Support

Common questions

Q: How do I call a contact in my phone's address book?

    A: From the main view in the app, first select the country you are calling to and then tap the name of the contact to initiate the call. If you are low on call time you will be prompted with the option to add time.

Q: Why is my phone contact not visible in the app?

    A: Express Caller only displays numbers from your address book starting with international dialing prefixes, i.e. +46 for Sweden, +1 for USA etc. Make sure the contacts you want to call are saved in an international format in your phone's address book. Otherwise simply update them and restart the Experess caller app.

Q: Is Express Caller free to use?

    A: The app is free to download. You need to buy calling time to your calling destination from inside the app.


text:
using DSGE, ModelConstructors, Dates, Plots
fn = dirname(@__FILE__)

# This script shows how to calculate state space systems
# with time-varying information sets and shows how they
# affect forecasts. See the documentation
# for mathematical and theoretical clarifications on
# what we mean precisely by time-varying information sets.

# What do you want to do?
calculate_system = true
modal_forecast   = true
create_plots     = true

## Set up

# Initialize model w/desired dates
m = Model1002("ss10")
usual_model_settings!(m, "200930"; cdvt = "200930", fcast_date = quartertodate("2020-Q3"))
m <= Setting(:use_population_forecast, false)
m <= Setting(:saveroot, joinpath("$(fn)", "..", "save"))
m <= Setting(:dataroot, joinpath("$(fn)", "..", "save", "input_data"))
m <= Setting(:date_forecast_end, quartertodate("2029-Q4"))

if calculate_system
    # Set up two different sets of equilibrium conditions,
    # one of which corresponds to an expected temporary ZLB
    # from 2020:Q3 to 2023:Q4 and another which
    # corresponds to an expected temporary ZLB from
    # 2020:Q3 to 2024:Q4 (one additional year).
    m <= Setting(:replace_eqcond, true) # turn on replace_eqcond and gensys2
    m <= Setting(:gensys2, true)        # to allow temporary alternative policies (namely the ZLB)
    regime_eqcond_info_shortzlb = Dict{Int, EqcondEntry}()
    replace_eqcond_func_dict_shortzlb = Dict()
    for i in 2:(length(DSGE.quarter_range(Date(2020, 9, 30), Date(2023, 12, 31))) + 1)
        # replace_eqcond_func_dict_shortzlb[i] = DSGE.zero_rate_replace_eq_entries
        regime_eqcond_info_shortzlb[i] = EqcondEntry(zero_rate())
    end
    regime_eqcond_info_longzlb = Dict{Int, EqcondEntry}()
    replace_eqcond_func_dict_longzlb = Dict()
    for i in 2:(length(DSGE.quarter_range(Date(2020, 9, 30), Date(2024, 12, 31))) + 1)
        # replace_eqcond_func_dict_longzlb[i] = DSGE.zero_rate_replace_eq_entries
        regime_eqcond_info_longzlb[i] = EqcondEntry(zero_rate())
    end
    m <= Setting(:zero_rate_zlb_value, 0.)
    m <= Setting(:temporary_altpolicy_names, [:zero_rate])

    # Set up regime-switching dates and indices
    regime_dates = Dict{Int, Date}(1 => date_presample_start(m))
    for (i, d) in enumerate(DSGE.quarter_range(Date(2020, 9, 30), Date(2025, 3, 31)))
        # Add regimes for each quarter up to 2025:Q1 b/c the same :regime_dates dictionary
        # will be used when calculating the state-space system for the shorter ZLB policy
        # and the longer ZLB policy. If we added regimes only up to 2024:Q1, then
        # the longer ZLB policy will run into an error.
        regime_dates[i + 1] = d
    end
    m <= Setting(:regime_dates, regime_dates)
    m <= Setting(:regime_switching, true)
    setup_regime_switching_inds!(m)

    ## Calculate state-space system with time-varying information sets

    # First, let's calculate an example where people learn about the short ZLB
    # starting in 2020:Q3. In 2020:Q2 (and before), people do NOT expect a ZLB.
    reg_2024Q1 = get_setting(m, :n_regimes) - 4 # This is the regime corresponding to 2024:Q1
    @assert get_setting(m, :regime_dates)[reg_2024Q1] == Date(2024, 3, 31)

    # How the time-varying information set is constructed:
    # In regime 1, agents only need to use the regime 1 transition equation
    # From 2020:Q3 to 2024:Q1, people need to use the transition equations for 2020:Q3 to 2024:Q1
    # to construct the measurement equation. In 2024:Q2 onward, people again only need to use
    # the current regime's transition equation. Alternatively, since the transition equation
    # in 2024:Q1 is the same as the one in 2024:Q2 - 2025:Q1, we could have also assumed that,
    # during 2020:Q3 to 2024:Q1, people use the transition equation from 2020:Q3 to 2025:Q1.
    # This alternative approach is mathematically equivalent.
    m <= Setting(:tvis_information_set,
                 vcat([1:1],
                      [i:reg_2024Q1 for i in 2:reg_2024Q1],
                      [[i:i] for i in (reg_2024Q1 + 1):get_setting(m, :n_regimes)]...))
    # m <= Setting(:replace_eqcond_func_dict, replace_eqcond_func_dict_shortzlb)
    m <= Setting(:regime_eqcond_info, regime_eqcond_info_shortzlb)
    system_shortzlb = compute_system(m; tvis = true)

    # We could use also these settings to generate the same results.
    # m <= Setting(:tvis_replace_eqcond_func_dict, [replace_eqcond_func_dict_shortzlb])
    # m <= Setting(:tvis_select_system, ones(Int, 7))

    # Note that if :tvis_replace_eqcond_func_dict is already a setting in m,
    # then we use this setting to determine the dictionary of functions for
    # :replace_eqcond_func_dict rather than what is already stored
    # in the setting :replace_eqcond_func_dict.

    # Now, let's calculate an example where people learn about the short ZLB
    # starting in 2020:Q3, but in 2021:Q2, people learn that the long ZLB
    # will go into action.

    # First, we add info about the equilibrium conditions
    reg_2021Q1 = DSGE.subtract_quarters(Date(2021, 3, 31), Date(2020, 9, 30)) + 2
    # m <= Setting(:tvis_replace_eqcond_func_dict, [replace_eqcond_func_dict_shortzlb, replace_eqcond_func_dict_longzlb])
    m <= Setting(:tvis_regime_eqcond_info, [regime_eqcond_info_shortzlb, regime_eqcond_info_longzlb])
    m <= Setting(:tvis_select_system, vcat(ones(Int, reg_2021Q1), # Use set 1 of conditions for regimes up to (and incl.) 2021:Q1
                                           fill(2, get_setting(m, :n_regimes) - reg_2021Q1))) # Use set 2 for remaining regimes

    # Second, we add info about the information sets
    m <= Setting(:tvis_information_set,
                 vcat([1:1], # Regime 1 doesn't change
                      [i:reg_2024Q1 for i in 2:reg_2021Q1], # This is the same as before, but the info set changes after 2021:Q1
                      [i:get_setting(m, :n_regimes) for i in (reg_2021Q1 + 1):get_setting(m, :n_regimes)])) # Now we use regimes to 2025:Q1 for the info set
    system_shortlong_zlb = compute_system(m; tvis = true)

    # Some tests that should pass
    for i in 1:reg_2021Q1
        @assert system_shortzlb[i, :ZZ] == system_shortlong_zlb[i, :ZZ]
        @assert system_shortzlb[i, :TTT] == system_shortlong_zlb[i, :TTT]
        @assert system_shortzlb[i, :ZZ] != system_shortlong_zlb[(reg_2021Q1 + 1), :ZZ]
        @assert system_shortzlb[i, :TTT] != system_shortlong_zlb[(reg_2021Q1 + 1), :TTT]
    end
    for i in (reg_2021Q1 + 1):(get_setting(m, :n_regimes) - 2)
        @assert system_shortzlb[i, :ZZ] != system_shortlong_zlb[i, :ZZ]
        @assert system_shortzlb[i, :TTT] != system_shortlong_zlb[i, :TTT]
    end
    @assert system_shortzlb[get_setting(m, :n_regimes) - 1, :ZZ] ≈ # b/c transition equation matters only for
        system_shortlong_zlb[get_setting(m, :n_regimes) - 1, :ZZ]  # forward expectations in measurement equation
    @assert system_shortzlb[get_setting(m, :n_regimes), :ZZ] ==
        system_shortlong_zlb[get_setting(m, :n_regimes), :ZZ]
    @assert system_shortzlb[get_setting(m, :n_regimes), :TTT] ==
        system_shortlong_zlb[get_setting(m, :n_regimes), :TTT]
end

if modal_forecast
    # Set up in case calculate_system is not true
    if !calculate_system
        m <= Setting(:replace_eqcond, true)
        m <= Setting(:gensys2, true)
        regime_eqcond_info_shortzlb = Dict{Int, EqcondEntry}()
        replace_eqcond_func_dict_shortzlb = Dict()
        for i in 2:(length(DSGE.quarter_range(Date(2020, 9, 30), Date(2023, 12, 31))) + 1)
            # replace_eqcond_func_dict_shortzlb[i] = DSGE.zero_rate_replace_eq_entries
            regime_eqcond_info_shortzlb[i] = EqcondEntry(zero_rate())
        end
        regime_eqcond_info_longzlb = Dict{Int, EqcondEntry}()
        replace_eqcond_func_dict_longzlb = Dict()
        for i in 2:(length(DSGE.quarter_range(Date(2020, 9, 30), Date(2024, 12, 31))) + 1)
            # replace_eqcond_func_dict_longzlb[i] = DSGE.zero_rate_replace_eq_entries
            regime_eqcond_info_longzlb[i] = EqcondEntry(zero_rate())
        end

        regime_dates = Dict{Int, Date}(1 => date_presample_start(m))
        for (i, d) in enumerate(DSGE.quarter_range(Date(2020, 9, 30), Date(2025, 3, 31)))
            regime_dates[i + 1] = d
        end
        m <= Setting(:zero_rate_zlb_value, 0.)
        m <= Setting(:temporary_altpolicy_names, [:zero_rate])

        m <= Setting(:regime_dates, regime_dates)
        m <= Setting(:regime_switching, true)
        setup_regime_switching_inds!(m)
    end

    # Set up two modal forecasts, to show the effect of extending the ZLB
    reg_2024Q1 = get_setting(m, :n_regimes) - 4
    m <= Setting(:tvis_information_set, vcat([1:1], [i:reg_2024Q1 for i in 2:reg_2024Q1],
                                             [[i:i] for i in (reg_2024Q1 + 1):get_setting(m, :n_regimes)]...))
    # m <= Setting(:tvis_replace_eqcond_func_dict, [replace_eqcond_func_dict_shortzlb])
    m <= Setting(:tvis_regime_eqcond_info, [regime_eqcond_info_shortzlb])
    # m <= Setting(:replace_eqcond_func_dict, replace_eqcond_func_dict_shortzlb)
    m <= Setting(:regime_eqcond_info, regime_eqcond_info_shortzlb)

    usual_model_forecast(m, :mode, :none, [:histobs, :forecastobs, :histpseudo, :forecastpseudo];
                         forecast_string = "short", params = [x.value for x in m.parameters],
                         check_empty_columns = false)
    mbobs_short = read_mb(m, :mode, :none, :forecastobs; forecast_string = "short")
    mbpse_short = read_mb(m, :mode, :none, :forecastpseudo; forecast_string = "short")

    reg_2021Q1 = DSGE.subtract_quarters(Date(2021, 3, 31), Date(2020, 9, 30)) + 2
    # m <= Setting(:tvis_replace_eqcond_func_dict, [replace_eqcond_func_dict_shortzlb, replace_eqcond_func_dict_longzlb])
    m <= Setting(:tvis_regime_eqcond_info, [regime_eqcond_info_shortzlb, regime_eqcond_info_longzlb])
    m <= Setting(:tvis_select_system, vcat(ones(Int, reg_2021Q1), fill(2, get_setting(m, :n_regimes) - reg_2021Q1)))
    m <= Setting(:tvis_information_set, vcat([1:1], [i:reg_2024Q1 for i in 2:reg_2021Q1],
                                             [i:get_setting(m, :n_regimes) for i in (reg_2021Q1 + 1):get_setting(m, :n_regimes)]))
    usual_model_forecast(m, :mode, :none, [:histobs, :forecastobs, :histpseudo, :forecastpseudo];
                         forecast_string = "shortlong", params = [x.value for x in m.parameters],
                         check_empty_columns = false)
    mbobs_shortlong = read_mb(m, :mode, :none, :forecastobs; forecast_string = "shortlong")
    mbpse_shortlong = read_mb(m, :mode, :none, :forecastpseudo; forecast_string = "shortlong")

    if create_plots
        plot_dicts = Dict()
        dates = [DSGE.iterate_quarters(d, -1) for d in mbobs_short.means[!, :date]]

        plot_dicts[:obs_gdp] = plot()
        plot!(dates, mbobs_shortlong.means[!, :obs_gdp], color = :black, label = "2024:Q4 ZLB", linewidth = 3)
        plot!(dates, mbobs_short.means[!, :obs_gdp], color = :blue, label = "2023:Q4 ZLB", linewidth = 3)

        plot_dicts[:obs_corepce] = plot()
        plot!(dates, mbobs_shortlong.means[!, :obs_corepce], color = :black, label = "2024:Q4 ZLB", linewidth = 3)
        plot!(dates, mbobs_short.means[!, :obs_corepce], color = :blue, label = "2023:Q4 ZLB", linewidth = 3)

        plot_dicts[:obs_nominalrate] = plot()
        plot!(dates, mbobs_shortlong.means[!, :obs_nominalrate], color = :black, label = "2024:Q4 ZLB", linewidth = 3)
        plot!(dates, mbobs_short.means[!, :obs_nominalrate], color = :blue, label = "2023:Q4 ZLB", linewidth = 3)

        plot_dicts[:obs_longinflation] = plot()
        plot!(dates, mbobs_shortlong.means[!, :obs_longinflation], color = :black, label = "2024:Q4 ZLB", linewidth = 3)
        plot!(dates, mbobs_short.means[!, :obs_longinflation], color = :blue, label = "2023:Q4 ZLB", linewidth = 3)

        plot_dicts[:obs_spread] = plot()
        plot!(dates, mbobs_shortlong.means[!, :obs_spread], color = :black, label = "2024:Q4 ZLB", linewidth = 3)
        plot!(dates, mbobs_short.means[!, :obs_spread], color = :blue, label = "2023:Q4 ZLB", linewidth = 3)

        plot_dicts[:NaturalRate] = plot()
        plot!(dates, mbpse_shortlong.means[!, :NaturalRate], color = :black, label = "2024:Q4 ZLB", linewidth = 3)
        plot!(dates, mbpse_short.means[!, :NaturalRate], color = :blue, label = "2023:Q4 ZLB", linewidth = 3)
    end
end


text:
package "dovecot2" do
  action :install
end

template "/usr/local/etc/dovecot/dovecot.conf" do
  source "dovecot.conf.erb"
  owner "root"
  group "wheel"
  mode 0600
  notifies :restart, "service[dovecot]"
end

# get secrets for mrtazz
secret = Chef::EncryptedDataBagItem.load_secret("/root/.chef/credentials-bag.key")
creds = Chef::EncryptedDataBagItem.load("credentials", "dovecot", secret)
users = creds["users"]

# create the users DB
template "/var/db/dovecot.users" do
  source "passwd-file.erb"
  owner "root"
  group "wheel"
  mode 0600
  variables( :users => users )
  notifies :restart, "service[dovecot]"
end

service "dovecot" do
  supports [:start, :stop, :restart]
  action :enable
end


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PluginInterfaceFixture.cs" company="None">
//   Crispin Parker 2011
// </copyright>
// <summary>
//   Defines the PluginInterfaceFixture type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace TfsWorkbench.VersionCheck.Tests
{
    using System.Linq;

    using NUnit.Framework;

    using Properties;

    using Rhino.Mocks;

    using SharpArch.Testing.NUnit;

    using TfsWorkbench.Core.Interfaces;
    using TfsWorkbench.Core.Services;
    using TfsWorkbench.VersionCheck.Iterfaces;
    using TfsWorkbench.VersionCheck.Services;
    using TfsWorkbench.VersionCheck.Views;

    /// <summary>
    /// The plug in interface test fixture.
    /// </summary>
    [TestFixture]
    public class PluginInterfaceFixture
    {
        /// <summary>
        /// The main view model.
        /// </summary>
        private IMainViewModel mainViewModel;

        /// <summary>
        /// Sets up the test environment.
        /// </summary>
        [SetUp]
        public void SetUp()
        {
            var serviceManager = MockRepository.GenerateMock<IServiceManager>();

            this.mainViewModel = MockRepository.GenerateMock<IMainViewModel>();

            serviceManager
                .Expect(sm => sm.GetService<IMainViewModel>())
                .Return(this.mainViewModel)
                .Repeat.Any();

            ServiceManager.Instance = serviceManager;
        }

        /// <summary>
        /// Tears down the test envrionment.
        /// </summary>
        [TearDown]
        public void TearDown()
        {
            ServiceManager.Instance = null;
        }

        /// <summary>
        /// Command bindings returns a non null empty array.
        /// </summary>
        [Test]
        public void CommandBindings_ReturnsNonNullEmptyArray()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            // Act
            var commands = pluginInterface.CommandBindings;

            // Assert
            commands.ShouldNotBeNull();
            commands.Any().ShouldBeFalse();
        }

        /// <summary>
        /// Control element, returns version control button.
        /// </summary>
        [Test]
        public void ControlElement_ReturnsVersionControlButton()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            // Act
            var controlElement = pluginInterface.ControlElement;

            // Assert
            controlElement.ShouldNotBeNull();
            controlElement.ShouldBeOfType(typeof(VersionCheckButton));
        }

        /// <summary>
        /// Display name, returns expected text.
        /// </summary>
        [Test]
        public void DisplayName_ReturnsExpectedText()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            // Act
            var displayName = pluginInterface.DisplayName;

            // Assert
            displayName.ShouldNotBeNull();
            displayName.ShouldEqual(Resources.String001);
        }

        /// <summary>
        /// Display priority, returns expected number.
        /// </summary>
        [Test]
        public void DisplayPriority_ReturnsExpectedNumber()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            // Act
            var displayPriority = pluginInterface.DisplayPriority;

            // Assert
            displayPriority.ShouldEqual(Settings.Default.DisplayPriority);
        }

        /// <summary>
        /// Menu item, on first call, intilises the menu item.
        /// </summary>
        [Test]
        public void MenuItem_OnFirstCall_InitialisesMenuItem()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            // Act
            var menuItemA = pluginInterface.MenuItem;
            var menuItemB = pluginInterface.MenuItem;

            // Assert
            menuItemA.ShouldNotBeNull();
            menuItemA.ShouldEqual(menuItemB);
        }

        /// <summary>
        /// Menu item, is of expected type.
        /// </summary>
        [Test]
        public void MenuItem_IsExpectedType()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            // Act
            var menuItem = pluginInterface.MenuItem;

            // Assert
            menuItem.ShouldBeOfType(typeof(VersionCheckMenuItem));
        }

        /// <summary>
        /// Menu item, on first call and check on start up is true, performs version check.
        /// </summary>
        [Test]
        public void MenuItem_OnFirstCallAndCheckOnStartUpIsTrue_PerformsVersionCheck()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            this.mainViewModel
                .Expect(mvm => mvm.CheckVersionOnStartUp)
                .Return(true)
                .Repeat.Once();

            this.mainViewModel
                .Expect(mvm => mvm.ExecuteVersionCheck())
                .Repeat.Once();

            // Act
            Assert.IsNotNull(pluginInterface.MenuItem);

            // Assert
            this.mainViewModel.VerifyAllExpectations();
        }

        /// <summary>
        /// Menu item, on first call and check on start up is false, does not perform version check.
        /// </summary>
        [Test]
        public void MenuItem_OnFirstCallAndCheckOnStartUpIsFalse_DoesNotPerformVersionCheck()
        {
            // Arrange
            var pluginInterface = GetPluginInterface();

            this.mainViewModel
                .Expect(mvm => mvm.CheckVersionOnStartUp)
                .Return(false)
                .Repeat.Once();

            this.mainViewModel
                .Expect(mvm => mvm.ExecuteVersionCheck())
                .Repeat.Never();

            // Act
            Assert.IsNotNull(pluginInterface.MenuItem);

            // Assert
            this.mainViewModel.VerifyAllExpectations();
        }

        /// <summary>
        /// Gets the plugin interface.
        /// </summary>
        /// <returns>A new instance of the plugin interface type.</returns>
        private static PluginInterface GetPluginInterface()
        {
            return new PluginInterface();
        }
    }
}


text:
using System.Collections.Generic;

namespace org.apache.lucene.analysis.bg
{

	using TokenFilterFactory = org.apache.lucene.analysis.util.TokenFilterFactory;

	///
	/// Factory for <seealso cref="BulgarianStemFilter"/>.
	///

	/// <fieldType name="text_bgstem" class="solr.TextField" positionIncrementGap="100">
	///   <analyzer>
	///     <tokenizer class="solr.StandardTokenizerFactory"/>
	///     <filter class="solr.LowerCaseFilterFactory"/>
	///     <filter class="solr.BulgarianStemFilterFactory"/>
	///   </analyzer>
	/// </fieldType>

	///
	public class BulgarianStemFilterFactory : TokenFilterFactory
	{

	  ///
	  /// Creates a new BulgarianStemFilterFactory
	  public BulgarianStemFilterFactory(IDictionary<string, string> args) : base(args)
	  {
		if (args.Count > 0)
		{
		  throw new System.ArgumentException("Unknown parameters: " + args);
		}
	  }

	  public override TokenStream create(TokenStream input)
	  {
		return new BulgarianStemFilter(input);
	  }
	}

}


text:
package org.nnsoft.guice.junice;

import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.nnsoft.guice.junice.JUniceRunner;
import org.nnsoft.guice.junice.annotation.Mock;

import com.google.inject.Inject;
import org.nnsoft.guice.junice.data.HelloWorld;
import org.nnsoft.guice.junice.data.TelephonService;

@RunWith( JUniceRunner.class )
public class MockitoFrameworkTestCase
    extends AbstractMockitoTestCase
{

    /*
     * Any NON-static filed will be injecteded before run each tests.
     */
    @Inject
    private HelloWorld helloWorldNotStatic;

    @Mock
    private TelephonService service;

    @BeforeClass
    public static void setUpClass()
    {
    }

    @Test
    public void testInjectNotStatic()
    {
        Assert.assertNotNull( helloWorldNotStatic );
        Assert.assertEquals( "Hello World!!!!", helloWorldNotStatic.sayHallo() );
        Assert.assertNotNull( service );
        Assert.assertNotNull( providedMock );
    }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>script Module — pyslave 0.8 documentation</title>

    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="pyslave 0.8 documentation" href="index.html" />
    <link rel="next" title="Instrument Drivers" href="drivers.html" />
    <link rel="prev" title="instruments Module" href="instruments.html" />

Navigation

          index

          modules |

          next |

          previous |

pyslave 0.8 documentation »

<tt class="xref py py-mod docutils literal">script</tt> Module¶

This module contains helper functions to write slave scripts.

<tt class="descclassname">pyslave.script.</tt><tt class="descname">increment</tt><big>(</big>filename, ndigits=3<big>)</big>¶

Automatically generate filenames with an incremented number

Return a filename with an auto incremented number at the end of the name.
The number is zero padded to have n digits.

<tt class="descclassname">pyslave.script.</tt><tt class="descname">save_txt</tt><big>(</big>source, filename<big>)</big>¶

Save the data from source to a text file.

Filename can be a string or a valid file handle opened for writing.

Source can be a numpy array or an instrument.
If source is an instrument the __save_txt__ method is called and the returned data are saved.

<tt class="descclassname">pyslave.script.</tt><tt class="descname">save_h5</tt><big>(</big>source, filename, dataset='data', attrs={}, **kwargs<big>)</big>¶

Save the data from source to a HDF5 dataset.

Source can be a numpy array or an instrument.
If source is an instrument the __save_h5__ method is called and the returned data are used to create the dataset.
Attributes passed in attrs are added to the dataset attributes.

Filename can be a string or a valid HDF5 file or group opened for writing. The file is flushed after the dataset is inserted.

Optional arguments are passed to the create_dataset function (e.g. compression=’gzip’).

<tt class="descclassname">pyslave.script.</tt><tt class="descname">fetch_txt</tt><big>(</big>instrument, filename, fetch_args={}<big>)</big>¶

Fetch and save data from an instrument to a text file.

The fetch method of the instrument is called with the fetch_args. Then the data are saved as described in save_txt.

<tt class="descclassname">pyslave.script.</tt><tt class="descname">fetch_h5</tt><big>(</big>instrument, filename, fetch_args={}, dataset='data', attrs={}, **kwargs<big>)</big>¶

Fetch and save data from an instrument to a HDF5 file.

The fetch method of the instrument is called with the fetch_args. Then the data are saved as described in save_h5.

Previous topic

<tt class="docutils literal">instruments</tt> Module

Next topic

Instrument Drivers

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

pyslave 0.8 documentation »

        © Copyright 2015, Jérôme Estève.
      Created using Sphinx 1.2.3.


text:
module Giraffi
  class Client
    # Defines methods related to the regions

    module Regions
      # Returns all available regions
      #
      # @requires_apikey Yes
      # @return [HTTParty::Response]
      def find_regions
        self.class.get("/regions.json?apikey=#{apikey}")
      end
    end
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>receiver</title>


text:
namespace Microsoft.Graph
{
    using System;
    using System.Collections.Generic;
    using System.IO;

    /// <summary>
    /// The type WorkbookFunctionsHyperlinkRequestBuilder.
    /// </summary>
    public partial class WorkbookFunctionsHyperlinkRequestBuilder : BaseActionMethodRequestBuilder<IWorkbookFunctionsHyperlinkRequest>, IWorkbookFunctionsHyperlinkRequestBuilder
    {
        /// <summary>
        /// Constructs a new <see cref="WorkbookFunctionsHyperlinkRequestBuilder"/>.
        /// </summary>
        /// <param name="requestUrl">The URL for the request.</param>
        /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
        /// <param name="linkLocation">A linkLocation parameter for the OData method call.</param>
        /// <param name="friendlyName">A friendlyName parameter for the OData method call.</param>
        public WorkbookFunctionsHyperlinkRequestBuilder(
            string requestUrl,
            IBaseClient client,
            Newtonsoft.Json.Linq.JToken linkLocation,
            Newtonsoft.Json.Linq.JToken friendlyName)
            : base(requestUrl, client)
        {
            this.SetParameter("linkLocation", linkLocation, true);
            this.SetParameter("friendlyName", friendlyName, true);
        }

        /// <summary>
        /// A method used by the base class to construct a request class instance.
        /// </summary>
        /// <param name="functionUrl">The request URL to </param>
        /// <param name="options">The query and header options for the request.</param>
        /// <returns>An instance of a specific request class.</returns>
        protected override IWorkbookFunctionsHyperlinkRequest CreateRequest(string functionUrl, IEnumerable<Option> options)
        {
            var request = new WorkbookFunctionsHyperlinkRequest(functionUrl, this.Client, options);

            if (this.HasParameter("linkLocation"))
            {
                request.RequestBody.LinkLocation = this.GetParameter<Newtonsoft.Json.Linq.JToken>("linkLocation");
            }

            if (this.HasParameter("friendlyName"))
            {
                request.RequestBody.FriendlyName = this.GetParameter<Newtonsoft.Json.Linq.JToken>("friendlyName");
            }

            return request;
        }
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="theme" content="hugo-academic">
  <meta name="generator" content="Hugo 0.50" />
  <meta name="author" content="Dang-Khoa">
  <meta name="description" content="Research Assistant">

    <link rel="stylesheet" href="/css/highlight.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha512-6MXa8B6uaO18Hid6blRMetEIoPqHf7Ux1tnyIQdpt9qI5OACx7C+O3IVTr98vwGnlcg0LOLa02i9Y1HpVhlfiw==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.1/css/academicons.min.css" integrity="sha512-NThgw3XKQ1absAahW6to7Ey42uycrVvfNfyjqcFNgCmOCQ5AR4AO0SiXrN+8ZtYeappp56lk1WtvjVmEa+VR6A==" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous">

  <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather%7CRoboto+Mono">
  <link rel="stylesheet" href="/css/hugo-academic.css">

  <link rel="stylesheet" href="/css/custom-theme.css">

  <link rel="alternate" href="" type="application/rss+xml" title="Dang-Khoa's blog ">
  <link rel="feed" href="" type="application/rss+xml" title="Dang-Khoa's blog ">

  <link rel="icon" type="image/png" href="/img/icon.png">
  <link rel="apple-touch-icon" type="image/png" href="/img/apple-touch-icon.png">

  <link rel="canonical" href="http://dangkhoasdc.github.io/publication/gemb/">

  <title>Enhance Feature Discrimination for Unsupervised Hashing | Dang-Khoa's blog </title>

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
              data-target=".navbar-collapse" aria-expanded="false">
        Toggle navigation

      </button>
      Dang-Khoa's blog

            Posts

            Home

            Projects

            Publications

            About

            Notes

            English

                Tiếng Việt

Enhance Feature Discrimination for Unsupervised Hashing

      Tuan Hoang, Thanh-Toan Do, Dang-Khoa Le Tan, Ngai-Man Cheung

Abstract

We propose a novel approach to improve unsupervised hashing. Specifically, we propose an embedding method to enhance the discriminative property of features before passing them into hashing. We propose a very efficient embedding method: Gaussian Mixture Model embedding (Gemb). Gemb embeds feature vector into a low-dimensional vector using Gaussian Mixture Model. Our experiment shows that the proposed method boosts the hashing performance of many state-of-the-art, e.g. Binary Autoencoder (BA), Iterative Quantization (ITQ), in standard evaluation metrics for the three main benchmark datasets.

Type

            Conference proceedings

Publication

ICIP 17

Date

          May, 2017

Links

  PDF

  Code

← An automated framework for counting lymphocytes from microscopic images

Simultaneous Feature Aggregating and Hashing for Large-scale Image Search →

      © 2017 Dang-Khoa ·

      Powered by the Academic
      theme for Hugo.


text:
var http = require('http'),
    path = require('path'),
    express = require('express'),
    twilio = require('twilio');

// Load configuration information from system environment variables.
var TWILIO_ACCOUNT_SID = process.env.TWILIO_ACCOUNT_SID,
    TWILIO_AUTH_TOKEN = process.env.TWILIO_AUTH_TOKEN,
    TWILIO_NUMBER = process.env.TWILIO_NUMBER;

// Create an authenticated client to access the Twilio REST API
var client = twilio(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN);

// Create an Express web application with some basic configuration
var app = express();

app.configure(function(){
    app.set('port', process.env.PORT || 3000);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'ejs');
    app.use(express.favicon());
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(path.join(__dirname, 'public')));
});

// render our home page
app.get('/', function(request, response) {

    // Replace these two arguments with your own account SID and auth token:
    var capability = new twilio.Capability(
        TWILIO_ACCOUNT_SID,
        TWILIO_AUTH_TOKEN
    );
    // Give the capability generator permission to make outbound calls
    capability.allowClientOutgoing('AP9b1001a76c80b78f4fb71baaa8fa0653');
    capability.allowClientIncoming('tommy');

    // Render an HTML page which contains our capability token
    response.render('client_browser', {token:capability.generate()});
});

app.post('/browseroutcall', function(request, response) {
    var resp = new twilio.TwimlResponse();
    var tocall = request.param('tocall'); // custom parameter from Twilio.Device.connect

    resp.dial(
        tocall,
        { callerId:'+31858889347'} //a phone number you've verified with Twilio to use as a caller ID number
    );
    response.set('Content-Type','text/xml');
    response.send(resp.toString());
});

app.get('/dialclient', function(request, response) {
    var resp = new twilio.TwimlResponse();

    resp.dial(function(node){
        node.client('tommy');
    });

    response.set('Content-Type','text/xml');
    response.send(resp.toString());
});

// Start our express app, by default on port 3000
http.createServer(app).listen(app.get('port'), function(){
    console.log("Express server listening on port " + app.get('port'));
});


text:
package org.codehaus.groovy.grails.commons.spring;

import groovy.lang.GroovyObject;
import groovy.lang.GroovySystem;
import groovy.lang.MetaClass;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.ui.context.Theme;
import org.springframework.ui.context.ThemeSource;
import org.springframework.ui.context.support.UiApplicationContextUtils;

/**
 * An ApplicationContext that extends StaticApplicationContext and implements GroovyObject such that
 * beans can be retrieved with the dot de-reference syntax instead of using getBean('name').
 *
 * @author Graeme Rocher
 * @since 1.0
 */
public class GrailsApplicationContext extends GenericApplicationContext implements GroovyObject {

    protected MetaClass metaClass;
    private BeanWrapper ctxBean = new BeanWrapperImpl(this);
    private ThemeSource themeSource;
    private static final String GRAILS_ENVIRONMENT_BEAN_NAME = "springEnvironment";

    public GrailsApplicationContext(DefaultListableBeanFactory defaultListableBeanFactory) {
        super(defaultListableBeanFactory);
        metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(getClass());
    }

    public GrailsApplicationContext(DefaultListableBeanFactory defaultListableBeanFactory, ApplicationContext applicationContext) {
        super(defaultListableBeanFactory, applicationContext);
        metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(getClass());
    }

    public GrailsApplicationContext(org.springframework.context.ApplicationContext parent) throws org.springframework.beans.BeansException {
        super(parent);
        metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(getClass());
    }

    public GrailsApplicationContext() throws org.springframework.beans.BeansException {
        metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(getClass());
    }

    public MetaClass getMetaClass() {
        return metaClass;
    }

    public Object getProperty(String property) {
        if (containsBean(property)) {
            return getBean(property);
        }
        if (ctxBean.isReadableProperty(property)) {
            return ctxBean.getPropertyValue(property);
        }
        return null;
    }

    public Object invokeMethod(String name, Object args) {
        return metaClass.invokeMethod(this, name, args);
    }

    public void setMetaClass(MetaClass metaClass) {
        this.metaClass = metaClass;
    }

    /**
     * Initialize the theme capability.
     */
    @Override
    protected void onRefresh() {
        themeSource = UiApplicationContextUtils.initThemeSource(this);
    }

    public Theme getTheme(String themeName) {
        return themeSource.getTheme(themeName);
    }

    public void setProperty(String property, Object newValue) {
        if (newValue instanceof BeanDefinition) {
            if (containsBean(property)) {
                removeBeanDefinition(property);
            }

            registerBeanDefinition(property, (BeanDefinition)newValue);
        }
        else {
            metaClass.setProperty(this, property, newValue);
        }
    }

    /**
     * Register a singleton bean with the underlying bean factory.
     *
For more advanced needs, register with the underlying BeanFactory directly.
     * @see #getDefaultListableBeanFactory
     */
    public void registerSingleton(String name, Class<?> clazz) throws BeansException {
        GenericBeanDefinition bd = new GenericBeanDefinition();
        bd.setBeanClass(clazz);
        getDefaultListableBeanFactory().registerBeanDefinition(name, bd);
    }

    /**
     * Register a singleton bean with the underlying bean factory.
     *
For more advanced needs, register with the underlying BeanFactory directly.
     * @see #getDefaultListableBeanFactory
     */
    public void registerSingleton(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException {
        GenericBeanDefinition bd = new GenericBeanDefinition();
        bd.setBeanClass(clazz);
        bd.setPropertyValues(pvs);
        getDefaultListableBeanFactory().registerBeanDefinition(name, bd);
    }

    /**
     * Register a prototype bean with the underlying bean factory.
     *
For more advanced needs, register with the underlying BeanFactory directly.
     * @see #getDefaultListableBeanFactory
     */
    public void registerPrototype(String name, Class<?> clazz) throws BeansException {
        GenericBeanDefinition bd = new GenericBeanDefinition();
        bd.setScope(GenericBeanDefinition.SCOPE_PROTOTYPE);
        bd.setBeanClass(clazz);
        getDefaultListableBeanFactory().registerBeanDefinition(name, bd);
    }

    /**
     * Register a prototype bean with the underlying bean factory.
     *
For more advanced needs, register with the underlying BeanFactory directly.
     * @see #getDefaultListableBeanFactory
     */
    public void registerPrototype(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException {
        GenericBeanDefinition bd = new GenericBeanDefinition();
        bd.setScope(GenericBeanDefinition.SCOPE_PROTOTYPE);
        bd.setBeanClass(clazz);
        bd.setPropertyValues(pvs);
        getDefaultListableBeanFactory().registerBeanDefinition(name, bd);
    }

    @Override
    protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) {
        super.prepareBeanFactory(beanFactory);

        // workaround for GRAILS-7851, until Spring allows the environment bean name to be configurable
        ((DefaultListableBeanFactory)beanFactory).destroySingleton(ENVIRONMENT_BEAN_NAME);
        beanFactory.registerSingleton(GRAILS_ENVIRONMENT_BEAN_NAME,getEnvironment());
    }
}


text:
import 'react-native';
import React from 'react';
import ReactShallowRenderer from 'react-test-renderer/shallow';

import App from '../App';

const renderer = new ReactShallowRenderer();

jest.mock('../services/BookManager');

const filterKeys = (state) => {
  if (state.routes) {
    return {
      ...state,
      routes: state.routes.map((route) => {
        const { key, ...others } = route;
        return filterKeys(others);
      }),
    };
  }
  return state;
};

describe('App', () => {
  it('should render itself', () => {
    renderer.render(<App />);
    const tree = renderer.getRenderOutput();
    tree.props.navigation.state = filterKeys(tree.props.navigation.state);
    expect(tree).toMatchSnapshot();
  });
});


text:
import Album from "./Album";
export default class Year {
    year: number;
    albums: Album[];
    constructor(album: Album);
    private sanitize;
}


text:
import { Command } from 'substance'
import { findParentByType } from '../shared/nodeHelpers'

export default class RemoveItemCommand extends Command {
  getCommandState (params, context) {
    let node = this._getNode(params)
    return {
      disabled: !node,
      nodeId: node ? node.id : null
    }
  }

  _getNode (params) {
    const nodeType = this.config.nodeType
    const sel = params.selection
    if (sel && !sel.isNull()) {
      const doc = params.editorSession.getDocument()
      const nodeId = sel.getNodeId()
      if (nodeId) {
        const selectedNode = doc.get(nodeId)
        if (selectedNode) {
          if (selectedNode.type === nodeType) return selectedNode
          return findParentByType(selectedNode, nodeType)
        }
      }
    }
  }
}


text:
package com.intellij.facet;

import com.intellij.facet.impl.ui.FacetTreeModel;
import com.intellij.facet.mock.MockFacetConfiguration;
import com.intellij.facet.mock.MockFacetType;

public class FacetTreeModelTest extends FacetTestCase {
  private FacetTreeModel myModel;

  public void testTopLevelFacets() {
    FacetInfo f1 = create();
    FacetInfo f2 = create();
    FacetInfo f3 = create();

    assertOrderedEquals(myModel.getTopLevelFacets(), f1, f2, f3);
    assertTrue(myModel.getChildren(f1).isEmpty());
    assertTrue(myModel.getChildren(f2).isEmpty());
    assertTrue(myModel.getChildren(f3).isEmpty());
    assertNull(myModel.getParent(f1));
    assertNull(myModel.getParent(f2));
    assertNull(myModel.getParent(f3));
    assertTrue(myModel.hasFacetOfType(null, MockFacetType.ID));
    assertFalse(myModel.hasFacetOfType(f1, MockFacetType.ID));

    assertSame(f2, myModel.findNearestFacet(f1));
    assertSame(f3, myModel.findNearestFacet(f2));
    assertSame(f2, myModel.findNearestFacet(f3));

    myModel.removeFacetInfo(f2);
    assertOrderedEquals(myModel.getTopLevelFacets(), f1, f3);
    assertSame(f3, myModel.findNearestFacet(f1));
    assertSame(f1, myModel.findNearestFacet(f3));

    myModel.removeFacetInfo(f1);
    assertOrderedEquals(myModel.getTopLevelFacets(), f3);
    assertNull(myModel.findNearestFacet(f3));
  }

  public void testNestedFacets() {
    FacetInfo f1 = create();
    FacetInfo f1a = create(f1);
    FacetInfo f1b = create(f1);
    FacetInfo f1a1 = create(f1a);
    FacetInfo f2 = create();
    assertOrderedEquals(myModel.getTopLevelFacets(), f1, f2);
    assertOrderedEquals(myModel.getChildren(f1), f1a, f1b);
    assertOrderedEquals(myModel.getChildren(f1a), f1a1);
    assertOrderedEquals(myModel.getChildren(f2));
    assertOrderedEquals(myModel.getChildren(f1b));

    assertNull(myModel.getParent(f1));
    assertNull(myModel.getParent(f2));
    assertSame(f1, myModel.getParent(f1a));
    assertSame(f1, myModel.getParent(f1b));
    assertSame(f1a, myModel.getParent(f1a1));

    assertTrue(myModel.hasFacetOfType(f1, MockFacetType.ID));
    assertSame(f1a, myModel.findNearestFacet(f1a1));
    assertSame(f1a, myModel.findNearestFacet(f1a1));
  }

  private FacetInfo create(FacetInfo underlying) {
    final FacetInfo info = new FacetInfo(MockFacetType.getInstance(), "239", new MockFacetConfiguration(), underlying);
    myModel.addFacetInfo(info);
    return info;
  }

  private FacetInfo create() {
    return create(null);
  }

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myModel = new FacetTreeModel();
  }

  @Override
  protected void tearDown() throws Exception {
    myModel = null;
    super.tearDown();
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>DefaultStepFunction</title>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.deeplearning4j.nn.conf.stepfunctions

Class DefaultStepFunction

java.lang.Object

org.deeplearning4j.nn.conf.stepfunctions.StepFunction

org.deeplearning4j.nn.conf.stepfunctions.DefaultStepFunction

All Implemented Interfaces:

java.io.Serializable, java.lang.Cloneable

public class DefaultStepFunction
extends StepFunction

Default step function

See Also:

Serialized Form

Constructor Summary

Constructors

Constructor and Description

DefaultStepFunction()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

boolean
equals(java.lang.Object obj)

int
hashCode()

java.lang.String
toString()

Methods inherited from class org.deeplearning4j.nn.conf.stepfunctions.StepFunction

clone

Methods inherited from class java.lang.Object

finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

DefaultStepFunction

public DefaultStepFunction()

Method Detail

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:

equals in class java.lang.Object

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
from toontown.toonbase import TTLocalizer
UNLOCKED = 0
TALK_TO_TOM = 1
DEFEAT_FLUNKY_HQ = 2
TALK_TO_HQ = 3
WRONG_DOOR_HQ = 4
GO_TO_PLAYGROUND = 5
DEFEAT_FLUNKY_TOM = 6
TALK_TO_HQ_TOM = 7
SUIT_APPROACHING = 8
BUILDING_TAKEOVER = 9
SB_DISGUISE_INCOMPLETE = 10
CB_DISGUISE_INCOMPLETE = 11
LB_DISGUISE_INCOMPLETE = 12
BB_DISGUISE_INCOMPLETE = 13
reasonDict = {UNLOCKED: TTLocalizer.FADoorCodes_UNLOCKED,
 TALK_TO_TOM: TTLocalizer.FADoorCodes_TALK_TO_TOM,
 DEFEAT_FLUNKY_HQ: TTLocalizer.FADoorCodes_DEFEAT_FLUNKY_HQ,
 TALK_TO_HQ: TTLocalizer.FADoorCodes_TALK_TO_HQ,
 WRONG_DOOR_HQ: TTLocalizer.FADoorCodes_WRONG_DOOR_HQ,
 GO_TO_PLAYGROUND: TTLocalizer.FADoorCodes_GO_TO_PLAYGROUND,
 DEFEAT_FLUNKY_TOM: TTLocalizer.FADoorCodes_DEFEAT_FLUNKY_TOM,
 TALK_TO_HQ_TOM: TTLocalizer.FADoorCodes_TALK_TO_HQ_TOM,
 SUIT_APPROACHING: TTLocalizer.FADoorCodes_SUIT_APPROACHING,
 BUILDING_TAKEOVER: TTLocalizer.FADoorCodes_BUILDING_TAKEOVER,
 SB_DISGUISE_INCOMPLETE: TTLocalizer.FADoorCodes_SB_DISGUISE_INCOMPLETE,
 CB_DISGUISE_INCOMPLETE: TTLocalizer.FADoorCodes_CB_DISGUISE_INCOMPLETE,
 LB_DISGUISE_INCOMPLETE: TTLocalizer.FADoorCodes_LB_DISGUISE_INCOMPLETE,
 BB_DISGUISE_INCOMPLETE: TTLocalizer.FADoorCodes_BB_DISGUISE_INCOMPLETE}


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

import javax.annotation.Generated;

/**
 * <p>
 * The time unit of the budget, such as MONTHLY or QUARTERLY.
 * </p>
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum TimeUnit {

    DAILY("DAILY"),
    MONTHLY("MONTHLY"),
    QUARTERLY("QUARTERLY"),
    ANNUALLY("ANNUALLY");

    private String value;

    private TimeUnit(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return TimeUnit corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static TimeUnit fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (TimeUnit enumEntry : TimeUnit.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
package org.apache.hadoop.mapreduce.v2.hs.webapp;

import java.io.IOException;
import java.util.Set;

import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.http.JettyUtils;
import org.apache.hadoop.mapreduce.JobACL;
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo;
import org.apache.hadoop.mapreduce.v2.api.records.JobState;
import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
import org.apache.hadoop.mapreduce.v2.api.records.TaskType;
import org.apache.hadoop.mapreduce.v2.app.job.Job;
import org.apache.hadoop.mapreduce.v2.app.job.Task;
import org.apache.hadoop.mapreduce.v2.app.job.TaskAttempt;
import org.apache.hadoop.mapreduce.v2.app.webapp.AMWebServices;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.ConfInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.JobCounterInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.JobTaskAttemptCounterInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.JobTaskCounterInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.MapTaskAttemptInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.ReduceTaskAttemptInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TaskAttemptInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TaskAttemptsInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TaskInfo;
import org.apache.hadoop.mapreduce.v2.app.webapp.dao.TasksInfo;
import org.apache.hadoop.mapreduce.v2.hs.HistoryContext;
import org.apache.hadoop.mapreduce.v2.hs.webapp.dao.AMAttemptInfo;
import org.apache.hadoop.mapreduce.v2.hs.webapp.dao.AMAttemptsInfo;
import org.apache.hadoop.mapreduce.v2.hs.webapp.dao.HistoryInfo;
import org.apache.hadoop.mapreduce.v2.hs.webapp.dao.JobInfo;
import org.apache.hadoop.mapreduce.v2.hs.webapp.dao.JobsInfo;
import org.apache.hadoop.mapreduce.v2.util.MRApps;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.yarn.api.ApplicationClientProtocol;
import org.apache.hadoop.yarn.exceptions.YarnRuntimeException;
import org.apache.hadoop.yarn.logaggregation.ExtendedLogMetaRequest;
import org.apache.hadoop.yarn.server.webapp.WrappedLogMetaRequest;
import org.apache.hadoop.yarn.server.webapp.YarnWebServiceParams;
import org.apache.hadoop.yarn.server.webapp.LogServlet;
import org.apache.hadoop.yarn.server.webapp.WebServices;
import org.apache.hadoop.yarn.webapp.BadRequestException;
import org.apache.hadoop.yarn.webapp.NotFoundException;
import org.apache.hadoop.yarn.webapp.WebApp;

import org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting;
import com.google.inject.Inject;

@Path("/ws/v1/history")
public class HsWebServices extends WebServices {
  private final HistoryContext ctx;
  private WebApp webapp;
  private LogServlet logServlet;

  private @Context HttpServletResponse response;
  @Context UriInfo uriInfo;

  @Inject
  public HsWebServices(final HistoryContext ctx,
      final Configuration conf,
      final WebApp webapp,
      @Nullable ApplicationClientProtocol appBaseProto) {
    super(appBaseProto);
    this.ctx = ctx;
    this.webapp = webapp;
    this.logServlet = new LogServlet(conf, this);
  }

  private boolean hasAccess(Job job, HttpServletRequest request) {
    String remoteUser = request.getRemoteUser();
    if (remoteUser != null) {
      return job.checkAccess(UserGroupInformation.createRemoteUser(remoteUser),
          JobACL.VIEW_JOB);
    }
    return true;
  }

  private void checkAccess(Job job, HttpServletRequest request) {
    if (!hasAccess(job, request)) {
      throw new WebApplicationException(Status.UNAUTHORIZED);
    }
  }

  private void init() {
    //clear content type
    response.setContentType(null);
  }

  @VisibleForTesting
  void setResponse(HttpServletResponse response) {
    this.response = response;
  }

  @GET
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public HistoryInfo get() {
    return getHistoryInfo();
  }

  @GET
  @Path("/info")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public HistoryInfo getHistoryInfo() {
    init();
    return new HistoryInfo();
  }

  @GET
  @Path("/mapreduce/jobs")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public JobsInfo getJobs(@QueryParam("user") String userQuery,
      @QueryParam("limit") String count,
      @QueryParam("state") String stateQuery,
      @QueryParam("queue") String queueQuery,
      @QueryParam("startedTimeBegin") String startedBegin,
      @QueryParam("startedTimeEnd") String startedEnd,
      @QueryParam("finishedTimeBegin") String finishBegin,
      @QueryParam("finishedTimeEnd") String finishEnd) {

    Long countParam = null;
    init();

    if (count != null && !count.isEmpty()) {
      try {
        countParam = Long.parseLong(count);
      } catch (NumberFormatException e) {
        throw new BadRequestException(e.getMessage());
      }
      if (countParam <= 0) {
        throw new BadRequestException("limit value must be greater then 0");
      }
    }

    Long sBegin = null;
    if (startedBegin != null && !startedBegin.isEmpty()) {
      try {
        sBegin = Long.parseLong(startedBegin);
      } catch (NumberFormatException e) {
        throw new BadRequestException("Invalid number format: " + e.getMessage());
      }
      if (sBegin < 0) {
        throw new BadRequestException("startedTimeBegin must be greater than 0");
      }
    }

    Long sEnd = null;
    if (startedEnd != null && !startedEnd.isEmpty()) {
      try {
        sEnd = Long.parseLong(startedEnd);
      } catch (NumberFormatException e) {
        throw new BadRequestException("Invalid number format: " + e.getMessage());
      }
      if (sEnd < 0) {
        throw new BadRequestException("startedTimeEnd must be greater than 0");
      }
    }
    if (sBegin != null && sEnd != null && sBegin > sEnd) {
      throw new BadRequestException(
          "startedTimeEnd must be greater than startTimeBegin");
    }

    Long fBegin = null;
    if (finishBegin != null && !finishBegin.isEmpty()) {
      try {
        fBegin = Long.parseLong(finishBegin);
      } catch (NumberFormatException e) {
        throw new BadRequestException("Invalid number format: " + e.getMessage());
      }
      if (fBegin < 0) {
        throw new BadRequestException("finishedTimeBegin must be greater than 0");
      }
    }
    Long fEnd = null;
    if (finishEnd != null && !finishEnd.isEmpty()) {
      try {
        fEnd = Long.parseLong(finishEnd);
      } catch (NumberFormatException e) {
        throw new BadRequestException("Invalid number format: " + e.getMessage());
      }
      if (fEnd < 0) {
        throw new BadRequestException("finishedTimeEnd must be greater than 0");
      }
    }
    if (fBegin != null && fEnd != null && fBegin > fEnd) {
      throw new BadRequestException(
          "finishedTimeEnd must be greater than finishedTimeBegin");
    }

    JobState jobState = null;
    if (stateQuery != null) {
      jobState = JobState.valueOf(stateQuery);
    }

    return ctx.getPartialJobs(0l, countParam, userQuery, queueQuery,
        sBegin, sEnd, fBegin, fEnd, jobState);
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public JobInfo getJob(@Context HttpServletRequest hsr,
      @PathParam("jobid") String jid) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    return new JobInfo(job);
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/jobattempts")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public AMAttemptsInfo getJobAttempts(@PathParam("jobid") String jid) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    AMAttemptsInfo amAttempts = new AMAttemptsInfo();
    for (AMInfo amInfo : job.getAMInfos()) {
      AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.toString(job
          .getID()), job.getUserName(), uriInfo.getBaseUri().toString(),
          webapp.name());
      amAttempts.add(attempt);
    }
    return amAttempts;
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/counters")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public JobCounterInfo getJobCounters(@Context HttpServletRequest hsr,
      @PathParam("jobid") String jid) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    return new JobCounterInfo(this.ctx, job);
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/conf")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public ConfInfo getJobConf(@Context HttpServletRequest hsr,
      @PathParam("jobid") String jid) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    ConfInfo info;
    try {
      info = new ConfInfo(job);
    } catch (IOException e) {
      throw new NotFoundException("unable to load configuration for job: "
          + jid);
    }
    return info;
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/tasks")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public TasksInfo getJobTasks(@Context HttpServletRequest hsr,
      @PathParam("jobid") String jid, @QueryParam("type") String type) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    TasksInfo allTasks = new TasksInfo();
    for (Task task : job.getTasks().values()) {
      TaskType ttype = null;
      if (type != null && !type.isEmpty()) {
        try {
          ttype = MRApps.taskType(type);
        } catch (YarnRuntimeException e) {
          throw new BadRequestException("tasktype must be either m or r");
        }
      }
      if (ttype != null && task.getType() != ttype) {
        continue;
      }
      allTasks.add(new TaskInfo(task));
    }
    return allTasks;
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/tasks/{taskid}")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public TaskInfo getJobTask(@Context HttpServletRequest hsr,
      @PathParam("jobid") String jid, @PathParam("taskid") String tid) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    Task task = AMWebServices.getTaskFromTaskIdString(tid, job);
    return new TaskInfo(task);

  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/tasks/{taskid}/counters")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public JobTaskCounterInfo getSingleTaskCounters(
      @Context HttpServletRequest hsr, @PathParam("jobid") String jid,
      @PathParam("taskid") String tid) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    TaskId taskID = MRApps.toTaskID(tid);
    if (taskID == null) {
      throw new NotFoundException("taskid " + tid + " not found or invalid");
    }
    Task task = job.getTask(taskID);
    if (task == null) {
      throw new NotFoundException("task not found with id " + tid);
    }
    return new JobTaskCounterInfo(task);
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public TaskAttemptsInfo getJobTaskAttempts(@Context HttpServletRequest hsr,
      @PathParam("jobid") String jid, @PathParam("taskid") String tid) {

    init();
    TaskAttemptsInfo attempts = new TaskAttemptsInfo();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    Task task = AMWebServices.getTaskFromTaskIdString(tid, job);
    for (TaskAttempt ta : task.getAttempts().values()) {
      if (ta != null) {
        if (task.getType() == TaskType.REDUCE) {
          attempts.add(new ReduceTaskAttemptInfo(ta));
        } else {
          attempts.add(new MapTaskAttemptInfo(ta, false));
        }
      }
    }
    return attempts;
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public TaskAttemptInfo getJobTaskAttemptId(@Context HttpServletRequest hsr,
      @PathParam("jobid") String jid, @PathParam("taskid") String tid,
      @PathParam("attemptid") String attId) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    Task task = AMWebServices.getTaskFromTaskIdString(tid, job);
    TaskAttempt ta = AMWebServices.getTaskAttemptFromTaskAttemptString(attId,
        task);
    if (task.getType() == TaskType.REDUCE) {
      return new ReduceTaskAttemptInfo(ta);
    } else {
      return new MapTaskAttemptInfo(ta, false);
    }
  }

  @GET
  @Path("/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/counters")
  @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
  public JobTaskAttemptCounterInfo getJobTaskAttemptIdCounters(
      @Context HttpServletRequest hsr, @PathParam("jobid") String jid,
      @PathParam("taskid") String tid, @PathParam("attemptid") String attId) {

    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    Task task = AMWebServices.getTaskFromTaskIdString(tid, job);
    TaskAttempt ta = AMWebServices.getTaskAttemptFromTaskAttemptString(attId,
        task);
    return new JobTaskAttemptCounterInfo(ta);
  }

  /**
   * Returns the user qualified path name of the remote log directory for
   * each pre-configured log aggregation file controller.
   *
   * @param req                HttpServletRequest
   * @return Path names grouped by file controller name
   */
  @GET
  @Path("/remote-log-dir")
  @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
  public Response getRemoteLogDirPath(@Context HttpServletRequest req,
      @QueryParam(YarnWebServiceParams.REMOTE_USER) String user,
      @QueryParam(YarnWebServiceParams.APP_ID) String appIdStr)
      throws IOException {
    init();
    return logServlet.getRemoteLogDirPath(user, appIdStr);
  }

  @GET
  @Path("/extended-log-query")
  @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
  @InterfaceAudience.Public
  @InterfaceStability.Unstable
  public Response getAggregatedLogsMeta(@Context HttpServletRequest hsr,
      @QueryParam(YarnWebServiceParams.CONTAINER_LOG_FILE_NAME) String fileName,
      @QueryParam(YarnWebServiceParams.FILESIZE) Set<String> fileSize,
      @QueryParam(YarnWebServiceParams.MODIFICATION_TIME) Set<String>
                                              modificationTime,
      @QueryParam(YarnWebServiceParams.APP_ID) String appIdStr,
      @QueryParam(YarnWebServiceParams.CONTAINER_ID) String containerIdStr,
      @QueryParam(YarnWebServiceParams.NM_ID) String nmId) throws IOException {
    init();
    ExtendedLogMetaRequest.ExtendedLogMetaRequestBuilder logsRequest =
        new ExtendedLogMetaRequest.ExtendedLogMetaRequestBuilder();
    logsRequest.setAppId(appIdStr);
    logsRequest.setFileName(fileName);
    logsRequest.setContainerId(containerIdStr);
    logsRequest.setFileSize(fileSize);
    logsRequest.setModificationTime(modificationTime);
    logsRequest.setNodeId(nmId);
    return logServlet.getContainerLogsInfo(hsr, logsRequest);
  }

  @GET
  @Path("/aggregatedlogs")
  @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
  @InterfaceAudience.Public
  @InterfaceStability.Unstable
  public Response getAggregatedLogsMeta(@Context HttpServletRequest hsr,
      @QueryParam(YarnWebServiceParams.APP_ID) String appIdStr,
      @QueryParam(YarnWebServiceParams.APPATTEMPT_ID) String appAttemptIdStr,
      @QueryParam(YarnWebServiceParams.CONTAINER_ID) String containerIdStr,
      @QueryParam(YarnWebServiceParams.NM_ID) String nmId,
      @QueryParam(YarnWebServiceParams.REDIRECTED_FROM_NODE)
      @DefaultValue("false") boolean redirectedFromNode,
      @QueryParam(YarnWebServiceParams.MANUAL_REDIRECTION)
      @DefaultValue("false") boolean manualRedirection) {
    init();
    return logServlet.getLogsInfo(hsr, appIdStr, appAttemptIdStr,
        containerIdStr, nmId, redirectedFromNode, manualRedirection);
  }

  @GET
  @Path("/containers/{containerid}/logs")
  @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
  @InterfaceAudience.Public
  @InterfaceStability.Unstable
  public Response getContainerLogs(@Context HttpServletRequest hsr,
      @PathParam(YarnWebServiceParams.CONTAINER_ID) String containerIdStr,
      @QueryParam(YarnWebServiceParams.NM_ID) String nmId,
      @QueryParam(YarnWebServiceParams.REDIRECTED_FROM_NODE)
      @DefaultValue("false") boolean redirectedFromNode,
      @QueryParam(YarnWebServiceParams.MANUAL_REDIRECTION)
      @DefaultValue("false") boolean manualRedirection) {
    init();

    WrappedLogMetaRequest.Builder logMetaRequestBuilder =
        LogServlet.createRequestFromContainerId(containerIdStr);

    return logServlet.getContainerLogsInfo(hsr, logMetaRequestBuilder, nmId,
        redirectedFromNode, null, manualRedirection);
  }

  @GET
  @Path("/containerlogs/{containerid}/{filename}")
  @Produces({ MediaType.TEXT_PLAIN + "; " + JettyUtils.UTF_8 })
  @InterfaceAudience.Public
  @InterfaceStability.Unstable
  public Response getContainerLogFile(@Context HttpServletRequest req,
      @PathParam(YarnWebServiceParams.CONTAINER_ID) String containerIdStr,
      @PathParam(YarnWebServiceParams.CONTAINER_LOG_FILE_NAME)
          String filename,
      @QueryParam(YarnWebServiceParams.RESPONSE_CONTENT_FORMAT)
          String format,
      @QueryParam(YarnWebServiceParams.RESPONSE_CONTENT_SIZE)
          String size,
      @QueryParam(YarnWebServiceParams.NM_ID) String nmId,
      @QueryParam(YarnWebServiceParams.REDIRECTED_FROM_NODE)
      @DefaultValue("false") boolean redirectedFromNode,
      @QueryParam(YarnWebServiceParams.MANUAL_REDIRECTION)
      @DefaultValue("false") boolean manualRedirection) {
    init();
    return logServlet.getLogFile(req, containerIdStr, filename, format, size,
        nmId, redirectedFromNode, null, manualRedirection);
  }

  @VisibleForTesting
  LogServlet getLogServlet() {
    return this.logServlet;
  }

  @VisibleForTesting
  void setLogServlet(LogServlet logServlet) {
    this.logServlet = logServlet;
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:drawable="@color/transparent_40_black"/>
    <item android:drawable="@drawable/mask_bitmap_repeat"/>

</layer-list>


text:
require 'graph'
class Digraph < Graph

  def initialize options={}
    options[:directed] = true
    super options
  end

end


text:
import Vue from 'vue'
import FamousVue from '../src/FamousVue'
import '../src/Twitterus'
import assert from 'assert'
import '../src/Carousel'

Vue.config.debug = true

new Vue({
  el: 'body',
  methods:{
    testNode: function(){
        this.$refs.testNode.sizeMode = 'render,absolute,default'
        assert.equal(this.$refs.testNode.sizeMode[0], 'render')
        assert.equal(this.$refs.testNode.sizeMode[1], 'absolute')
        assert.equal(this.$refs.testNode.sizeMode[2], 'relative')

        assert.equal(this.$refs.testNode.location, 'body/0', 'get location failed')
        assert.equal(this.$refs.testNode.id, 'body/0', 'get id failed')

        assert.equal(typeof this.$refs.testNode.emit, 'function', 'emit is not a function')

        assert.equal(typeof this.$refs.testNode.value, 'object', 'value doesnt return an object')

        assert.equal(this.$refs.testNode.children.length, 0, 'children is not empty')

        assert.equal(typeof this.$refs.testNode.parent, 'object', 'parent is not an object')
        assert.equal(this.$refs.testNode.parent.constructor.name, 'Scene')

        assert.equal(typeof this.$refs.testNode.requestUpdate, 'function')
        assert.equal(typeof this.$refs.testNode.requestUpdateOnNextTick, 'function')

        assert.equal(this.$refs.testNode.isMounted(), true)

        assert.equal(this.$refs.testNode.isShown(), true)

        this.$refs.testNode.opacity = 0.7
        assert.equal(this.$refs.testNode.opacity, 0.7)

        this.$refs.testNode.mountPoint = "0,1,1"
        assert.equal(this.$refs.testNode.mountPoint[0], 0)
        assert.equal(this.$refs.testNode.mountPoint[1], 1)
        assert.equal(this.$refs.testNode.mountPoint[2], 0.5)

        this.$refs.testNode.mountPoint = [1,0,0]
        assert.equal(this.$refs.testNode.mountPoint[0], 1)
        assert.equal(this.$refs.testNode.mountPoint[1], 0)
        assert.equal(this.$refs.testNode.mountPoint[2], -0.5)

        let currentAlignt = this.$refs.testNode.align
        this.$refs.testNode.align = "1"
        assert.equal(this.$refs.testNode.align[0], 1)
        assert.equal(this.$refs.testNode.align[1], currentAlignt[1])
        assert.equal(this.$refs.testNode.align[2], currentAlignt[2])

        currentAlignt = this.$refs.testNode.align
        this.$refs.testNode.align = "0.5,1"
        assert.equal(this.$refs.testNode.align[0], 0.5)
        assert.equal(this.$refs.testNode.align[1], 1)
        assert.equal(this.$refs.testNode.align[2], currentAlignt[2])

        this.$refs.testNode.align = "0,0.5,1"
        assert.equal(this.$refs.testNode.align[0], 0)
        assert.equal(this.$refs.testNode.align[1], 0.5)
        assert.equal(this.$refs.testNode.align[2], 0.5)

        this.$refs.testNode.align = [1, 0, 0]
        assert.equal(this.$refs.testNode.align[0], 1)
        assert.equal(this.$refs.testNode.align[1], 0)
        assert.equal(this.$refs.testNode.align[2], -0.5)

        let currentPosition = this.$refs.testNode.position
        this.$refs.testNode.position = "400"
        assert.equal(this.$refs.testNode.position[0], 400)
        assert.equal(this.$refs.testNode.position[1], currentPosition[1])
        assert.equal(this.$refs.testNode.position[2], currentPosition[2])

        currentPosition = this.$refs.testNode.position
        this.$refs.testNode.position = "700,200"
        assert.equal(this.$refs.testNode.position[0], 700)
        assert.equal(this.$refs.testNode.position[1], 200)
        assert.equal(this.$refs.testNode.position[2], currentPosition[2])

        this.$refs.testNode.position = "900,100,300"
        assert.equal(this.$refs.testNode.position[0], 900)
        assert.equal(this.$refs.testNode.position[1], 100)
        assert.equal(this.$refs.testNode.position[2], 300)

        this.$refs.testNode.position = [20, 800, 98]
        assert.equal(this.$refs.testNode.position[0], 20)
        assert.equal(this.$refs.testNode.position[1], 800)
        assert.equal(this.$refs.testNode.position[2], 98)

        this.$refs.testNode.position = [77, 11]
        assert.equal(this.$refs.testNode.position[0], 77)
        assert.equal(this.$refs.testNode.position[1], 11)
        assert.equal(this.$refs.testNode.position[2], 98)

        console.info('end of testNode')
    },
    testDOMElement: function(){
        assert.equal(typeof this.$refs.testDom.value, 'object')
        assert.equal(typeof this.$refs.testDom.onUpdate, 'function')
        assert.equal(typeof this.$refs.testDom.onMount, 'function')
        assert.equal(typeof this.$refs.testDom.onDismount, 'function')
        assert.equal(typeof this.$refs.testDom.onShow, 'function')

        this.$refs.testDom.cutOutState = true
        this.$refs.testDom.cutOutState = false

        assert.equal(typeof this.$refs.testDom.onTransformChange, 'function')
        assert.equal(typeof this.$refs.testDom.onSizeChange, 'function')
        assert.equal(typeof this.$refs.testDom.onOpacityChange, 'function')
        assert.equal(typeof this.$refs.testDom.onAddUIEvent, 'function')
        assert.equal(typeof this.$refs.testDom.onRemoveUIEvent, 'function')
        assert.equal(typeof this.$refs.testDom.preventDefault, 'function')
        assert.equal(typeof this.$refs.testDom.allowDefault, 'function')
        assert.equal(typeof this.$refs.testDom.onSizeModeChange, 'function')

        assert.equal(typeof this.$refs.testDom.renderSize, 'object')

        this.$refs.testDom.addClass('button')
        assert.equal(this.$refs.testDom.value.classes[1], 'button')
        assert.equal(this.$refs.testDom.hasClass('button'), true)

        this.$refs.testDom.removeClass('button')
        assert.equal(this.$refs.testDom.value.classes.length, 1)
        assert.equal(this.$refs.testDom.hasClass('button'), false)

        this.$refs.testDom.attributes = {href:'localhost'}
        assert.equal(this.$refs.testDom.value.attributes.href, 'localhost')

        this.$refs.testDom.cssproperties = {
            backgroundColor: 'green'
        }
        assert.equal(this.$refs.testDom.value.styles.backgroundColor, 'green')

        this.$refs.testDom.id = "divMain"
        assert.equal(this.$refs.testDom.value.id, 'divMain')

        this.$refs.testDom.content = "haloo"

        assert.equal(this.$refs.testDom.value.content, 'haloo')

        assert.equal(typeof this.$refs.testDom.on, 'function')
        assert.equal(typeof this.$refs.testDom.onReceive, 'function')

        this.$refs.domnode.align = [0.5, 0.7]

        this.$refs.testDom.classes = "button"
        assert.equal(this.$refs.testDom.value.classes[1], 'button')

        console.info('end of testDOMElement')
    }
  },
  ready: function(){

    this.testNode()
    this.testDOMElement()

    console.info('End of tests')
  }
})


text:
package org.brickred.socialauth.plugin;

import org.brickred.socialauth.util.ProviderSupport;

/**
 * This interface represents the Plugin. All plugins should be inherited from
 * this interface.
 *
 * @author tarun.nagpal
 *
 */
public interface Plugin {

	/**
	 * Retrieves the provider support object. provider support object provides
	 * the functionality to make OAuth HTTP call for a given provider.
	 *
	 * @return
	 */
	public ProviderSupport getProviderSupport();

	/**
	 * Updates the {@link ProviderSupport}
	 *
	 * @param providerSupport
	 *            provider support object
	 */
	public void setProviderSupport(ProviderSupport providerSupport);

}


text:
package nl.knaw.huygens.timbuctoo.search.description.propertyparser;

import nl.knaw.huygens.timbuctoo.model.Datable;
import nl.knaw.huygens.timbuctoo.search.description.PropertyParser;
import org.apache.commons.lang3.StringUtils;

class DatableFromYearPropertyParser implements PropertyParser {

  @Override
  public String parse(String value) {
    if (value == null) {
      return null;
    }

    Datable datable = deserializeDatable(value);

    return datable.isValid() ? String.valueOf(datable.getFromYear()) : null;
  }

  @Override
  public Comparable<?> parseForSort(String value) {
    if (value == null) {
      return null;
    }

    Datable datable = deserializeDatable(value);

    return datable.isValid() ?  datable.getFromYear() : null;
  }

  private Datable deserializeDatable(String value) {
    String cleanedValue = StringUtils.strip(value, "\"");
    return new Datable(cleanedValue);
  }
}


text:
var h = require('hyperscript')
var u = require('../util')
var pull = require('pull-stream')
var pullSort = require('pull-sort')
var Scroller = require('pull-scroll')

exports.needs = {
  message_render: 'first',
  message_compose: 'first',
  ting_myskills: 'first',
  sbot_get: 'first',
  sbot_query: 'first',
  avatar_profile: 'first',
  avatar_name:"first",
  avatar_link: "first",
  ting_allskills: "first",
  avatar_description: "first"
}

exports.gives = {
  builtin_tabs: true,
  menu_items: true,
  screen_view: true
}

exports.create = function (api) {
  return {
    builtin_tabs: function () {
      return ['/inquiries']
    },

    menu_items: function () {
      return h('a', {href: '#/collaborators'}, '/collaborators')
    },

    screen_view: function (path, opts) {
      if (path !== '/collaborators') return

      function switchUser(ev) {
        if (ev) ev.preventDefault()

        var selectedUser = this

        var oldEL = document.getElementById("fetchMe2");

        var content = h('div.scroller__content__filter#fetchMe2')
        oldEL.parentNode.replaceChild(content, oldEL);

        pull(
          api.sbot_query({query: [
            {"$filter": {
              "value":{
                "content": {
                  "sk0rg": selectedUser.key,
                  //  "adopted": true    TODO henry
                }
              }
            }},
            {"$map": {
              "author": ["value","author"]
            }}
          ]}),
          pull.unique("author"),
          pull.drain(function(msg) {
            content.appendChild(h('div.message_inquiry.userfilter_wrapper', h("div.userfilter_author",api.avatar_link(msg.author, api.avatar_name(msg.author))),  h("div.userfilter_description", api.avatar_description(msg.author))))
          })
        )

      }

      var self_id = require('../keys').id
      var skillSwitchers = h('div')

      var skillFields2 = h('div.skill_wrapper')
      pull(
        api.ting_allskills(),
        pull.filter(function(obj) { return obj.value.content.type === "sk0rg" }),
        pullSort(function(a, b){
          var a = a.value.content.name.toLowerCase()
          var b = b.value.content.name.toLowerCase()
          if(a < b) return -1;
          if(a > b) return 1;
          return 0;
        }),
        pull.drain(function(skMsg) {
          skillFields2.appendChild(
            h('div.skill_object.float',
              h('a',{href:'#', onclick: switchUser.bind(skMsg)}, skMsg.value.content.name)
            )
          )
        })
      )

      //     api.ting_myskills(self_id, function(err, mySkills) {//
      //
      //        if (err) {throw error; return}
      //
      //      mySkills = mySkills.map(function(msg) { return msg.value.content.sk0rg })
      //
      //
      //      mySkills.forEach(function(skID) {
      //
      //          api.sbot_get(skID, function(err, skMsg) {
      //          if(err) { throw err; return}
      //
      //          skMsg.key = skID
      //          skillSwitchers.appendChild( h('div.skill_object.float',
      //            h('a',{href:'#', onclick: switchUser.bind(skMsg)}, skMsg.content.name)))
      //        })
      //      })
      //    })

      var content = h('div.scroller__content__filter#fetchMe2')
      var div = h('div.column.scroller',
        {style: {'overflow': 'auto'}},
        h('div',
          h('div.profile_headline.float.clear', 'skill filter:'),
          skillFields2),

        h('div.scroller__wrapper', content)
      )

      // ugly hack because div needs to be returned first
      setTimeout(function() {
        switchUser()
      }, 100)

      return div
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>dcm4che</groupId>
    <artifactId>dcm4chee-xdsb-src</artifactId>
    <version>0.0.1-jbossws302</version>
  </parent>
  <groupId>dcm4che</groupId>
  <artifactId>dcm4chee-xdsb-src-mbean</artifactId>
  <version>0.0.1-jbossws302</version>
  <packaging>jboss-sar</packaging>
  <name>JMX service for XDS.b Document Source Actor</name>
  <build>
    <plugins>
      <plugin>
	  <groupId>org.codehaus.mojo</groupId>
	  <artifactId>jboss-packaging-maven-plugin</artifactId>
	  <version>2.0-SNAPSHOT</version>
	  <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>dcm4che</groupId>
      <artifactId>dcm4chee-xds-common</artifactId>
      <version>0.0.1-jbossws302</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>dcm4che</groupId>
	  <artifactId>dcm4che-core</artifactId>
	  <version>2.0.14</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>dcm4che</groupId>
	  <artifactId>dcm4che-audit</artifactId>
	  <version>2.0.14</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-jmx</artifactId>
      <version>4.0.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-system</artifactId>
      <version>4.0.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-common</artifactId>
      <version>4.2.2.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.ws</groupId>
      <artifactId>jbossws-common</artifactId>
      <version>1.0.5.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.ws.native</groupId>
      <artifactId>jbossws-native-core</artifactId>
      <version>3.0.2.GA</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.soap</groupId>
      <artifactId>saaj-api</artifactId>
      <version>1.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.ws.native</groupId>
        <artifactId>jbossws-native-jaxws</artifactId>
        <version>3.0.2.GA</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
      <version>1.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>


text:
package de.vandermeer.skb.examples.asciitable.examples;

import org.apache.commons.lang3.text.StrBuilder;

import de.vandermeer.asciitable.AsciiTable;
import de.vandermeer.skb.interfaces.StandardExampleAsCmd;

/**
 * AsciiTable example for a simple table as getting started example.
 *
 * @author     Sven van der Meer <vdmeer.sven@mykolab.com>
 *
 *
 */
public class AT_01f_5Columns implements StandardExampleAsCmd {

	@Override
	public void showOutput(){
		// tag::example[]
		AsciiTable at = new AsciiTable();
		at.addRule();
		at.addRow("row1 (col1)", "text (col2)", "text (col3)", "text (col4)", "text (col5)");
		at.addRule();
		at.addRow("row2 (col1)", "text (col2)", "text (col3)", "text (col4)", "text (col5)");
		at.addRule();
		System.out.println(at.render());
		// end::example[]
	}

	@Override
	public StrBuilder getSource(){
		String[] source = new String[]{
				"AsciiTable at = new AsciiTable();",
				"at.addRule();",
				"at.addRow(\"row1 (col1)\", \"text (col2)\", \"text (col3)\", \"text (col4)\", \"text (col5)\");",
				"at.addRule();",
				"at.addRow(\"row2 (col1)\", \"text (col2)\", \"text (col3)\", \"text (col4)\", \"text (col5)\");",
				"at.addRule();",
				"System.out.println(at.render());",
		};
		return new StrBuilder().appendWithSeparators(source, "\n");
	}

	@Override
	public String getDescription() {
		return "table with 5 columns";
	}

	@Override
	public String getID() {
		return "5cols";
	}
}