text:
/* =========================== */
/* === Super Light Toolbar === */
/* =========================== */
.super-light-toolbar .toolbar, .super-light-toolbar .popup-content, #pad_title  {
  --text-color: var(--super-dark-color);
  --text-soft-color: var(--dark-color);
  --border-color: #e4e6e9;
  --bg-soft-color: var(--light-color);
  --bg-color: var(--super-light-color);
}
/* ===================== */
/* === Light Toolbar === */
/* ===================== */
.light-toolbar .toolbar, .light-toolbar .popup-content, #pad_title {
  --text-color: var(--super-dark-color);
  --text-soft-color: var(--dark-color);
  --border-color: var(--middle-color);
  --bg-soft-color: var(--super-light-color);
  --bg-color: var(--light-color);
}
/* ========================== */
/* === Super Dark Toolbar === */
/* ========================== */
.super-dark-toolbar .toolbar, .super-dark-toolbar .popup-content, #pad_title {
  --text-color: var(--super-light-color);
  --text-soft-color: var(--light-color);
  --border-color: var(--dark-color);
  --bg-soft-color: var(--dark-color);
  --bg-color: var(--super-dark-color);
}
.super-dark-toolbar.super-dark-editor .popup-content {
  border: 1px solid var(--dark-color);
  box-shadow: none;
}
/* ==================== */
/* === Dark Toolbar === */
/* ==================== */
.dark-toolbar .toolbar, .dark-toolbar .popup-content, #pad_title  {
  --text-color: var(--super-light-color);
  --text-soft-color: var(--light-color);
  --border-color: var(--super-dark-color);
  --bg-soft-color: var(--super-dark-color);
  --bg-color: var(--dark-color);
}

/* ============================ */
/* == Super Light Background == */
/* ============================ */
.super-light-background #editorcontainerbox, .super-light-background #sidediv,
.super-light-background #chatbox, .super-light-background #outerdocbody, .super-light-background {
  --text-color: var(--super-dark-color);
  --text-soft-color: var(--dark-color);
  --border-color: #e4e6e9;
  --bg-soft-color: var(--light-color);
  --bg-color: var(--super-light-color);
}
.super-light-background  body, .full-width-editor.super-light-editor body:not(.comments-active) {
  --scrollbar-bg: var(--super-light-color);
  --scrollbar-track: var(--light-color);
  --scrollbar-thumb: var(--dark-color);
}
.super-light-background .compact-display-content {
  background-color: var(--super-light-color);
}
/* ====================== */
/* == Light Background == */
/* ====================== */
.light-background #editorcontainerbox, .light-background #sidediv,
.light-background #chatbox, .light-background #outerdocbody, .light-background {
  --text-color: var(--super-dark-color);
  --text-soft-color: var(--dark-color);
  --border-color: var(--middle-color);
  --bg-soft-color: var(--super-light-color);
  --bg-color: var(--light-color);
}
.light-background  body, .full-width-editor.light-editor body:not(.comments-active) {
  --scrollbar-bg: var(--light-color);
  --scrollbar-track: var(--super-light-color);
  --scrollbar-thumb: var(--dark-color);
}
.light-background .compact-display-content {
  background-color: var(--light-color);
}
/* =========================== */
/* == Super Dark Background == */
/* =========================== */
.super-dark-background #editorcontainerbox, .super-dark-background #sidediv,
.super-dark-background #chatbox, .super-dark-background #outerdocbody, .super-dark-background {
  --text-color: var(--super-light-color);
  --text-soft-color: var(--light-color);
  --border-color: var(--dark-color);
  --bg-soft-color: var(--dark-color);
  --bg-color: var(--super-dark-color);
}
.super-dark-background body, .full-width-editor.super-dark-editor body:not(.comments-active) {
  --scrollbar-bg: var(--super-dark-color);
  --scrollbar-track: var(--dark-color);
  --scrollbar-thumb: var(--light-color);
}
.super-dark-background .compact-display-content {
  background-color: var(--super-dark-color);
}
/* Special combinaison with toolbar */
.super-dark-background.super-dark-toolbar .popup-content {
  border: 1px solid var(--dark-color);
  box-shadow: none;
}
/* ===================== */
/* == Dark Background == */
/* ===================== */
.dark-background #editorcontainerbox, .dark-background #sidediv,
.dark-background #chatbox, .dark-background #outerdocbody, .dark-background  {
  --text-color: var(--super-light-color);
  --text-soft-color: var(--light-color);
  --border-color: var(--super-dark-color);
  --bg-soft-color: var(--super-dark-color);
  --bg-color: var(--dark-color);
}
.dark-background  body, .full-width-editor.dark-editor body:not(.comments-active) {
  --scrollbar-bg: var(--dark-color);
  --scrollbar-track: var(--super-dark-color);
  --scrollbar-thumb: var(--light-color);
}
.dark-background .compact-display-content {
  background-color: var(--dark-color);
}
/* Special combinaison with toolbar */
.dark-background.dark-toolbar .popup-content, .dark-editor.dark-toolbar .popup-content {
  box-shadow: 0 0 14px 0px var(--super-dark-color);
}

/* ======================== */
/* == Super Light Editor == */
/* ======================== */
.super-light-editor #outerdocbody iframe, .super-light-editor #outerdocbody > #innerdocbody {
  --bg-color: var(--super-light-color);
}
.super-light-editor #innerdocbody {
  --text-color: var(--super-dark-color);
}
/* ================== */
/* == Light Editor == */
/* ================== */
.light-editor #outerdocbody iframe, .light-editor #outerdocbody > #innerdocbody {
  --bg-color: var(--light-color);
}
.light-editor #innerdocbody {
  --text-color: var(--super-dark-color);
}
/* ======================= */
/* == Super Dark Editor == */
/* ======================= */
.super-dark-editor #outerdocbody iframe, .super-dark-editor #outerdocbody > #innerdocbody {
  --bg-color: var(--super-dark-color);
}
.super-dark-editor #innerdocbody {
  --text-color: var(--super-light-color);
}
/* ================= */
/* == Dark Editor == */
/* ================= */
.dark-editor #outerdocbody iframe, .dark-editor #outerdocbody > #innerdocbody {
  --bg-color: var(--dark-color);
}
.dark-editor #innerdocbody {
  --text-color: var(--super-light-color);
}

/* ======================================== */
/* == Combinaison with background/editor == */
/* ======================================== */
.super-light-editor.super-light-background #outerdocbody,
.light-editor.light-background #outerdocbody,
.super-dark-editor.super-dark-background #outerdocbody,
.dark-editor.dark-background #outerdocbody {
  padding-top: 0;
}
@media (min-width: 1001px) {
  .super-light-editor.super-light-background,
  .light-editor.light-background,
  .super-dark-editor.super-dark-background,
  .dark-editor.dark-background {
    --editor-horizontal-padding: 35px;
    --editor-vertical-padding: 20px;
  }
}

/* ===================================== */
/* == Combinaison with toolbar/editor == */
/* ===================================== */
.super-light-editor.super-light-toolbar .toolbar,
.light-editor.light-toolbar .toolbar,
.super-dark-editor.super-dark-toolbar .toolbar,
.dark-editor.dark-toolbar .toolbar {
  --toolbar-border: 1px solid var(--border-color);
}

/* ======================= */
/* == Full Width Editor == */
/* ======================= */
.full-width-editor #outerdocbody iframe, .full-width-editor #outerdocbody > #innerdocbody {
  max-width: none !important;
  border-radius: 0;
}
.full-width-editor #outerdocbody {
  padding: 0;
  margin: 0;
}
@media (min-width: 1001px) {
  .full-width-editor {
    --editor-horizontal-padding: 35px !important;
    --editor-vertical-padding: 20px !important;
  }
}
.full-width-editor ::-webkit-scrollbar-track,
.full-width-editor ::-webkit-scrollbar-thumb {
  border-radius: 0px;
}


text:
package io.mattw.youtube.commentsuite.db;

import java.sql.*;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * @link https://www.javaworld.com/article/2077706/core-java/named-parameters-for-preparedstatement.html?page=2
 */
public class NamedParameterStatement implements AutoCloseable {

    private final PreparedStatement statement;
    private final Map indexMap;

    /**
     * Creates a NamedParameterStatement.  Wraps a call to
     * c.{@link Connection#prepareStatement(java.lang.String) prepareStatement}.
     *
     * @param connection the database connection
     * @param query      the parameterized query
     * @throws SQLException if the statement could not be created
     */
    public NamedParameterStatement(Connection connection, String query) throws SQLException {
        indexMap = new HashMap();
        statement = connection.prepareStatement(parse(query, indexMap));
    }

    /**
     * Parses a query with named parameters.  The parameter-index mappings are put into the map, and the
     * parsed query is returned.  DO NOT CALL FROM CLIENT CODE.  This method is non-private so JUnit code can
     * test it.
     *
     * @param query    query to parse
     * @param paramMap map to hold parameter-index mappings
     * @return the parsed query
     */
    static String parse(String query, Map paramMap) {
        int length = query.length();
        StringBuilder parsedQuery = new StringBuilder(length);
        boolean inSingleQuote = false;
        boolean inDoubleQuote = false;
        int index = 1;

        for (int i = 0; i < length; i++) {
            char c = query.charAt(i);
            if (inSingleQuote) {
                if (c == '\'') {
                    inSingleQuote = false;
                }
            } else if (inDoubleQuote) {
                if (c == '"') {
                    inDoubleQuote = false;
                }
            } else {
                if (c == '\'') {
                    inSingleQuote = true;
                } else if (c == '"') {
                    inDoubleQuote = true;
                } else if (c == ':' && i + 1 < length && Character.isJavaIdentifierStart(query.charAt(i + 1))) {
                    int j = i + 2;
                    while (j < length && Character.isJavaIdentifierPart(query.charAt(j))) {
                        j++;
                    }
                    String name = query.substring(i + 1, j);
                    c = '?'; // replace the parameter with a question mark
                    i += name.length(); // skip past the end if the parameter

                    List indexList = (List) paramMap.get(name);
                    if (indexList == null) {
                        indexList = new LinkedList();
                        paramMap.put(name, indexList);
                    }
                    indexList.add(index);

                    index++;
                }
            }
            parsedQuery.append(c);
        }

        // replace the lists of Integer objects with arrays of ints
        for (Object o : paramMap.entrySet()) {
            Map.Entry entry = (Map.Entry) o;
            List list = (List) entry.getValue();
            int[] indexes = new int[list.size()];
            int i = 0;
            for (Object o1 : list) {
                Integer x = (Integer) o1;
                indexes[i++] = x;
            }
            entry.setValue(indexes);
        }

        return parsedQuery.toString();
    }

