text:
@extends('masterPage')

@section('content')

LDO Permits Information

Add LDO permit details,update existing LDO permit details and delete LDO Permit details

                            LDO Permits Information

                                Permit No
                                GS Division
                                Name of Village
                                Name of Land
                                Permit Holder's Name
                                Extent
                                Present Owner
                                Present Situation
                                Cancellation
                                Edit
                                Delete

                                @foreach($ldo_permits as $permit)

                                        {{$permit->permit_no}}
                                        {{$permit->GS_division}}
                                        {{$permit->name_of_village}}
                                        {{$permit->name_of_land}}
                                        {{$permit->permit_holder_name}}
                                        {{$permit->extent}}
                                        {{$permit->present_owner}}
                                        {{$permit->present_situation}}
                                        {{$permit->cancellation}}

<button  class="approve" data-title="Edit" data-toggle="modal"  data-target="#edit"></button>

<button class="reject" data-title="Delete" data-toggle="modal" data-target="#delete" ></button>

                                @endforeach

Add New LDO Permit Details

                        <form class="form-horizontal" role="form" method="POST" action="{{ url('LDOPermit/add') }}">
                            {!! csrf_field() !!}

has('permit_no') ? ' has-error' : '' }}">
                                Permit No

                                    <input type="text" class="form-control" name="permit_no" value="{{ old('permit_no') }}">

                                    @if ($errors->has('permit_no'))

                                        {{ $errors->first('permit_no') }}

                                    @endif

has('gs_division') ? ' has-error' : '' }}">
                                GS Division

                                    <select class="form-control" name="gs_division" id="gs_division" onchange="loadcats()" >
                                        <option id="0" value=0></option>
                                        <option id="1" value="Mangalapura">Mangalapura</option>
                                        <option id="2" value="Banadaranayakepura">Banadaranayakepura</option>
                                        <option id="3" value="Wanathawilluwa-North" >Wanathawilluwa-North</option>

                                    </select>
                                    @if ($errors->has('gs_division'))

                                        {{ $errors->first('gs_division') }}

                                    @endif

has('name_of_village') ? ' has-error' : '' }}">
                                Name of Village

                                    <input type="text" class="form-control" name="name_of_village" value="{{ old('name_of_village') }}">

                                    @if ($errors->has('name_of_village'))

                                        {{ $errors->first('name_of_village') }}

                                    @endif

has('name_of_land') ? ' has-error' : '' }}">
                                Name of Land

                                    <input type="text" class="form-control" name="name_of_land" value="{{ old('name_of_land') }}">

                                    @if ($errors->has('name_of_land'))

                                        {{ $errors->first('name_of_land') }}

                                    @endif

has('permit_holder_name') ? ' has-error' : '' }}">
                                LDO Permit Holder's Name

                                    <input type="text" class="form-control" name="permit_holder_name" value="{{ old('permit_holder_name') }}">

                                    @if ($errors->has('permit_holder_name'))

                                        {{ $errors->first('permit_holder_name') }}

                                    @endif

has('extent') ? ' has-error' : '' }}">
                                Extent

                                    <input type="text" class="form-control" name="extent" value="{{ old('extent') }}">

                                    @if ($errors->has('extent'))

                                        {{ $errors->first('extent') }}

                                    @endif

                                <select class="form-control" name="unit" id="unit"  >
                                    <option id="0" value=0></option>
                                    <option id="1" value="Rods">Rods</option>
                                    <option id="2" value="Acres">Acres</option>
                                    <option id="3" value="Hectares" >Hectares</option>

                                </select>
                                    @if ($errors->has('unit'))

                                        {{ $errors->first('unit') }}

                                    @endif

has('present_owner') ? ' has-error' : '' }}">
                                Present Owner

                                    <input type="text" class="form-control" name="present_owner" value="{{ old('present_owner') }}">

                                    @if ($errors->has('present_owner'))

                                        {{ $errors->first('present_owner') }}

                                    @endif

has('present_situation') ? ' has-error' : '' }}">
                                Present Situation

                                    <input type="text" class="form-control" name="present_situation" value="{{ old('present_situation') }}">

                                    @if ($errors->has('present_situation'))

                                        {{ $errors->first('present_situation') }}

                                    @endif

                                        <button type="submit" class="btn btn-primary" id="form_submit"  name="form_submit" >
                                            Submit Data</button>

                        </form>

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Delete this entry

 Are you sure you want to delete this Record?

                    <button type="button" class="yesdel"  aria-hidden="true" data-dismiss="modal" > Yes</button>
                    <button type="button" class="nodel" data-dismiss="modal"> No</button>

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Update LDO Permit Details

                        Permit No

                            <input type="text" class="form-control" name="permit_no1" id="permit_no1" readonly >

                        GS Division

                            <select class="form-control" name="gs_division1" id="gs_division1"  >
                                <option id="0" value=0></option>
                                <option id="1" value="Mangalapura">Mangalapura</option>
                                <option id="2" value="Banadaranayakepura">Banadaranayakepura</option>
                                <option id="3" value="Wanathawilluwa-North" >Wanathawilluwa-North</option>

                            </select>

                        Name of Village

                            <input type="text" class="form-control" name="name_of_village1" id="name_of_village1">

                        Name of Land

                            <input type="text" class="form-control" name="name_of_land1" id="name_of_land1" >

                        LDO Permit Holder's Name

                            <input type="text" class="form-control" name="permit_holder_name1" id="permit_holder_name1" >

                        Extent

                            <input type="text" class="form-control" name="extent1" id="extent1" >

                            <select class="form-control" name="unit1" id="unit1"  >
                                <option id="0" value=0></option>
                                <option id="1" value="Rods">Rods</option>
                                <option id="2" value="Acres">Acres</option>
                                <option id="3" value="Hectares" >Hectares</option>

                            </select>

                        Name of Land

                            <input type="text" class="form-control" name="present_owner1" id="present_owner1" >

                        Present Situation

                            <input type="text" class="form-control" name="present_situation1" id="present_situation1" >

                        Cancelled?

                            <select class="form-control" name="cancellation" id="cancellation"  >
                                <option id="0" value="No">No</option>
                                <option id="1" value="Yes">Yes</option>

                            </select>

                    <button  type="button" class="updateform" style="width: 100%;" aria-hidden="true" data-dismiss="modal"> Update</button>

@endsection


text:
package org.hisrc.jsonix.compilation.mapping.typeinfo.builtin;

import javax.xml.namespace.QName;

import org.hisrc.jscm.codemodel.JSCodeModel;
import org.hisrc.jscm.codemodel.expression.JSAssignmentExpression;
import org.hisrc.jsonix.compilation.mapping.MappingCompiler;
import org.hisrc.jsonix.compilation.mapping.typeinfo.BuiltinLeafInfoCompiler;

public class StringTypeInfoCompiler<T, C extends T, O> extends BuiltinLeafInfoCompiler<T, C, O> {

	public StringTypeInfoCompiler(String name,QName qualifiedName) {
		super(name, qualifiedName);
	}

