text:
<?php

namespace common\models\p;

use Yii;

/**
 * This is the model class for table "public.sys_divisas".
 *
 * @property integer $id
 * @property string $nombre
 * @property string $codigo
 * @property boolean $sys_status
 * @property string $sys_creado_el
 * @property string $sys_actualizado_el
 * @property string $sys_finalizado_el
 *
 * @property SysTasasDivisas[] $sysTasasDivisas
 */
class SysDivisas extends \common\components\BaseActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'public.sys_divisas';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['nombre', 'codigo'], 'required'],
            [['sys_status'], 'boolean'],
            [['sys_creado_el', 'sys_actualizado_el', 'sys_finalizado_el'], 'safe'],
            [['nombre'], 'string', 'max' => 255],
            [['codigo'], 'string', 'max' => 20],
            [['nombre'], 'unique']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'nombre' => Yii::t('app', 'Nombre'),
            'codigo' => Yii::t('app', 'Codigo'),
            'sys_status' => Yii::t('app', 'Sys Status'),
            'sys_creado_el' => Yii::t('app', 'Sys Creado El'),
            'sys_actualizado_el' => Yii::t('app', 'Sys Actualizado El'),
            'sys_finalizado_el' => Yii::t('app', 'Sys Finalizado El'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getSysTasasDivisas()
    {
        return $this->hasMany(SysTasasDivisas::className(), ['sys_divisa_id' => 'id']);
    }
}