    /**
     * Returns the indexes for a parameter.
     *
     * @param name parameter name
     * @return parameter indexes
     * @throws IllegalArgumentException if the parameter does not exist
     */
    private int[] getIndexes(String name) {
        int[] indexes = (int[]) indexMap.get(name);
        if (indexes == null) {
            throw new IllegalArgumentException("Parameter not found: " + name);
        }
        return indexes;
    }

    /**
     * Sets a parameter.
     *
     * @param name  parameter name
     * @param value parameter value
     * @throws SQLException             if an error occurred
     * @throws IllegalArgumentException if the parameter does not exist
     * @see PreparedStatement#setObject(int, java.lang.Object)
     */
    public void setObject(String name, Object value) throws SQLException {
        int[] indexes = getIndexes(name);
        for (int index : indexes) {
            statement.setObject(index, value);
        }
    }

    /**
     * Sets a parameter.
     *
     * @param name  parameter name
     * @param value parameter value
     * @throws SQLException             if an error occurred
     * @throws IllegalArgumentException if the parameter does not exist
     * @see PreparedStatement#setString(int, java.lang.String)
     */
    public void setString(String name, String value) throws SQLException {
        int[] indexes = getIndexes(name);
        for (int index : indexes) {
            statement.setString(index, value);
        }
    }

    /**
     * Sets a parameter.
     *
     * @param name  parameter name
     * @param value parameter value
     * @throws SQLException             if an error occurred
     * @throws IllegalArgumentException if the parameter does not exist
     * @see PreparedStatement#setInt(int, int)
     */
    public void setInt(String name, int value) throws SQLException {
        int[] indexes = getIndexes(name);
        for (int index : indexes) {
            statement.setInt(index, value);
        }
    }

    /**
     * Sets a parameter.
     *
     * @param name  parameter name
     * @param value parameter value
     * @throws SQLException             if an error occurred
     * @throws IllegalArgumentException if the parameter does not exist
     * @see PreparedStatement#setInt(int, int)
     */
    public void setLong(String name, long value) throws SQLException {
        int[] indexes = getIndexes(name);
        for (int index : indexes) {
            statement.setLong(index, value);
        }
    }

    /**
     * Sets a parameter.
     *
     * @param name  parameter name
     * @param value parameter value
     * @throws SQLException             if an error occurred
     * @throws IllegalArgumentException if the parameter does not exist
     * @see PreparedStatement#setTimestamp(int, java.sql.Timestamp)
     */
    public void setTimestamp(String name, Timestamp value) throws SQLException {
        int[] indexes = getIndexes(name);
        for (int index : indexes) {
            statement.setTimestamp(index, value);
        }
    }

    /**
     * Returns the underlying statement.
     *
     * @return the statement
     */
    public PreparedStatement getStatement() {
        return statement;
    }

    /**
     * Executes the statement.
     *
     * @return true if the first result is a {@link}
     * @throws SQLException if an error occurred
     * @see PreparedStatement#execute()
     */
    public boolean execute() throws SQLException {
        return statement.execute();
    }

    /**
     * Executes the statement, which must be a query.
     *
     * @return the query results
     * @throws SQLException if an error occurred
     * @see PreparedStatement#executeQuery()
     */
    public ResultSet executeQuery() throws SQLException {
        return statement.executeQuery();
    }

    /**
     * Executes the statement, which must be an SQL INSERT, UPDATE or DELETE
     * statement;
     * or an SQL statement that returns nothing, such as a DDL statement.
     *
     * @return number of rows affected
     * @throws SQLException if an error occurred
     * @see PreparedStatement#executeUpdate()
     */
    public int executeUpdate() throws SQLException {
        return statement.executeUpdate();
    }

    /**
     * Closes the statement.
     *
     * @throws SQLException if an error occurred
     * @see Statement#close()
     */
    public void close() throws SQLException {
        statement.close();
    }

    /**
     * Adds the current set of parameters as a batch entry.
     *
     * @throws SQLException if something went wrong
     */
    public void addBatch() throws SQLException {
        statement.addBatch();
    }

    /**
     * Executes all the batched statements.
     * <p>
     * See {@link Statement#executeBatch()} for details.
     *
     * @return update counts for each statement
     * @throws SQLException if something went wrong
     */
    public int[] executeBatch() throws SQLException {
        return statement.executeBatch();
    }
}

redpajama_set_name: RedPajamaGithub


text:
(function(){
  App.Views.AdminUserNew = Backbone.View.extend({
    initialize    : function(){
      this.groupCollection = new App.Collections.Groups({});
      this.groupCollection.fetch({reset:true});
      this.listenTo(this.model, "invalid", this.showErrorInfo);
      this.render();
    },
    template      : _.template($("#template-user-edit").html()),
    render        : function(){
      var html = this.template();
      this.groupCollection.add([{id : '',name:'Wybierz grupę dla użytkownika'}]);
      this.$el.html(html);
      App.Regions.appEditDashboard.html(this.el);
      this.stickit();
      this.$el.find('.ui.dropdown').dropdown();
    },
    bindings      : {
      "#form-username"      : "username",
      "#form-email"         : "email",
      "#form-first-name"    : "first_name",
      "#form-last-name"     : "last_name",
      "#form-password"      : "new_password",
      "#form-re-password"   : "re_new_password",
      "#dropdown-groups"    : {observe : 'group',
                               selectOptions: {
                                  collection: 'this.groupCollection',
                                  labelPath: 'name',
                                  valuePath: 'id'}
                              }
    },
    events      : {"submit form"      : "saveUser",
                   "click #btn-exit"  : "exitEdit"
    },
    saveUser    : function(e){
      e.preventDefault();
      this.model.save();
      if(!this.model.isNew()) {
      App.router.navigate("userEdit/"+this.model.get("id"),{trigger : true});
      };
    },
    exitEdit   : function(){
      App.router.navigate("/users",{trigger : true});
    },
    showErrorInfo(){
      $("#msg-error").removeClass("hidden").empty().append(this.model.validationError);
    }
  });

})();


text:
class DefaultController {

    constructor() {
        let vm = this;

        let [year = 1995, rating = 78] = [];    // jshint ignore:line
        vm.firstMovie = movie('Braveheart', 3, year, rating);
        vm.secondMovie = movie('Ant-Man', 2, undefined, 79);
    }
}

function movie (title, length, year = 2015, rating = 0) {
    return `${title} was ${length} hours long. It came out in ${year} and had a rating of ${rating}.`;
}

export default DefaultController;


text:
require 'rails_helper'

RSpec.describe Stage do
  describe "all" do
    it "should return all the hardcoded stages with slugs" do
      stages = Stage.all

      expect(stages.size).to eq(3)

      expect(stages.map(&:name)).to eq(["Pre-start", "Start-up", "Grow and sustain"])
      expect(stages.map(&:slug)).to eq(["pre-start", "start-up", "grow-and-sustain"])
    end
  end
end


text:
<full-backup-content>
</full-backup-content>


text:
require 'yaml'
require 'erb'

module Forklift
  module Base
    class Utils

      def load_yml(file)
        YAML.load(ERB.new(File.read(file)).result)
      end

      def class_name_from_file(file)
        klass = ""
        words = file.split("/").last.split(".").first.split("_")
        words.each do |word|
          klass << word.capitalize
        end
        klass
      end

    end
  end
end


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

<title>Uses of Class vos.Reserva</title>
<meta name="date" content="2017-10-04">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
vos.Reserva

Packages that use Reserva

Package
Description

dao

rest

tm

Uses of Reserva in dao

Methods in dao that return Reserva

Modifier and Type
Method and Description

Reserva
DAOReserva.get(long id)

Methods in dao that return types with arguments of type Reserva

Modifier and Type
Method and Description

java.util.List<Reserva>
DAOReserva.getAll()

Methods in dao with parameters of type Reserva

Modifier and Type
Method and Description

void
DAOReserva.add(Reserva data)

void
DAOReserva.delete(Reserva data)

void
DAOReserva.update(Reserva data)

Uses of Reserva in rest

Methods in rest with parameters of type Reserva

Modifier and Type
Method and Description

javax.ws.rs.core.Response
ReservaModificationServices.add(Reserva data)

javax.ws.rs.core.Response
ReservaModificationServices.delete(Reserva data)

void
ReservaModificationServices.integridad(Reserva data)

javax.ws.rs.core.Response
ReservaModificationServices.update(Reserva data)

Uses of Reserva in tm

Methods in tm that return Reserva

Modifier and Type
Method and Description

Reserva
RotondAndesTM.getReserva(long id)

Methods in tm that return types with arguments of type Reserva

Modifier and Type
Method and Description

java.util.List<Reserva>
RotondAndesTM.getAllReserva()

Methods in tm with parameters of type Reserva

Modifier and Type
Method and Description

void
RotondAndesTM.addReserva(Reserva data)

void
RotondAndesTM.deleteReserva(Reserva data)

void
RotondAndesTM.updateReserva(Reserva data)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
package org.apache.vxquery.runtime.functions.strings;

import org.apache.vxquery.datamodel.accessors.SequencePointable;
import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
import org.apache.vxquery.datamodel.values.ValueTag;
import org.apache.vxquery.datamodel.values.XDMConstants;
import org.apache.vxquery.exceptions.ErrorCode;
import org.apache.vxquery.exceptions.SystemException;
import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluator;
import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluatorFactory;
import org.apache.vxquery.runtime.functions.util.FunctionHelper;

import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.data.std.api.IPointable;
import org.apache.hyracks.data.std.primitive.LongPointable;
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;

public class FnCompareEvaluatorFactory extends AbstractTaggedValueArgumentScalarEvaluatorFactory {
    private static final long serialVersionUID = 1L;

    public FnCompareEvaluatorFactory(IScalarEvaluatorFactory[] args) {
        super(args);
    }