	@Override
	public JSAssignmentExpression createValue(MappingCompiler<T, C> mappingCompiler, String item) {
		final JSCodeModel codeModel = mappingCompiler.getCodeModel();
		return codeModel.string(item);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package de.danoeh.antennapod.gpoddernet.model;

import java.util.Comparator;

public class GpodnetTag {

    private String name;
    private int usage;

    public GpodnetTag(String name, int usage) {
        if (name == null) {
            throw new IllegalArgumentException("Name must not be null");
        }

        this.name = name;
        this.usage = usage;
    }

    public GpodnetTag(String name) {
        super();
        this.name = name;
    }

    @Override
    public String toString() {
        return "GpodnetTag [name=" + name + ", usage=" + usage + "]";
    }

    public String getName() {
        return name;
    }

    public int getUsage() {
        return usage;
    }

    public static class UsageComparator implements Comparator<GpodnetTag> {

        @Override
        public int compare(GpodnetTag o1, GpodnetTag o2) {
            return o1.usage - o2.usage;
        }

    }

}


text:
@charset "utf-8";

/* Generated content for English documents */

question:before {
	content: "Q: ";
}
answer:before {
	content: "A: ";
}

example > title:before {
	content: "Example: ";
}

quote {
	quotes: """ """;
}
quote quote {
	quotes: "'" "'";
}

/* Admonitions */

warning:before {
	content: "Warning: ";
}
caution:before {
	content: "Caution: ";
}
important:before {
	content: "Important: ";
}
tip:before {
	content: "Tip: ";
}
note:before {
	content: "Note: ";
}


text:
namespace {

template <typename T_action, typename T_goal, typename T_result>
void handleErrors(actionlib::SimpleActionServer<T_action>* server,
                  std::function<bool(const T_goal&)> handler,
                  const T_goal& goal) {
  T_result result;
  try {
    result.success = handler(goal);
    server->setSucceeded(result);
  } catch (const franka::Exception& ex) {
    ROS_ERROR_STREAM("" << ex.what());
    result.success = false;
    result.error = ex.what();
    server->setAborted(result);
  }
}

}  // anonymous namespace

using actionlib::SimpleActionServer;
using control_msgs::GripperCommandAction;
using franka_gripper::GraspAction;
using franka_gripper::GraspEpsilon;
using franka_gripper::GraspGoalConstPtr;
using franka_gripper::GraspResult;
using franka_gripper::HomingAction;
using franka_gripper::HomingGoalConstPtr;
using franka_gripper::HomingResult;
using franka_gripper::MoveAction;
using franka_gripper::MoveGoalConstPtr;
using franka_gripper::MoveResult;
using franka_gripper::StopAction;
using franka_gripper::StopGoalConstPtr;
using franka_gripper::StopResult;
using franka_gripper::grasp;
using franka_gripper::gripperCommandExecuteCallback;
using franka_gripper::homing;
using franka_gripper::move;
using franka_gripper::stop;
using franka_gripper::updateGripperState;

int main(int argc, char** argv) {
  ros::init(argc, argv, "franka_gripper_node");
  ros::NodeHandle node_handle("~");
  std::string robot_ip;
  if (!node_handle.getParam("robot_ip", robot_ip)) {
    ROS_ERROR("franka_gripper_node: Could not parse robot_ip parameter");
    return -1;
  }

  double default_speed(0.1);
  if (node_handle.getParam("default_speed", default_speed)) {
    ROS_INFO_STREAM("franka_gripper_node: Found default_speed " << default_speed);
  }

  GraspEpsilon default_grasp_epsilon;
  default_grasp_epsilon.inner = 0.005;
  default_grasp_epsilon.outer = 0.005;
  std::map<std::string, double> epsilon_map;
  if (node_handle.getParam("default_grasp_epsilon", epsilon_map)) {
    ROS_INFO_STREAM("franka_gripper_node: Found default_grasp_epsilon "
                    << "inner: " << epsilon_map["inner"] << ", outer: " << epsilon_map["outer"]);
    default_grasp_epsilon.inner = epsilon_map["inner"];
    default_grasp_epsilon.outer = epsilon_map["outer"];
  }

  franka::Gripper gripper(robot_ip);

  auto homing_handler = [&gripper](auto&& goal) { return homing(gripper, goal); };
  auto stop_handler = [&gripper](auto&& goal) { return stop(gripper, goal); };
  auto grasp_handler = [&gripper](auto&& goal) { return grasp(gripper, goal); };
  auto move_handler = [&gripper](auto&& goal) { return move(gripper, goal); };

  SimpleActionServer<HomingAction> homing_action_server(
      node_handle, "homing",
      [=, &homing_action_server](auto&& goal) {
        return handleErrors<franka_gripper::HomingAction, franka_gripper::HomingGoalConstPtr,
                            franka_gripper::HomingResult>(&homing_action_server, homing_handler,
                                                          goal);
      },
      false);

  SimpleActionServer<StopAction> stop_action_server(
      node_handle, "stop",
      [=, &stop_action_server](auto&& goal) {
        return handleErrors<franka_gripper::StopAction, franka_gripper::StopGoalConstPtr,
                            franka_gripper::StopResult>(&stop_action_server, stop_handler, goal);
      },
      false);

  SimpleActionServer<MoveAction> move_action_server(
      node_handle, "move",
      [=, &move_action_server](auto&& goal) {
        return handleErrors<franka_gripper::MoveAction, franka_gripper::MoveGoalConstPtr,
                            franka_gripper::MoveResult>(&move_action_server, move_handler, goal);
      },
      false);

  SimpleActionServer<GraspAction> grasp_action_server(
      node_handle, "grasp",
      [=, &grasp_action_server](auto&& goal) {
        return handleErrors<franka_gripper::GraspAction, franka_gripper::GraspGoalConstPtr,
                            franka_gripper::GraspResult>(&grasp_action_server, grasp_handler, goal);
      },
      false);

  SimpleActionServer<GripperCommandAction> gripper_command_action_server(
      node_handle, "gripper_action",
      [=, &gripper, &gripper_command_action_server](auto&& goal) {
        return gripperCommandExecuteCallback(gripper, default_grasp_epsilon, default_speed,
                                             &gripper_command_action_server, goal);
      },
      false);

  homing_action_server.start();
  stop_action_server.start();
  move_action_server.start();
  grasp_action_server.start();
  gripper_command_action_server.start();

  double publish_rate(30.0);
  if (!node_handle.getParam("publish_rate", publish_rate)) {
    ROS_INFO_STREAM("franka_gripper_node: Could not find parameter publish_rate. Defaulting to "
                    << publish_rate);
  }

  std::vector<std::string> joint_names;
  if (!node_handle.getParam("joint_names", joint_names)) {
    ROS_ERROR("franka_gripper_node: Could not parse joint_names!");
    return -1;
  }
  if (joint_names.size() != 2) {
    ROS_ERROR("franka_gripper_node: Got wrong number of joint_names!");
    return -1;
  }

  franka::GripperState gripper_state;
  std::mutex gripper_state_mutex;
  std::thread read_thread([&gripper_state, &gripper, &gripper_state_mutex]() {
    ros::Rate read_rate(10);
    while (ros::ok()) {
      {
        std::lock_guard<std::mutex> _(gripper_state_mutex);
        updateGripperState(gripper, &gripper_state);
      }
      read_rate.sleep();
    }
  });

  ros::Publisher gripper_state_publisher =
      node_handle.advertise<sensor_msgs::JointState>("joint_states", 1);
  ros::AsyncSpinner spinner(2);
  spinner.start();
  ros::Rate rate(publish_rate);
  while (ros::ok()) {
    if (gripper_state_mutex.try_lock()) {
      sensor_msgs::JointState joint_states;
      joint_states.header.stamp = ros::Time::now();
      joint_states.name.push_back(joint_names[0]);
      joint_states.name.push_back(joint_names[1]);
      joint_states.position.push_back(gripper_state.width * 0.5);
      joint_states.position.push_back(gripper_state.width * 0.5);
      joint_states.velocity.push_back(0.0);
      joint_states.velocity.push_back(0.0);
      joint_states.effort.push_back(0.0);
      joint_states.effort.push_back(0.0);
      gripper_state_publisher.publish(joint_states);
      gripper_state_mutex.unlock();
    }
    rate.sleep();
  }
  read_thread.join();
  return 0;
}


text:
#ifndef BABYLON_MATERIALS_TEXTURES_LOADERS_DDS_TEXTURE_LOADER_H
#define BABYLON_MATERIALS_TEXTURES_LOADERS_DDS_TEXTURE_LOADER_H

#include <babylon/materials/textures/iinternal_texture_loader.h>

namespace BABYLON {

/**
 * @brief Implementation of the DDS Texture Loader.
 */
struct BABYLON_SHARED_EXPORT _DDSTextureLoader : public IInternalTextureLoader {

  _DDSTextureLoader();
  ~_DDSTextureLoader() override; // = default

  /**
   * @brief Defines whether the loader supports cascade loading the different faces.
   */
  bool supportCascades() const override;

  /**
   * @brief This returns if the loader support the current file information.
   * @param extension defines the file extension of the file being loaded
   * @param mimeType defines the optional mime type of the file being loaded
   * @returns true if the loader can load the specified file
   */
  bool canLoad(const std::string& extension, const std::string& mimeType = "") override;

  /**
   * @brief Uploads the cube texture data to the WebGL texture. It has already been bound.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param createPolynomials will be true if polynomials have been requested
   * @param onLoad defines the callback to trigger once the texture is ready
   * @param onError defines the callback to trigger in case of error
   */
  void loadCubeData(const std::variant<std::string, ArrayBufferView>& img,
                    const InternalTexturePtr& texture, bool createPolynomials,
                    const std::function<void(const std::optional<CubeTextureData>& data)>& onLoad,
                    const std::function<void(const std::string& message,
                                             const std::string& exception)>& onError) override;

  /**
   * @brief Uploads the cube texture data to the WebGL texture. It has already been bound.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param createPolynomials will be true if polynomials have been requested
   * @param onLoad defines the callback to trigger once the texture is ready
   * @param onError defines the callback to trigger in case of error
   */
  void loadCubeData(const std::vector<std::variant<std::string, ArrayBufferView>>& imgs,
                    const InternalTexturePtr& texture, bool createPolynomials,
                    const std::function<void(const std::optional<CubeTextureData>& data)>& onLoad,
                    const std::function<void(const std::string& message,
                                             const std::string& exception)>& onError) override;

  /**
   * @brief Uploads the 2D texture data to the WebGL texture. It has already been bound once in the
   * callback.
   * @param data contains the texture data
   * @param texture defines the BabylonJS internal texture
   * @param callback defines the method to call once ready to upload
   */
  void loadData(const ArrayBufferView& data, const InternalTexturePtr& texture,
                const std::function<void(int width, int height, bool loadMipmap, bool isCompressed,
                                         const std::function<void()>& done, bool loadFailed)>&
                  callback) override;

}; // end of struct _DDSTextureLoader

} // end of namespace BABYLON

#endif // end of BABYLON_MATERIALS_TEXTURES_LOADERS_DDS_TEXTURE_LOADER_H


text:
/*
The following content was designed & implemented under AlexSeif.com
*/
/*
    Created on : Apr 12, 2018, 3:54:00 PM
    Author     : Alex Seif <me@alexseif.com>
*/

.text-lg{
  font-size: 2em;
  overflow-wrap: break-word;
  white-space: normal;
  text-align: center;
}
.action-list{
  font-size: 100%;
}
.active{
  height: calc(100vh);
  padding-top: 20%;
}
.btns {
  position: absolute;
  bottom: 10%;
}
.action-item:first-child .action-prev{display: none;}
.action-item:last-child .action-next{display: none;}
a.list-group-item, button.list-group-item{color: white;}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Framework.Localization;
using Microsoft.Framework.Runtime;

namespace Microsoft.AspNet.Mvc.Localization
{
    public class ViewLocalizer : IViewLocalizer, ICanHasViewContext
    {
        private readonly IHtmlLocalizerFactory _localizerFactory;
        private readonly string _appName;
        private IHtmlLocalizer _localizer;

        public ViewLocalizer(IHtmlLocalizerFactory localizerFactory, IApplicationEnvironment appEnv)
        {
            _appName = appEnv.ApplicationName;
            _localizerFactory = localizerFactory;
        }

        public LocalizedString this[string name] => _localizer[name];

        public LocalizedString this[string name, params object[] arguments] => _localizer[name, arguments];

        public LocalizedString GetString(string name) => _localizer.GetString(name);

        public LocalizedString GetString(string name, params object[] values) => _localizer.GetString(name, values);

        public LocalizedHtmlString Html(string key) => _localizer.Html(key);

        public LocalizedHtmlString Html(string key, params object[] arguments) => _localizer.Html(key, arguments);

        public IStringLocalizer WithCulture(CultureInfo culture) => _localizer.WithCulture(culture);

        public IEnumerator<LocalizedString> GetEnumerator() => _localizer.GetEnumerator();

        IEnumerator IEnumerable.GetEnumerator() => _localizer.GetEnumerator();

        IHtmlLocalizer IHtmlLocalizer.WithCulture(CultureInfo culture) => _localizer.WithCulture(culture);

        public void Contextualize(ViewContext viewContext)
        {
            var baseName = viewContext.View.Path.Replace('/', '.').Replace('\\', '.');
            if (baseName.StartsWith("."))
            {
                baseName = baseName.Substring(1);
            }
            baseName = _appName + "." + baseName;
            _localizer = _localizerFactory.Create(baseName, _appName);
        }
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.senai.estacionamento.model;

import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Victor Matheus
 */
@Entity
@Table(name = "USUARIO")
@XmlRootElement
public class Usuario  implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    @Column(name = "nome", nullable = false, length = 20)
    private String nome;

    @Column(name = "login", nullable = false, length = 20)
    private String login;

    @Column(name = "senha", nullable = false, length = 20)
    private String senha;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    public Usuario() {
    }

    public Usuario(String nome, String login, String senha) {
        this.nome = nome;
        this.login = login;
        this.senha = senha;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + Objects.hashCode(this.id);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Usuario other = (Usuario) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }

}


text:
#include "sim-main.h"
#include "sim-assert.h"

/* Generic implementation of sim_fetch_register for simulators using
   CPU_REG_FETCH.
   The contents of BUF are in target byte order.  */
/* ??? Obviously the interface needs to be extended to handle multiple
   cpus.  */

int
sim_fetch_register (SIM_DESC sd, int rn, unsigned char *buf, int length)
{
  SIM_CPU *cpu = STATE_CPU (sd, 0);

  SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
  return (* CPU_REG_FETCH (cpu)) (cpu, rn, buf, length);
}

/* Generic implementation of sim_store_register for simulators using
   CPU_REG_STORE.
   The contents of BUF are in target byte order.  */
/* ??? Obviously the interface needs to be extended to handle multiple
   cpus.  */

int
sim_store_register (SIM_DESC sd, int rn, unsigned char *buf, int length)
{
  SIM_CPU *cpu = STATE_CPU (sd, 0);

  SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
  return (* CPU_REG_STORE (cpu)) (cpu, rn, buf, length);
}


text:
LoL.Summoner.League = function(summoner, options){
    this.route = summoner._client.route('v2.3/league/by-summoner/'+summoner.id);
};

LoL.Summoner.League.prototype.processData = function(summoner, data){
    summoner.league = data;
};


text:
int main(int argc, char** argv)
{
    QApplication a(argc, argv);
    ExampleWindow w;

    w.show();

    return a.exec();
}


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

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

    <title>BlockWithBasePlane — armacode Documentation</title>

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

    <link rel="shortcut icon" href="../../../_static/ar-ma_favicon.ico"/>
    <link rel="top" title="armacode Documentation" href="../../../index.html" />
    <link rel="up" title="Plug-ins" href="../../../plug-ins.html" />
    <link rel="next" title="BrepEdges" href="BrepEdges.html" />
    <link rel="prev" title="ArrayTween" href="ArrayTween.html" />

Navigation

          index

          next |

          previous |

armacode Documentation »

Plug-ins »

BlockWithBasePlane¶

Extends builtin Block command.
Create a block definition with specified plane. User will be prompted to select a surface as base plane.
Base Plane is defined by the surface’s evaluated plane at normalised param uv (0.5,0.5)

Previous topic

ArrayTween

Next topic

BrepEdges

This Page

Show Source

Quick search

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

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

Navigation

          index

          next |

          previous |

armacode Documentation »

Plug-ins »

        © Copyright 2014, Tony Ho.
      Created using Sphinx 1.3.5.


text:
/**
 * Namespace: browser.theme
 * Generated from Mozilla sources. Do not manually edit!
 *
 * The theme API allows customizing of visual elements of the browser.
 *
 * Comments found in source JSON schema files:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
import { Manifest } from "./manifest";
import { Events } from "./events";

export namespace Theme {
    /**
     * Info provided in the onUpdated listener.
     */
    interface ThemeUpdateInfo {
        /**
         * The new theme after update
         */
        theme: ThemeUpdateInfoThemeType;

        /**
         * The id of the window the theme has been applied to
         * Optional.
         */
        windowId?: number;
    }

    /**
     * The new theme after update
     */
    interface ThemeUpdateInfoThemeType {
        [s: string]: unknown;
    }

    interface Static {
        /**
         * Returns the current theme for the specified window or the last focused window.
         *
         * @param windowId Optional. The window for which we want the theme.
         */
        getCurrent(windowId?: number): Promise<any>;

        /**
         * Make complete updates to the theme. Resolves when the update has completed.
         *
         * @param windowId Optional. The id of the window to update. No id updates all windows.
         * @param details The properties of the theme to update.
         */
        update(windowId: number | undefined, details: Manifest.ThemeType): Promise<void>;

        /**
         * Make complete updates to the theme. Resolves when the update has completed.
         *
         * @param details The properties of the theme to update.
         */
        update(details: Manifest.ThemeType): Promise<void>;

        /**
         * Removes the updates made to the theme.
         *
         * @param windowId Optional. The id of the window to reset. No id resets all windows.
         */
        reset(windowId?: number): Promise<void>;

        /**
         * Fired when a new theme has been applied
         *
         * @param updateInfo Details of the theme update
         */
        onUpdated: Events.Event<(updateInfo: ThemeUpdateInfo) => void>;
    }
}


text:
layout: default
title: Navigation Drawer
js: navigation-drawer
---

	Navigation Drawer

		<form>

					<input type="checkbox" class="navigation-drawer-invert" value="inverse" />
					 Invert Nav Drawer

		</form>

Add the Overlay:

<div class="navigation-drawer-overlay"></div>

Add dividers in the sidebar with <div class="sidebar-divider"></div>

Add text to the sidebar with <div class="sidebar-text"><p>Text</p></div>

Position

Fix to the left with .sidebar-fixed-left

Fix to the right with .sidebar-fixed-right

Style

Default with .sidebar-default

Inverse with .sidebar-inverse

Create your own style with the sidebar-template() mixin:

@mixin sidebar-template(
$color,
$bg,
$header-bg,
$brand-color,
$brand-bg,
$brand-hover-color,
$brand-hover-bg,
$divider,
$badge-color,
$badge-bg,
$icon-color,
$icon-hover-color,
$link-color,
$link-bg,
$link-hover-color,
$link-hover-bg,
$link-active-color,
$link-active-bg,
$link-disabled-color,
$link-disabled-bg
) {
//	processes css
}

Markup

<aside id="sidebar" class="sidebar sidebar-default sidebar-fixed-left" role="navigation">

//	content goes here

</aside>

Add the Javascript

$(document).ready(function() {

var overlay = $('.sidebar-overlay');

$('.sidebar-toggle').on('click', function() {
var sidebar = $('#sidebar');
sidebar.toggleClass('open');
if((sidebar.hasClass('sidebar-fixed-left') || sidebar.hasClass('sidebar-fixed-right')) && sidebar.hasClass('open')) {
overlay.addClass('active');
} else {
overlay.removeClass('active');
}
});

overlay.on('click', function() {
$(this).removeClass('active');
$('#sidebar').removeClass('open');
});

});

(function($) {

var dropdown = $('.sidebar .dropdown');

//	Add slidedown animation to dropdown
dropdown.on('show.bs.dropdown', function(e){
$(this).find('.dropdown-menu').first().stop(true, true).slideDown();
});

//	Add slideup animation to dropdown
dropdown.on('hide.bs.dropdown', function(e){
$(this).find('.dropdown-menu').first().stop(true, true).slideUp();
});

})(jQuery);


text:
'''
 ====================================================================
 Copyright (c) 2016 Barry A Scott.  All rights reserved.

 This software is licensed as described in the file LICENSE.txt,
 which you should have received as part of this distribution.

 ====================================================================

    wb_scm_main.py

'''
import sys
import os

MIN_SUPPORTED_PYTHON_VERSION = (3, 5)
if sys.version_info < MIN_SUPPORTED_PYTHON_VERSION:
    print( 'Error: Must be run using pthon %d.%d or newer' % MIN_SUPPORTED_PYTHON_VERSION )
    sys.exit( 9 )

if sys.platform.startswith( 'win' ):
    # in windows when building from a venv its necessary to
    # use add_dll_directory so that packaging will work

    # also at run time it is also necessary to add
    # these folders
    import PyQt5
    PyQt5_dir = os.path.dirname( PyQt5.__file__ )
    for folder in (PyQt5_dir, os.path.join( PyQt5_dir, 'Qt5', 'bin' )):
        os.add_dll_directory( folder )

import wb_main
import wb_scm_app

if __name__ == '__main__':
    sys.exit( wb_main.main( wb_scm_app.WbScmApp, sys.argv ) )


text:
import {__DEV__} from '../../config';
import * as zrUtil from 'zrender/src/core/util';
import VisualMapModel from './VisualMapModel';
import VisualMapping from '../../visual/VisualMapping';
import visualDefault from '../../visual/visualDefault';
import {reformIntervals} from '../../util/number';

var PiecewiseModel = VisualMapModel.extend({

    type: 'visualMap.piecewise',

    /**
     * Order Rule:
     *
     * option.categories / option.pieces / option.text / option.selected:
     *     If !option.inverse,
     *     Order when vertical: ['top', ..., 'bottom'].
     *     Order when horizontal: ['left', ..., 'right'].
     *     If option.inverse, the meaning of
     *     the order should be reversed.
     *
     * this._pieceList:
     *     The order is always [low, ..., high].
     *
     * Mapping from location to low-high:
     *     If !option.inverse
     *     When vertical, top is high.
     *     When horizontal, right is high.
     *     If option.inverse, reverse.
     */

    /**
     * @protected
     */
    defaultOption: {
        selected: null,             // Object. If not specified, means selected.
                                    // When pieces and splitNumber: {'0': true, '5': true}
                                    // When categories: {'cate1': false, 'cate3': true}
                                    // When selected === false, means all unselected.

        minOpen: false,             // Whether include values that smaller than `min`.
        maxOpen: false,             // Whether include values that bigger than `max`.

        align: 'auto',              // 'auto', 'left', 'right'
        itemWidth: 20,              // When put the controller vertically, it is the length of
                                    // horizontal side of each item. Otherwise, vertical side.
        itemHeight: 14,             // When put the controller vertically, it is the length of
                                    // vertical side of each item. Otherwise, horizontal side.
        itemSymbol: 'roundRect',
        pieceList: null,            // Each item is Object, with some of those attrs:
                                    // {min, max, lt, gt, lte, gte, value,
                                    // color, colorSaturation, colorAlpha, opacity,
                                    // symbol, symbolSize}, which customize the range or visual
                                    // coding of the certain piece. Besides, see "Order Rule".
        categories: null,           // category names, like: ['some1', 'some2', 'some3'].
                                    // Attr min/max are ignored when categories set. See "Order Rule"
        splitNumber: 5,             // If set to 5, auto split five pieces equally.
                                    // If set to 0 and component type not set, component type will be
                                    // determined as "continuous". (It is less reasonable but for ec2
                                    // compatibility, see echarts/component/visualMap/typeDefaulter)
        selectedMode: 'multiple',   // Can be 'multiple' or 'single'.
        itemGap: 10,                // The gap between two items, in px.
        hoverLink: true,            // Enable hover highlight.

        showLabel: null             // By default, when text is used, label will hide (the logic
                                    // is remained for compatibility reason)
    },

    /**
     * @override
     */
    optionUpdated: function (newOption, isInit) {
        PiecewiseModel.superApply(this, 'optionUpdated', arguments);

        /**
         * The order is always [low, ..., high].
         * [{text: string, interval: Array.<number>}, ...]
         * @private
         * @type {Array.<Object>}
         */
        this._pieceList = [];

        this.resetExtent();

        /**
         * 'pieces', 'categories', 'splitNumber'
         * @type {string}
         */
        var mode = this._mode = this._determineMode();

        resetMethods[this._mode].call(this);

        this._resetSelected(newOption, isInit);

        var categories = this.option.categories;

        this.resetVisual(function (mappingOption, state) {
            if (mode === 'categories') {
                mappingOption.mappingMethod = 'category';
                mappingOption.categories = zrUtil.clone(categories);
            }
            else {
                mappingOption.dataExtent = this.getExtent();
                mappingOption.mappingMethod = 'piecewise';
                mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {
                    var piece = zrUtil.clone(piece);
                    if (state !== 'inRange') {
                        // FIXME
                        // outOfRange do not support special visual in pieces.
                        piece.visual = null;
                    }
                    return piece;
                });
            }
        });
    },

    /**
     * @protected
     * @override
     */
    completeVisualOption: function () {
        // Consider this case:
        // visualMap: {
        //      pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]
        // }
        // where no inRange/outOfRange set but only pieces. So we should make
        // default inRange/outOfRange for this case, otherwise visuals that only
        // appear in `pieces` will not be taken into account in visual encoding.

        var option = this.option;
        var visualTypesInPieces = {};
        var visualTypes = VisualMapping.listVisualTypes();
        var isCategory = this.isCategory();

        zrUtil.each(option.pieces, function (piece) {
            zrUtil.each(visualTypes, function (visualType) {
                if (piece.hasOwnProperty(visualType)) {
                    visualTypesInPieces[visualType] = 1;
                }
            });
        });

        zrUtil.each(visualTypesInPieces, function (v, visualType) {
            var exists = 0;
            zrUtil.each(this.stateList, function (state) {
                exists |= has(option, state, visualType)
                    || has(option.target, state, visualType);
            }, this);

            !exists && zrUtil.each(this.stateList, function (state) {
                (option[state] || (option[state] = {}))[visualType] = visualDefault.get(
                    visualType, state === 'inRange' ? 'active' : 'inactive', isCategory
                );
            });
        }, this);

        function has(obj, state, visualType) {
            return obj && obj[state] && (
                zrUtil.isObject(obj[state])
                    ? obj[state].hasOwnProperty(visualType)
                    : obj[state] === visualType // e.g., inRange: 'symbol'
            );
        }

        VisualMapModel.prototype.completeVisualOption.apply(this, arguments);
    },

    _resetSelected: function (newOption, isInit) {
        var thisOption = this.option;
        var pieceList = this._pieceList;

        // Selected do not merge but all override.
        var selected = (isInit ? thisOption : newOption).selected || {};
        thisOption.selected = selected;

        // Consider 'not specified' means true.
        zrUtil.each(pieceList, function (piece, index) {
            var key = this.getSelectedMapKey(piece);
            if (!selected.hasOwnProperty(key)) {
                selected[key] = true;
            }
        }, this);

        if (thisOption.selectedMode === 'single') {
            // Ensure there is only one selected.
            var hasSel = false;

            zrUtil.each(pieceList, function (piece, index) {
                var key = this.getSelectedMapKey(piece);
                if (selected[key]) {
                    hasSel
                        ? (selected[key] = false)
                        : (hasSel = true);
                }
            }, this);
        }
        // thisOption.selectedMode === 'multiple', default: all selected.
    },

    /**
     * @public
     */
    getSelectedMapKey: function (piece) {
        return this._mode === 'categories'
            ? piece.value + '' : piece.index + '';
    },

    /**
     * @public
     */
    getPieceList: function () {
        return this._pieceList;
    },

    /**
     * @private
     * @return {string}
     */
    _determineMode: function () {
        var option = this.option;

        return option.pieces && option.pieces.length > 0
            ? 'pieces'
            : this.option.categories
            ? 'categories'
            : 'splitNumber';
    },

    /**
     * @public
     * @override
     */
    setSelected: function (selected) {
        this.option.selected = zrUtil.clone(selected);
    },

    /**
     * @public
     * @override
     */
    getValueState: function (value) {
        var index = VisualMapping.findPieceIndex(value, this._pieceList);

        return index != null
            ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])]
                ? 'inRange' : 'outOfRange'
            )
            : 'outOfRange';
    },

    /**
     * @public
     * @params {number} pieceIndex piece index in visualMapModel.getPieceList()
     * @return {Array.<Object>} [{seriesId, dataIndices: <Array.<number>>}, ...]
     */
    findTargetDataIndices: function (pieceIndex) {
        var result = [];

        this.eachTargetSeries(function (seriesModel) {
            var dataIndices = [];
            var data = seriesModel.getData();

            data.each(this.getDataDimension(data), function (value, dataIndex) {
                // Should always base on model pieceList, because it is order sensitive.
                var pIdx = VisualMapping.findPieceIndex(value, this._pieceList);
                pIdx === pieceIndex && dataIndices.push(dataIndex);
            }, this);

            result.push({seriesId: seriesModel.id, dataIndex: dataIndices});
        }, this);

        return result;
    },

    /**
     * @private
     * @param {Object} piece piece.value or piece.interval is required.
     * @return {number} Can be Infinity or -Infinity
     */
    getRepresentValue: function (piece) {
        var representValue;
        if (this.isCategory()) {
            representValue = piece.value;
        }
        else {
            if (piece.value != null) {
                representValue = piece.value;
            }
            else {
                var pieceInterval = piece.interval || [];
                representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity)
                    ? 0
                    : (pieceInterval[0] + pieceInterval[1]) / 2;
            }
        }
        return representValue;
    },

    getVisualMeta: function (getColorVisual) {
        // Do not support category. (category axis is ordinal, numerical)
        if (this.isCategory()) {
            return;
        }

        var stops = [];
        var outerColors = [];
        var visualMapModel = this;

        function setStop(interval, valueState) {
            var representValue = visualMapModel.getRepresentValue({interval: interval});
            if (!valueState) {
                valueState = visualMapModel.getValueState(representValue);
            }
            var color = getColorVisual(representValue, valueState);
            if (interval[0] === -Infinity) {
                outerColors[0] = color;
            }
            else if (interval[1] === Infinity) {
                outerColors[1] = color;
            }
            else {
                stops.push(
                    {value: interval[0], color: color},
                    {value: interval[1], color: color}
                );
            }
        }

        // Suplement
        var pieceList = this._pieceList.slice();
        if (!pieceList.length) {
            pieceList.push({interval: [-Infinity, Infinity]});
        }
        else {
            var edge = pieceList[0].interval[0];
            edge !== -Infinity && pieceList.unshift({interval: [-Infinity, edge]});
            edge = pieceList[pieceList.length - 1].interval[1];
            edge !== Infinity && pieceList.push({interval: [edge, Infinity]});
        }

        var curr = -Infinity;
        zrUtil.each(pieceList, function (piece) {
            var interval = piece.interval;
            if (interval) {
                // Fulfill gap.
                interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');
                setStop(interval.slice());
                curr = interval[1];
            }
        }, this);

        return {stops: stops, outerColors: outerColors};
    }

});