text:
class UserOpenid < ActiveRecord::Base
  belongs_to :user

  validates_presence_of :openid_url
  validates_uniqueness_of :openid_url

  def denormalized_url
    self.openid_url.gsub(%r{^https?://}, '').gsub(%r{/$},'')
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.o2d.pkayjava.editor.view.ui.widget.actors;

import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.utils.Array;
import com.esotericsoftware.spine.*;
import com.esotericsoftware.spine.attachments.Attachment;
import com.esotericsoftware.spine.attachments.RegionAttachment;
import com.o2d.pkayjava.runtime.resources.IResourceRetriever;

public class SpineActor extends Actor {

    private String animationName;
    public SkeletonData skeletonData;
    private SkeletonRenderer renderer;
    private Skeleton skeleton;
    private AnimationState state;
    private IResourceRetriever irr;
    private SkeletonJson skeletonJson;
    private float minX = 0;
    private float minY = 0;

    public SpineActor(String animationName, IResourceRetriever irr) {
        this.irr = irr;
        this.renderer = new SkeletonRenderer();
        this.animationName = animationName;
        initSkeletonData();
        initSpine();
    }

    private void computeBoundBox() {
        skeleton.updateWorldTransform();
        minX = Float.MAX_VALUE;
        minY = Float.MAX_VALUE;
        float maxX = Float.MIN_VALUE, maxY = Float.MIN_VALUE;
        for (int i = 0, n = skeleton.getSlots().size; i < n; i++) {
            Slot slot = skeleton.getSlots().get(i);
            Attachment attachment = slot.getAttachment();
            if (attachment == null) continue;
            if (!(attachment instanceof RegionAttachment)) continue;
            RegionAttachment imageRegion = (RegionAttachment) attachment;
            imageRegion.updateWorldVertices(slot, false);
            float[] vertices = imageRegion.getWorldVertices();
            for (int ii = 0, nn = vertices.length; ii < nn; ii += 5) {
                minX = Math.min(minX, vertices[ii]);
                minY = Math.min(minY, vertices[ii + 1]);
                maxX = Math.max(maxX, vertices[ii]);
                maxY = Math.max(maxY, vertices[ii + 1]);
            }
        }

        setWidth(maxX - minX);
        setHeight(maxY - minY);
    }

    private void initSkeletonData() {
        skeletonJson = new SkeletonJson(irr.getSkeletonAtlas(animationName));
        skeletonData = skeletonJson.readSkeletonData((irr.getSkeletonJSON(animationName)));
    }

    private void initSpine() {
        BoneData root = skeletonData.getBones().get(0);
        root.setScale(getScaleX(), getScaleY());
        skeleton = new Skeleton(skeletonData);
        AnimationStateData stateData = new AnimationStateData(skeletonData);
        state = new AnimationState(stateData);
        computeBoundBox();
        setAnimation(skeletonData.getAnimations().get(0).getName());
    }

    public Array<Animation> getAnimations() {
        return skeletonData.getAnimations();
    }

    public void setAnimation(String animName) {
        state.setAnimation(0, animName, true);
    }

    public AnimationState getState() {
        return state;
    }

    @Override
    public void setScale(float scale) {
        super.setScale(scale);
        initSpine();
    }

    @Override
    public void draw(Batch batch, float parentAlpha) {
        renderer.draw(batch, skeleton);
        super.draw(batch, parentAlpha);
    }

    @Override
    public void act(float delta) {
        skeleton.updateWorldTransform(); //
        state.update(delta);
        state.apply(skeleton);
        skeleton.setPosition(getX() - minX, getY() - minY);
        super.act(delta);
    }
}


text:
'''Imports'''
import sys
import math

from operator import itemgetter

import re

'''Fields'''
pairs_to_index = {}

'''fields End.'''

''' Parse file to internal data structure.
    @param: filename: The path of file to parse
'''

def parse_file(filename):
    data = ""
    n = 0
    header_ended = False
    full_regex = r'[\b\s]*(\d+)[\b\s]+([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)[\b\s]+([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)'
    points = []
    if filename.find("-tsp"):
        header_ended = True
    with open(filename) as f:
        data = f.readlines()
        point_index = 0
        for line in data:
            if(header_ended):
                match_obj = re.match(full_regex, line)
                if match_obj:
                    pairs_to_index[(float(match_obj.group(2)),float(match_obj.group(3)))] = point_index
                    point_index += 1
                    points.append((float(match_obj.group(2)),float(match_obj.group(3))))
            else :
                # check if header is finishing this line.
                if line.strip() == "NODE_COORD_SECTION":
                    header_ended = True

    return points

'''The passing file code. END'''

''' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Helper functions
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'''

def sort_points_into_x(points):
    return sorted(points,key=itemgetter(0))

def sort_points_into_y(points):
    return sorted(points,key=itemgetter(1))

def find_closest_pair_of_points(points):
    closest_pair = None
    closest_dist = float('inf')
    for i, point1 in enumerate(points):
        for j, point2 in enumerate(points):
            if i != j:
                point_pair = (point1,point2)
                current_dist = dist(point_pair)
                if closest_dist > current_dist:
                    closest_pair = point_pair
                    closest_dist = current_dist
    return closest_pair

def dist(point_pair):
    point1, point2 = point_pair
    return math.sqrt(math.pow(point1[0]-point2[0],2.)+math.pow(point1[1]-point2[1],2.))

''' Parse file to internal data structure.
    @param: points_x_sorted: The x sorted points.
    @param: points_y_sorted: The y sorted points.
    @param: split_x: the splitting axis. If true split on x axis, if false split on y.
    @return: (Qx, Qy, Rx, Ry).
'''
def divide_sets(points_x_sorted, points_y_sorted, split_x):
    splitting_point = int(len(points_x_sorted)/2)

    if split_x:
        Qx = points_x_sorted[:splitting_point]
        Rx = points_x_sorted[splitting_point:]
        Qy = sort_points_into_y(Qx)
        Ry = sort_points_into_y(Rx)
        return (Qx, Qy, Rx, Ry)
    else:
        Qy = points_y_sorted[:splitting_point]
        Ry = points_y_sorted[splitting_point:]
        Qx = sort_points_into_x(Qy)
        Rx = sort_points_into_x(Ry)
        return (Qx, Qy, Rx, Ry)

def get_largest_value(points_x_sorted, points_y_sorted, split_x):
    if split_x:
        return points_x_sorted[-1][0]
    else:
        return points_y_sorted[-1][1]

def get_points_in_range(points_x_sorted, points_y_sorted,minimum_distance, split_value,split_x):
    min_val = split_value - minimum_distance
    min_index = None
    max_val = split_value + minimum_distance

    if split_x:
        for i, point in enumerate(points_x_sorted):
            if point[0] > min_val and min_index is None:
                min_index = i
            if point[0] > max_val:
                return points_x_sorted[min_index : i]
    else:
        for i, point in enumerate(points_y_sorted):
            if point[1] > min_val and min_index is None:
                min_index = i
            if point[1] > max_val:
                return points_y_sorted[min_index : i]

def sort_points_in_other_direction(potential_points, split_x):
    if split_x:
        return sort_points_into_x(potential_points)
    else:
        return sort_points_into_y(potential_points)

def get_closest_pair_in_potential_subset(potential_points_sorted):
    '''
    for each point in s compute distance to each of the next 15 points
    retun lowest distance.
    '''
    counter = 0
    closest_pair = None
    closest_dist = float('inf')
    for i in range(len(potential_points_sorted) -1):
        for j in range(i + 1, min(len(potential_points_sorted) -1, i + 15)):
            point_pair = (potential_points_sorted[i],potential_points_sorted[j])
            current_dist = dist(point_pair)
            if(closest_dist > current_dist):
                closest_pair = point_pair
                closest_dist = current_dist

    return closest_pair

def output_closest_pair(number_of_nodes, closest_pair):
    print("{0:2d} {1:.12f} --- {2:g} {3:g}".format(number_of_nodes, dist(closest_pair), pairs_to_index[closest_pair[0]], pairs_to_index[closest_pair[1]]))

''' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Helper Functions End
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'''

'''Algorithm'''
def closest_pair(points):
    points_x_sorted = sort_points_into_x(points)
    points_y_sorted = sort_points_into_y(points)
    return closest_pair_rec(points_x_sorted,points_y_sorted, True)

def closest_pair_rec(points_x_sorted, points_y_sorted, split_x):
    if len(points_x_sorted) <= 3:
        return find_closest_pair_of_points(points_x_sorted)

    (Qx,Qy,Rx,Ry) = divide_sets(points_x_sorted,points_y_sorted, split_x)
    closest_pair_in_q = closest_pair_rec(Qx,Qy,not(split_x))
    closest_pair_in_r = closest_pair_rec(Rx,Ry,not(split_x))
    minimum_distance = min(dist(closest_pair_in_q), dist(closest_pair_in_r))

    if minimum_distance != 0:
        split_value = get_largest_value(Qx,Qy,split_x)
        potential_points = get_points_in_range(points_x_sorted, points_y_sorted,minimum_distance, split_value,split_x)
        if potential_points:
            potential_points_sorted = sort_points_in_other_direction(potential_points, not(split_x))
            closest_pair_in_potential_points = get_closest_pair_in_potential_subset(potential_points_sorted)
            if closest_pair_in_potential_points and dist(closest_pair_in_potential_points) < minimum_distance:
               return closest_pair_in_potential_points
    if dist(closest_pair_in_q) < dist(closest_pair_in_r):
        return closest_pair_in_q
    else:
        return closest_pair_in_r

'''Algorithm End'''

'''RUN CODE'''
if __name__ == "__main__":
    args = sys.argv
    if len(args) > 1:
        points = parse_file(args[1])
        closest_pair = closest_pair(points)
        output_closest_pair(len(points), closest_pair)
'''END CODE'''


text:
var drawSVG = function (viewId,totalAmount,maxAmount,config) {

  if (totalAmount < 1) {
    return;
  }

  var svgNS             = 'http://www.w3.org/2000/svg';
  var strokeWidthActive = viewConfig.strokeWidthActive;
  var svgSize           = viewConfig.svgSize;
  var minSize           = viewConfig.minSize;
  var radius            = viewConfig.radius;
  var radiusWithStroke  = radius - strokeWidthActive/2;
  var size = ( (0.99 * Math.sqrt(totalAmount))/Math.sqrt(maxAmount)).toFixed(3); // 0.99x so that we always detect a transitionend as we transform to 1x
  if (size < minSize) {
    size = minSize;
  }

  var svg = document.createElementNS(svgNS, 'svg');
  svg.id = viewId;
  svg.classList.add('radar');
  svg.setAttribute('xmlns',svgNS);
  svg.setAttribute('data-js-radar','');
  svg.setAttribute('data-js-radar-size',size);
  svg.setAttribute('viewBox','0 0 ' + svgSize + ' ' + svgSize);
  svg.setAttribute('width',svgSize);
  svg.setAttributeNS(null,'style','transform: translate3d(0,0,0) scale3d(1,1,1);');
  svg.setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xlink', 'http://www.w3.org/1999/xlink');

  var defs = document.createElementNS(svgNS, 'defs');
  defs.setAttributeNS(null,'data-js-radar-defs','');
  svg.appendChild(defs);

  // create the device group

  var grpDevicesArcs = document.createElementNS(svgNS, 'g');
  grpDevicesArcs.setAttributeNS(null,'data-js-radar-g-device-arcs','');
  grpDevicesArcs.setAttributeNS(null,'style','transform: translate3d(0,0,0) scale3d(' + size + ',' + size + ',1); transform-origin: ' + radius + 'px ' + radius + 'px 0px;');
  grpDevicesArcs.classList.add('radar__grp__arcs');

  var grpDevicesCircle = document.createElementNS(svgNS, 'circle');
  grpDevicesCircle.setAttributeNS(null,'cx',radius);
  grpDevicesCircle.setAttributeNS(null,'cy',radius);
  grpDevicesCircle.setAttributeNS(null,'r',radiusWithStroke);
  grpDevicesCircle.classList.add('radar__grp__circle');

  var grpDevices = document.createElementNS(svgNS, 'g');
  grpDevices.setAttributeNS(null,'data-js-radar-g-device','');
  grpDevices.classList.add('radar__grp');
  grpDevices.classList.add('radar__grp--device');

  grpDevicesArcs.appendChild(grpDevicesCircle);
  grpDevices.appendChild(grpDevicesArcs);
  svg.appendChild(grpDevices);

  // create the browsers group

  var grpBrowsersArcs = document.createElementNS(svgNS, 'g');
  grpBrowsersArcs.setAttributeNS(null,'data-js-radar-g-browser-arcs','');
  grpBrowsersArcs.setAttributeNS(null,'style','transform: translate3d(0,0,0) scale3d(' + size + ',' + size + ',1);transform-origin: ' + radius + 'px ' + radius + 'px 0px;');
  grpBrowsersArcs.classList.add('radar__grp__arcs');

  var grpBrowsersCircle = document.createElementNS(svgNS, 'circle');
  grpBrowsersCircle.setAttributeNS(null,'cx',radius);
  grpBrowsersCircle.setAttributeNS(null,'cy',radius);
  grpBrowsersCircle.setAttributeNS(null,'r',radiusWithStroke);
  grpBrowsersCircle.classList.add('radar__grp__circle');

  var grpBrowsers = document.createElementNS(svgNS, 'g');
  grpBrowsers.setAttributeNS(null,'data-js-radar-g-browser','');
  grpBrowsers.classList.add('radar__grp');
  grpBrowsers.classList.add('radar__grp--browser');

  grpBrowsersArcs.appendChild(grpBrowsersCircle);
  grpBrowsers.appendChild(grpBrowsersArcs);
  svg.appendChild(grpBrowsers);

  // create the age group

  var grpAgesArcs = document.createElementNS(svgNS, 'g');
  grpAgesArcs.setAttributeNS(null,'data-js-radar-g-age-arcs','');
  grpAgesArcs.setAttributeNS(null,'style','transform: translate3d(0,0,0) scale3d(' + size + ',' + size + ',1);transform-origin: ' + radius + 'px ' + radius + 'px 0px;');
  grpAgesArcs.classList.add('radar__grp__arcs');

  var grpAgesCircle = document.createElementNS(svgNS, 'circle');
  grpAgesCircle.setAttributeNS(null,'cx',radius);
  grpAgesCircle.setAttributeNS(null,'cy',radius);
  grpAgesCircle.setAttributeNS(null,'r',radiusWithStroke);
  grpAgesCircle.classList.add('radar__grp__circle');

  var grpAges = document.createElementNS(svgNS, 'g');
  grpAges.setAttributeNS(null,'data-js-radar-g-age','');
  grpAges.classList.add('radar__grp');
  grpAges.classList.add('radar__grp--age');

  grpAgesArcs.appendChild(grpAgesCircle);
  grpAges.appendChild(grpAgesArcs);
  svg.appendChild(grpAges);

  // create the versions group

  var grpVersionsArcs = document.createElementNS(svgNS, 'g');
  grpVersionsArcs.setAttributeNS(null,'data-js-radar-g-version-arcs','');
  grpVersionsArcs.setAttributeNS(null,'style','transform: translate3d(0,0,0) scale3d(' + size + ',' + size + ',1);transform-origin: ' + radius + 'px ' + radius + 'px 0px;');
  grpVersionsArcs.classList.add('radar__grp__arcs');

  var grpVersionsCircle = document.createElementNS(svgNS, 'circle');
  grpVersionsCircle.setAttributeNS(null,'cx',radius);
  grpVersionsCircle.setAttributeNS(null,'cy',radius);
  grpVersionsCircle.setAttributeNS(null,'r',radiusWithStroke);
  grpVersionsCircle.classList.add('radar__grp__circle');

  var grpVersions = document.createElementNS(svgNS, 'g');
  grpVersions.setAttributeNS(null,'data-js-radar-g-version','');
  grpVersions.classList.add('radar__grp');
  grpVersions.classList.add('radar__grp--version');

  grpVersionsArcs.appendChild(grpVersionsCircle);
  grpVersions.appendChild(grpVersionsArcs);
  svg.appendChild(grpVersions);

  return svg;

};

var drawSVGArc = function (config) {

  return new Promise(function(resolve, reject) {

    var svgNS             = 'http://www.w3.org/2000/svg';
    var viewId            = config.viewId;
    var arcThisMode       = config.arcThisMode;
    var arcNextMode       = config.arcNextMode;
    var arcSelector       = config.arcSelector;

    var timeStart         = 0;
    var timeCurrent       = timeStart;
    var timeIncrement     = config.timeIncrement || 10;
    var timeDuration      = config.timeDuration || 500;

    var pie               = document.getElementById(viewId);
    var scaled            = pie.querySelector('[data-js-radar-g-' + arcThisMode + '-arcs]');
    var defs              = pie.querySelector('[data-js-radar-defs]');
    var color             = config.color || 'white';
    var strokeWidth       = viewConfig.strokeWidth;
    var strokeWidthActive = viewConfig.strokeWidthActive;
    var angleStart        = config.angleStart || 0;
    var angleArc          = config.angleArc || 360;
    var angleStep         = config.angleStep || 10;
    var angle             = angleStart;
    var radius            = viewConfig.radius;
    var radiusWithStroke  = radius - strokeWidthActive/2;

    var labelSize         = viewConfig.labelFontSize;
    var labelTitle        = config.labelTitle || arcSelector;
    var labelValTotal     = config.labelValTotal || null;
    var labelValTotalPerc = config.labelValTotalPerc || null;
    var labelValDevicePerc= config.labelValDevicePerc || null;

    var arcGrp = document.createElementNS(svgNS, 'g');
    arcGrp.setAttributeNS(null,'data-js-radar-arc-grp','');
    arcGrp.setAttributeNS(null,'data-js-radar-arc-grp-' + arcThisMode,'');
    arcGrp.classList.add('radar__arc__grp');

    // create the path
    var arc = document.createElementNS(svgNS, 'path');
    arc.setAttributeNS(null,'fill','none');
    arc.setAttributeNS(null,'data-js-arc-thismode' , arcThisMode);
    arc.setAttributeNS(null,'data-js-arc-nextmode' , arcNextMode);
    arc.setAttributeNS(null,'data-js-arc-segment' , arcSelector);
    arc.setAttributeNS(null,'data-js-arc-angle-start' , angleStart);
    arc.setAttributeNS(null,'data-js-arc-angle-arc' , angleArc);
    arc.setAttributeNS(null,'d','');
    arc.setAttributeNS(null,'stroke',color);
    arc.setAttributeNS(null,'stroke-width',strokeWidth);
    arc.classList.add('radar__arc');
    arc.id = 'radar-arc-' + arcThisMode + '-' + arcSelector.replace(/ /g,'-');
    arcGrp.appendChild(arc);

    // create a path for the text in defs
    var radians = (angleStart/180) * Math.PI;
    var radiusWithText = radiusWithStroke - labelSize/2.5;
    var xStart = radius + Math.cos(radians) * radiusWithText;
    var yStart = radius + Math.sin(radians) * radiusWithText;
    var xEnd = radius + Math.cos(radians - 0.02) * radiusWithText;
    var yEnd = radius + Math.sin(radians - 0.02) * radiusWithText;
    var arcDef = document.createElementNS(svgNS, 'path');
    arcDef.setAttributeNS(null,'data-js-radar-arcdef-' + arcThisMode,'');
    arcDef.id = 'radar-' + viewId + '-arcdef-' + arcThisMode + '-' + arcSelector.replace(/ /g,'-');
    arcDef.setAttribute("d", "M " + xStart.toFixed(3) + labelSize + " " + yStart.toFixed(3) + " A " + radiusWithText + " " + radiusWithText + " " + angleStart + " 1 1 "+ xEnd.toFixed(3) + " " + yEnd.toFixed(3));
    defs.appendChild(arcDef);

    // create the text
    var label = document.createElementNS(svgNS, 'text');
    label.setAttributeNS(null,"x",1);
    label.setAttributeNS(null,"y",0);
    label.setAttributeNS(null,"font-size",labelSize);
    label.classList.add('radar__arc__txt');
    var labelPath = document.createElementNS(svgNS, 'textPath');
    labelPath.setAttributeNS('http://www.w3.org/1999/xlink','xlink:href','#' + arcDef.id);
    var textNode = document.createTextNode(labelTitle.toUpperCase());
    labelPath.appendChild(textNode);
    label.appendChild(labelPath);
    arcGrp.appendChild(label);

    if (arcThisMode==='device' && scaled.firstChild.nextSibling) {
      scaled.insertBefore(arcGrp, scaled.firstChild.nextSibling);
    } else {
      scaled.appendChild(arcGrp);
    }

    // draw one frame of the arc
    var i = 0;
    var drawArcFrame = function () {
      var radians = null;
      var x = null;
      var y = null;
      var d = null;
      var e = arc.getAttribute("d");
      // on first beat, we just move to the correct position
      if (i === 0) {
        radians = (angleStart/180) * Math.PI;
        x = radius + Math.cos(radians) * radiusWithStroke;
        y = radius + Math.sin(radians) * radiusWithStroke;
        d = e + "\n M " + x.toFixed(3) + " " + y.toFixed(3);
      // if we've finished the entire arc, exit
      } else if (angle >= (angleStart + angleArc) && i !== 0) {
        resolve(angle);
        return;
      // draw a frame of the arc
      } else {
        timeCurrent += timeIncrement;
        // if the final position is not a multiple of the angleStep
        if (angle + angleStep > angleStart + angleArc) {
          angle = angleStart + angleArc;
        // add angleStep
        } else {
          //angle = Math.easeInCubic(timeCurrent, angleStart, angleStart + angleArc, timeDuration);
          angle += angleStep;
        }
        // calc final stroke position
        radians= (angle/180) * Math.PI;
        x = radius + Math.cos(radians) * radiusWithStroke;
        y = radius + Math.sin(radians) * radiusWithStroke;
        // decide between straight line and arc
        d = e + "\n A " + radius + " " + radius + " 0 0 1 "+ x.toFixed(3) + " " + y.toFixed(3); // arc
      }
      // draw it
      arc.setAttribute("d", d);
      i++;
      window.requestAnimationFrame(function(){
        drawArcFrame();
      });
    };
    // convert to requestAnimationFrame soon:
    drawArcFrame();
  });
};

var drawSVGText = function (viewIndex,type,value) {

  var svgNS     = 'http://www.w3.org/2000/svg';
  var view      = gaConfig.views[viewIndex];
  var viewId    = view.abbr;
  var radius    = viewConfig.radius;
  var pie       = document.getElementById(viewId);
  var grp       = pie.querySelector('[data-js-radar-g-device]');

  // switch
  var x = 0;
  var y = 0;
  var align = 'middle';
  var cssClass = '';
  var dataType = '';
  var text = '';
  switch (type) {
    case 'title':
      x = radius;
      y = radius;
      text = view.name;
      break;
    case 'sub':
      x = radius;
      y = radius;
      text = '';
      break;
    case 'value':
      x = radius;
      y = radius + 25;
      text = value.toLocaleString(viewConfig.locale);
      break;
  }

  // create the path to the arc
  var txtBox = document.createElementNS(svgNS, 'text');
  txtBox.setAttributeNS(null,'x',x);
  txtBox.setAttributeNS(null,'y',y);
  txtBox.setAttributeNS(null,'text-anchor',align);
  txtBox.setAttributeNS(null,'data-js-radar-txt-' + type,'');
  txtBox.classList.add('radar__txt__' + type);
  txtBox.textContent = text;
  grp.appendChild(txtBox);

};


text:
namespace System.ServiceModel.Configuration
{
    using System.Configuration;
    using System.Net;

    public sealed partial class DefaultPortElement : ConfigurationElement
    {
        public DefaultPortElement()
        {
        }

        public DefaultPortElement(DefaultPortElement other)
        {
            this.Scheme = other.Scheme;
            this.Port = other.Port;
        }

        [ConfigurationProperty(ConfigurationStrings.Scheme, Options = ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired)]
        [StringValidator(MinLength = 1)]
        public string Scheme
        {
            get { return (string)base[ConfigurationStrings.Scheme]; }
            set
            {
                if (String.IsNullOrEmpty(value))
                {
                    value = String.Empty;
                }
                base[ConfigurationStrings.Scheme] = value;
            }
        }

        [ConfigurationProperty(ConfigurationStrings.Port, DefaultValue = 0, Options = ConfigurationPropertyOptions.IsRequired)]
        [IntegerValidator(MinValue = IPEndPoint.MinPort, MaxValue = IPEndPoint.MaxPort)]
        public int Port
        {
            get { return (int)base[ConfigurationStrings.Port]; }
            set { base[ConfigurationStrings.Port] = value; }
        }
    }
}