    @Override
    protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
            throws AlgebricksException {
        final UTF8StringPointable stringp1 = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
        final UTF8StringPointable stringp2 = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
        final UTF8StringPointable stringp3 = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
        final byte[] integerResult = new byte[LongPointable.TYPE_TRAITS.getFixedLength() + 1];
        final SequencePointable seqp = (SequencePointable) SequencePointable.FACTORY.createPointable();

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                TaggedValuePointable tvp1 = args[0];
                TaggedValuePointable tvp2 = args[1];

                // Only accept strings or empty sequence as input.
                if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
                    tvp1.getValue(seqp);
                    if (seqp.getEntryCount() == 0) {
                        XDMConstants.setEmptySequence(result);
                        return;
                    } else {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                } else {
                    if (!FunctionHelper.isDerivedFromString(tvp1.getTag())) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp1.getValue(stringp1);
                }
                if (tvp2.getTag() == ValueTag.SEQUENCE_TAG) {
                    tvp2.getValue(seqp);
                    if (seqp.getEntryCount() == 0) {
                        XDMConstants.setEmptySequence(result);
                        return;
                    } else {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                } else {
                    if (!FunctionHelper.isDerivedFromString(tvp2.getTag())) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(stringp2);
                }

                // Third parameter is optional.
                if (args.length > 2) {
                    TaggedValuePointable tvp3 = args[2];
                    if (tvp3.getTag() != ValueTag.XS_STRING_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp3.getValue(stringp3);
                }
                // TODO use the third value as collation

                integerResult[0] = ValueTag.XS_INTEGER_TAG;
                long compareTo = (stringp1.compareTo(stringp2) == 0 ? 0 : (stringp1.compareTo(stringp2) > 0 ? 1 : -1));
                LongPointable.setLong(integerResult, 1, compareTo);
                result.set(integerResult, 0, LongPointable.TYPE_TRAITS.getFixedLength() + 1);
            }
        };
    }
};


text:
package com.stackexchange.stacman;

import java.util.Date;
import java.util.concurrent.Future;

public final class EventMethods {
    private StacManClient client;

    EventMethods(StacManClient client){
        this.client = client;
    }

    public Future<StacManResponse<Event>> getRecent(String site, String access_token, String filter, Integer page, Integer pagesize, Date since)
    {
        client.validateString(site, "site");
        client.validateString(access_token, "access_token");
        client.validatePaging(page, pagesize);

        ApiUrlBuilder ub = new ApiUrlBuilder("/events", true);

        ub.addParameter("site", site);
        ub.addParameter("access_token", access_token);
        ub.addParameter("filter", filter);
        ub.addParameter("page", page);
        ub.addParameter("pagesize", pagesize);
        ub.addParameter("since", since);

        return client.createApiTask(Types.Event, ub, "/events");
    }
}


text:
/* Overrides */
body {
    font-family: 'Noto Sans', sans-serif;
}
p {
    line-height: 1.6em;
}
a, a:visited {
    color: #27C5C0;
}
blockquote {
    font-size: 90%;
    color: #777;
}
a:hover, a:focus, a:active {
    color: #476666;
}
.navbar-default {
    background: #27C5C0;
    border-color: #27C5C0;
}
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
    color: transparent;
}
.navbar-default .navbar-brand,
.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-toggle .icon-bar {
    color: #fff;
}
.navbar-default .navbar-toggle .icon-bar {
    background-color: #fff;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-toggle .icon-bar:hover {
    color: #fff;
}
.navbar-default .navbar-brand > span {
    float: left;
}
.navbar-default .navbar-brand .logo {
    width: 150px;
    height: 50px;
    background-image: url("../img/logo.png");
    background-size: 150px 50px;
    margin-top: -15px;
}

/* Custom styles */
footer {
    background: #27C5C0;
    margin-top: 50px;
    padding: 1em;
    color: #FFF;
    text-align: center;
}
footer p {
    margin: 0;
}
footer a, footer a:visited {
    color: #D7FFF7;
}
footer a:hover, footer a:focus, footer a:active {
    color: #FFF;
}


text:
require 'rails_helper'

RSpec.describe Admin::AccountsController do
  it_behaves_like 'admin only controller'

  describe '#update' do
    subject { patch :update, params: params }

    include_context 'user is logged in' do
      context 'update works' do
        let(:params) do
          {
            id: account.id,
            account: { admin: 'true' }
          }
        end

        describe 'redirecting and setting the flash' do
          let(:account) { build_stubbed :account }

          before do
            allow(Account).to receive(:find).with(account.id.to_s).and_return account
            allow(account).to receive(:update).and_return true
          end

          it 'redirects to the admin index' do
            subject
            expect(response).to redirect_to admin_accounts_path
          end

          it 'sets a friendly flash message' do
            subject
            expect(controller).to set_flash[:notice].to t('flash.accounts.success')
          end
        end

        context 'actually updating the user to make a regular user an admin' do
          let(:account) { create :account }

          it 'changes the account from not admin to admin' do
            expect(account.admin?).to eq false
            subject
            account.reload
            expect(account.admin?).to eq true
          end
        end
      end

      context 'udpate fails' do
        let(:params) do
          {
            id: account.id,
            account: { admin: 'No' }
          }
        end

        describe 'redirecting and setting the flash' do
          let(:account) { build_stubbed :account }

          before do
            allow(Account).to receive(:find).with(account.id.to_s).and_return account
            allow(account).to receive(:update).and_return false
          end

          it 're-renders the template' do
            subject
            expect(response.status).not_to eq :redirect
            expect(response.status).to eq 200
          end

          it 'sets a friendly flash message' do
            subject
            expect(controller).to set_flash[:alert].to t('flash.accounts.failure')
          end
        end

        context 'actually updating the user fails' do
          let(:account) { create :account }

          it 'does not change the account from not admin to admin' do
            expect(account.admin?).to eq false
            subject
            account.reload
            expect(account.admin?).to eq false
          end
        end
      end
    end
  end
end


text:
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

/* ChapterWithText.cs --
 * Ars Magna project, http://arsmagna.ru
 * -------------------------------------------------------
 * Status: poor
 */

#region Using directives

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using AM;
using AM.Collections;
using AM.IO;
using AM.Runtime;
using AM.Text;
using AM.Text.Output;

using CodeJam;

using JetBrains.Annotations;

using ManagedIrbis.Reports;

using MoonSharp.Interpreter;

using Newtonsoft.Json;

#endregion

namespace ManagedIrbis.Biblio
{
    /// <summary>
    ///
    /// </summary>
    [PublicAPI]
    [MoonSharpUserData]
    public class ChapterWithText
        : BiblioChapter
    {
        #region Properties

        /// <summary>
        /// Text.
        /// </summary>
        [CanBeNull]
        [JsonProperty("text")]
        public string Text { get; set; }

        /// <inheritdoc cref="BiblioChapter.IsServiceChapter" />
        public override bool IsServiceChapter
        {
            get { return true; }
        }

        #endregion

        #region Construction

        #endregion

        #region Private members

        private static char[] _lineDelimiters = { '\r', '\n' };

        #endregion

        #region Public methods

        #endregion

        #region BiblioChapter members

        /// <inheritdoc cref="BiblioChapter.Render" />
        public override void Render
            (
                BiblioContext context
            )
        {
            Code.NotNull(context, "context");

            AbstractOutput log = context.Log;
            log.WriteLine("Begin render {0}", this);

            BiblioProcessor processor = context.Processor
                .ThrowIfNull("context.Processor");
            IrbisReport report = processor.Report
                .ThrowIfNull("processor.Report");

            RenderTitle(context);

            string text = Text;
            if (!string.IsNullOrEmpty(text))
            {
                text = processor.GetText(context, text);
                if (!string.IsNullOrEmpty(text))
                {
                    string[] lines = text.Split(_lineDelimiters)
                        .NonEmptyLines()
                        .ToArray();
                    foreach (string line in lines)
                    {
                        ReportBand band = new ParagraphBand();
                        report.Body.Add(band);
                        band.Cells.Add(new SimpleTextCell(line));
                    }
                }
            }

            RenderChildren(context);

            log.WriteLine("End render {0}", this);
        }

        #endregion

        #region Object members

        #endregion
    }
}


text:
#pragma once

/** include
*/
#include "./types.h"
#include "./platform.h"

/** include
*/
#include "./sharedptr.h"
#include "./atomicvalue.h"
#include "./debugassert.h"
#include "./stlstring.h"

/** threadhandle
*/
#if(BLIB_STDTHREAD_ENABLE)

	#pragma warning(push)
	#pragma warning(disable:4710 4987 4365 4820 4623 5027 4514 4626)
	#include <thread>
	#pragma warning(pop)

#endif

/** NBlib
*/
#pragma warning(push)
#pragma warning(disable:4710)
namespace NBlib
{
	/** ThreadSleep
	*/
	void ThreadSleep(u32 a_millisec);

	/** SetThreadName
	*/
	#if defined(PLATFORM_VCWIN)

	void SetThreadName(const STLString& a_threadname);

	#endif