/**
 * Key is this._mode
 * @type {Object}
 * @this {module:echarts/component/viusalMap/PiecewiseMode}
 */
var resetMethods = {

    splitNumber: function () {
        var thisOption = this.option;
        var pieceList = this._pieceList;
        var precision = Math.min(thisOption.precision, 20);
        var dataExtent = this.getExtent();
        var splitNumber = thisOption.splitNumber;
        splitNumber = Math.max(parseInt(splitNumber, 10), 1);
        thisOption.splitNumber = splitNumber;

        var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;
        // Precision auto-adaption
        while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {
            precision++;
        }
        thisOption.precision = precision;
        splitStep = +splitStep.toFixed(precision);

        var index = 0;

        if (thisOption.minOpen) {
            pieceList.push({
                index: index++,
                interval: [-Infinity, dataExtent[0]],
                close: [0, 0]
            });
        }

        for (
            var curr = dataExtent[0], len = index + splitNumber;
            index < len;
            curr += splitStep
        ) {
            var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);

            pieceList.push({
                index: index++,
                interval: [curr, max],
                close: [1, 1]
            });
        }

        if (thisOption.maxOpen) {
            pieceList.push({
                index: index++,
                interval: [dataExtent[1], Infinity],
                close: [0, 0]
            });
        }

        reformIntervals(pieceList);

        zrUtil.each(pieceList, function (piece) {
            piece.text = this.formatValueText(piece.interval);
        }, this);
    },

    categories: function () {
        var thisOption = this.option;
        zrUtil.each(thisOption.categories, function (cate) {
            // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。
            // 是否改一致。
            this._pieceList.push({
                text: this.formatValueText(cate, true),
                value: cate
            });
        }, this);

        // See "Order Rule".
        normalizeReverse(thisOption, this._pieceList);
    },

    pieces: function () {
        var thisOption = this.option;
        var pieceList = this._pieceList;

        zrUtil.each(thisOption.pieces, function (pieceListItem, index) {

            if (!zrUtil.isObject(pieceListItem)) {
                pieceListItem = {value: pieceListItem};
            }

            var item = {text: '', index: index};

            if (pieceListItem.label != null) {
                item.text = pieceListItem.label;
            }

            if (pieceListItem.hasOwnProperty('value')) {
                var value = item.value = pieceListItem.value;
                item.interval = [value, value];
                item.close = [1, 1];
            }
            else {
                // `min` `max` is legacy option.
                // `lt` `gt` `lte` `gte` is recommanded.
                var interval = item.interval = [];
                var close = item.close = [0, 0];

                var closeList = [1, 0, 1];
                var infinityList = [-Infinity, Infinity];

                var useMinMax = [];
                for (var lg = 0; lg < 2; lg++) {
                    var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];
                    for (var i = 0; i < 3 && interval[lg] == null; i++) {
                        interval[lg] = pieceListItem[names[i]];
                        close[lg] = closeList[i];
                        useMinMax[lg] = i === 2;
                    }
                    interval[lg] == null && (interval[lg] = infinityList[lg]);
                }
                useMinMax[0] && interval[1] === Infinity && (close[0] = 0);
                useMinMax[1] && interval[0] === -Infinity && (close[1] = 0);

                if (__DEV__) {
                    if (interval[0] > interval[1]) {
                        console.warn(
                            'Piece ' + index + 'is illegal: ' + interval
                            + ' lower bound should not greater then uppper bound.'
                        );
                    }
                }

                if (interval[0] === interval[1] && close[0] && close[1]) {
                    // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],
                    // we use value to lift the priority when min === max
                    item.value = interval[0];
                }
            }

            item.visual = VisualMapping.retrieveVisuals(pieceListItem);

            pieceList.push(item);

        }, this);

        // See "Order Rule".
        normalizeReverse(thisOption, pieceList);
        // Only pieces
        reformIntervals(pieceList);

        zrUtil.each(pieceList, function (piece) {
            var close = piece.close;
            var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];
            piece.text = piece.text || this.formatValueText(
                piece.value != null ? piece.value : piece.interval,
                false,
                edgeSymbols
            );
        }, this);
    }
};

