text:
namespace RoombaSharp.Settings
{
    partial class ScheduleForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnOK = new System.Windows.Forms.Button();
            this.btnCancel = new System.Windows.Forms.Button();
            this.tbMonHour = new System.Windows.Forms.TextBox();
            this.tbMonMinute = new System.Windows.Forms.TextBox();
            this.tbTueHour = new System.Windows.Forms.TextBox();
            this.tbTueMinute = new System.Windows.Forms.TextBox();
            this.tbWedHour = new System.Windows.Forms.TextBox();
            this.tbWedMinute = new System.Windows.Forms.TextBox();
            this.tbThuHour = new System.Windows.Forms.TextBox();
            this.tbThuMinute = new System.Windows.Forms.TextBox();
            this.tbFriHour = new System.Windows.Forms.TextBox();
            this.tbFriMinute = new System.Windows.Forms.TextBox();
            this.lblMonday = new System.Windows.Forms.Label();
            this.lblTuesday = new System.Windows.Forms.Label();
            this.lblThursday = new System.Windows.Forms.Label();
            this.lblWednesday = new System.Windows.Forms.Label();
            this.lblFriday = new System.Windows.Forms.Label();
            this.tbSatMinute = new System.Windows.Forms.TextBox();
            this.tbSatHour = new System.Windows.Forms.TextBox();
            this.tbSunMinute = new System.Windows.Forms.TextBox();
            this.tbSunHour = new System.Windows.Forms.TextBox();
            this.lblSaturday = new System.Windows.Forms.Label();
            this.lblSunday = new System.Windows.Forms.Label();
            this.cbMonEnb = new System.Windows.Forms.CheckBox();
            this.cbTueEnb = new System.Windows.Forms.CheckBox();
            this.cbThuEnb = new System.Windows.Forms.CheckBox();
            this.cbWedEnb = new System.Windows.Forms.CheckBox();
            this.cbFriEnb = new System.Windows.Forms.CheckBox();
            this.cbSatEnb = new System.Windows.Forms.CheckBox();
            this.cbSunEnb = new System.Windows.Forms.CheckBox();
            this.lblDays = new System.Windows.Forms.Label();
            this.lblEnable = new System.Windows.Forms.Label();
            this.lblHours = new System.Windows.Forms.Label();
            this.lblMinutes = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // btnOK
            //
            this.btnOK.Location = new System.Drawing.Point(158, 229);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new System.Drawing.Size(100, 23);
            this.btnOK.TabIndex = 0;
            this.btnOK.Text = "OK";
            this.btnOK.UseVisualStyleBackColor = true;
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            //
            // btnCancel
            //
            this.btnCancel.Location = new System.Drawing.Point(264, 229);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(100, 23);
            this.btnCancel.TabIndex = 1;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            //
            // tbMonHour
            //
            this.tbMonHour.Location = new System.Drawing.Point(158, 73);
            this.tbMonHour.Name = "tbMonHour";
            this.tbMonHour.Size = new System.Drawing.Size(100, 20);
            this.tbMonHour.TabIndex = 2;
            //
            // tbMonMinute
            //
            this.tbMonMinute.Location = new System.Drawing.Point(264, 73);
            this.tbMonMinute.Name = "tbMonMinute";
            this.tbMonMinute.Size = new System.Drawing.Size(100, 20);
            this.tbMonMinute.TabIndex = 3;
            //
            // tbTueHour
            //
            this.tbTueHour.Location = new System.Drawing.Point(158, 99);
            this.tbTueHour.Name = "tbTueHour";
            this.tbTueHour.Size = new System.Drawing.Size(100, 20);
            this.tbTueHour.TabIndex = 4;
            //
            // tbTueMinute
            //
            this.tbTueMinute.Location = new System.Drawing.Point(264, 99);
            this.tbTueMinute.Name = "tbTueMinute";
            this.tbTueMinute.Size = new System.Drawing.Size(100, 20);
            this.tbTueMinute.TabIndex = 5;
            //
            // tbWedHour
            //
            this.tbWedHour.Location = new System.Drawing.Point(158, 125);
            this.tbWedHour.Name = "tbWedHour";
            this.tbWedHour.Size = new System.Drawing.Size(100, 20);
            this.tbWedHour.TabIndex = 6;
            //
            // tbWedMinute
            //
            this.tbWedMinute.Location = new System.Drawing.Point(264, 125);
            this.tbWedMinute.Name = "tbWedMinute";
            this.tbWedMinute.Size = new System.Drawing.Size(100, 20);
            this.tbWedMinute.TabIndex = 7;
            //
            // tbThuHour
            //
            this.tbThuHour.Location = new System.Drawing.Point(158, 151);
            this.tbThuHour.Name = "tbThuHour";
            this.tbThuHour.Size = new System.Drawing.Size(100, 20);
            this.tbThuHour.TabIndex = 8;
            //
            // tbThuMinute
            //
            this.tbThuMinute.Location = new System.Drawing.Point(264, 151);
            this.tbThuMinute.Name = "tbThuMinute";
            this.tbThuMinute.Size = new System.Drawing.Size(100, 20);
            this.tbThuMinute.TabIndex = 9;
            //
            // tbFriHour
            //
            this.tbFriHour.Location = new System.Drawing.Point(158, 177);
            this.tbFriHour.Name = "tbFriHour";
            this.tbFriHour.Size = new System.Drawing.Size(100, 20);
            this.tbFriHour.TabIndex = 10;
            //
            // tbFriMinute
            //
            this.tbFriMinute.Location = new System.Drawing.Point(264, 177);
            this.tbFriMinute.Name = "tbFriMinute";
            this.tbFriMinute.Size = new System.Drawing.Size(100, 20);
            this.tbFriMinute.TabIndex = 11;
            //
            // lblMonday
            //
            this.lblMonday.AutoSize = true;
            this.lblMonday.Location = new System.Drawing.Point(42, 76);
            this.lblMonday.Name = "lblMonday";
            this.lblMonday.Size = new System.Drawing.Size(45, 13);
            this.lblMonday.TabIndex = 12;
            this.lblMonday.Text = "Monday";
            //
            // lblTuesday
            //
            this.lblTuesday.AutoSize = true;
            this.lblTuesday.Location = new System.Drawing.Point(39, 102);
            this.lblTuesday.Name = "lblTuesday";
            this.lblTuesday.Size = new System.Drawing.Size(48, 13);
            this.lblTuesday.TabIndex = 13;
            this.lblTuesday.Text = "Tuesday";
            //
            // lblThursday
            //
            this.lblThursday.AutoSize = true;
            this.lblThursday.Location = new System.Drawing.Point(36, 154);
            this.lblThursday.Name = "lblThursday";
            this.lblThursday.Size = new System.Drawing.Size(51, 13);
            this.lblThursday.TabIndex = 14;
            this.lblThursday.Text = "Thursday";
            //
            // lblWednesday
            //
            this.lblWednesday.AutoSize = true;
            this.lblWednesday.Location = new System.Drawing.Point(23, 128);
            this.lblWednesday.Name = "lblWednesday";
            this.lblWednesday.Size = new System.Drawing.Size(64, 13);
            this.lblWednesday.TabIndex = 15;
            this.lblWednesday.Text = "Wednesday";
            //
            // lblFriday
            //
            this.lblFriday.AutoSize = true;
            this.lblFriday.Location = new System.Drawing.Point(52, 180);
            this.lblFriday.Name = "lblFriday";
            this.lblFriday.Size = new System.Drawing.Size(35, 13);
            this.lblFriday.TabIndex = 16;
            this.lblFriday.Text = "Friday";
            //
            // tbSatMinute
            //
            this.tbSatMinute.Location = new System.Drawing.Point(264, 203);
            this.tbSatMinute.Name = "tbSatMinute";
            this.tbSatMinute.Size = new System.Drawing.Size(100, 20);
            this.tbSatMinute.TabIndex = 18;
            //
            // tbSatHour
            //
            this.tbSatHour.Location = new System.Drawing.Point(158, 203);
            this.tbSatHour.Name = "tbSatHour";
            this.tbSatHour.Size = new System.Drawing.Size(100, 20);
            this.tbSatHour.TabIndex = 17;
            //
            // tbSunMinute
            //
            this.tbSunMinute.Location = new System.Drawing.Point(264, 45);
            this.tbSunMinute.Name = "tbSunMinute";
            this.tbSunMinute.Size = new System.Drawing.Size(100, 20);
            this.tbSunMinute.TabIndex = 20;
            //
            // tbSunHour
            //
            this.tbSunHour.Location = new System.Drawing.Point(158, 45);
            this.tbSunHour.Name = "tbSunHour";
            this.tbSunHour.Size = new System.Drawing.Size(100, 20);
            this.tbSunHour.TabIndex = 19;
            //
            // lblSaturday
            //
            this.lblSaturday.AutoSize = true;
            this.lblSaturday.Location = new System.Drawing.Point(38, 206);
            this.lblSaturday.Name = "lblSaturday";
            this.lblSaturday.Size = new System.Drawing.Size(49, 13);
            this.lblSaturday.TabIndex = 21;
            this.lblSaturday.Text = "Saturday";
            //
            // lblSunday
            //
            this.lblSunday.AutoSize = true;
            this.lblSunday.Location = new System.Drawing.Point(44, 48);
            this.lblSunday.Name = "lblSunday";
            this.lblSunday.Size = new System.Drawing.Size(43, 13);
            this.lblSunday.TabIndex = 22;
            this.lblSunday.Text = "Sunday";
            //
            // cbMonEnb
            //
            this.cbMonEnb.AutoSize = true;
            this.cbMonEnb.Location = new System.Drawing.Point(93, 75);
            this.cbMonEnb.Name = "cbMonEnb";
            this.cbMonEnb.Size = new System.Drawing.Size(59, 17);
            this.cbMonEnb.TabIndex = 23;
            this.cbMonEnb.Text = "Enable";
            this.cbMonEnb.UseVisualStyleBackColor = true;
            this.cbMonEnb.CheckedChanged += new System.EventHandler(this.cbMonEnb_CheckedChanged);
            //
            // cbTueEnb
            //
            this.cbTueEnb.AutoSize = true;
            this.cbTueEnb.Location = new System.Drawing.Point(93, 101);
            this.cbTueEnb.Name = "cbTueEnb";
            this.cbTueEnb.Size = new System.Drawing.Size(59, 17);
            this.cbTueEnb.TabIndex = 24;
            this.cbTueEnb.Text = "Enable";
            this.cbTueEnb.UseVisualStyleBackColor = true;
            this.cbTueEnb.CheckedChanged += new System.EventHandler(this.cbTueEnb_CheckedChanged);
            //
            // cbThuEnb
            //
            this.cbThuEnb.AutoSize = true;
            this.cbThuEnb.Location = new System.Drawing.Point(93, 153);
            this.cbThuEnb.Name = "cbThuEnb";
            this.cbThuEnb.Size = new System.Drawing.Size(59, 17);
            this.cbThuEnb.TabIndex = 25;
            this.cbThuEnb.Text = "Enable";
            this.cbThuEnb.UseVisualStyleBackColor = true;
            this.cbThuEnb.CheckedChanged += new System.EventHandler(this.cbThuEnb_CheckedChanged);
            //
            // cbWedEnb
            //
            this.cbWedEnb.AutoSize = true;
            this.cbWedEnb.Location = new System.Drawing.Point(93, 127);
            this.cbWedEnb.Name = "cbWedEnb";
            this.cbWedEnb.Size = new System.Drawing.Size(59, 17);
            this.cbWedEnb.TabIndex = 26;
            this.cbWedEnb.Text = "Enable";
            this.cbWedEnb.UseVisualStyleBackColor = true;
            this.cbWedEnb.CheckedChanged += new System.EventHandler(this.cbWedEnb_CheckedChanged);
            //
            // cbFriEnb
            //
            this.cbFriEnb.AutoSize = true;
            this.cbFriEnb.Location = new System.Drawing.Point(93, 179);
            this.cbFriEnb.Name = "cbFriEnb";
            this.cbFriEnb.Size = new System.Drawing.Size(59, 17);
            this.cbFriEnb.TabIndex = 27;
            this.cbFriEnb.Text = "Enable";
            this.cbFriEnb.UseVisualStyleBackColor = true;
            this.cbFriEnb.CheckedChanged += new System.EventHandler(this.cbFriEnb_CheckedChanged);
            //
            // cbSatEnb
            //
            this.cbSatEnb.AutoSize = true;
            this.cbSatEnb.Location = new System.Drawing.Point(93, 205);
            this.cbSatEnb.Name = "cbSatEnb";
            this.cbSatEnb.Size = new System.Drawing.Size(59, 17);
            this.cbSatEnb.TabIndex = 28;
            this.cbSatEnb.Text = "Enable";
            this.cbSatEnb.UseVisualStyleBackColor = true;
            this.cbSatEnb.CheckedChanged += new System.EventHandler(this.cbSatEnb_CheckedChanged);
            //
            // cbSunEnb
            //
            this.cbSunEnb.AutoSize = true;
            this.cbSunEnb.Location = new System.Drawing.Point(93, 47);
            this.cbSunEnb.Name = "cbSunEnb";
            this.cbSunEnb.Size = new System.Drawing.Size(59, 17);
            this.cbSunEnb.TabIndex = 29;
            this.cbSunEnb.Text = "Enable";
            this.cbSunEnb.UseVisualStyleBackColor = true;
            this.cbSunEnb.CheckedChanged += new System.EventHandler(this.cbSunEnb_CheckedChanged);
            //
            // lblDays
            //
            this.lblDays.AutoSize = true;
            this.lblDays.Location = new System.Drawing.Point(23, 19);
            this.lblDays.Name = "lblDays";
            this.lblDays.Size = new System.Drawing.Size(31, 13);
            this.lblDays.TabIndex = 30;
            this.lblDays.Text = "Days";
            //
            // lblEnable
            //
            this.lblEnable.AutoSize = true;
            this.lblEnable.Location = new System.Drawing.Point(90, 19);
            this.lblEnable.Name = "lblEnable";
            this.lblEnable.Size = new System.Drawing.Size(40, 13);
            this.lblEnable.TabIndex = 31;
            this.lblEnable.Text = "Enable";
            //
            // lblHours
            //
            this.lblHours.AutoSize = true;
            this.lblHours.Location = new System.Drawing.Point(155, 19);
            this.lblHours.Name = "lblHours";
            this.lblHours.Size = new System.Drawing.Size(35, 13);
            this.lblHours.TabIndex = 32;
            this.lblHours.Text = "Hours";
            //
            // lblMinutes
            //
            this.lblMinutes.AutoSize = true;
            this.lblMinutes.Location = new System.Drawing.Point(261, 19);
            this.lblMinutes.Name = "lblMinutes";
            this.lblMinutes.Size = new System.Drawing.Size(44, 13);
            this.lblMinutes.TabIndex = 33;
            this.lblMinutes.Text = "Minutes";
            //
            // ScheduleForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(373, 262);
            this.Controls.Add(this.lblMinutes);
            this.Controls.Add(this.lblHours);
            this.Controls.Add(this.lblEnable);
            this.Controls.Add(this.lblDays);
            this.Controls.Add(this.cbSunEnb);
            this.Controls.Add(this.cbSatEnb);
            this.Controls.Add(this.cbFriEnb);
            this.Controls.Add(this.cbWedEnb);
            this.Controls.Add(this.cbThuEnb);
            this.Controls.Add(this.cbTueEnb);
            this.Controls.Add(this.cbMonEnb);
            this.Controls.Add(this.lblSunday);
            this.Controls.Add(this.lblSaturday);
            this.Controls.Add(this.tbSunMinute);
            this.Controls.Add(this.tbSunHour);
            this.Controls.Add(this.tbSatMinute);
            this.Controls.Add(this.tbSatHour);
            this.Controls.Add(this.lblFriday);
            this.Controls.Add(this.lblWednesday);
            this.Controls.Add(this.lblThursday);
            this.Controls.Add(this.lblTuesday);
            this.Controls.Add(this.lblMonday);
            this.Controls.Add(this.tbFriMinute);
            this.Controls.Add(this.tbFriHour);
            this.Controls.Add(this.tbThuMinute);
            this.Controls.Add(this.tbThuHour);
            this.Controls.Add(this.tbWedMinute);
            this.Controls.Add(this.tbWedHour);
            this.Controls.Add(this.tbTueMinute);
            this.Controls.Add(this.tbTueHour);
            this.Controls.Add(this.tbMonMinute);
            this.Controls.Add(this.tbMonHour);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.btnOK);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "ScheduleForm";
            this.Text = "Schedule";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ScheduleForm_FormClosing);
            this.Load += new System.EventHandler(this.ScheduleForm_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btnOK;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.TextBox tbMonHour;
        private System.Windows.Forms.TextBox tbMonMinute;
        private System.Windows.Forms.TextBox tbTueHour;
        private System.Windows.Forms.TextBox tbTueMinute;
        private System.Windows.Forms.TextBox tbWedHour;
        private System.Windows.Forms.TextBox tbWedMinute;
        private System.Windows.Forms.TextBox tbThuHour;
        private System.Windows.Forms.TextBox tbThuMinute;
        private System.Windows.Forms.TextBox tbFriHour;
        private System.Windows.Forms.TextBox tbFriMinute;
        private System.Windows.Forms.Label lblMonday;
        private System.Windows.Forms.Label lblTuesday;
        private System.Windows.Forms.Label lblThursday;
        private System.Windows.Forms.Label lblWednesday;
        private System.Windows.Forms.Label lblFriday;
        private System.Windows.Forms.TextBox tbSatMinute;
        private System.Windows.Forms.TextBox tbSatHour;
        private System.Windows.Forms.TextBox tbSunMinute;
        private System.Windows.Forms.TextBox tbSunHour;
        private System.Windows.Forms.Label lblSaturday;
        private System.Windows.Forms.Label lblSunday;
        private System.Windows.Forms.CheckBox cbMonEnb;
        private System.Windows.Forms.CheckBox cbTueEnb;
        private System.Windows.Forms.CheckBox cbThuEnb;
        private System.Windows.Forms.CheckBox cbWedEnb;
        private System.Windows.Forms.CheckBox cbFriEnb;
        private System.Windows.Forms.CheckBox cbSatEnb;
        private System.Windows.Forms.CheckBox cbSunEnb;
        private System.Windows.Forms.Label lblDays;
        private System.Windows.Forms.Label lblEnable;
        private System.Windows.Forms.Label lblHours;
        private System.Windows.Forms.Label lblMinutes;
    }
}