	/** クラスのスレッド化。
	*/
	template <typename T> class ThreadTemplate
	{
	private:

		/** スレッド開始時の引数。
		*/
		struct Argument
		{
			typename T::ThreadArgument	threadargument;
			sharedptr<T>				implimentation;
			ThreadTemplate*				me;
		};

	private:

		/** threadhandle
		*/
		#if(BLIB_STDTHREAD_ENABLE)

		sharedptr<std::thread> threadhandle;

		#endif

		/** implimentation
		*/
		sharedptr<T> implimentation;

		/** argument
		*/
		sharedptr<Argument> argument;

		/** isopen
		*/
		AtomicValue<bool> isopen;

		/** padding
		*/
		padding64(0,7);
		padding32(0,3);

	public:

		/** constructor
		*/
		ThreadTemplate()
			:
			isopen(false)
		{
		}

		/** destructor
		*/
		nonvirtual ~ThreadTemplate()
		{
			this->EndWait();
		}

	private:

		/** copy constructor禁止。
		*/
		ThreadTemplate<T>& operator =(const ThreadTemplate<T>& a_instance) = delete;

		/** 代入禁止。
		*/
		ThreadTemplate(const ThreadTemplate<T>& a_instance) = delete;

	public:

		/** スレッド開始。
		*/
		void Start(typename T::ThreadArgument& a_threadargument)
		{
			if(this->threadhandle == nullptr){
				if(this->implimentation == nullptr){

					DEEPDEBUG_TAGLOG(BLIB_THREADTEMPLATE_DEBUG_ENABLE,L"threadtemplate",L"new T : start");

					//実装部分作成。
					this->implimentation.reset(new T());

					DEEPDEBUG_TAGLOG(BLIB_THREADTEMPLATE_DEBUG_ENABLE,L"threadtemplate",L"new T : end");

					//フラグ設定。
					this->isopen.Store(true);

					//引数作成。
					this->argument.reset(new Argument());
					this->argument->me = this;
					this->argument->threadargument = a_threadargument;
					this->argument->implimentation = this->implimentation;

					DEEPDEBUG_TAGLOG(BLIB_THREADTEMPLATE_DEBUG_ENABLE,L"threadtemplate",L"ThreadMain : start");

					//スレッド起動。
					#if(BLIB_STDTHREAD_ENABLE)
					{
						Argument* t_argument = this->argument.get();
						this->threadhandle.reset(new std::thread(&ThreadTemplate<T>::ThreadMain,t_argument));
					}
					#else
					{
						ASSERT(0);
					}
					#endif
				}else{
					ASSERT(0);
				}
			}else{
				ASSERT(0);
			}
		}

		/** スレッド停止確認。
		*/
		bool IsEnd() const
		{
			if(this->isopen.Load()){
				return false;
			}
			return true;
		}

		/** スレッド削除待ち。
		*/
		void EndWait()
		{
			DEEPDEBUG_TAGLOG(BLIB_THREADTEMPLATE_DEBUG_ENABLE,L"threadtemplate",L"EndWait : start");

			if(this->threadhandle){
				{
					#if(BLIB_STDTHREAD_ENABLE)
					{
						this->threadhandle->join();
					}
					#else
					{
						ASSERT(0);
					}
					#endif
				}
			}
			this->threadhandle.reset();
			this->implimentation.reset();

			DEEPDEBUG_TAGLOG(BLIB_THREADTEMPLATE_DEBUG_ENABLE,L"threadtemplate",L"EndWait : end");
		}

		/** ポインタのように振舞う。
		*/
		sharedptr<T>& operator ->()
		{
			return this->implimentation;
		}

		/** ポインタのように振舞う。
		*/
		const sharedptr<T>& operator ->() const
		{
			return this->implimentation;
		}

		sharedptr<T>& get()
		{
			return this->implimentation;
		}

		const sharedptr<T>& get() const
		{
			return this->implimentation;
		}

		/** ポインタのように振舞う。
		*/
		operator bool() const
		{
			if(this->implimentation){
				return true;
			}
			return false;
		}

	private:

		/** ThreadMain
		*/
		#if(BLIB_STDTHREAD_ENABLE)
		static void ThreadMain(Argument* a_argument)
		#else
		static void ThreadMain(void* a_argument)
		#endif
		{
			#if(BLIB_STDTHREAD_ENABLE)

				Argument* t_argument = a_argument;

			#else

				ASSERT(0);
				Argument* t_argument = a_argument;

			#endif

			#if defined(PLATFORM_VCWIN)
			{
				SetThreadName(t_argument->threadargument.threadname);
			}
			#endif

			if(t_argument->implimentation){
				t_argument->implimentation->ThreadMain(t_argument->threadargument);
			}else{
				ASSERT(0);
			}

			if(t_argument->me){
				t_argument->me->isopen.Store(false);
			}else{
				ASSERT(0);
			}
		}

	};

}
#pragma warning(pop)


text:
#ifndef __PHIZ_BODY_PARTICLE__
#define __PHIZ_BODY_PARTICLE__

#include "Body.hpp"

namespace Phiz
{
    class Particle : public Body
    {
    public:
        Particle(glm::vec3 position, float mass = 1.0f, float radius = 1.0f);
        virtual ~Particle();

        virtual void step(float dt);
    protected:
        float _radius;
    };

}

#endif /*__PHIZ_BODY_PARTICLE__*/


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

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="享受音乐,轻松每刻"
        android:textColor="#30b2e3"
        android:textSize="20sp"
        android:layout_gravity="center"
        android:gravity="center"
        />
</LinearLayout>


text:
static float highPassFilter(float input) {
    static float xv[NZEROS+1], yv[NPOLES+1];
    static float runningLowAmp = 0;
    static float runningHighAmp = 0;
    xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4]; xv[4] = xv[5];
    xv[5] = input / GAIN;
    yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = yv[3]; yv[3] = yv[4]; yv[4] = yv[5];
    yv[5] =   (xv[5] - xv[0]) + 5 * (xv[1] - xv[4]) + 10 * (xv[3] - xv[2])
    + (  0.6011158229 * yv[0]) + ( -3.3110475620 * yv[1])
    + (  7.3120812802 * yv[2]) + ( -8.0940554178 * yv[3])
    + (  4.4918309651 * yv[4]);
    return yv[5];
}

// finds a scaling factor on x that minimizes the difference
static float getScale(float x[], float y[], int n) {
    float sumxy = 0, sumx2 = 0;
    for(int i = 0; i < n; i++) {
        sumxy += x[i] * y[i];
        sumx2 += x[i] * x[i];
    }
    return sumxy / (2 * sumx2);
}

// heart kernel based on observation at 60Hz samplerate
static float heartFilter(float input) {
    static const int heartKernelSize = 9;
    static float heartHistory [heartKernelSize];
    static float heartKernel [] = {
        -0.000312664, -0.00870198, -0.076416, -0.179242, 0,
        0.179242, 0.076416, 0.00870198, 0.000312664};
    for(int i = 0; i < heartKernelSize - 1; i++) {
        heartHistory[i] = heartHistory[i + 1];
    }
    heartHistory[heartKernelSize - 1] = input;
    float scale = getScale(heartHistory, heartKernel, heartKernelSize);
    scale = MAX(0, scale); // only correctly oriented heartbeats
    static float movingScale = 1;
    movingScale = movingScale * .25 + scale * .75;
    float sumSquaredDiffs = 0;
    for(int i = 0; i < heartKernelSize; i++) {
//        float diff = heartHistory[i] - heartKernel[i];
        float diff = movingScale * heartHistory[i] - heartKernel[i];
        sumSquaredDiffs += diff * diff;
    }
//    return input;
    return -sqrt(sumSquaredDiffs);
//    return scale;
}

// moving min filter to introduce some hysteresis
static float movingMaxFilter(float input) {
    static float hysteresis = .01;
    static float max = 0;
    if(input > max) {
        max = input;
    } else {
        max = (hysteresis * input) + ((1-hysteresis) * max);
    }
    return max;
}

// rising values filter checks for onsets
static bool risingFilter(float input) {
    static float previous = 0;
    bool rising = input > previous;
    previous = input;
    return rising;
}

// peak filter triggers immediately but is rate limited
static bool rateLimitedPeakFilter(bool input) {
    static long previousPeak = 0;
    static const long rateLimit = 20; // 180 bpm at 60 Hz (60 * 60 / 180)
    if(input && previousPeak > rateLimit) {
        previousPeak = 0;
        return true;
    } else {
        previousPeak++;
        return false;
    }
}

bool rangeFilter(float input) {
    static const int count = 3;
    static float recent[count];
    static const float range = 2.;
    bool inRange = true;
    for(int i = 0; i < count; i++) {
        if(recent[i] / range > input || recent[i] * range < input) {
            inRange = false;
        }
        recent[i] = recent[i + 1];
    }
    recent[count - 1] = input;
    return inRange;
}

float stddevFilter(float input) {
    static const int count = 5;
    static float recent[count];
    float sum = 0, sumSquaredDifferences = 0;
    for(int i = 0; i < count; i++) {
        recent[i] = recent[i + 1];
        sum += recent[i];
    }
    float mean = sum / count;
    for(int i = 0; i < count; i++) {
        float diff = recent[i] - mean;
        sumSquaredDifferences = diff * diff;
    }
    recent[count - 1] = input;
    return sqrt(sumSquaredDifferences / count);
}

float bpmFilter(unsigned long timeMs) {
    static unsigned long previousTimeMs = 0;
    float curBpm = (60. * 1000.) / (timeMs - previousTimeMs);
    previousTimeMs = timeMs;
    return curBpm;
}

bool heartbeatFilter(float x, unsigned long timeMs) {
    if(x != x) {
        return false;
    }
    x = highPassFilter(x);
    x = heartFilter(x);
    x = movingMaxFilter(x);
    bool curBeat = risingFilter(x);
//    curBeat = rateLimitedPeakFilter(curBeat);
    if(curBeat) {
//        return rangeFilter(bpmFilter(timeMs));
        return timeMs;
    }
    return false;
}

vector<float> cleanHeartRate(vector<float>& data) {
    vector<float> result;
    for(int i = 0; i < data.size(); i++) {
        float x = data[i];
        float strength;
        x = highPassFilter(x);
//        x = heartFilter(x);
//        x = movingMaxFilter(x);
//        x = risingFilter(x);
//        x = rateLimitedPeakFilter(x);
//        if(rateLimitedPeakFilter(x)) {
//            x = bpmFilter(i * 1000 / 60.);
//            x = stddevFilter(x);
//        } else {
//            if(result.empty()) x = 0;
//            else x = result.back();
//        }
        result.push_back(x);
    }
    return result;
}

Markers buildHeartRateMarkers(vector<float>& data) {
    Markers result;
    for(int i = 0; i < data.size(); i++) {
        if(heartbeatFilter(data[i], i * 1000 / 60.)) {
            result.addMarker(i);
        }
    }
    return result;
}

class ofApp : public ofBaseApp {
public:
    vector<float> data;
    LinePlot plot;
    ZoomableRegion zoomable;
    Markers markers;

    void setup() {
        ofBackground(0);
        loadData("lauren-yun.csv");
    }
    void draw() {
        zoomable.begin(ofGetWidth(), ofGetHeight());
        ofSetColor(255, 255, 0);
        markers.draw(plot.size(), ofGetWidth(), ofGetHeight());
        ofSetColor(255);
        plot.draw(ofGetWidth(), ofGetHeight());
        zoomable.end();
    }
    void loadData(string filename) {
        ofBuffer buffer = ofBufferFromFile(filename);
        data = vector<float>();
        for(auto line : buffer.getLines()) {
            data.push_back(ofToFloat(line));
        }
        markers = buildHeartRateMarkers(data);
        data = cleanHeartRate(data);
        plot = LinePlot();
        plot.set(data);
    }
    void dragEvent(ofDragInfo dragInfo) {
        if(dragInfo.files.size()) {
            loadData(dragInfo.files.front());
        }
    }
};
int main() {
    ofSetupOpenGL(1024, 512, OF_WINDOW);
    ofSetWindowShape(2048, 512);
    ofRunApp(new ofApp());
}


text:
<?php
global $ADMIN, $IKO;
?>
<!DOCTYPE html>

      <title>IkoBB Administration Panel</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="<?php echo SITE_URL; ?>/public/css/old-acp-bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="<?php echo SITE_URL; ?>/public/css/flat-ui.min.css" rel="stylesheet" media="screen">
    <link href="<?php echo SITE_URL; ?>/public/css/old-admin.css" rel="stylesheet" media="screen">
      <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">

Welcome, <?php echo $IKO->sess->data['username']; ?>

<a href="<?php echo SITE_URL; ?>/admin"> Dashboard