function normalizeReverse(thisOption, pieceList) {
    var inverse = thisOption.inverse;
    if (thisOption.orient === 'vertical' ? !inverse : inverse) {
            pieceList.reverse();
    }
}

export default PiecewiseModel;


text:
<?php

declare(strict_types=1);

namespace App\Tests\Entity;

use App\Entity\Course;
use App\Entity\CourseObjective;
use App\Entity\CourseObjectiveInterface;
use App\Entity\School;
use App\Entity\SessionInterface;
use App\Entity\SessionObjectiveInterface;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Mockery as m;

/**
 * Tests for Entity Course
 * @group model
 */
class CourseTest extends EntityBase
{
    /**
     * @var Course
     */
    protected $object;

    /**
     * Instantiate a Course object
     */
    protected function setUp(): void
    {
        $this->object = new Course();
    }

    public function testNotBlankValidation()
    {
        $notBlank = [
            'title',
            'level',
            'year',
            'startDate',
            'endDate',
        ];
        $this->object->setSchool(new School());
        $this->validateNotBlanks($notBlank);

        $this->object->setTitle('test');
        $this->object->setLevel(3);
        $this->object->setYear(2004);
        $this->object->setStartDate(new DateTime());
        $this->object->setEndDate(new DateTime());
        $this->object->setExternalId('');
        $this->validate(0);
        $this->object->setExternalId('test');
        $this->validate(0);
    }