text:
<!DOCTYPE html>

        <meta charset="utf-8" />
        <title>CheckBox - GUI Demo</title>

        <link rel="stylesheet" href="asset/css/demo.css" />
        <link rel="stylesheet" href="../src/css/main.less" />

        CheckBox

redpajama_set_name: RedPajamaGithub


text:
module RubyWarrior
  module Abilities
    class Rest < Base
      def description
        "Gain 10% of max health back, but do nothing more."
      end

      def perform
        if @unit.health < @unit.max_health
          amount = (@unit.max_health*0.1).round
          amount = @unit.max_health-@unit.health if (@unit.health + amount) > @unit.max_health
          @unit.health += amount
          @unit.say "receives #{amount} health from resting, up to #{@unit.health} health"
        else
          @unit.say "is already fit as a fiddle"
        end
      end
    end
  end
end


text:
using System;
using System.ComponentModel.DataAnnotations;

namespace Netcached.Example.Models
{
    public class FibonacciViewModel
    {
        [Display(Name = "Position")]
        [DataType(DataType.Text)]
        public Int32 Position { get; set; }

        [Display(Name = "Value")]
        [DataType(DataType.Text)]
        public Int64 Value { get; set; }
    }
}


text:
package com.justdavis.karl.misc.datasources;

/**
 * Just contains the {@link #JE_DATASOURCES} constant.
 */