<a href="<?php echo SITE_URL; ?>/admin/terminal.php"> Terminal

                      <?php echo $ADMIN->navigation(); ?>

                    <a href="<?php echo SITE_URL; ?>" class="btn btn-default btn-lg" data-toggle="tooltip" title="Back To Forum">

                    <a href="<?php echo SITE_URL; ?>/members.php/cmd/logout" class="btn btn-default btn-lg" data-toggle="tooltip" title="Log Out">


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="15dp"
    android:background="@color/translucence">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="15dp"
        android:text="预报"
        android:textSize="20sp"
        android:textColor="@color/colorNormal"/>
    <LinearLayout
        android:id="@+id/forecast_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

    </LinearLayout>
</LinearLayout>


text:
namespace mc {

class DataBuffer;

namespace core {

class CompressionStrategy {
public:
    virtual MCLIB_API ~CompressionStrategy() { }
    virtual DataBuffer MCLIB_API Compress(DataBuffer& buffer) = 0;
    virtual DataBuffer MCLIB_API Decompress(DataBuffer& buffer, std::size_t packetLength) = 0;
};

class CompressionNone : public CompressionStrategy {
public:
    DataBuffer MCLIB_API Compress(DataBuffer& buffer);
    DataBuffer MCLIB_API Decompress(DataBuffer& buffer, std::size_t packetLength);
};

class CompressionZ : public CompressionStrategy {
private:
    // How large a packet needs to be before it's compressed.
    // Don't compress packets smaller than this.
    // Received in SetCompressionPacket.
    u64 m_CompressionThreshold;

public:
    MCLIB_API CompressionZ(u64 threshold) : m_CompressionThreshold(threshold) { }

    DataBuffer MCLIB_API Compress(DataBuffer& buffer);
    DataBuffer MCLIB_API Decompress(DataBuffer& buffer, std::size_t packetLength);
};

} // ns core
} // ns mc

#endif


text:
<?php
# Usage: playlist.php?name=playlist&pltype=m3u&stream=myradio.tld:8000/myradio
ini_set('display_errors', '0');

#define defaults
$type="audio";
$pltype="m3u";
$stream="";
$name="playlist";

#get options
$type=$_GET['type'];
$pltype=$_GET['pltype'];
$stream=$_GET['stream'];
$name=$_GET['name'];

#Undefined varible check
switch ($type){
	case "audio": break;
	case "video": break;
	default: $type="audio"; break;
};
if($name == ""){$name="playlist";};

#Generating output
$smilbody="
	<head>
        <meta name=\"Generator\" content=\"Microsoft Windows Media Player -- 11.0.5721.5145\" />
        <meta name=\"TotalDuration\" content=\"1102\" />
        <meta name=\"ItemCount\" content=\"1\" />
        <author/>
        <title>$name</title>
    </head>
    <body>
        <seq>
            <media src=\"$stream\" />
        </seq>
    </body>
</smil>";
switch ($pltype){
	case "m3u": $output=$stream; break;
	case "ram": $output=$stream; break;
	case "asx": $output="<ASX version = \"3.0\">
<Entry>
<REF HREF=\"$stream\" />
</Entry>
</ASX>";
break;
	case "wpl": $output="<?wpl version=\"1.0\"?>
<smil>".$smilbody; break;
	case "smil": $output="<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">".$smilbody; break;
	case "zpl": $output="ac=$stream
nm=$stream
dr=-1
br!";
	break;
	case "pls": $output="[playlist]
File1=$stream
Title1=$name
NumberOfEntries=1
Version=2";
	break;
	case m3u8: $output="#EXTM3U
#EXTINF:0,$name
#EXTVLCOPT:network-caching=1000
$stream";
break;
	case "xfps": $output="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">
  <trackList>
    <track>
      <title>$name</title>
      <location>$stream</location>
    </track>
  </trackList>
</playlist>";
break;
	case "qtl":
	$output="<?xml version=\"1.0\"?>
<?quicktime type=\"application/x-quicktime-media-link\"?>
<embed
autoplay=\"true\"
moviename=\"$name\"
src=\"$stream\"
/>";
	break;
	default: $pltype="m3u"; $output=$stream; break;
};

#Making the file
header("Content-Type: application/download; charset=utf-8");
header("Content-Disposition: attachment; filename=$name.$pltype");
print ($output);
?>


text:
package com.gbaldera.yts.receivers;

import android.content.Context;
import android.content.Intent;

import com.gbaldera.yts.activities.MainActivity;
import com.parse.ParsePushBroadcastReceiver;

public class YtsParsePushBroadcastReceiver extends ParsePushBroadcastReceiver {

    @Override
    public void onPushOpen(Context context, Intent intent) {
        Intent i = new Intent(context, MainActivity.class);
        i.putExtras(intent.getExtras());
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(i);
    }
}


text:
(function() {

    /**
     * Module to add checkers and block proceed to another URL.
     * @namespace
     */
    ns.page.block = {};

    /**
     * Array of checkers
     * @private
     * @type {Function[]}
     */
    ns.page.block._checkers = [];

    /**
     * Добавляет функцию блокировки.
     * @description
     * Функция блокировки должна вернуть false, если переход нельзя осуществить.
     * @param {Function} fn
     * @returns {ns.page.block}
     */
    ns.page.block.add = function(fn) {
        ns.page.block._checkers.push(fn);

        return this;
    };

    /**
     * Remove function to check.
     * @param {Function} fn
     * @returns {ns.page.block}
     */
    ns.page.block.remove = function(fn) {
        var checkers = ns.page.block._checkers;
        var index = checkers.indexOf(fn);
        if (index > -1) {
            checkers.splice(index, 1);
        }

        return this;
    };

    /**
     * Очищает все функции блокировки.
     * @returns {ns.page.block}
     */
    ns.page.block.clear = function() {
        ns.page.block._checkers = [];
        return this;
    };

    /**
     * Detect if possible to go to the url.
     * You can add your own checkers with ns.page.block.add(checkerFn)
     * @param {string} url URL to go.
     * @returns {Boolean}
     */
    ns.page.block.check = function(url) {
        var checkers = ns.page.block._checkers;
        for (var i = 0, j = checkers.length; i < j; i++) {
            if (checkers[i](url) === false) {
                return false;
            }
        }

        return true;
    };

})();


text:
import unittest

import serializers
import test_soap
import test_service

def suite():
    suite = serializers.suite()
    suite.addTests(test_soap.suite())
    suite.addTests(test_service.suite())

    return suite

if __name__== '__main__':
    unittest.TextTestRunner().run(suite())


text:
package gcbatch.base.cmd;

import java.util.Collection;

public class CmdGroupInfo extends AbstractCmdInfo implements Cloneable {
    private String groupType;

    private Collection<? extends AbstractCmdInfo> children;

    public CmdGroupInfo(int index, String name, String displayName, String description, String groupType, String[] accessableRoles, Collection<? extends AbstractCmdInfo> children) {
        super(index, name, displayName, description, "", CmdType.group, new String[] {"*"});

        this.children = children;
        this.groupType = groupType;
        this.setAccessableRoles(accessableRoles);
    }

    @Override
    public CmdGroupInfo clone() throws CloneNotSupportedException {
        CmdGroupInfo cmdInfo = (CmdGroupInfo) super.clone();

        cmdInfo.setGroupType(groupType);
        cmdInfo.setChildren(children);

        return cmdInfo;
    }

    public void setGroupType(String groupType) {
        this.groupType = groupType;
    }

    public void setChildren(Collection<? extends AbstractCmdInfo> children) {
        this.children = children;
    }

    public Collection<? extends AbstractCmdInfo> getChildren() {
        return children;
    }

    public String getGroupType() {
        return groupType;
    }
}


text:
1. Allows selection of multiple song files
2. Uses file title or custom query to search Spotify Web API and return top 5 results
3. User selects desired result or searches again
4. File's Title, Artist, and Album properties will be edited to match result
5. User may select to organize their music directory to be formatted as such: Artist\Album\songFile.ext

Interface Main launches the program


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using NUnit.Framework;

namespace SequelocityDotNet.Tests.PostgreSQL.DatabaseCommandExtensionsTests
{
    [TestFixture]
    public class GenerateInsertForPostgreSQLTests
    {
        public class Customer
        {
            public int? CustomerId;
            public string FirstName;
            public string LastName;
            public DateTime DateOfBirth;
        }

        [Test]
        public void Should_Return_The_Last_Inserted_Id()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Customer;

CREATE TABLE IF NOT EXISTS Customer
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            var customer = new Customer { FirstName = "Clark", LastName = "Kent", DateOfBirth = DateTime.Parse("06/18/1938") };

            // Act
            var customerId = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .GenerateInsertForPostgreSQL(customer, "public.Customer")
                .ExecuteScalar()
                .ToInt();

            // Assert
            Assert.That(customerId == 1);
        }

        [Test]
        public void Should_Handle_Generating_Inserts_For_A_Strongly_Typed_Object()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Customer;

CREATE TABLE IF NOT EXISTS Customer
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            var newCustomer = new Customer { FirstName = "Clark", LastName = "Kent", DateOfBirth = DateTime.Parse("06/18/1938") };

            // Act
            var customerId = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .GenerateInsertForPostgreSQL(newCustomer)
                .ExecuteScalar()
                .ToInt();

            const string selectCustomerQuery = @"
SELECT  CustomerId,
		FirstName,
		LastName,
		DateOfBirth
FROM    Customer;
";

            var customer = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(selectCustomerQuery)
                .ExecuteToObject<Customer>();

            // Assert
            Assert.That(customerId == 1);
            Assert.That(customer.CustomerId == 1);
            Assert.That(customer.FirstName == newCustomer.FirstName);
            Assert.That(customer.LastName == newCustomer.LastName);
            Assert.That(customer.DateOfBirth == newCustomer.DateOfBirth);
        }

        [Test]
        public void Should_Be_Able_To_Specify_The_Table_Name()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Person;

CREATE TABLE IF NOT EXISTS Person
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            var customer = new Customer { FirstName = "Clark", LastName = "Kent", DateOfBirth = DateTime.Parse("06/18/1938") };

            // Act
            var customerId = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .GenerateInsertForPostgreSQL(customer, "Person") // Specifying a table name of Person
                .ExecuteScalar<int>();

            // Assert
            Assert.That(customerId == 1);
        }

        [Test]
        public void Should_Throw_An_Exception_When_Passing_An_Anonymous_Object_And_Not_Specifying_A_TableName()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Customer;

CREATE TABLE IF NOT EXISTS Customer
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            var customer = new { FirstName = "Clark", LastName = "Kent", DateOfBirth = DateTime.Parse("06/18/1938") };

            // Act
            TestDelegate action = () => Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .GenerateInsertForPostgreSQL(customer)
                .ExecuteScalar<int>();

            // Assert
            var exception = Assert.Catch<ArgumentNullException>(action);
            Assert.That(exception.Message.Contains("The 'tableName' parameter must be provided when the object supplied is an anonymous type."));
        }

        [Test]
        public void Should_Handle_Generating_Inserts_For_An_Anonymous_Object()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Customer;