    public function testNotNullValidation()
    {
        $notNull = [
            'school',
        ];
        $this->object->setTitle('test');
        $this->object->setLevel(3);
        $this->object->setYear(2004);
        $this->object->setStartDate(new DateTime());
        $this->object->setEndDate(new DateTime());
        $this->validateNotNulls($notNull);

        $this->object->setSchool(new School());
        $this->validate(0);
    }

    /**
     * @covers \App\Entity\Course::__construct
     */
    public function testConstructor()
    {
        $this->assertEmpty($this->object->getCohorts());
        $this->assertEmpty($this->object->getDirectors());
        $this->assertEmpty($this->object->getMeshDescriptors());
        $this->assertEmpty($this->object->getCourseObjectives());
        $this->assertEmpty($this->object->getLearningMaterials());
        $this->assertEmpty($this->object->getSessions());
        $this->assertEmpty($this->object->getTerms());
        $this->assertEmpty($this->object->getDescendants());
        $this->assertEmpty($this->object->getAdministrators());
        $this->assertEmpty($this->object->getStudentAdvisors());
    }

    /**
     * @covers \App\Entity\Course::setTitle
     * @covers \App\Entity\Course::getTitle
     */
    public function testSetTitle()
    {
        $this->basicSetTest('title', 'string');
    }