public final class XmlNamespace {
	/**
	 * The default XML namespace that should be used by this package's (and its
	 * descendants) JAX-B-supporting classes.
	 */
	public static final String JE_DATASOURCES = "http://justdavis.com/karl/jessentials/datasources";
}


text:
var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Unit Testing' });
});

router.get("/records", function(req, res) {
  var records = req.app.locals.dataManager.getRecords();
  res.render("records", {
    title: "Unit Testing - records",
    data: records
  })
});

module.exports = router;


text:
package org.beigesoft.uml.pojo;

import org.beigesoft.graphic.pojo.Point2D;
import org.beigesoft.uml.model.ELineEndShape;
import org.beigesoft.uml.model.ElementUml;

public class LineUml extends ElementUml {

  private Point2D point1 = new Point2D();

  private Point2D point2 = new Point2D();

  private ELineEndShape lineEnd1Shape;

  private ELineEndShape lineEnd2Shape;

  private boolean isDashed;

  public LineUml() {
    setIndexZ(200);
  }

  @Override
  public String toString() {
    String strPoint1 = point1 == null ? "?" :
      String.format("X1=%1$.3f, Y1=%2$.3f", point1.getX(), point1.getY());
    String strPoint2 = point2 == null ? "?" :
      String.format("X2=%1$.3f, Y2=%2$.3f", point2.getX(), point2.getY());

    return "ln from " + strPoint1 + " to " + strPoint2;
  }

  //SGS:
  public Point2D getPoint1() {
    return point1;
  }

  public void setPoint1(Point2D point1) {
    this.point1 = point1;
  }

  public Point2D getPoint2() {
    return point2;
  }

  public void setPoint2(Point2D point2) {
    this.point2 = point2;
  }

  public ELineEndShape getLineEnd1Shape() {
    return lineEnd1Shape;
  }

  public void setLineEnd1Shape(ELineEndShape lineEnd1Shape) {
    this.lineEnd1Shape = lineEnd1Shape;
  }

  public ELineEndShape getLineEnd2Shape() {
    return lineEnd2Shape;
  }

  public void setLineEnd2Shape(ELineEndShape lineEnd2Shape) {
    this.lineEnd2Shape = lineEnd2Shape;
  }

  public boolean getIsDashed() {
    return isDashed;
  }

  public void setIsDashed(boolean isDashed) {
    this.isDashed = isDashed;
  }
}


text:
% visualize number of trials per condition after batch2