CREATE TABLE IF NOT EXISTS Customer
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            var newCustomer = new { FirstName = "Clark", LastName = "Kent", DateOfBirth = DateTime.Parse("06/18/1938") };

            // Act
            var customerId = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .GenerateInsertForPostgreSQL(newCustomer, "Customer")
                .ExecuteScalar<int>();

            const string selectCustomerQuery = @"
SELECT  CustomerId,
		FirstName,
		LastName,
		DateOfBirth
FROM    Customer;
";

            var customer = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(selectCustomerQuery)
                .ExecuteToObject<Customer>();

            // Assert
            Assert.That(customerId == 1);
            Assert.That(customer.CustomerId == 1);
            Assert.That(customer.FirstName == newCustomer.FirstName);
            Assert.That(customer.LastName == newCustomer.LastName);
            Assert.That(customer.DateOfBirth == newCustomer.DateOfBirth);
        }

        [Test]
        public void Should_Handle_Generating_Inserts_For_A_Dynamic_ExpandoObject()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Customer;

CREATE TABLE IF NOT EXISTS Customer
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            dynamic newCustomer = new ExpandoObject();
            newCustomer.FirstName = "Clark";
            newCustomer.LastName = "Kent";
            newCustomer.DateOfBirth = DateTime.Parse("06/18/1938");

            // Act
            var databaseCommand = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString);
            databaseCommand = DatabaseCommandExtensions.GenerateInsertForPostgreSQL(databaseCommand, newCustomer, "Customer");
            var customerId = databaseCommand
                .ExecuteScalar<int>();

            const string selectCustomerQuery = @"
SELECT  CustomerId,
		FirstName,
		LastName,
		DateOfBirth
FROM    Customer;
";

            var customer = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(selectCustomerQuery)
                .ExecuteToObject<Customer>();

            // Assert
            Assert.That(customerId == 1);
            Assert.That(customer.CustomerId == 1);
            Assert.That(customer.FirstName == newCustomer.FirstName);
            Assert.That(customer.LastName == newCustomer.LastName);
            Assert.That(customer.DateOfBirth == newCustomer.DateOfBirth);
        }

        [Test]
        public void Should_Handle_Generating_Inserts_For_A_Dictionary_Of_String_Object()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Customer;

CREATE TABLE IF NOT EXISTS Customer
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            dynamic newCustomer = new ExpandoObject();
            newCustomer.FirstName = "Clark";
            newCustomer.LastName = "Kent";
            newCustomer.DateOfBirth = DateTime.Parse("06/18/1938");

            // Act
            var customerId = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .GenerateInsertForPostgreSQL((IDictionary<string, object>)newCustomer, "Customer")
                .ExecuteScalar<int>();

            const string selectCustomerQuery = @"
SELECT  CustomerId,
		FirstName,
		LastName,
		DateOfBirth
FROM    public.Customer;
";

            var customer = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(selectCustomerQuery)
                .ExecuteToObject<Customer>();

            // Assert
            Assert.That(customerId == 1);
            Assert.That(customer.CustomerId == 1);
            Assert.That(customer.FirstName == newCustomer.FirstName);
            Assert.That(customer.LastName == newCustomer.LastName);
            Assert.That(customer.DateOfBirth == newCustomer.DateOfBirth);
        }

        [Test]
        public void Should_Handle_Generating_Inserts_For_An_Anonymous_Object_Converted_Into_A_Dynamic()
        {
            // Arrange
            const string createSchemaSql = @"
DROP TABLE IF EXISTS Customer;

CREATE TABLE IF NOT EXISTS Customer
(
    CustomerId      serial not null,
    FirstName       VARCHAR(120)   NOT NULL,
    LastName        VARCHAR(120)   NOT NULL,
    DateOfBirth     timestamp        NOT NULL,
    PRIMARY KEY ( CustomerId )
);
";
            Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(createSchemaSql)
                .ExecuteNonQuery();

            dynamic newCustomer = new { FirstName = "Clark", LastName = "Kent", DateOfBirth = DateTime.Parse("06/18/1938") };

            // Act
            var customerId = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .GenerateInsertForPostgreSQL((object)newCustomer, "Customer")
                .ExecuteScalar<int>();

            const string selectCustomerQuery = @"
SELECT  CustomerId,
		FirstName,
		LastName,
		DateOfBirth
FROM    public.Customer;
";

            var customer = Sequelocity.GetDatabaseCommand(ConnectionStringsNames.PostgreSQLConnectionString)
                .SetCommandText(selectCustomerQuery)
                .ExecuteToObject<Customer>();

            // Assert
            Assert.That(customerId == 1);
            Assert.That(customer.CustomerId == 1);
            Assert.That(customer.FirstName == newCustomer.FirstName);
            Assert.That(customer.LastName == newCustomer.LastName);
            Assert.That(customer.DateOfBirth == newCustomer.DateOfBirth);
        }
    }
}


text:
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/include/autoprepend.php');
/*======================================

objet de BDD cms_enquete :: class cms_enquete

SQL mySQL:

DROP TABLE IF EXISTS cms_enquete;
CREATE TABLE cms_enquete
(
	cms_id			int (11) PRIMARY KEY not null,
	cms_datecrea			date,
	cms_titre			varchar (255)
)

SQL Oracle:

DROP TABLE cms_enquete
CREATE TABLE cms_enquete
(
	cms_id			number (11) constraint cms_pk PRIMARY KEY not null,
	cms_datecrea			date,
	cms_titre			varchar2 (255)
)

<?xml version="1.0" encoding="ISO-8859-1" ?>
<class name="cms_enquete" libelle="Brique Enquete" prefix="cms" display="titre" abstract="id" >
<item name="id" type="int" length="11" isprimary="true" notnull="true" default="-1" asso="cms_assoenquetequestion"/>
<item name="datecrea" libelle="Date de l'actualité" type="date" list="true" order="true" format="l j F Y"/>
<item name="titre" libelle="Titre" type="varchar" length="255" list="true" order="true" />
<langpack lang="fr">
<norecords>Aucune enquête à afficher</norecords>
</langpack>
</class>

==========================================*/

class cms_enquete
{
var $id;
var $datecrea;
var $titre;

var $XML = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>
<class name=\"cms_enquete\" libelle=\"Brique Enquete\" prefix=\"cms\" display=\"titre\" abstract=\"id\" >
<item name=\"id\" type=\"int\" length=\"11\" isprimary=\"true\" notnull=\"true\" default=\"-1\" asso=\"cms_assoenquetequestion\"/>
<item name=\"datecrea\" libelle=\"Date de l'actualité\" type=\"date\" list=\"true\" order=\"true\" format=\"l j F Y\"/>
<item name=\"titre\" libelle=\"Titre\" type=\"varchar\" length=\"255\" list=\"true\" order=\"true\" />
<langpack lang=\"fr\">
<norecords>Aucune enquête à afficher</norecords>
</langpack>
</class>";

var $sMySql = "CREATE TABLE cms_enquete
(
	cms_id			int (11) PRIMARY KEY not null,
	cms_datecrea			date,
	cms_titre			varchar (255)
)

";

// constructeur
function cms_enquete($id=null)
{
	if (istable("cms_enquete") == false){
		dbExecuteQuery($this->sMySql);
	}

	if($id!=null) {
		$tempThis = dbGetObjectFromPK(get_class($this), $id);
		foreach ($tempThis as $tempKey => $tempValue){
			$this->$tempKey = $tempValue;
		}
		$tempThis = null;
	} else {
		$this->id = -1;
		$this->datecrea = date("d/m/Y");
		$this->titre = "";
	}
}

// liste des champs de l'objet
function getListeChamps()
{
	// ATTENTION, respecter l'ordre des champs de la table dans la base de données pour construire laListeChamp
	$laListeChamps[]=new dbChamp("Cms_id", "entier", "get_id", "set_id");
	$laListeChamps[]=new dbChamp("Cms_datecrea", "date_formatee", "get_datecrea", "set_datecrea");
	$laListeChamps[]=new dbChamp("Cms_titre", "text", "get_titre", "set_titre");
	return($laListeChamps);
}

// getters
function get_id() { return($this->id); }
function get_datecrea() { return($this->datecrea); }
function get_titre() { return($this->titre); }

// setters
function set_id($c_cms_id) { return($this->id=$c_cms_id); }
function set_datecrea($c_cms_datecrea) { return($this->datecrea=$c_cms_datecrea); }
function set_titre($c_cms_titre) { return($this->titre=$c_cms_titre); }

// autres getters
function getGetterPK() { return("get_id"); }
function getSetterPK() { return("set_id"); }
function getFieldPK() { return("cms_id"); }
// statut
function getGetterStatut() {return("none"); }
function getFieldStatut() {return("none"); }
//
function getTable() { return("cms_enquete"); }
function getClasse() { return("cms_enquete"); }
function getDisplay() { return("titre"); }
function getAbstract() { return("id"); }

} //class
/*

// ecriture des fichiers
if (!is_dir($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete")){
	mkdir($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete");
	$list = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/list_cms_enquete.php", "w");
	$listContent = "<"."?php include('cms-inc/autoClass/list.php'); ?".">";
	fwrite($list, $listContent);
	fclose($list);
	$maj = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/maj_cms_enquete.php", "w");
	$majContent = "<"."?php include('cms-inc/autoClass/maj.php'); ?".">";
	fwrite($maj, $majContent);
	fclose($maj);
	$show = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/show_cms_enquete.php", "w");
	$showContent = "<"."?php include('cms-inc/autoClass/show.php'); ?".">";
	fwrite($show, $showContent);
	fclose($show);
	$rss = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/rss_cms_enquete.php", "w");
	$rssContent = "<"."?php include('cms-inc/autoClass/rss.php'); ?".">";
	fwrite($rss, $rssContent);
	fclose($rss);
	$xml = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/xml_cms_enquete.php", "w");
	$xmlContent = "<"."?php include('cms-inc/autoClass/xml.php'); ?".">";
	fwrite($xml, $xmlContent);
	fclose($xml);
	$xmlxls = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/xmlxls_cms_enquete.php", "w");
	$xmlxlsContent = "<"."?php include('cms-inc/autoClass/xmlxls.php'); ?".">";
	fwrite($xmlxls, $xmlxlsContent);
	fclose($xmlxls);
	$export = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/export_cms_enquete.php", "w");
	$exportContent = "<"."?php include('cms-inc/autoClass/export.php'); ?".">";
	fwrite($export, $exportContent);
	fclose($export);
	$import = fopen($_SERVER['DOCUMENT_ROOT']."/backoffice/cms_enquete/import_cms_enquete.php", "w");
	$importContent = "<"."?php include('cms-inc/autoClass/import.php'); ?".">";
	fwrite($import, $importContent);
	fclose($import);
}*/
?>