    /**
     * @covers \App\Entity\Course::setLevel
     * @covers \App\Entity\Course::getLevel
     */
    public function testSetCourseLevel()
    {
        $this->basicSetTest('level', 'integer');
    }

    /**
     * @covers \App\Entity\Course::setYear
     * @covers \App\Entity\Course::getYear
     */
    public function testSetYear()
    {
        $this->basicSetTest('year', 'integer');
    }

    /**
     * @covers \App\Entity\Course::setStartDate
     * @covers \App\Entity\Course::getStartDate
     */
    public function testSetStartDate()
    {
        $this->basicSetTest('startDate', 'datetime');
    }

    /**
     * @covers \App\Entity\Course::setEndDate
     * @covers \App\Entity\Course::getEndDate
     */
    public function testSetEndDate()
    {
        $this->basicSetTest('endDate', 'datetime');
    }

    /**
     * @covers \App\Entity\Course::setId
     * @covers \App\Entity\Course::getId
     */
    public function testSetExternalId()
    {
        $this->basicSetTest('externalId', 'string');
    }

    /**
     * @covers \App\Entity\Course::setLocked
     * @covers \App\Entity\Course::isLocked
     */
    public function testSetLocked()
    {
        $this->booleanSetTest('locked');
    }

    /**
     * @covers \App\Entity\Course::setArchived
     * @covers \App\Entity\Course::isArchived
     */
    public function testSetArchived()
    {
        $this->booleanSetTest('archived');
    }

    /**
     * @covers \App\Entity\Course::setPublishedAsTbd
     * @covers \App\Entity\Course::isPublishedAsTbd
     */
    public function testSetPublishedAsTbd()
    {
        $this->booleanSetTest('publishedAsTbd');
    }

    /**
     * @covers \App\Entity\Course::setPublished
     * @covers \App\Entity\Course::isPublished
     */
    public function testSetPublished()
    {
        $this->booleanSetTest('published');
    }

    /**
     * @covers \App\Entity\Course::setSchool
     * @covers \App\Entity\Course::getSchool
     */
    public function testSetSchool()
    {
        $this->entitySetTest('school', 'School');
    }

    /**
     * @covers \App\Entity\Course::setClerkshipType
     * @covers \App\Entity\Course::getClerkshipType
     */
    public function testSetClerkshipType()
    {
         $this->entitySetTest('clerkshipType', 'CourseClerkshipType');
    }

    /**
     * @covers \App\Entity\Course::addDirector
     */
    public function testAddDirector()
    {
        $this->entityCollectionAddTest('director', 'User', false, false, 'addDirectedCourse');
    }

    /**
     * @covers \App\Entity\Course::removeDirector
     */
    public function testRemoveDirector()
    {
        $this->entityCollectionRemoveTest('director', 'User', false, false, false, 'removeDirectedCourse');
    }

    /**
     * @covers \App\Entity\Course::getDirectors
     */
    public function testGetDirectors()
    {
        $this->entityCollectionSetTest('director', 'User', false, false, 'addDirectedCourse');
    }

    /**
     * @covers \App\Entity\Course::addCohort
     */
    public function testAddCohort()
    {
        $this->entityCollectionAddTest('cohort', 'Cohort', false, false, 'addCourse');
    }

    /**
     * @covers \App\Entity\Course::removeCohort
     */
    public function testRemoveCohort()
    {
        $this->entityCollectionRemoveTest('cohort', 'Cohort', false, false, false, 'removeCourse');
    }

    /**
     * @covers \App\Entity\Course::getCohorts
     */
    public function testGetCohorts()
    {
        $this->entityCollectionSetTest('cohort', 'Cohort', false, false, 'addCourse');
    }

    /**
     * @covers \App\Entity\Course::addLearningMaterial
     */
    public function testAddLearningMaterial()
    {
        $this->entityCollectionAddTest('learningMaterial', 'CourseLearningMaterial');
    }

    /**
     * @covers \App\Entity\Course::removeLearningMaterial
     */
    public function testRemoveLearningMaterial()
    {
        $this->entityCollectionRemoveTest('learningMaterial', 'CourseLearningMaterial');
    }

    /**
     * @covers \App\Entity\Course::setLearningMaterials
     * @covers \App\Entity\Course::getLearningMaterials
     */
    public function testGetLearningMaterials()
    {
        $this->entityCollectionSetTest('learningMaterial', 'CourseLearningMaterial');
    }

    /**
     * @covers \App\Entity\Course::addTerm
     */
    public function testAddTerm()
    {
        $this->entityCollectionAddTest('term', 'Term', false, false, 'addCourse');
    }

    /**
     * @covers \App\Entity\Course::removeTerm
     */
    public function testRemoveTerm()
    {
        $this->entityCollectionRemoveTest('term', 'Term', false, false, false, 'removeCourse');
    }

    /**
     * @covers \App\Entity\Course::getTerms
     * @covers \App\Entity\Course::setTerms
     */
    public function testSetTerms()
    {
        $this->entityCollectionSetTest('term', 'Term', false, false, 'addCourse');
    }

    /**
     * @covers \App\Entity\Course::setAncestor
     * @covers \App\Entity\Course::getAncestor
     */
    public function testSetAncestor()
    {
        $this->entitySetTest('ancestor', 'Course');
    }

    /**
     * @covers \App\Entity\Course::getAncestorOrSelf
     */
    public function testGetAncestorOrSelfWithAncestor()
    {
        $ancestor = m::mock('App\Entity\Course');
        $this->object->setAncestor($ancestor);
        $this->assertSame($ancestor, $this->object->getAncestorOrSelf());
    }

    /**
     * @covers \App\Entity\Course::getAncestorOrSelf
     */
    public function testGetAncestorOrSelfWithNoAncestor()
    {
        $this->assertSame($this->object, $this->object->getAncestorOrSelf());
    }

    /**
     * @covers \App\Entity\Course::addDescendant
     */
    public function testAddDescendant()
    {
        $this->entityCollectionAddTest('descendant', 'Course');
    }

    /**
     * @covers \App\Entity\Course::removeDescendant
     */
    public function testRemoveDescendant()
    {
        $this->entityCollectionRemoveTest('descendant', 'Course');
    }

    /**
     * @covers \App\Entity\Course::getDescendants
     * @covers \App\Entity\Course::setDescendants
     */
    public function testGetDescendants()
    {
        $this->entityCollectionSetTest('descendant', 'Course');
    }

    /**
     * @covers \App\Entity\Course::addSession
     */
    public function testAddSession()
    {
        $this->entityCollectionAddTest('session', 'Session');
    }

    /**
     * @covers \App\Entity\Course::removeSession
     */
    public function testRemoveSession()
    {
        $this->entityCollectionRemoveTest('session', 'Session');
    }

    /**
     * @covers \App\Entity\Course::getSessions
     */
    public function testGetSessions()
    {
        $this->entityCollectionSetTest('session', 'Session');
    }

    /**
     * @covers \App\Entity\Course::addAdministrator
     */
    public function testAddAdministrator()
    {
        $this->entityCollectionAddTest('administrator', 'User', false, false, 'addAdministeredCourse');
    }