%% display total num of trials per subject,
%  before and after automatic trial removal
for s=1:numel(subjects)
   subj = subjects{s};
   outpath = [outdir subj '\'];
   load([outpath 'batch2_summary.mat']);
   disp([subj '  ' num2str(trial_stats.orig_num_trials) '  ' num2str(trial_stats.new_num_trials)]);
end

%% display number of trials per condition

figure;
%dim = ceil(sqrt(numel(subjects)));
dim = ceil(sqrt(numel(subjects)));
for s=1:numel(subjects)
  subj = subjects{s};
  outpath = [outdir subj '\'];
  load([outpath 'batch2_summary.mat']);
  subplot(dim,dim,s,'align');
  bar(trial_stats.trial_count);
  set(gca,'xlim',[0 numel(trial_stats.trial_count)+1],'xtick',[1:numel(stims)],'xticklabel',conditions,'ylim',[0 max(trial_stats.trial_count)+5]);
  %set(gca,'xlim',[0 numel(trial_stats.trial_count)+1],'xtick',[],'ylim',[0 80]);
  title(subj);
  axcopy(gcf);
end


text:
"""election URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin

from election import views

urlpatterns = [
    url(r'^$', views.browse, name='browse'),
    url(r'^admin/', admin.site.urls),
    url(r'^api/endorsements.json', views.get_endorsements,
        name='get-endorsements'),
    url(r'^api/tags.json', views.get_tags, name='get_tags'),
    url(r'^api/search.json', views.search_endorsers,
        name='search_endorsers'),
    url(r'^endorser/$', views.add_endorser,
        name='add-endorser'),
    url(r'^endorser/(?P<pk>\d+)/$', views.view_endorser,
        name='view-endorser'),
    url(r'^endorser/(?P<pk>\d+)/add-account$',
        views.add_account, name='add-account'),
    url(r'^endorser/(?P<pk>\d+)/add-endorsement$',
        views.add_endorsement, name='add-endorsement'),
    url(r'^endorsers/random$',
        views.random_endorser, name='random-endorser'),
    url(r'^progress/wikipedia$',
        views.progress_wikipedia, name='progress-wikipedia'),
    url(r'^progress/wikipedia/(?P<slug>[^/]+)/missing$',
        views.progress_wikipedia_missing, name='progress-wikipedia-missing'),
    url(r'^progress/wikipedia/(?P<slug>[^/]+)/(?P<mode>\w+)$',
        views.progress_wikipedia_list, name='progress-wikipedia-list'),
    url(r'^progress/tagging$', views.progress_tagging,
        name='progress-tagging'),
    url(r'^progress/twitter$', views.progress_twitter,
        name='progress-twitter'),
    url(r'^confirm/endorsements$',
        views.confirm_endorsements, name='confirm-endorsements'),
    url(r'^confirm/endorsements/(?P<pk>\d+)', views.confirm_endorsement,
        name='confirm-endorsement'),
    url(r'^confirm/newspapers$', views.confirm_newspapers,
        name='confirm-newspapers'),
    url(r'^confirm/newspapers/(?P<pk>\d+)', views.confirm_newspaper,
        name='confirm-newspaper'),
    url(r'^stats/states$', views.stats_states, name='stats-states'),
    url(r'^stats/predictions$', views.stats_predictions,
        name='stats-predictions'),
    url(r'^stats/tags$', views.stats_tags, name='stats-tags'),
    url(r'^stats/charts$', views.charts, name='charts'),
]

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]


text:
% read the NIST format wav files
% Author: Xiao Xiong
% Created: 1 Feb 2005
% Last modified: 1 Feb 2005

function [data] = readFloat32(file_name, big_endian)
if nargin<2
    big_endian = 0;
end
FILE = fopen( file_name );
if FILE < 0
    fprintf('File open error: %s\n', file_name);
    return;
end
if big_endian
    data = fread(FILE, 'float32','ieee-be');
else
    data = fread(FILE, 'float32','ieee-le');
end
data = double(data);
%plot(data);
fclose(FILE);


text:
<?php
/**
 * Created by PhpStorm.
 * User: Khue Quang Nguyen
 * Date: 05-Sep-17
 * Time: 15:22
 */

namespace BrainBundle\Services\Components;

class ArrayProcessor
{
    /**
     * Get random weighted element
     * @param array $weightedValues
     * @return int|mixed|string
     */
    function getRandomWeightedElement(array $weightedValues)
    {
        $rand = mt_rand(0, (int)array_sum($weightedValues));

        foreach ($weightedValues as $key => $value) {
            $rand -= $value;
            if ($rand <= 0) {
                return $key;
            }
        }

        return "";
    }
}


text:
package javax.naming.spi;

import java.util.Hashtable;
import javax.naming.Name;
import javax.naming.Context;
import javax.naming.NamingException;

/**
 * The StateFactory interface describes a factory used to get
 * the state of an object to be bound. Using a lookup() on a
 * suitable context, an class may be found representing, say, a printer;
 * an ObjectFactory may be used to create an instance of the
 * printer object class and methods defined by the printer class may be used
 * to inspect and manipulate the printer. There is a reverse mechanism in
 * which a StateFactory is used by the service provider
 * to obtain the state of the (in this case) printer for storing in the
 * naming system. In addition to implementing this interface, a
 * StateFactory class must be public and have a public
 * constructor taking no parameters.
 *

 * Note that while StateFactory is meant to be used in
 * Context service providers, whereas DirStateFactory
 * is meant to be used in DirContext service providers.

 *
 */
public interface StateFactory {

    /*
     * -------------------------------------------------------------------
     * Methods
     * -------------------------------------------------------------------
     */

    /**
     * Returns a new instance of the specified object o
     * containing the state of the object to be bound, customized by the
     * specified envmt parameter. The name and context
     * parameters optionally specify the name of the object being created.
     *
     * Object and state factories are specified via environment properties
     * from several sources including provider properties files (see the
     * specification of the Context interface) and may comprise
     * a list of factories. When the service provider looks to obtain the list
     * of state factories, the environment and provider properties files are
     * search for the property name specified by constant
     * Context.STATE_FACTORIES. Each state factory in the
     * resulting list is used by NamingManager.getStateToBind()
     * which invokes this method on each of them until a non-null result is
     * achieved or until the list is exhausted. If a StateFactory
     * throws an exception, it should be passed back to the code that
     * invoked NamingManager.getStateToBind() and no further
     * state factories in the list are examined. An exception should only be
     * thrown by a state factory if it is intended that no other state
     * factories be examined. Usually, if an state factory is unable to
     * return the state of an object, then null should be returned.
     *
     * @param o     may be null, or specifies the returning instance
     * @param n     may be null, or specifies the name relative to the
     *              specified context c. The implementation
     *              may clone or copy this object, but will not modify the
     *              original.
     * @param c     the context to which the name parameter is relative, or
     *              may be null when using a name relative the the default
     *              initial context. If a factory uses this context object,
     *              synchronization should be used as context objects are
     *              not thread-safe.
     * @param envmt may be null; the implementation may clone or copy this
     *              object, but will not modify the original.
     * @return      either a new instance of the specified object
     *              o containing the state of the object to be
     *              bound, customized by the specified
     *              envmt parameter. Or null if no object could
     *              be created.
     * @throws NamingException if it is intended that no other state
     *              factories be examined.
     */
    Object getStateToBind(Object o, Name n, Context c, Hashtable<?, ?> envmt)
        throws NamingException;

}


text:
import React from "react";
import {Route, RouteProps, RouteComponentProps} from "react-router-dom";
import LoginPage from "../auth/LoginPage";
import Layout from "../app/Layout";
import CurrentUserStore from "../auth/CurrentUserStore";
import {createImportFetcher} from "../suspense/Fetcher";

interface Props extends RouteProps {
    dynamic?(): PromiseLike<any>;
}

class RouteContent extends React.Component<{renderProps: RouteComponentProps<any>} & Props> {
    render() {
        const {component, render, dynamic, renderProps} = this.props;
        if (component) {
            const Component = component;
            return <Component {...renderProps} />;
        }
        if (render) {
            return render(renderProps);
        }
        if (dynamic) {
            const {default: Component} = createImportFetcher(dynamic).read();
            return <Component {...renderProps} />;
        }
        throw new Error("Route children not supported.");
    }
}

export class PublicRoute extends React.Component<Props> {
    render() {
        const {component, render, ...rest} = this.props;
        return (
            <Route
                {...rest}
                render={rp => (
                    <Layout pathname={rp.location.pathname}>
                        <RouteContent {...this.props} renderProps={rp} />
                    </Layout>
                )}
            />
        );
    }
}

export class PrivateRoute extends React.Component<Props> {
    render() {
        const {component, render, ...rest} = this.props;
        return (
            <Route
                {...rest}
                render={rp => (
                    <CurrentUserStore.Context.Consumer>
                        {store => {
                            const user = store.getUser();
                            if (!user) {
                                return (
                                    <Layout pathname={rp.location.pathname} fullWindow>
                                        <LoginPage loginAttempt={store.getLoginAttempt()} />
                                    </Layout>
                                );
                            }
                            return (
                                <Layout pathname={rp.location.pathname} user={user}>
                                    <RouteContent {...this.props} renderProps={rp} />
                                </Layout>
                            );
                        }}
                    </CurrentUserStore.Context.Consumer>
                )}
            />
        );
    }
}


text:
package Java_Basics_Exercise;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class E23_Average_Grades {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        ArrayList<Student> students = new ArrayList<>();

        int studentsCount = Integer.parseInt(scanner.nextLine());

        for (int i = 0; i < studentsCount; i++) {
            String[] input = scanner.nextLine().split("\\s+");

            String studentName = input[0];
            Double[] studentGrades = Arrays
                    .stream(input)
                    .skip(1)
                    .map(Double::parseDouble)
                    .toArray(Double[]::new);

            Student currentStudent = new Student() {{
                setName(studentName);
                setGrades(Arrays.asList(studentGrades));
            }};

            students.add(currentStudent);
        }

        Student[] filteredStudents = students
                .stream()
                .filter(s -> s.getAverageGrade() >= 5.00)
                .sorted((a, b) -> {
                    int comparissonResult = a.getName().compareTo(b.getName());

                    if (comparissonResult == 0) {   // if it returns 0, a equals b (we need to do
                                                    // the other sort - descending by avgGrade)
                        comparissonResult = b.getAverageGrade().compareTo(a.getAverageGrade());
                    }

                    return comparissonResult;
                })
                .toArray(Student[]::new);

        for (Student student : filteredStudents) {
            System.out.printf("%s -> %.2f%n", student.getName(), student.getAverageGrade());
        }
    }
}

class Student {
    private String name;

    private List<Double> grades;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Double> getGrades() {
        return grades;
    }

    public void setGrades(List<Double> grades) {
        this.grades = grades;
    }

    public Double getAverageGrade() {
        double averageGrade = this.grades.stream().mapToDouble(a -> a).average().getAsDouble();
        return averageGrade;
    }
}


text:
package com.netflix.servo.publish;

import com.google.common.base.Function;
import com.netflix.servo.Metric;

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

/**
 * An observer that will transform the list of metrics using a given function.
 */
public class MetricTransformObserver implements MetricObserver {
    private final Function<Metric, Metric> transformer;
    private final MetricObserver observer;

    /**
     * Create a new MetricTransformObserver using the given transfomer function.
     *
     * @param transformer The function used to transform metrics.
     * @param observer    The MetricObserver that will receive the transfomed metrics.
     */
    public MetricTransformObserver(Function<Metric, Metric> transformer, MetricObserver observer) {
        this.transformer = transformer;
        this.observer = observer;
    }

    @Override
    public void update(List<Metric> metrics) {
        List<Metric> transformed = new ArrayList<Metric>(metrics.size());
        for (Metric m : metrics) {
            transformed.add(transformer.apply(m));
        }
        observer.update(transformed);
    }

    @Override
    public String getName() {
        return "MetricTransformObserver";
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: jmadueno
 * Date: 06/11/2015
 * Time: 10:26
 */

namespace RM\ComunicacionBundle\Form\Type;

use RM\ComunicacionBundle\Entity\Canal;
use RM\ComunicacionBundle\Entity\Comunicacion;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;

class ComunicacionType extends AbstractType
{
    private $comunicacion;

    private $estados = [
        Comunicacion::ESTADO_CONFIGURACION => 'En configuración',
        Comunicacion::ESTADO_ACTIVO        => 'Activa',
        Comunicacion::ESTADO_PAUSADO       => 'Pausada',
        Comunicacion::ESTADO_COMPLETADA    => 'Completada'
    ];

    public function __construct(Comunicacion $comunicacion = null)
    {
        $this->comunicacion = $comunicacion;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nombre', 'text', [
                'required' => true
            ])
            ->add('fecInicio', 'date', [
                'widget'   => 'single_text',
                'format'   => 'dd/MM/yyyy',
                'required' => true,
            ])
            ->add('fecFin', 'date', [
                'widget'   => 'single_text',
                'format'   => 'dd/MM/yyyy',
                'required' => true,
            ])
            ->add('estado', 'choice', [
                'choices' => $this->getEstadosPosibles(),
            ])
            ->add('idCanal', 'entity', [
                'class'       => 'RMComunicacionBundle:Canal',
                'placeholder' => 'Seleccione un canal',
                'em'          => $options['em'],
                'required'    => true
            ])
        ;

        $addAsunto = function(FormInterface $form, Canal $canal){

            if($canal->getNombre() === 'Email') {
                $form->add('asunto', 'text', ['required' =>true,]);
            } else {
                $form->remove('asunto');
            }
        };

        $builder->get('idCanal')->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) use ($addAsunto) {
            $form = $event->getForm()->getParent();
            $canal = $event->getData();

            if(!$canal instanceof Canal) {
                return;
            }

            $addAsunto($form, $canal);
        } );

        $builder->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event) use ($addAsunto){
            $form = $event->getForm();
            $comunicacion = $event->getData();

            if(!$comunicacion instanceof Comunicacion) {
                return;
            }

            $canal = $comunicacion->getIdCanal();
            if(!$canal instanceof Canal) {
                return;
            }

            $addAsunto($form, $canal);

        });

    }

    /**
     * Devuelve un array con los estados a los que puede pasar una comunicación
     *
     * @return array
     */
    private function getEstadosPosibles()
    {
        if (!$this->comunicacion instanceof Comunicacion) {
            return $this->estados;
        }

        if ($this->comunicacion->getGenerada() || in_array($this->comunicacion->getEstado(), [
                Comunicacion::ESTADO_ACTIVO,
                Comunicacion::ESTADO_PAUSADO,
                Comunicacion::ESTADO_COMPLETADA
            ])
        ) {
            return [
                Comunicacion::ESTADO_ACTIVO     => 'Activa',
                Comunicacion::ESTADO_PAUSADO    => 'Pausada',
                Comunicacion::ESTADO_COMPLETADA => 'Completada'
            ];
        }

        return $this->estados;
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults([
                'data_class' => 'RM\ComunicacionBundle\Entity\Comunicacion'
            ])
            ->setRequired(['em'])
            ->setAllowedTypes('em', 'Doctrine\Common\Persistence\ObjectManager');
    }

    public function getName()
    {
        return 'comunicacion';
    }

}


text:
<refentry xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          id="section.properties">
<refmeta>
<refentrytitle>section.properties</refentrytitle>
<refmiscinfo role="type">attribute set</refmiscinfo>
</refmeta>
<refnamediv>
<refname>section.properties</refname>
<refpurpose>Properties for all section levels</refpurpose>
</refnamediv>

<refsynopsisdiv>
<src:fragment id='section.properties.frag'>
<xsl:attribute-set name="section.properties">
</xsl:attribute-set>
</src:fragment>
</refsynopsisdiv>

<refsect1><title>Description</title>

<para>The properties that apply to the containing
block of all section levels, and therefore apply to
the whole section.
This attribute set is inherited by the
more specific attribute sets such as
<sgmltag>section.level1.properties</sgmltag>.
The default is empty.
</para>

</refsect1>
</refentry>


text:
using Xunit;

namespace UnitTests.SQL.MicroORM
{
    public class Database
    {
        [Fact]
        public void Create()
        {
            Utilities.SQL.MicroORM.Database TestObject = null;
            Assert.DoesNotThrow(() =>
            {
                TestObject = new Utilities.SQL.MicroORM.Database("Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", "Database1");
            });
            Assert.Equal("Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", TestObject.Connection);
            Assert.Equal(0, TestObject.Mappings.Count);
            Assert.Equal("Database1", TestObject.Name);
        }
    }
}


text:
package com.ycombinator.news.dto;

import android.os.AsyncTask;
import android.test.InstrumentationTestCase;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.apache.http.HttpStatus;

import static org.fest.assertions.api.Assertions.assertThat;

public class HackerNewsWebsiteTest extends InstrumentationTestCase
{
    private CountDownLatch signal;
    private Integer result;

    @Override protected void setUp() throws Exception
    {
        super.setUp();
        signal = new CountDownLatch(1);
        result = null;
    }

    private class TestUrl extends AsyncTask<URL, Void, Integer>
    {
        @Override protected Integer doInBackground(URL... params)
        {
            URL url = params[0];
            try
            {
                HttpURLConnection huc = (HttpURLConnection) url.openConnection();
                huc.setRequestMethod("GET");
                huc.connect();
                return huc.getResponseCode();
            }
            catch (IOException e)
            {
                return -1;
            }
        }

        @Override protected void onPostExecute(Integer integer)
        {
            super.onPostExecute(integer);
            result = integer;
            signal.countDown();
        }
    }

    public void testUrlNotPresent() throws Throwable
    {
        runTestOnUiThread(new Runnable()
        {
            @Override public void run()
            {
                try
                {
                    new TestUrl().execute(new URL("http://not_a_url.com"));
                }
                catch (MalformedURLException e)
                {
                    assertTrue(false);
                }
            }
        });
        signal.await(30, TimeUnit.SECONDS);
        assertThat(result).isEqualTo(-1);
    }

    public void testUrlPresent() throws Throwable
    {
        runTestOnUiThread(new Runnable()
        {
            @Override public void run()
            {
                try
                {
                    new TestUrl().execute(new URL(ItemDTO.getOwnUrl(new ItemId(8422599))));
                }
                catch (MalformedURLException e)
                {
                    assertTrue(false);
                }
            }
        });
        signal.await(30, TimeUnit.SECONDS);
        assertThat(result).isEqualTo(HttpStatus.SC_OK);
    }
}


text:
import copy

from libcloud.dns.base import Zone, Record, DNSDriver
from libcloud.dns.types import (
    Provider,
    RecordType,
    RecordError,
    ZoneDoesNotExistError,
    ZoneAlreadyExistsError,
    RecordDoesNotExistError,
    RecordAlreadyExistsError,
)
from libcloud.common.gandi_live import (
    GandiLiveResponse,
    BaseGandiLiveDriver,
    GandiLiveConnection,
    ResourceConflictError,
    ResourceNotFoundError,
)

__all__ = [
    "GandiLiveDNSDriver",
]

TTL_MIN = 300
TTL_MAX = 2592000  # 30 days
API_BASE = "/api/v5"

class GandiLiveDNSResponse(GandiLiveResponse):
    pass

class GandiLiveDNSConnection(GandiLiveConnection):
    responseCls = GandiLiveDNSResponse

class GandiLiveDNSDriver(BaseGandiLiveDriver, DNSDriver):
    """
    API reference can be found at:

    https://doc.livedns.gandi.net/

    Please note that the Libcloud paradigm of one zone per domain does not
    match exactly with Gandi LiveDNS.  For Gandi, a "zone" can apply to
    multiple domains.  This driver behaves as if the domain is a zone, but be
    warned that modifying a domain means modifying the zone.  Iif you have a
    zone associated with mutiple domains, all of those domains will be
    modified as well.
    """

    type = Provider.GANDI
    name = "Gandi LiveDNS"
    website = "http://www.gandi.net/domain"

    connectionCls = GandiLiveDNSConnection

    # also supports CAA, CDS
    RECORD_TYPE_MAP = {
        RecordType.A: "A",
        RecordType.AAAA: "AAAA",
        RecordType.ALIAS: "ALIAS",
        RecordType.CNAME: "CNAME",
        RecordType.DNAME: "DNAME",
        RecordType.DS: "DS",
        RecordType.KEY: "KEY",
        RecordType.LOC: "LOC",
        RecordType.MX: "MX",
        RecordType.NS: "NS",
        RecordType.PTR: "PTR",
        RecordType.SPF: "SPF",
        RecordType.SRV: "SRV",
        RecordType.SSHFP: "SSHFP",
        RecordType.TLSA: "TLSA",
        RecordType.TXT: "TXT",
        RecordType.WKS: "WKS",
        RecordType.CAA: "CAA",
    }

    def list_zones(self):
        zones = self.connection.request(action="%s/domains" % API_BASE, method="GET")
        return self._to_zones(zones.object)

    def get_zone(self, zone_id):
        action = "{}/domains/{}".format(API_BASE, zone_id)
        try:
            zone = self.connection.request(action=action, method="GET")
        except ResourceNotFoundError:
            raise ZoneDoesNotExistError(value="", driver=self.connection.driver, zone_id=zone_id)
        return self._to_zone(zone.object)

    """
    :param extra: (optional) Extra attribute ('name'); if not provided, name
                             is based on domain.

    :return: :class:`Zone` with attribute zone_uuid set in extra ``dict``
    """

    def create_zone(self, domain, type="master", ttl=None, extra=None):
        if extra and "name" in extra:
            zone_name = extra["name"]
        else:
            zone_name = "%s zone" % domain
        zone_data = {
            "name": zone_name,
        }

        try:
            new_zone = self.connection.request(
                action="%s/zones" % API_BASE, method="POST", data=zone_data
            )
        except ResourceConflictError:
            raise ZoneAlreadyExistsError(value="", driver=self.connection.driver, zone_id=zone_name)
        new_zone_uuid = new_zone.headers["location"].split("/")[-1]

        self.ex_switch_domain_gandi_zone(domain, new_zone_uuid)

        return self._to_zone({"fqdn": domain, "zone_uuid": new_zone_uuid})

    def list_records(self, zone):
        action = "{}/domains/{}/records".format(API_BASE, zone.id)
        records = self.connection.request(action=action, method="GET")
        return self._to_records(records.object, zone)

    """
    :return: :class:`Record` with the extra ``dict`` containing attribute
             other_values ``list`` of ``str`` for other values; the first
             value is returned through Record.data.
    """

    def get_record(self, zone_id, record_id):
        record_type, name = record_id.split(":", 1)
        action = "{}/domains/{}/records/{}/{}".format(API_BASE, zone_id, name, record_type)
        try:
            record = self.connection.request(action=action, method="GET")
        except ResourceNotFoundError:
            raise RecordDoesNotExistError(
                value="", driver=self.connection.driver, record_id=record_id
            )
        return self._to_record(record.object, self.get_zone(zone_id))[0]

    def create_record(self, name, zone, type, data, extra=None):
        self._validate_record(None, name, type, data, extra)

        action = "{}/domains/{}/records".format(API_BASE, zone.id)

        if type == "MX":
            data = "{} {}".format(extra["priority"], data)

        record_data = {
            "rrset_name": name,
            "rrset_type": self.RECORD_TYPE_MAP[type],
            "rrset_values": [data],
        }

        if extra is not None and "ttl" in extra:
            record_data["rrset_ttl"] = extra["ttl"]

        try:
            self.connection.request(action=action, method="POST", data=record_data)
        except ResourceConflictError:
            raise RecordAlreadyExistsError(
                value="",
                driver=self.connection.driver,
                record_id="{}:{}".format(self.RECORD_TYPE_MAP[type], name),
            )

        return self._to_record_sub(record_data, zone, data)

    """
    Ignores name and type, not allowed in an update call to the service.

    The Gandi service requires all values for a record when doing an update.
    Not providing all values during an update means the service will interpret
    it as replacing all values with the one data value.  The easiest way to
    accomplish this is to make sure the value of a get_record is used as the
    value of the record parameter.

    This method will change the value when only one exists.  When more than
    one exists, it will combine the data parameter value with the extra dict
    values contained in the list extra['_other_records'].  This method should
    only be used to make single value updates.

    To change the number of values in the value set or to change several at
    once, delete and recreate, potentially using ex_create_multi_value_record.
    """

    def update_record(self, record, name, type, data, extra):
        self._validate_record(record.id, record.name, record.type, data, extra)

        action = "{}/domains/{}/records/{}/{}".format(
            API_BASE,
            record.zone.id,
            record.name,
            self.RECORD_TYPE_MAP[record.type],
        )

        multiple_value_record = record.extra.get("_multi_value", False)
        other_records = record.extra.get("_other_records", [])

        if record.type == RecordType.MX:
            data = "{} {}".format(extra["priority"], data)

        if multiple_value_record and len(other_records) > 0:
            rvalue = [data]
            for other_record in other_records:
                if record.type == RecordType.MX:
                    rvalue.append(
                        "{} {}".format(other_record["extra"]["priority"], other_record["data"])
                    )
                else:
                    rvalue.append(other_record["data"])
        else:
            rvalue = [data]

        record_data = {"rrset_values": rvalue}

        if extra is not None and "ttl" in extra:
            record_data["rrset_ttl"] = extra["ttl"]

        try:
            self.connection.request(action=action, method="PUT", data=record_data)
        except ResourceNotFoundError:
            raise RecordDoesNotExistError(
                value="", driver=self.connection.driver, record_id=record.id
            )

        record_data["rrset_name"] = record.name
        record_data["rrset_type"] = self.RECORD_TYPE_MAP[record.type]
        return self._to_record(record_data, record.zone)[0]

    """
    The Gandi service considers all values for a name-type combination to be
    one record.  Deleting that name-type record means deleting all values for
    it.
    """

    def delete_record(self, record):
        action = "{}/domains/{}/records/{}/{}".format(
            API_BASE,
            record.zone.id,
            record.name,
            self.RECORD_TYPE_MAP[record.type],
        )
        try:
            self.connection.request(action=action, method="DELETE")
        except ResourceNotFoundError:
            raise RecordDoesNotExistError(
                value="", driver=self.connection.driver, record_id=record.id
            )
        # Originally checked for success here, but it should never reach
        # this point with anything other than HTTP 200
        return True

    def export_zone_to_bind_format(self, zone):
        action = "{}/domains/{}/records".format(API_BASE, zone.id)
        headers = {"Accept": "text/plain"}
        resp = self.connection.request(action=action, method="GET", headers=headers, raw=True)
        return resp.body

    # There is nothing you can update about a domain; you can update zones'
    # names and which zone a domain is associated with, but the domain itself
    # is basically immutable.  Instead, some ex_ methods for dealing with
    # Gandi zones.

    """
    Update the name of a Gandi zone.

    Note that a Gandi zone is not the same as a Libcloud zone.  A Gandi zone
    is a separate object type from a Gandi domain; a Gandi zone can be reused
    by multiple Gandi domains, and the actual records are associated with the
    zone directly.  This is mostly masked in this driver to make it look like
    records are associated with domains.  If you need to step out of that
    masking, use these extension methods.

    :param zone_uuid: Identifier for the Gandi zone.
    :type  zone_uuid: ``str``

    :param name: New name for the Gandi zone.
    :type  name: ``str``

    :return: ``bool``
    """

    def ex_update_gandi_zone_name(self, zone_uuid, name):
        action = "{}/zones/{}".format(API_BASE, zone_uuid)
        data = {
            "name": name,
        }
        self.connection.request(action=action, method="PATCH", data=data)
        return True

    # There is no concept of deleting domains in this API, not even to
    # disassociate a domain from a zone.  You can delete a zone, though.
    """
    Delete a Gandi zone.  This may raise a ResourceConflictError if you
    try to delete a zone that has domains still using it.

    :param zone_uuid: Identifier for the Gandi zone
    :type  zone_uuid: ``str``

    :return: ``bool``
    """

    def ex_delete_gandi_zone(self, zone_uuid):
        self.connection.request(action="{}/zones/{}".format(API_BASE, zone_uuid), method="DELETE")
        return True

    """
    Change the Gandi zone a domain is asociated with.

    :param domain: Domain name to switch zones.
    :type  domain: ``str``

    :param zone_uuid: Identifier for the new Gandi zone to switch to.
    :type  zone_uuid: ``str``

    :return: ``bool``
    """

    def ex_switch_domain_gandi_zone(self, domain, zone_uuid):
        domain_data = {
            "zone_uuid": zone_uuid,
        }
        self.connection.request(
            action="{}/domains/{}".format(API_BASE, domain),
            method="PATCH",
            data=domain_data,
        )
        return True

    """
    Create a new record with multiple values.

    :param data: Record values (depends on the record type)
    :type  data: ``list`` (of ``str``)

    :return: ``list`` of :class:`Record`s
    """

    def ex_create_multi_value_record(self, name, zone, type, data, extra=None):
        self._validate_record(None, name, type, data, extra)

        action = "{}/domains/{}/records".format(API_BASE, zone.id)

        record_data = {
            "rrset_name": name,
            "rrset_type": self.RECORD_TYPE_MAP[type],
            "rrset_values": data,
        }

        if extra is not None and "ttl" in extra:
            record_data["rrset_ttl"] = extra["ttl"]

        try:
            self.connection.request(action=action, method="POST", data=record_data)
        except ResourceConflictError:
            raise RecordAlreadyExistsError(
                value="",
                driver=self.connection.driver,
                record_id="{}:{}".format(self.RECORD_TYPE_MAP[type], name),
            )
        return self._to_record(record_data, zone)

    def _to_record(self, data, zone):
        records = []
        rrset_values = data["rrset_values"]
        multiple_value_record = len(rrset_values) > 1

        for index, rrset_value in enumerate(rrset_values):
            record = self._to_record_sub(data, zone, rrset_value)
            record.extra["_multi_value"] = multiple_value_record
            if multiple_value_record:
                record.extra["_other_records"] = []
            records.append(record)

        if multiple_value_record:
            for index in range(0, len(records)):
                record = records[index]
                for other_index, other_record in enumerate(records):
                    if index == other_index:
                        continue

                    extra = copy.deepcopy(other_record.extra)
                    extra.pop("_multi_value")
                    extra.pop("_other_records")

                    item = {
                        "name": other_record.name,
                        "data": other_record.data,
                        "type": other_record.type,
                        "extra": extra,
                    }
                    record.extra["_other_records"].append(item)
        return records

    def _to_record_sub(self, data, zone, value):
        extra = {}
        ttl = data.get("rrset_ttl", None)
        if ttl is not None:
            extra["ttl"] = int(ttl)
        if data["rrset_type"] == "MX":
            priority, value = value.split()
            extra["priority"] = priority
        return Record(
            id="{}:{}".format(data["rrset_type"], data["rrset_name"]),
            name=data["rrset_name"],
            type=self._string_to_record_type(data["rrset_type"]),
            data=value,
            zone=zone,
            driver=self,
            ttl=ttl,
            extra=extra,
        )

    def _to_records(self, data, zone):
        records = []
        for r in data:
            records += self._to_record(r, zone)
        return records

    def _to_zone(self, zone):
        extra = {}
        if "zone_uuid" in zone:
            extra = {"zone_uuid": zone["zone_uuid"]}
        return Zone(
            id=str(zone["fqdn"]),
            domain=zone["fqdn"],
            type="master",
            ttl=0,
            driver=self,
            extra=extra,
        )

    def _to_zones(self, zones):
        ret = []
        for z in zones:
            ret.append(self._to_zone(z))
        return ret

    def _validate_record(self, record_id, name, record_type, data, extra):
        if len(data) > 1024:
            raise RecordError(
                "Record data must be <= 1024 characters",
                driver=self,
                record_id=record_id,
            )
        if type == "MX" or type == RecordType.MX:
            if extra is None or "priority" not in extra:
                raise RecordError(
                    "MX record must have a priority", driver=self, record_id=record_id
                )
        if extra is not None and "_other_records" in extra:
            for other_value in extra.get("_other_records", []):
                if len(other_value["data"]) > 1024:
                    raise RecordError(
                        "Record data must be <= 1024 characters",
                        driver=self,
                        record_id=record_id,
                    )
                if type == "MX" or type == RecordType.MX:
                    if other_value["extra"] is None or "priority" not in other_value["extra"]:
                        raise RecordError(
                            "MX record must have a priority",
                            driver=self,
                            record_id=record_id,
                        )
        if extra is not None and "ttl" in extra:
            if extra["ttl"] < TTL_MIN:
                raise RecordError(
                    "TTL must be at least 300 seconds", driver=self, record_id=record_id
                )
            if extra["ttl"] > TTL_MAX:
                raise RecordError("TTL must not exceed 30 days", driver=self, record_id=record_id)


text:
from dataclasses import dataclass
from decimal import Decimal, InvalidOperation

from jsonobject.exceptions import BadValueError

@dataclass(frozen=True)
class GeoPoint:
    latitude: Decimal
    longitude: Decimal
    altitude: Decimal = Decimal("NaN")
    accuracy: Decimal = Decimal("NaN")

    @property
    def lat_lon(self):
        """Suitable to send to an elasticsearch geo_point field"""
        return {
            'lat': float(self.latitude),
            'lon': float(self.longitude),
        }

    @classmethod
    def from_string(cls, input_string, flexible=False):
        """
        Construct GeoPoint object from string containing space-separated decimals.

        Expects 4 elements, unless flexible=True, in which case 2 works too
        CommCare mobile GPS questions come back with 4 elements, Geocoder uses 2
        """
        try:
            latitude, longitude, altitude, accuracy = _extract_elements(input_string, flexible)
            return cls(
                _validate_range(_to_decimal(latitude), -90, 90),
                _validate_range(_to_decimal(longitude), -180, 180),
                _to_decimal(altitude),
                _to_decimal(accuracy),
            )
        except _GeoPointGenerationError as e:
            raise BadValueError(f"{input_string} is not a valid format GeoPoint format") from e

def _extract_elements(input_string, flexible):
    try:
        elements = input_string.split(' ')
    except (TypeError, AttributeError, ValueError) as e:
        raise _GeoPointGenerationError(f"{input_string} can't be split") from e

    if len(elements) == 4:
        return elements
    if flexible and len(elements) == 2:
        return elements + ["NaN", "NaN"]
    raise _GeoPointGenerationError(f"Unexpected number of elements: {len(elements)}")

def _to_decimal(n):
    """Coerces to Decimal and rounds small scientific notation inputs to 0"""
    try:
        ret = Decimal(n)
    except InvalidOperation as e:
        raise _GeoPointGenerationError(f"{n} is not a valid Decimal") from e

    uses_sci_notation = 'e' in n.lower()
    if uses_sci_notation and abs(ret) < Decimal("0.001"):
        return Decimal("0")
    return ret

def _validate_range(d, lower, upper):
    if (d.is_nan() or not lower <= d <= upper):
        raise _GeoPointGenerationError(f"{d} is out of range")
    return d

class _GeoPointGenerationError(Exception):
    pass


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

namespace Microsoft.WindowsAzure.Management.SqlDatabase.Test.UnitTests.Database.Cmdlet
{
    using System;
    using System.Collections.ObjectModel;
    using System.Management.Automation;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Microsoft.WindowsAzure.Management.SqlDatabase.Database.Cmdlet;
    using Microsoft.WindowsAzure.Management.SqlDatabase.Services;
    using Microsoft.WindowsAzure.Management.SqlDatabase.Services.Server;
    using Microsoft.WindowsAzure.Management.SqlDatabase.Test.UnitTests.MockServer;
    using Microsoft.WindowsAzure.Management.Test.Utilities.Common;
    using Microsoft.WindowsAzure.Management.Utilities.Common;

    [TestClass]
    public class RemoveAzureSqlDatabaseTests : TestBase
    {
        [TestCleanup]
        public void CleanupTest()
        {
            DatabaseTestHelper.SaveDefaultSessionCollection();
        }

        [TestMethod]
        public void RemoveAzureSqlDatabaseWithSqlAuth()
        {
            using (System.Management.Automation.PowerShell powershell =
                System.Management.Automation.PowerShell.Create())
            {
                // Create a context
                NewAzureSqlDatabaseServerContextTests.CreateServerContextSqlAuth(
                    powershell,
                    "$context");

                // Create 2 test databases
                NewAzureSqlDatabaseTests.CreateTestDatabasesWithSqlAuth(
                    powershell,
                    "$context");

                HttpSession testSession = DatabaseTestHelper.DefaultSessionCollection.GetSession(
                    "UnitTests.RemoveAzureSqlDatabaseWithSqlAuth");
                DatabaseTestHelper.SetDefaultTestSessionSettings(testSession);
                testSession.RequestValidator =
                    new Action<HttpMessage, HttpMessage.Request>(
                        (expected, actual) =>
                        {
                            Assert.AreEqual(expected.RequestInfo.Method, actual.Method);
                            Assert.AreEqual(expected.RequestInfo.UserAgent, actual.UserAgent);
                            if (expected.Index < 8)
                            {
                                // Request 0-5: Remove database requests
                                // Request 6-7: Get all database request
                                DatabaseTestHelper.ValidateHeadersForODataRequest(
                                    expected.RequestInfo,
                                    actual);
                            }
                            else
                            {
                                Assert.Fail("No more requests expected.");
                            }
                        });

                using (AsyncExceptionManager exceptionManager = new AsyncExceptionManager())
                {
                    // Create context with both ManageUrl and ServerName overriden
                    Collection<PSObject> databases;
                    using (new MockHttpServer(
                        exceptionManager,
                        MockHttpServer.DefaultServerPrefixUri,
                        testSession))
                    {
                        powershell.InvokeBatchScript(
                            @"Remove-AzureSqlDatabase " +
                            @"-Context $context " +
                            @"-DatabaseName testdb1 " +
                            @"-Force");
                        powershell.InvokeBatchScript(
                            @"Remove-AzureSqlDatabase " +
                            @"-Context $context " +
                            @"-DatabaseName testdb2 " +
                            @"-Force");

                        databases = powershell.InvokeBatchScript(
                            @"Get-AzureSqlDatabase " +
                            @"-Context $context");
                    }

                    Assert.AreEqual(0, powershell.Streams.Error.Count, "Errors during run!");
                    Assert.AreEqual(0, powershell.Streams.Warning.Count, "Warnings during run!");
                    powershell.Streams.ClearStreams();

                    Assert.AreEqual(1, databases.Count, "Expecting only master database object");
                }
            }
        }

        /// <summary>
        /// Test removing a database using certificate authentication
        /// </summary>
        [TestMethod]
        public void RemoveAzureSqlDatabaseWithCertAuth()
        {
            SimpleSqlDatabaseManagement channel = new SimpleSqlDatabaseManagement();

            // This is needed because RemoveDatabases calls GetDatabases in order to
            // get the necessary database information for the delete.
            channel.GetDatabaseThunk = ar =>
            {
                Assert.AreEqual(
                    ar.Values["databaseName"],
                    "testdb1",
                    "The input databaseName did not match the expected");

                SqlDatabaseResponse db1 = new SqlDatabaseResponse();
                db1.CollationName = "Japanese_CI_AS";
                db1.Edition = "Web";
                db1.Id = "1";
                db1.MaxSizeGB = "1";
                db1.Name = "testdb1";
                db1.CreationDate = DateTime.Now.ToString();
                db1.IsFederationRoot = true.ToString();
                db1.IsSystemObject = true.ToString();
                db1.MaxSizeBytes = "1073741824";

                return db1;
            };

            channel.RemoveDatabaseThunk = ar =>
            {
                Assert.AreEqual(
                    ar.Values["databaseName"],
                    "testdb1",
                    "The input databaseName did not match the expected");

                Assert.AreEqual(
                    ((SqlDatabaseInput)ar.Values["input"]).Name,
                    "testdb1",
                    "The database Name input parameter does not match");
                Assert.AreEqual(
                    ((SqlDatabaseInput)ar.Values["input"]).MaxSizeGB,
                    "1",
                    "The database MaxSizeGB input parameter does not match");
                Assert.AreEqual(
                    ((SqlDatabaseInput)ar.Values["input"]).CollationName,
                    "Japanese_CI_AS",
                    "The database CollationName input parameter does not match");
                Assert.AreEqual(
                    ((SqlDatabaseInput)ar.Values["input"]).Edition,
                    "Web",
                    "The database Edition input parameter does not match");
            };

            SubscriptionData subscriptionData = UnitTestHelper.CreateUnitTestSubscription();
            subscriptionData.ServiceEndpoint = MockHttpServer.DefaultHttpsServerPrefixUri.AbsoluteUri;

            NewAzureSqlDatabaseServerContext contextCmdlet = new NewAzureSqlDatabaseServerContext();

            ServerDataServiceCertAuth service =
                contextCmdlet.GetServerDataServiceByCertAuth("TestServer", subscriptionData);
            service.Channel = channel;

            service.RemoveDatabase("testdb1");
        }
    }
}


text:
package org.kuali.rice.krad.dao.proxy;

import org.apache.commons.lang.StringUtils;
import org.kuali.rice.core.api.config.ConfigurationException;
import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
import org.kuali.rice.krad.bo.ModuleConfiguration;
import org.kuali.rice.krad.dao.BusinessObjectDao;
import org.kuali.rice.krad.dao.DocumentDao;
import org.kuali.rice.krad.dao.impl.DocumentDaoJpa;
import org.kuali.rice.krad.dao.impl.DocumentDaoOjb;
import org.kuali.rice.krad.document.Document;
import org.kuali.rice.krad.service.DocumentAdHocService;
import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
import org.kuali.rice.krad.service.KualiModuleService;
import org.kuali.rice.krad.service.ModuleService;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Transactional
public class DocumentDaoProxy implements DocumentDao {

    private DocumentDao documentDaoJpa;
    private DocumentDao documentDaoOjb;

    private static KualiModuleService kualiModuleService;
    private static Map<String, DocumentDao> documentDaoValues = new ConcurrentHashMap<String, DocumentDao>();

    private DocumentDao getDao(Class<? extends Document> clazz) {
    	ModuleService moduleService = getKualiModuleService().getResponsibleModuleService(clazz);
        if (moduleService != null) {
            ModuleConfiguration moduleConfig = moduleService.getModuleConfiguration();
            String dataSourceName = "";
            EntityManager entityManager = null;
            if (moduleConfig != null) {
                dataSourceName = moduleConfig.getDataSourceName();
                entityManager = moduleConfig.getEntityManager();
            }

            if (StringUtils.isNotEmpty(dataSourceName)) {
                if (documentDaoValues.get(dataSourceName) != null) {
                    return documentDaoValues.get(dataSourceName);
                }
                if (OrmUtils.isJpaAnnotated(clazz) && (OrmUtils.isJpaEnabled() || OrmUtils.isJpaEnabled("rice.krad"))) {
                	//using JPA
                	if (entityManager != null) {
                		// we set the entity manager directly in the constructor
                		DocumentDaoJpa documentDaoJpaInstance =
                			new DocumentDaoJpa(entityManager, this.documentDaoJpa.getBusinessObjectDao(),
                					this.documentDaoJpa.getDocumentAdHocService());

                		documentDaoValues.put(dataSourceName, documentDaoJpaInstance);
                		return documentDaoJpaInstance;
                	}
                	throw new ConfigurationException("EntityManager is null. EntityManager must be set in the Module Configuration bean in the appropriate spring beans xml. (see nested exception for details).");
                }
                //using OJB
                DocumentDaoOjb documentDaoOjbInstance =
                	new DocumentDaoOjb(
                			this.documentDaoOjb.getBusinessObjectDao(),
                			this.documentDaoOjb.getDocumentAdHocService());

                // set the data source alias
                documentDaoOjbInstance.setJcdAlias(dataSourceName);

                documentDaoValues.put(dataSourceName, documentDaoOjbInstance);
                return documentDaoOjbInstance;

                }

        }
        return (OrmUtils.isJpaAnnotated(clazz) && OrmUtils.isJpaEnabled()) ? documentDaoJpa : documentDaoOjb;
    }

    /**
	 * @see org.kuali.rice.krad.dao.DocumentDao#save(org.kuali.rice.krad.document.Document)
	 */
    @Override
	public <T extends Document> T save(T document) {
		return getDao(document.getClass()).save(document);
	}

	/**
	 * @see org.kuali.rice.krad.dao.DocumentDao#findByDocumentHeaderId(java.lang.Class, java.lang.String)
	 */
    @Override
	public <T extends Document> T findByDocumentHeaderId(Class<T> clazz, String id) {
		return getDao(clazz).findByDocumentHeaderId(clazz, id);
	}

	/**
	 * @see org.kuali.rice.krad.dao.DocumentDao#findByDocumentHeaderIds(java.lang.Class, java.util.List)
	 */
    @Override
	public <T extends Document> List<T> findByDocumentHeaderIds(Class<T> clazz, List<String> idList) {
		return getDao(clazz).findByDocumentHeaderIds(clazz, idList);
	}

	/**
	 * @see org.kuali.rice.krad.dao.DocumentDao#getBusinessObjectDao()
	 */
    @Override
	public BusinessObjectDao getBusinessObjectDao() {
		if (OrmUtils.isJpaEnabled()) {
			return documentDaoJpa.getBusinessObjectDao();
		}
		return documentDaoOjb.getBusinessObjectDao();
	}

	/**
	 * @see org.kuali.rice.krad.dao.DocumentDao#getDocumentAdHocService()
	 */
    @Override
	public DocumentAdHocService getDocumentAdHocService() {
		if (OrmUtils.isJpaEnabled()) {
			return documentDaoJpa.getDocumentAdHocService();
		}
		return documentDaoOjb.getDocumentAdHocService();
    }

	public void setDocumentDaoJpa(DocumentDao documentDaoJpa) {
		this.documentDaoJpa = documentDaoJpa;
	}

	public void setDocumentDaoOjb(DocumentDao documentDaoOjb) {
		this.documentDaoOjb = documentDaoOjb;
	}

    private synchronized static KualiModuleService getKualiModuleService() {
        if (kualiModuleService == null) {
            kualiModuleService = KRADServiceLocatorWeb.getKualiModuleService();
        }
        return kualiModuleService;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2012 Nodeable Inc
  ~
  ~    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.
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:task="http://www.springframework.org/schema/task"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           ">

    <!-- ===================================================================
         -  Core Config
         =================================================================== -->
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath*:application.properties</value>
                <value>classpath*:cache.properties</value>
                <value>classpath*:cloud.properties</value>
                <value>classpath*:database.properties</value>
                <value>classpath*:email.properties</value>
                <value>classpath*:github.properties</value>
                <value>classpath*:jira.properties</value>
                <value>classpath*:messagebroker.properties</value>
                <value>classpath*:pingdom.properties</value>
                <value>classpath*:search.properties</value>
                <value>classpath*:server.properties</value>
                <value>classpath*:webhdfs.properties</value>

                <value>classpath*:override.properties</value>
            </list>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
    </bean>

    <!-- Email properties file -->
    <util:properties id="emailProperties" location="classpath:email.properties"/>
    <!-- Messages properties file -->
    <util:properties id="messageProperties" location="classpath:messages.properties"/>

    <!-- Enable annotation configuration -->
    <context:annotation-config/>

    <!-- enable AOP annotation access -->
    <aop:aspectj-autoproxy/>

    <!-- Scan sample packages for Spring annotations -->
    <context:component-scan base-package="com.streamreduce.rest"/>
    <context:component-scan base-package="com.streamreduce.core"/>
    <context:component-scan base-package="com.streamreduce.connections"/>
    <context:component-scan base-package="com.streamreduce.client"/>
    <context:component-scan base-package="com.streamreduce.datasource.patch"/>

    <!-- allows us to use the @Async annotation for the task executor -->
    <task:annotation-driven executor="taskExecutor"/>

    <!-- there is a less verbose way in spring 3.0,but we can't set the threadFactory with custom names -->
    <bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="corePoolSize" value="100"/>
        <property name="maxPoolSize" value="100"/>
        <!-- block instead of reject -->
        <!--<property name="rejectedExecutionHandler">-->
        <!--<bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy"/>-->
        <!--</property>-->
        <property name="threadFactory">
            <!-- Customize thread names -->
            <bean class="org.springframework.scheduling.concurrent.CustomizableThreadFactory">
                <property name="threadGroupName" value="pool-async-events"/>
                <property name="threadNamePrefix" value="async-event-thread-"/>
            </bean>
        </property>
    </bean>

    <!-- Amazon Email Service -->
    <bean id="simpleEmailServiceClient" class="com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient">
        <constructor-arg index="0" type="com.amazonaws.auth.AWSCredentials">
            <bean class="com.amazonaws.auth.BasicAWSCredentials">
                <constructor-arg index="0" type="java.lang.String" value="${email.aws.accessKeyId}"/>
                <constructor-arg index="1" type="java.lang.String" value="${email.aws.secretKey}"/>
            </bean>
        </constructor-arg>
    </bean>

</beans>


text:
<?php
foreach($templates as $key => $template)
{
    echo "
id'>";
    echo "bug->applyTemplate}' class='tpl-name' id='tplTitleBox$template->id' href='javascript:setTemplate($template->id)'>$template->title";
    echo "id)' class='btn-delete'>";
    echo "id' class='hidden'>$template->content";
    echo '
';
}


text:
//
//  ========================================================================
//  Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
//  ------------------------------------------------------------------------
//  All rights reserved. This program and the accompanying materials
//  are made available under the terms of the Eclipse Public License v1.0
//  and Apache License v2.0 which accompanies this distribution.
//
//      The Eclipse Public License is available at
//      http://www.eclipse.org/legal/epl-v10.html
//
//      The Apache License v2.0 is available at
//      http://www.opensource.org/licenses/apache2.0.php
//
//  You may elect to redistribute this code under either of these licenses.
//  ========================================================================
//

package org.eclipse.jetty.util.preventers;

/**
 * Java2DLeakPreventer
 *
 * Prevent pinning of webapp classloader by pre-loading sun.java2d.Disposer class
 * before webapp classloaders are created.
 *
 * See https://issues.apache.org/bugzilla/show_bug.cgi?id=51687
 *
 */
public class Java2DLeakPreventer extends AbstractLeakPreventer
{
    /* ------------------------------------------------------------ */
    /**
     * @see org.eclipse.jetty.util.preventers.AbstractLeakPreventer#prevent(java.lang.ClassLoader)
     */
    @Override
    public void prevent(ClassLoader loader)
    {
        try
        {
            Class.forName("sun.java2d.Disposer", true, loader);
        }
        catch (ClassNotFoundException e)
        {
            LOG.ignore(e);
        }
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    class="app.mobile_una_sarapiqui.InfoSeccionRegional.DetalleCarreraFragment"
    android:id="@+id/FrgDetalleCarrera"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />


text:
using System.Net.Http;
using Jumbleblocks.Net.Models;

namespace ConsumingFileUploadWebsite.Models
{
    public class TestFormFile : IFileOverHttp
    {
        public string Title { get; set; }
        public string Description { get; set; }

        public MultipartFileData[] FileData { get; set; }
    }
}