text:
module Kitchen
  module Dsc
    VERSION = "0.11.1".freeze
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <entity name="Sulu\Bundle\CategoryBundle\Entity\CategoryTranslation" table="ca_category_translations">

        <id name="id" type="integer" column="id">
            <generator strategy="AUTO"/>
        </id>

        <field name="translation" column="translation" type="string" length="255"/>
        <field name="locale" column="locale" type="string" length="5"/>

        <many-to-one field="category" target-entity="Sulu\Bundle\CategoryBundle\Entity\Category" inversed-by="translations">
            <cascade>
                <cascade-all/>
            </cascade>
            <join-columns>
                <join-column name="idCategories" on-delete="CASCADE" referenced-column-name="id" nullable="false"/>
            </join-columns>
        </many-to-one>

        <many-to-many field="keywords" mapped-by="categoryTranslations"
                      target-entity="Sulu\Bundle\CategoryBundle\Entity\Keyword"/>

    </entity>
</doctrine-mapping>


text:
<?php

class Google_Service_DLP_GooglePrivacyDlpV2beta1Conditions extends Google_Collection
{
  protected $collection_key = 'conditions';
  protected $conditionsType = 'Google_Service_DLP_GooglePrivacyDlpV2beta1Condition';
  protected $conditionsDataType = 'array';

  /**
   * @param Google_Service_DLP_GooglePrivacyDlpV2beta1Condition
   */
  public function setConditions($conditions)
  {
    $this->conditions = $conditions;
  }
  /**
   * @return Google_Service_DLP_GooglePrivacyDlpV2beta1Condition
   */
  public function getConditions()
  {
    return $this->conditions;
  }
}


text:
{#  Copyright 2017 Cargill Incorporated

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

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

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

-- Query Parquet table in Impala
USE `{{ conf.raw_database.name }}`;
SELECT COUNT(*) FROM `{{ table.destination.name }}_avro`;


text:
#if !defined(AFX_SPRITEVIEW_H__BC340CB4_A2E4_497C_BB57_069D8220EBFB__INCLUDED_)
#define AFX_SPRITEVIEW_H__BC340CB4_A2E4_497C_BB57_069D8220EBFB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "dcgf.h"
#include "SpriteDoc.h"
#include "../mfc_shared/UndoState.h"

class CSpriteView : public CScrollView
{
protected: // create from serialization only
	CSpriteView();
	DECLARE_DYNCREATE(CSpriteView)

// Attributes
public:
	CBSprite* m_Background;
	int m_LastSelectedFrame;
	CSpriteDoc* GetDocument();
	CBGame* Game;
	CBSprite* m_Sprite;
	CArray<CUndoState*, CUndoState*> m_UndoStates;
	int m_UndoPointer;
	bool m_Dragging;
	CPoint m_DragFrom;
	CPoint m_DragOrigin;
	bool m_DragMove;

	afx_msg void OnDisplayFPS(CCmdUI * pCmdUI);
	afx_msg void OnDisplayMode(CCmdUI * pCmdUI);
	afx_msg void OnDisplayCursor(CCmdUI * pCmdUI);
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSpriteView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
	protected:
	virtual void OnInitialUpdate(); // called first time after construct
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

// Implementation
public:
	void GetScrollSize(CSize& Size);
	HRESULT ReloadBackground();
	void Stop();
	void Play();
	bool m_Playing;
	void UpdateDrag(CPoint Origin, CPoint Current);
	void EndDrag();
	CRect m_HotRect;
	CBObject* m_Object;
	bool m_CumulateMove;
	void DrawPoint(int X, int Y, DWORD Color);
	void DrawTracker(int X, int Y);
	void SetExpand(CBSubFrame* Sub, bool Expand);
	void GetSelectedObjects();
	void UpdateSelectionState();
	int SelectSubframe(CBSubFrame* Sub);
	CBSubFrame* m_SelectedSubframe;
	bool m_ViewReady;
	void Undo();
	HRESULT RenderFrame();
	void SetDirty(bool IsDirty=true);
	HRESULT SetUndoState(CString Name);
	void PurgeLastUndo();
	virtual ~CSpriteView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CSpriteView)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnEditUndo();
	afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnToolsRefresh();
	afx_msg void OnViewBackground();
	afx_msg void OnUpdateViewBackground(CCmdUI* pCmdUI);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
	afx_msg void OnContextMenu(CWnd*, CPoint point);
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in SpriteView.cpp
inline CSpriteDoc* CSpriteView::GetDocument()
   { return (CSpriteDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SPRITEVIEW_H__BC340CB4_A2E4_497C_BB57_069D8220EBFB__INCLUDED_)


text:
using System;
using System.Net;
using System.Text;
using Newtonsoft.Json;

namespace IndexBackend.NationalGalleryOfArt
{
    public class HighResImageEncoding
    {
        public static string Decode(string encoded)
        {
            byte[] base64 = Convert.FromBase64String(encoded);
            string decodedBase64 = Encoding.UTF8.GetString(base64);
            var urlDecoded = WebUtility.UrlDecode(decodedBase64);
            return urlDecoded;
        }

        public static string Encode(string decoded)
        {
            var urlEncoded = Uri.EscapeDataString(decoded);
            byte[] base64UrlEncoding = Encoding.UTF8.GetBytes(urlEncoded);
            string base64UrlEncodedText = Convert.ToBase64String(base64UrlEncoding);
            return base64UrlEncodedText;
        }

        public static string CreateReferenceUrlData(int assetId)
        {
            var reference = CreateReference(assetId);
            var jsonReference = JsonConvert.SerializeObject(reference);
            var encoded = Encode(jsonReference);
            return encoded;
        }

        private static HighResImageReference CreateReference(int assetId)
        {
            var reference = new HighResImageReference
            {
                MainForm = new HighResImageReferenceMainForm(),
                Assets = new HighResImageReferenceAssets
                {
                    Asset0 = new HighResImageReferenceAsset {AssetId = assetId.ToString()}
                }
            };
            return reference;
        }
    }
}


text:
Pattern: Missing use of literal initializer for hashtable

Issue: -

## Description

Creating a hashtable by either `[hashtable]::new()` or `New-Object -TypeName hashtable` will create a hashtable wherein the keys are looked-up in a case-sensitive manner, unless an `IEqualityComparer` object is passed as an argument. However, PowerShell is case-insensitive in nature and it is best to create hashtables with case-insensitive key look-up.

This rule is intended to warn the author of the case-sensitive nature of the hashtable if he/she creates a hashtable using the `new` member or the `New-Object` cmdlet.

## How

Use the full cmdlet name and not an alias.

Example of **incorrect** code:

``` PowerShell
$hashtable = [hashtable]::new()
```

``` PowerShell
$hashtable = New-Object -TypeName hashtable
```

Example of **correct** code:

``` PowerShell
$hashtable = @{}
```

## Further Reading

* [PSScriptAnalyzer - UseLiteralInitializerForHashtable](https://github.com/PowerShell/PSScriptAnalyzer/tree/master/docs/Rules/UseLiteralInitializerForHashtable.md)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta id="layout-head" />
    <title>Avaje Metrics - Java Application performance metrics</title>

    <link rel="shortcut icon" href="/images/favicon.ico" >
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/pygments.css" rel="stylesheet" type="text/css" />
    <link href="/css/site.css" rel="stylesheet">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

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

          </button>
          Avaje Metrics

  Home

Getting Started

Support

Documentation

  Github

Documentation / Annotations

Annotations

Quick links:

@Timed

@NotTimed

@Timed

  When put on a class means that all public methods of that class will be enhanced with
  either a TimedMetric or BucketTimedMetric.

Example: Class level

package org.example.service;
  ...

  @Timed
  public class MyService {
    ...
  }

}

Example: with bucket ranges

  Adding some bucket ranges (in milliseconds) means this method will use a BucketTimedMetric.

package org.example.service;
  ...

  @Timed(buckets={100,200})
  public class MyService {
    ...
  }

}

@NotTimed

  Can be put on a class or method to explicitly exclude it from being enhanced by the agent.

Example: Class level

package org.example.service;
  ...

  @NotTimed
  public class MyService {
    ...
  }

}

        DOCUMENTATION

           Metric types

           Reporting

           Enhancement

           Annotations

           Components

           Background

           LongAdder

Home

 |

Documentation


text:
package fr.paris.lutece.portal.service.admin;

import fr.paris.lutece.portal.business.user.AdminUserHome;
import fr.paris.lutece.portal.service.csv.CSVMessageDescriptor;
import fr.paris.lutece.portal.service.csv.CSVMessageLevel;
import fr.paris.lutece.portal.service.csv.CSVReaderService;
import fr.paris.lutece.portal.service.i18n.I18nService;
import fr.paris.lutece.portal.service.util.AppPropertiesService;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

/**
 * Class to import Admin Users from CSV files.
 */
public abstract class ImportAdminUserService extends CSVReaderService
{
    private static final String MESSAGE_ACCESS_CODE_ALREADY_USED = "portal.users.message.user.accessCodeAlreadyUsed";
    private static final String MESSAGE_EMAIL_ALREADY_USED = "portal.users.message.user.accessEmailUsed";
    private static final String MESSAGE_ERROR_MIN_NUMBER_COLUMNS = "portal.users.import_users_from_file.messageErrorMinColumnNumber";
    private static final String PROPERTY_IMPORT_EXPORT_USER_SEPARATOR = "lutece.importExportUser.defaultSeparator";
    private static final String CONSTANT_DEFAULT_IMPORT_EXPORT_USER_SEPARATOR = ":";
    private static final String MESSAGE_USERS_IMPORTED = "portal.users.import_users_from_file.usersImported";

    private Character _strAttributesSeparator;
    private boolean _bUpdateExistingUsers;