    /**
     * @covers \App\Entity\Course::removeAdministrator
     */
    public function testRemoveAdministrator()
    {
        $this->entityCollectionRemoveTest('administrator', 'User', false, false, false, 'removeAdministeredCourse');
    }

    /**
     * @covers \App\Entity\Course::getAdministrators
     * @covers \App\Entity\Course::setAdministrators
     */
    public function testSetAdministrators()
    {
        $this->entityCollectionSetTest('administrator', 'User', false, false, 'addAdministeredCourse');
    }

    /**
     * @covers \App\Entity\Course::addStudentAdvisor
     */
    public function testAddStudentAdvisor()
    {
        $this->entityCollectionAddTest('studentAdvisor', 'User', false, false, 'addStudentAdvisedCourse');
    }

    /**
     * @covers \App\Entity\Course::removeStudentAdvisor
     */
    public function testRemoveStudentAdvisor()
    {
        $this->entityCollectionRemoveTest('studentAdvisor', 'User', false, false, false, 'removeStudentAdvisedCourse');
    }

    /**
     * @covers \App\Entity\Course::getStudentAdvisors
     * @covers \App\Entity\Course::setStudentAdvisors
     */
    public function testSetStudentAdvisors()
    {
        $this->entityCollectionSetTest('studentAdvisor', 'User', false, false, 'addStudentAdvisedCourse');
    }

    /**
     * @covers \App\Entity\Course::removeCourseObjective
     */
    public function testRemoveObjectiveWithSessionChildren()
    {
        $courseObjective = m::mock(CourseObjectiveInterface::class);
        $sessionObjective = m::mock(SessionObjectiveInterface::class);
        $sessionObjective->shouldReceive('removeCourseObjective')->with($courseObjective)->once();
        $session = m::mock(SessionInterface::class);
        $session->shouldReceive('getSessionObjectives')
            ->andReturn(new ArrayCollection([$sessionObjective]))->once();
        $this->object->addSession($session);
        $this->object->addCourseObjective($courseObjective);
        $this->object->removeCourseObjective($courseObjective);
    }

    /**
     * @covers \App\Entity\Course::addCourseObjective
     */
    public function testAddCourseObjective()
    {
        $this->entityCollectionAddTest('courseObjective', 'CourseObjective');
    }

    /**
     * @covers \App\Entity\Course::removeCourseObjective
     */
    public function testRemoveCourseObjective()
    {
        $this->entityCollectionRemoveTest('courseObjective', 'CourseObjective');
    }

    /**
     * @covers \App\Entity\Course::setCourseObjectives
     * @covers \App\Entity\Course::getCourseObjectives
     */
    public function testGetCourseObjectives()
    {
        $this->entityCollectionSetTest('courseObjective', 'CourseObjective');
    }

    /**
     * @covers \App\Entity\Course::addSequenceBlock
     */
    public function testAddSequenceBlock()
    {
        $this->entityCollectionAddTest('sequenceBlock', 'CurriculumInventorySequenceBlock');
    }

    /**
     * @covers \App\Entity\Course::removeSequenceBlock
     */
    public function testRemoveSequenceBlock()
    {
        $this->entityCollectionRemoveTest('sequenceBlock', 'CurriculumInventorySequenceBlock');
    }

    /**
     * @covers \App\Entity\Course::getSequenceBlocks
     * @covers \App\Entity\Course::setSequenceBlocks
     */
    public function testSetSequenceBlocks()
    {
        $this->entityCollectionSetTest('sequenceBlock', 'CurriculumInventorySequenceBlock');
    }

    /**
     * @covers \App\Entity\Course::getIndexableCourses
     */
    public function testGetIndexableCourses()
    {
        $this->assertEquals([$this->object], $this->object->getIndexableCourses());
    }
}


text:
package org.egzi.treebuilder.visitors;

import org.egzi.treebuilder.TreeNode;

/**
 * Listener react on error when {@see Visitor} doVisit fails on some treenode
 */
public interface OnErrorListener {
    /**
     * Execute logic on <b>treeNode</b> during iteration
     * @param treeNode current {@see TreeNode}
     * @param <K> type of tree id
     * @param <V> type of tree value
     */
    <K,V> void report(TreeNode<K,V> treeNode);
}


text:
package org.gradle.internal.operations;

import java.io.Serializable;

public interface BuildOperationRef extends Serializable {

    OperationIdentifier getId();

    OperationIdentifier getParentId();

}


text:
class UserMailer < ApplicationMailer

	def send_welcome_email(user)
    @user = user
    @url  = "http://localhost:3000/#{user_path(@user)}"
    mail(to: @user.email, subject: 'Welcome to My Awesome Site')
  end

  def send_invitation_email(user, challenge)
  	@user = user
    @url  = 'http://example.com/login'
    @challenge = challenge
    mail(to: @user.email, subject: "You've been challenged!")
  end

  def decline
    binding.pry
  end

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <parent>
    <artifactId>camunda-engine-plugins</artifactId>
    <groupId>org.camunda.bpm</groupId>
    <version>7.19.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>camunda-engine-plugin-spin</artifactId>
  <name>Camunda Platform - engine plugins - spin</name>

  <dependencies>

    <dependency>
      <groupId>org.camunda.spin</groupId>
      <artifactId>camunda-spin-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm.dmn</groupId>
      <artifactId>camunda-engine-feel-scala</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.camunda.spin</groupId>
      <artifactId>camunda-spin-dataformat-json-jackson</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.camunda.spin</groupId>
      <artifactId>camunda-spin-dataformat-xml-dom</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>test</scope>
   </dependency>

   <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <scope>test</scope>
   </dependency>

    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-jsr223</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js-scriptengine</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm.model</groupId>
      <artifactId>camunda-bpmn-model</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.skyscreamer</groupId>
      <artifactId>jsonassert</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.python</groupId>
      <artifactId>jython</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-complete</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.camunda.commons</groupId>
      <artifactId>camunda-commons-testing</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>jdk9-and-onwards</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>

      <dependencies>
        <dependency>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

</project>


text:
package com.evolveum.midpoint.web.component.form;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;

import org.apache.commons.lang.StringUtils;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

/**
 * @author lazyman
 */
public class TextAreaFormGroup extends BasePanel<String> {

    private static final String ID_TEXT = "text";
    private static final String ID_TEXT_WRAPPER = "textWrapper";
    private static final String ID_LABEL_CONTAINER = "labelContainer";
    private static final String ID_LABEL = "label";
    private static final String ID_TOOLTIP = "tooltip";

    private static final int DEFAULT_NUMBER_OF_ROWS = 2;

    public TextAreaFormGroup(String id, IModel<String> value, IModel<String> label, String labelSize, String textSize) {
        this(id, value, label, labelSize, textSize, false);
    }

    public TextAreaFormGroup(String id, IModel<String> value, IModel<String> label, String labelSize, String textSize,
                             boolean required) {
        this(id, value, label, labelSize, textSize, required, DEFAULT_NUMBER_OF_ROWS);
    }

    public TextAreaFormGroup(String id, IModel<String> value, IModel<String> label, String labelSize, String textSize,
                             boolean required, int rowNumber){
        this(id, value, label, null, false, labelSize, textSize, required, rowNumber);
    }

    public TextAreaFormGroup(String id, IModel<String> value, IModel<String> label, String tooltipKey,
                             boolean isTooltipInModal, String labelSize, String textSize, boolean required, int rowNumber){
        super(id, value);

        initLayout(label, tooltipKey, isTooltipInModal, labelSize, textSize, required, rowNumber);
    }

    private void initLayout(IModel<String> label, final String tooltipKey, boolean isTooltipInModal, String labelSize,
                            String textSize, boolean required, int rowNumber) {
        WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
        add(labelContainer);

        Label l = new Label(ID_LABEL, label);
        if (StringUtils.isNotEmpty(labelSize)) {
            labelContainer.add(AttributeAppender.prepend("class", labelSize));
        }
        labelContainer.add(l);

		Label tooltipLabel = new Label(ID_TOOLTIP, new Model<>());
        tooltipLabel.add(new AttributeAppender("data-original-title", new AbstractReadOnlyModel<String>() {

            @Override
            public String getObject() {
                return getString(tooltipKey);
		}
        }));
		tooltipLabel.add(new InfoTooltipBehavior(isTooltipInModal));
		tooltipLabel.add(new VisibleEnableBehaviour() {

			@Override
			public boolean isVisible() {
				return tooltipKey != null;
			}
		});
		tooltipLabel.setOutputMarkupId(true);
		tooltipLabel.setOutputMarkupPlaceholderTag(true);
		labelContainer.add(tooltipLabel);

        WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
        if (StringUtils.isNotEmpty(textSize)) {
            textWrapper.add(AttributeAppender.prepend("class", textSize));
        }
        add(textWrapper);

        TextArea text = new TextArea<>(ID_TEXT, getModel());
        text.add(new AttributeModifier("rows", rowNumber));
        text.setOutputMarkupId(true);
        text.setRequired(required);
        text.setLabel(label);
        text.add(AttributeAppender.replace("placeholder", label));
        textWrapper.add(text);
    }