    /**
     * {@inheritDoc}
     */
    @Override
    protected List<CSVMessageDescriptor> checkLineOfCSVFile( String [ ] strLineDataArray, int nLineNumber, Locale locale )
    {
        List<CSVMessageDescriptor> listMessages = new ArrayList<>( );

        int nbMinColumns = getNbMinColumns( );
        if ( ( strLineDataArray == null ) || ( strLineDataArray.length < nbMinColumns ) )
        {
            int nNbCol;

            if ( strLineDataArray == null )
            {
                nNbCol = 0;
            }
            else
            {
                nNbCol = strLineDataArray.length;
            }

            Object [ ] args = {
                    nNbCol, nbMinColumns
            };
            String strErrorMessage = I18nService.getLocalizedString( MESSAGE_ERROR_MIN_NUMBER_COLUMNS, args, locale );
            CSVMessageDescriptor error = new CSVMessageDescriptor( CSVMessageLevel.ERROR, nLineNumber, strErrorMessage );
            listMessages.add( error );

            return listMessages;
        }

        if ( !getUpdateExistingUsers( ) )
        {
            String strAccessCode = getAccessCode( strLineDataArray );
            String strEmail = getEmail( strLineDataArray );

            if ( AdminUserHome.checkAccessCodeAlreadyInUse( strAccessCode ) > 0 )
            {
                String strMessage = I18nService.getLocalizedString( MESSAGE_ACCESS_CODE_ALREADY_USED, locale );
                CSVMessageDescriptor error = new CSVMessageDescriptor( CSVMessageLevel.ERROR, nLineNumber, strMessage );
                listMessages.add( error );
            }
            else
            {
                if ( AdminUserHome.checkEmailAlreadyInUse( strEmail ) > 0 )
                {
                    String strMessage = I18nService.getLocalizedString( MESSAGE_EMAIL_ALREADY_USED, locale );
                    CSVMessageDescriptor error = new CSVMessageDescriptor( CSVMessageLevel.ERROR, nLineNumber, strMessage );
                    listMessages.add( error );
                }
            }
        }

        return listMessages;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected List<CSVMessageDescriptor> getEndOfProcessMessages( int nNbLineParses, int nNbLinesWithoutErrors, Locale locale )
    {
        List<CSVMessageDescriptor> listMessages = new ArrayList<>( );
        Object [ ] args = {
                nNbLineParses, nNbLinesWithoutErrors
        };
        String strMessageContent = I18nService.getLocalizedString( MESSAGE_USERS_IMPORTED, args, locale );
        CSVMessageDescriptor message = new CSVMessageDescriptor( CSVMessageLevel.INFO, 0, strMessageContent );
        listMessages.add( message );

        return listMessages;
    }

    /**
     * Get the separator used for attributes of admin users.
     *
     * @return The separator
     */
    public Character getAttributesSeparator( )
    {
        if ( _strAttributesSeparator == null )
        {
            _strAttributesSeparator = AppPropertiesService.getProperty( PROPERTY_IMPORT_EXPORT_USER_SEPARATOR, CONSTANT_DEFAULT_IMPORT_EXPORT_USER_SEPARATOR )
                    .charAt( 0 );
        }

        return _strAttributesSeparator;
    }

    /**
     * Get the update users flag
     *
     * @return True if existing users should be updated, false if they should be ignored.
     */
    public boolean getUpdateExistingUsers( )
    {
        return _bUpdateExistingUsers;
    }

    /**
     * Set the update users flag
     *
     * @param bUpdateExistingUsers
     *            True if existing users should be updated, false if they should be ignored.
     */
    public void setUpdateExistingUsers( boolean bUpdateExistingUsers )
    {
        _bUpdateExistingUsers = bUpdateExistingUsers;
    }

    /**
     * Get the HTML template for importing users from file
     *
     * @return the template path
     */
    public abstract String getImportFromFileTemplate( );

    /**
     * Get the number min of CSV columns
     *
     * @return the min number of columns
     */
    public abstract int getNbMinColumns( );

    /**
     * Get the access code from data array
     *
     * @param strLineDataArray
     *            the data array
     * @return the access code
     */
    public abstract String getAccessCode( String [ ] strLineDataArray );

    /**
     * Get the email from CSV columns
     *
     * @param strLineDataArray
     *            the data array
     * @return the email
     */
    public abstract String getEmail( String [ ] strLineDataArray );

    /**
     * {@inheritDoc}
     */
    // Reexport this method for visibility in this package
    @Override
    protected abstract List<CSVMessageDescriptor> readLineOfCSVFile( String [ ] strLineDataArray, int nLineNumber, Locale locale, String strBaseUrl );

}


text:
from __future__ import print_function

import json
import optparse
import os
import random
import shutil
import subprocess
import sys

SKIPLIST = [
  # Skip special d8 functions.
  "load", "os", "print", "read", "readline", "quit"
]

def GetRandomObject():
  return random.choice([
    "0", "1", "2.5", "0x1000", "\"string\"", "{foo: \"bar\"}", "[1, 2, 3]",
    "function() { return 0; }"
  ])

g_var_index = 0

def GetVars(result, num, first = []):
  global g_var_index
  variables = []
  for i in range(num):
    variables.append("__v_%d" % g_var_index)
    g_var_index += 1
  for var in variables:
    result.append("var %s = %s;" % (var, GetRandomObject()))
  return ", ".join(first + variables)

# Wraps |string| in try..catch.
def TryCatch(result, string, exception_behavior = ""):
  result.append("try { %s } catch(e) { %s }" % (string, exception_behavior))

def BuildTests(function, full_name, options):
  assert function["type"] == "function"
  global g_var_index
  g_var_index = 0
  result = ["// AUTO-GENERATED BY tools/generate-builtins-tests.py.\n"]
  result.append("// Function call test:")
  length = function["length"]
  TryCatch(result, "%s(%s);" % (full_name, GetVars(result, length)))

  if "prototype" in function:
    proto = function["prototype"]
    result.append("\n// Constructor test:")
    TryCatch(result,
             "var recv = new %s(%s);" % (full_name, GetVars(result, length)),
             "var recv = new Object();")

    getters = []
    methods = []
    for prop in proto:
      proto_property = proto[prop]
      proto_property_type = proto_property["type"]
      if proto_property_type == "getter":
        getters.append(proto_property)
        result.append("recv.__defineGetter__(\"%s\", "
                      "function() { return %s; });" %
                      (proto_property["name"], GetVars(result, 1)))
      if proto_property_type == "number":
        result.append("recv.__defineGetter__(\"%s\", "
                      "function() { return %s; });" %
                      (proto_property["name"], GetVars(result, 1)))
      if proto_property_type == "function":
        methods.append(proto_property)
    if getters:
      result.append("\n// Getter tests:")
      for getter in getters:
        result.append("print(recv.%s);" % getter["name"])
    if methods:
      result.append("\n// Method tests:")
      for method in methods:
        args = GetVars(result, method["length"], ["recv"])
        call = "%s.prototype.%s.call(%s)" % (full_name, method["name"], args)
        TryCatch(result, call)

  filename = os.path.join(options.outdir, "%s.js" % (full_name))
  with open(filename, "w") as f:
    f.write("\n".join(result))
    f.write("\n")

def VisitObject(obj, path, options):
  obj_type = obj["type"]
  obj_name = "%s%s" % (path, obj["name"])
  if obj_type == "function":
    BuildTests(obj, obj_name, options)
  if "properties" in obj:
    for prop_name in obj["properties"]:
      prop = obj["properties"][prop_name]
      VisitObject(prop, "%s." % (obj_name), options)

def ClearGeneratedFiles(options):
  if os.path.exists(options.outdir):
    shutil.rmtree(options.outdir)

def GenerateTests(options):
  ClearGeneratedFiles(options)  # Re-generate everything.
  output = subprocess.check_output(
      "%s %s" % (options.d8, options.script), shell=True).strip()
  objects = json.loads(output)

  os.makedirs(options.outdir)
  for obj_name in objects:
    if obj_name in SKIPLIST: continue
    obj = objects[obj_name]
    VisitObject(obj, "", options)

def BuildOptions():
  result = optparse.OptionParser()
  result.add_option("--d8", help="d8 binary to use",
                    default="out/ia32.release/d8")
  result.add_option("--outdir", help="directory where to place generated tests",
                    default="test/mjsunit/builtins-gen")
  result.add_option("--script", help="builtins detector script to run in d8",
                    default="tools/detect-builtins.js")
  return result

def Main():
  parser = BuildOptions()
  (options, args) = parser.parse_args()
  if len(args) != 1 or args[0] == "help":
    parser.print_help()
    return 1
  action = args[0]

  if action == "generate":
    GenerateTests(options)
    return 0

  if action == "clear":
    ClearGeneratedFiles(options)
    return 0

  print("Unknown action: %s" % action)
  parser.print_help()
  return 1

if __name__ == "__main__":
  sys.exit(Main())


text:
from gi.repository import Gtk
import os

class MyWindow(Gtk.Window):

    def __init__(self):

        Gtk.Window.__init__(self, title='My Window Title')
        self.connect('delete-event', Gtk.main_quit)

        # Gtk.ListStore will hold data for the TreeView
        # Only the first two columns will be displayed
        # The third one is for sorting file sizes as numbers
        store = Gtk.ListStore(str, str, long)
        # Get the data - see below
        self.populate_store(store)

        treeview = Gtk.TreeView(model=store)

        # The first TreeView column displays the data from
        # the first ListStore column (text=0), which contains
        # file names
        renderer_1 = Gtk.CellRendererText()
        column_1 = Gtk.TreeViewColumn('File Name', renderer_1, text=0)
        # Calling set_sort_column_id makes the treeViewColumn sortable
        # by clicking on its header. The column is sorted by
        # the ListStore column index passed to it
        # (in this case 0 - the first ListStore column)
        column_1.set_sort_column_id(0)
        treeview.append_column(column_1)

        # xalign=1 right-aligns the file sizes in the second column
        renderer_2 = Gtk.CellRendererText(xalign=1)
        # text=1 pulls the data from the second ListStore column
        # which contains filesizes in bytes formatted as strings
        # with thousand separators
        column_2 = Gtk.TreeViewColumn('Size in bytes', renderer_2, text=1)
        # Mak the Treeview column sortable by the third ListStore column
        # which contains the actual file sizes
        column_2.set_sort_column_id(2)
        treeview.append_column(column_2)

        # Use ScrolledWindow to make the TreeView scrollable
        # Otherwise the TreeView would expand to show all items
        # Only allow vertical scrollbar
        scrolled_window = Gtk.ScrolledWindow()
        scrolled_window.set_policy(
            Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        scrolled_window.add(treeview)
        scrolled_window.set_min_content_height(200)

        self.add(scrolled_window)
        self.show_all()

    def populate_store(self, store):

        directory = '/home/anon/Documents'
        for filename in os.listdir(directory):
            size = os.path.getsize(os.path.join(directory, filename))
            # the second element is displayed in the second TreeView column
            # but that column is sorted by the third element
            # so the file sizes are sorted as numbers, not as strings
            store.append([filename, '{0:,}'.format(size), size])

# The main part:
win = MyWindow()
Gtk.main()