    public void setRows(int rows) {
        TextArea area = (TextArea) get(createComponentPath(ID_TEXT_WRAPPER, ID_TEXT));
        area.add(AttributeModifier.replace("rows", rows));
    }
}


text:
import Promise from 'bluebird';
import request from 'request';

import { getImageLink } from '../../helpers';
var gm = require('gm').subClass({imageMagick: true});

function pixelate(client, evt, suffix) {
  let data = getImageLink(client, evt, suffix);

  let intensity = parseInt(data[0], 10);
  if (intensity > 10) intensity = 10;
  if (intensity <= 0) intensity = 1;

  let image = data[1];

  let embed = { color: 15747399, description: `<:redTick:405749796603822080> Something went wrong. Make sure you use the command correctly!` };

  evt.message.channel.sendMessage('<a:loadingCircle:456089197057671198> Processing Image...')
  .then(message => { setTimeout(() => { message.delete(); }, 5000); });

  return new Promise((resolve, reject) => {
    gm(request(image, function(error, response, body) {
      if (error) { return evt.message.channel.sendMessage('', false, embed); }
    }))
    .out('-scale', '10%', '-scale', '1000%')
    .toBuffer('PNG', (err, buffer) => {
      if (err) { return evt.message.channel.sendMessage('', false, embed); }
      resolve(buffer);
    });
  });
}

export default {
  pixelate
};

export const help = {
  pixelate: {}
};


text:
package com.oakhole.utils;

import com.google.common.base.Charsets;
import com.google.common.net.HttpHeaders;
import org.apache.commons.lang3.Validate;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.Map.Entry;

/**
 * Http与Servlet工具类.
 *
 * @author calvin
 */
@SuppressWarnings("ALL")
public class Servlets {

	// -- 常用数值定义 --//
	public static final long ONE_YEAR_SECONDS = 60 * 60 * 24 * 365;

	/**
	 * 设置客户端缓存过期时间 的Header.
	 */
	public static void setExpiresHeader(HttpServletResponse response, long expiresSeconds) {
		// Http 1.0 header, set a fix expires date.
		response.setDateHeader(HttpHeaders.EXPIRES, System.currentTimeMillis() + (expiresSeconds * 1000));
		// Http 1.1 header, set a time after now.
		response.setHeader(HttpHeaders.CACHE_CONTROL, "private, max-age=" + expiresSeconds);
	}

	/**
	 * 设置禁止客户端缓存的Header.
	 */
	public static void setNoCacheHeader(HttpServletResponse response) {
		// Http 1.0 header
		response.setDateHeader(HttpHeaders.EXPIRES, 1L);
		response.addHeader(HttpHeaders.PRAGMA, "no-cache");
		// Http 1.1 header
		response.setHeader(HttpHeaders.CACHE_CONTROL, "no-cache, no-store, max-age=0");
	}

	/**
	 * 设置LastModified Header.
	 */
	public static void setLastModifiedHeader(HttpServletResponse response, long lastModifiedDate) {
		response.setDateHeader(HttpHeaders.LAST_MODIFIED, lastModifiedDate);
	}

	/**
	 * 设置Etag Header.
	 */
	public static void setEtag(HttpServletResponse response, String etag) {
		response.setHeader(HttpHeaders.ETAG, etag);
	}

	/**
	 * 根据浏览器If-Modified-Since Header, 计算文件是否已被修改.
	 *
	 * 如果无修改, checkIfModify返回false ,设置304 not modify status.
	 *
	 * @param lastModified 内容的最后修改时间.
	 */
	public static boolean checkIfModifiedSince(HttpServletRequest request, HttpServletResponse response,
			long lastModified) {
		long ifModifiedSince = request.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
		if ((ifModifiedSince != -1) && (lastModified < (ifModifiedSince + 1000))) {
			response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
			return false;
		}
		return true;
	}

	/**
	 * 根据浏览器 If-None-Match Header, 计算Etag是否已无效.
	 *
	 * 如果Etag有效, checkIfNoneMatch返回false, 设置304 not modify status.
	 *
	 * @param etag 内容的ETag.
	 */
	public static boolean checkIfNoneMatchEtag(HttpServletRequest request, HttpServletResponse response, String etag) {
		String headerValue = request.getHeader(HttpHeaders.IF_NONE_MATCH);
		if (headerValue != null) {
			boolean conditionSatisfied = false;
			if (!"*".equals(headerValue)) {
				StringTokenizer commaTokenizer = new StringTokenizer(headerValue, ",");

				while (!conditionSatisfied && commaTokenizer.hasMoreTokens()) {
					String currentToken = commaTokenizer.nextToken();
					if (currentToken.trim().equals(etag)) {
						conditionSatisfied = true;
					}
				}
			} else {
				conditionSatisfied = true;
			}

			if (conditionSatisfied) {
				response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
				response.setHeader(HttpHeaders.ETAG, etag);
				return false;
			}
		}
		return true;
	}

	/**
	 * 设置让浏览器弹出下载对话框的Header.
	 *
	 * @param fileName 下载后的文件名.
	 */
	public static void setFileDownloadHeader(HttpServletResponse response, String fileName) {
		// 中文文件名支持
		String encodedfileName = new String(fileName.getBytes(), Charsets.ISO_8859_1);
		response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + encodedfileName + "\"");

	}

	/**
	 * 取得带相同前缀的Request Parameters, copy from spring WebUtils.
	 *
	 * 返回的结果的Parameter名已去除前缀.
	 */
	public static Map<String, Object> getParametersStartingWith(ServletRequest request, String prefix) {
		Validate.notNull(request, "Request must not be null");
		Enumeration paramNames = request.getParameterNames();
		Map<String, Object> params = new TreeMap<String, Object>();
		if (prefix == null) {
			prefix = "";
		}
		while ((paramNames != null) && paramNames.hasMoreElements()) {
			String paramName = (String) paramNames.nextElement();
			if ("".equals(prefix) || paramName.startsWith(prefix)) {
				String unprefixed = paramName.substring(prefix.length());
				String[] values = request.getParameterValues(paramName);
				if ((values == null) || (values.length == 0)) {
					// Do nothing, no values found at all.
				} else if (values.length > 1) {
					params.put(unprefixed, values);
				} else {
					params.put(unprefixed, values[0]);
				}
			}
		}
		return params;
	}

	/**
	 * 组合Parameters生成Query String的Parameter部分, 并在paramter name上加上prefix.
	 *
	 * @see #getParametersStartingWith
	 */
	public static String encodeParameterStringWithPrefix(Map<String, Object> params, String prefix) {
		if (Collections3.isEmpty(params)) {
			return "";
		}

		if (prefix == null) {
			prefix = "";
		}

		StringBuilder queryStringBuilder = new StringBuilder();
		Iterator<Entry<String, Object>> it = params.entrySet().iterator();
		while (it.hasNext()) {
			Entry<String, Object> entry = it.next();
			queryStringBuilder.append(prefix).append(entry.getKey()).append('=').append(entry.getValue());
			if (it.hasNext()) {
				queryStringBuilder.append('&');
			}
		}
		return queryStringBuilder.toString();
	}

	/**
	 * 客户端对Http Basic验证的 Header进行编码.
	 */
	public static String encodeHttpBasic(String userName, String password) {
		String encode = userName + ":" + password;
		return "Basic " + Encodes.encodeBase64(encode.getBytes());
	}
}


text:
ALTER TABLE `user` ADD `remark` TEXT NULL AFTER `pac`;

ALTER TABLE `user` ADD `im_type` INT NULL DEFAULT '1' AFTER `is_admin`;

ALTER TABLE `user` CHANGE `wechat` `im_value` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL;


text:
using System.Collections;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using SqlServerSlackAPI;

// ReSharper disable CheckNamespace
public class UserDefinedFunctions
{
    [SqlFunction(FillRowMethodName = "SlackChatPostMessageFillRow")]
    public static IEnumerable SlackChatPostMessage(
        string token,
            string channel,
            string text,
            string userName,
            string iconUrl
        )
    {
        yield return SlackChatApi.PostMessage(
            token,
            channel,
            text,
            userName,
            iconUrl
            );
    }

    public static void SlackChatPostMessageFillRow(
        object value,
        out SqlBoolean ok,
        out SqlString channel,
        out SqlString timeStamp,
        out SqlString error

        )
    {
        var result = value as SlackChatMessageResult;
        if (result == null)
        {
            ok = SqlBoolean.Null;
            channel = SqlString.Null;
            timeStamp = SqlString.Null;
            error = SqlString.Null;
        }
        else
        {
            ok = result.Ok;
            channel = result.Channel;
            timeStamp = result.TimeStamp;
            error = result.Error;
        }
    }
}