text:
'use strict'
/* eslint-env mocha */

const http = require('ipfs-utils/src/http')
const { Buffer } = require('buffer')
const { expect } = require('../../utils/chai')
const EchoServer = require('../../utils/echo-server')
// @ts-ignore
const { format } = require('iso-url')

describe('echo server spec', () => {
  const echo = new EchoServer()
  /** @type {string} */
  let url

  before(async () => {
    await echo.start()
    const { port, address } = /** @type {import('net').AddressInfo} */(echo.server.address())
    url = format({ protocol: 'http:', hostname: address, port })
  })

  after(() => echo.stop())

  it('get', async () => {
    const req = await http.get('echo', { base: url })
    expect(req.text()).to.eventually.fulfilled()
  })

  it('get with search params', async () => {
    const req = await http.get('echo/query', { base: url, searchParams: new URLSearchParams({ test: '1' }) })
    const res = await req.text()
    expect(res).to.be.eq('{"test":"1"}')
  })

  it('get with redirect', async () => {
    const req = await http.get('redirect', { base: url, searchParams: new URLSearchParams({ to: `${url}/echo/query?test=1` }) })
    const res = await req.text()
    expect(res).to.be.eq('{"test":"1"}')
  })

  it('post with body', async () => {
    const req = await http.post('echo', { base: url, body: '{"test":"1"}' })
    const res = await req.text()
    expect(res).to.be.eq('{"test":"1"}')
  })

  it('download endpoint with text', async () => {
    const req = await http.get('download', { base: url, searchParams: new URLSearchParams({ data: 'hello world' }) })
    const res = await req.text()
    expect(res).to.be.eq('hello world')
  })
  it('download endpoint without data', async () => {
    const req = await http.get('download', { base: url })
    const res = await req.text()
    expect(res).to.be.eq('')
  })

  it('download endpoint with arraybuffer', async () => {
    const req = await http.get('download', { base: url, searchParams: new URLSearchParams({ data: 'hello world' }) })
    const res = Buffer.from(await req.arrayBuffer())
    expect(res).to.be.deep.eq(Buffer.from('hello world'))
  })

  it('get with headers', async () => {
    const req = await http.get('echo/headers', { base: url, headers: { foo: 'bar' } })
    const res = await req.json()
    expect(res).to.deep.include({ foo: 'bar' })
  })
})


text:
<dom-module id="tag-link">
  <style>
    :host, a {
      display: inline-block;
      cursor: pointer;
      color: #606060;
    }

    :host(:hover) span {
      text-decoration: underline;
    }

    span {
      font-size: 12px;
      font-weight: 500;
      color: var(--primary-text-color);
      text-decoration: none;
    }
  </style>
  <template>
    <span>{{name}}</span>
  </template>
</dom-module>

<script>
  Polymer({
    is: 'tag-link',
    enableCustomStyleProperties: true,
    properties: {
      name: {type: String, notify: true, reflectToAttribute: true, observer: 'convert'}
    },
    convert: function() {
      if (typeof this.name === 'object') {
        this.name = this.name.valueOf();
      }
    }
  });
</script>

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: "Alexander Gabriel Worden"
comments: true
description: "blanks"
keywords: "Alexander Gabriel Worden,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: Program in Environmental Design

**Classes taught**: ENVD 4300

#### ENVD 4300: Advanced Design Lab 2

**Terms taught**: Spring 2017

**Instructor rating**: 5.6

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 3.69

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 5.25

**Standard deviation in workload** (raw): 0.0


text:
package util

import (
	"strconv"
	"path/filepath"
	"log"
	"strings"
	"reflect"
	"crypto/md5"
	"io"
	"encoding/hex"
)

func HostPortToAddress(host string, port uint16) string {
	return host + ":" + strconv.Itoa(int(port))
}

func UrlToHost(url string) string {
	return strings.Split(url, ":")[0]
}

func AbsolutePath(relpath string) string {
	absolutePath, err := filepath.Abs(relpath)
	if err != nil {
		log.Println("current path error:", err)
	}
	return absolutePath
}

func HomePath() string {
	return AbsolutePath(".")
}

func SliceIndex(slice interface{}, element interface{}) int {
	index := -1
	sv := reflect.ValueOf(slice)
	if sv.Kind() != reflect.Slice {
		return index
	}
	ev := reflect.ValueOf(element).Interface()
	length := sv.Len()
	for i := 0; i < length; i++ {
		iv := sv.Index(i).Interface()
		if reflect.DeepEqual(iv, ev) {
			index = i;
			break
		}
	}
	return index
}

func Md5String(str string) string {
	hash := md5.New()
	io.WriteString(hash, str)
	return hex.EncodeToString(hash.Sum(nil))
}

func IP4ToInt(ip string) int {
	nums := strings.Split(ip, ".")
	sum := 0
	for i := 0; i < len(nums); i++ {
		n, _ := strconv.Atoi(nums[i])
		sum += n
		sum <<= 8
	}
	return sum >> 8
}


text:
package com.qualixium.playnb.project.specific;

import com.qualixium.playnb.PlayProject;
import java.awt.Dialog;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.netbeans.api.project.ProjectUtils;
import org.netbeans.spi.project.ui.CustomizerProvider;
import org.netbeans.spi.project.ui.support.ProjectCustomizer;
import org.openide.awt.StatusDisplayer;
import org.openide.util.lookup.Lookups;

public class ProjectCustomizerProvider implements CustomizerProvider {

    public final PlayProject playProject;
    public static final String CUSTOMIZER_FOLDER_PATH = "Projects/com-qualixium-playnb/Customizer";

    public ProjectCustomizerProvider(PlayProject playProject) {
        this.playProject = playProject;
    }

    @Override
    public void showCustomizer() {
        Dialog dialog = ProjectCustomizer.createCustomizerDialog(
                //Path to layer folder:
                CUSTOMIZER_FOLDER_PATH,
                //Lookup, which must contain, at least, the Project:
                Lookups.fixed(playProject),
                //Preselected category:
                "",
                //OK button listener:
                new OKOptionListener(),
                //HelpCtx for Help button of dialog:
                null);
        dialog.setTitle(ProjectUtils.getInformation(playProject).getDisplayName());
        dialog.setVisible(true);
    }

    private class OKOptionListener implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {
            StatusDisplayer.getDefault().setStatusText("Project (" + playProject.getProjectName() + ") options saved");
        }
    }
}


text:
import React from "react";
import {classNames, hyperscript as h} from "neutrine-utils";
import {omit} from "kofi";

import "siimple/scss/typography/_paragraph.scss";

//Paragraph component
export default class Paragraph extends React.Component {
    render() {
        //Clone the paragraph props
        let props = omit(this.props, ["children", "className"]);
        props.className = classNames("siimple-paragraph", this.props.className);
        //Return a div with the paragraph class
        return h("div", props, this.props.children);
    }
}

//Paragraph default props
Paragraph.defaultProps = {
    style: null
};


text:
/**
 * async AJAX returns promise
 *
 * @param   Object      params              request params
 * @param   String      params.method       HTTP-метод. GET/POST/TRACE/DELETE/PUT и т.п.
 * @param   String      params.url          адрес запроса. http/https/ftp/file.
 * @param   Object      params.headers      request headers
 * @param   FormData    params.body         request body
 */
export default function send(params) {
    /**
     * Promise – это специальный объект, который содержит своё состояние.
     * Вначале pending («ожидание»), затем – одно из:
     *      fulfilled («выполнено успешно»)
     *      rejected («выполнено с ошибкой»).
     */
    return new Promise((resolve, reject) => {
        /**
         * Эта функция будет вызвана автоматически
         * В ней можно делать любые асинхронные операции,
         * А когда они завершатся — нужно вызвать один из callback из:
         *      resolve(результат) при успешном выполнении
         *      reject(ошибка) при ошибке
         */

         const xhr = new XMLHttpRequest();

         xhr.open(params.method, params.url, true);

         if (params.headers) {
             for (const header in params.headers) {
                 xhr.setRequestHeader(header, params.headers[header]);
             }
         }

         if (params.body && params.headers && params.headers['Content-Type'] === 'multipart/form-data') {
             const body = new FormData();

             Object.keys(params.body).forEach(key => {
                 body.append(key, params.body[key]);
             });

             xhr.send(body);
         } else if (params.body && params.headers && params.headers['Content-Type'] === 'application/json') {
             const body = JSON.stringify(params.body);

             xhr.send(body);
         } else {
             xhr.send();
         }

         xhr.addEventListener('load', function() {
             const {status, responseText} = xhr;
             let responseData;

             try {
                 responseData = JSON.parse(responseText);
             } catch (err) {
                 responseData = responseText;
             }

             // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
             if (xhr.status < 200 || xhr.status > 299) {
                 // обработать ошибку
                 reject({status, responseData, xhr});
             } else {
                 // вывести результат
                 resolve({status, responseData, xhr});
             }
         });

         xhr.addEventListener('error', function() {
             const {status, responseText} = xhr;

             reject({status, responseText, xhr});
         });

    });
}


text:
from quantum.api.v2 import attributes
from quantum.common import exceptions as qexception

class PortSecurityPortHasSecurityGroup(qexception.InUse):
    message = _("Port has security group associated. Cannot disable port "
                "security or ip address until security group is removed")

class PortSecurityAndIPRequiredForSecurityGroups(qexception.InvalidInput):
    message = _("Port security must be enabled and port must have an IP"
                " address in order to use security groups.")

class PortSecurityBindingNotFound(qexception.InvalidExtensionEnv):
    message = _("Port does not have port security binding.")

PORTSECURITY = 'port_security_enabled'
EXTENDED_ATTRIBUTES_2_0 = {
    'networks': {
        PORTSECURITY: {'allow_post': True, 'allow_put': True,
                       'convert_to': attributes.convert_to_boolean,
                       'default': True,
                       'is_visible': True},
    },
    'ports': {
        PORTSECURITY: {'allow_post': True, 'allow_put': True,
                       'convert_to': attributes.convert_to_boolean,
                       'default': attributes.ATTR_NOT_SPECIFIED,
                       'is_visible': True},
    }
}

class Portsecurity(object):
    """Extension class supporting port security
    """

    @classmethod
    def get_name(cls):
        return "Port Security"

    @classmethod
    def get_alias(cls):
        return "port-security"

    @classmethod
    def get_description(cls):
        return "Provides port security"

    @classmethod
    def get_namespace(cls):
        return "http://docs.openstack.org/ext/portsecurity/api/v1.0"

    @classmethod
    def get_updated(cls):
        return "2012-07-23T10:00:00-00:00"

    def get_extended_resources(self, version):
        if version == "2.0":
            return EXTENDED_ATTRIBUTES_2_0
        else:
            return {}


text:
import numpy as np
import tensorflow as tf
import argparse
import os
import sys

from tensorpack import *
from tensorpack.tfutils.symbolic_functions import *
from tensorpack.tfutils.summary import *
from ternary import *

"""
CIFAR10 ResNet example. See:
Deep Residual Learning for Image Recognition, arxiv:1512.03385
This implementation uses the variants proposed in:
Identity Mappings in Deep Residual Networks, arxiv:1603.05027

I can reproduce the results on 2 TitanX for
n=5, about 7.1% val error after 67k step (8.6 step/s)
n=18, about 5.7% val error (2.45 step/s)
n=30: a 182-layer network, about 5.6% val error after 51k step (1.55 step/s)
This model uses the whole training set instead of a train-val split.
"""

BATCH_SIZE = 128

class Model(ModelDesc):
    def __init__(self, n):
        super(Model, self).__init__()
        self.n = n

    def _get_input_vars(self):
        return [InputVar(tf.float32, [None, 32, 32, 3], 'input'),
                InputVar(tf.int32, [None], 'label')
               ]

    def _build_graph(self, input_vars):
        image, label = input_vars
        image = image / 128.0 - 1

        old_get_variable = tf.get_variable
        def new_get_variable(name, shape=None, **kwargs):
            v = old_get_variable(name, shape, **kwargs)
            # don't binarize first and last layer
            if name is not 'W' or 'conv0' in v.op.name or 'fct' in v.op.name:
                return v
            else:
                return tw_ternarize(v, args.t)
        tf.get_variable = new_get_variable

        def conv(name, l, channel, stride):
            return Conv2D(name, l, channel, 3, stride=stride,
                          nl=tf.identity, use_bias=False,
                          W_init=tf.random_normal_initializer(stddev=np.sqrt(2.0/9/channel)))

        def residual(name, l, increase_dim=False, first=False):
            shape = l.get_shape().as_list()
            in_channel = shape[3]

            if increase_dim:
                out_channel = in_channel * 2
                stride1 = 2
            else:
                out_channel = in_channel
                stride1 = 1

            with tf.variable_scope(name) as scope:
                if not first:
                    b1 = BatchNorm('bn1', l)
                    b1 = tf.nn.relu(b1)
                else:
                    b1 = l
                c1 = conv('conv1', b1, out_channel, stride1)
                b2 = BatchNorm('bn2', c1)
                b2 = tf.nn.relu(b2)
                c2 = conv('conv2', b2, out_channel, 1)

                if increase_dim:
                    l = AvgPooling('pool', l, 2)
                    l = tf.pad(l, [[0,0], [0,0], [0,0], [in_channel//2, in_channel//2]])

                l = c2 + l
                return l

        l = conv('conv0', image, 16, 1)
        l = BatchNorm('bn0', l)
        l = tf.nn.relu(l)
        l = residual('res1.0', l, first=True)
        for k in range(1, self.n):
            l = residual('res1.{}'.format(k), l)
        # 32,c=16

        l = residual('res2.0', l, increase_dim=True)
        for k in range(1, self.n):
            l = residual('res2.{}'.format(k), l)
        # 16,c=32

        l = residual('res3.0', l, increase_dim=True)
        for k in range(1, self.n):
            l = residual('res3.' + str(k), l)
        l = BatchNorm('bnlast', l)
        l = tf.nn.relu(l)
        # 8,c=64
        l = GlobalAvgPooling('gap', l)
        logits = FullyConnected('linear', l, out_dim=10, nl=tf.identity)

        tf.get_variable = old_get_variable
        prob = tf.nn.softmax(logits, name='output')

        cost = tf.nn.sparse_softmax_cross_entropy_with_logits(logits, label)
        cost = tf.reduce_mean(cost, name='cross_entropy_loss')

        wrong = prediction_incorrect(logits, label)
        nr_wrong = tf.reduce_sum(wrong, name='wrong')
        # monitor training error
        add_moving_summary(tf.reduce_mean(wrong, name='train_error'))

        # weight decay on all W of fc layers
        wd_w = tf.train.exponential_decay(0.0002, get_global_step_var(),
                                          480000, 0.2, True)
        wd_cost = tf.mul(wd_w, regularize_cost('.*/W', tf.nn.l2_loss), name='wd_cost')
        add_moving_summary(cost, wd_cost)

        add_param_summary([('.*/W', ['histogram'])])   # monitor W

        writer = tf.train.SummaryWriter('log', graph=tf.get_default_graph())
        self.cost = tf.add_n([cost, wd_cost], name='cost')

def get_data(train_or_test):
    isTrain = train_or_test == 'train'
    ds = dataset.Cifar10(train_or_test)
    pp_mean = ds.get_per_pixel_mean()
    if isTrain:
        augmentors = [
            imgaug.CenterPaste((40, 40)),
            imgaug.RandomCrop((32, 32)),
            imgaug.Flip(horiz=True),
            #imgaug.Brightness(20),
            #imgaug.Contrast((0.6,1.4)),
            imgaug.MapImage(lambda x: x - pp_mean),
        ]
    else:
        augmentors = [
            imgaug.MapImage(lambda x: x - pp_mean)
        ]
    ds = AugmentImageComponent(ds, augmentors)
    ds = BatchData(ds, 128, remainder=not isTrain)
    if isTrain:
        ds = PrefetchData(ds, 3, 2)
    return ds

def get_config(nsize):
    mod = sys.modules['__main__']
    basename = os.path.basename(mod.__file__)
    logdir = os.path.join('train_log',
                         'ter-cifar10-resnet-{}'.format(6*nsize+2),
                         'tw', 't-{}'.format(args.t))

    logger.set_logger_dir(logdir)

    import shutil
    # import pdb; pdb.set_trace()

    shutil.copy(mod.__file__, logger.LOG_DIR)

    # prepare dataset
    dataset_train = get_data('train')
    step_per_epoch = dataset_train.size()
    dataset_test = get_data('test')

    sess_config = get_default_sess_config(0.9)

    get_global_step_var()
    lr = tf.Variable(0.1, trainable=False, name='learning_rate')
    tf.scalar_summary('learning_rate', lr)

    optimizer = tf.train.MomentumOptimizer(lr, 0.9)

    return TrainConfig(
        dataset=dataset_train,
        optimizer=optimizer,
        callbacks=Callbacks([
            StatPrinter(),
            ModelSaver(),
            InferenceRunner(dataset_test,
                [ScalarStats('cost'), ClassificationError()]),
            # PruneRunner(),
            ScheduledHyperParamSetter('learning_rate',
                                      [(1, 0.1), (82, 0.01), (123, 0.001), (150, 0.0001)])
        ]),
        session_config=sess_config,
        model=Model(n=nsize),
        step_per_epoch=step_per_epoch,
        max_epoch=400,
    )

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--gpu', help='comma separated list of GPU(s) to use.') # nargs='*' in multi mode
    parser.add_argument('--load', help='load model')
    parser.add_argument('--n', help='Nsize', type=int, default=3)
    parser.add_argument('--t', help='hyperparameter t', type=float, default=0.05)
    args = parser.parse_args()

    if args.gpu:
        os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu

    config = get_config(args.n)
    if args.load:
        config.session_init = SaverRestore(args.load)

    if args.gpu:
        config.nr_tower = len(args.gpu.split(','))
    SyncMultiGPUTrainer(config).train()


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.subsystems;

import Team102Lib.MathLib;
import Team102Lib.MessageLogger;
import edu.wpi.first.wpilibj.ADXL345_I2C;
import edu.wpi.first.wpilibj.ADXL345_I2C.DataFormat_Range;
import edu.wpi.first.wpilibj.command.PIDSubsystem;
import edu.wpi.first.wpilibj.templates.commands.DriveWithJoysticks;
import edu.wpi.first.wpilibj.templates.RobotMap;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Gyro;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.templates.commands.DriveWithXbox;

/**
 *
 * @author Administrator
 */
public class DriveTrain extends PIDSubsystem
{
    private static final double Kp = -.05;
    private static final double Ki = 20.0;
    private static final double Kd = 0.0;
    SpeedController leftMotor;
    SpeedController leftRear;
    SpeedController rightMotor;
    SpeedController rightRear;
    RobotDrive drive;
    public Gyro gyro;
    public ADXL345_I2C accelerometer;
    double preRightJoyY;
    double preLeftJoyY;
    double rightJoyY;
    double leftJoyY;

    // Initialize your subsystem here
    public DriveTrain()
    {
        super("DriveTrain", Kp, Ki, Kd);
        leftMotor = new Victor(RobotMap.leftMotor);
        rightMotor = new Victor(RobotMap.rightMotor);
        drive = new RobotDrive(leftMotor, rightMotor);
        drive.setSafetyEnabled(false);
        /*        drive.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, true);
         drive.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);
         drive.setInvertedMotor(RobotDrive.MotorType.kFrontLeft, true);
         drive.setInvertedMotor(RobotDrive.MotorType.kRearLeft, true);
         */
        // Gyro setup
        gyro = new Gyro(RobotMap.gyroPort);
        gyro.reset();

        accelerometer = new ADXL345_I2C(RobotMap.accelerometerPort, DataFormat_Range.k2G);

    }

    public void enableGyroSetPoint(double setPoint)
    {
        setSetpoint(setPoint);
        enable();
    }

    public void disablePIDMovement()
    {
        disable();
    }

    public void initDefaultCommand()
    {
        setDefaultCommand(new DriveWithXbox());
    }

    public void driveWithJoysticks(Joystick leftstick, Joystick rightstick)
    {

        preRightJoyY = rightstick.getY();
        preLeftJoyY = leftstick.getY();

        rightJoyY = RobotMap.stickDeadBand.Deaden(preRightJoyY);
        leftJoyY = RobotMap.stickDeadBand.Deaden(preLeftJoyY);

//        System.out.println("Left Joy: " + -leftJoyY);
//        System.out.println("Right Joy: " + rightJoyY);
        drive.tankDrive(-leftJoyY, rightJoyY);
    }

    public void driveWithXbox(Joystick xbox)
    {

        double preRighty = xbox.getRawAxis(RobotMap.xBoxRightYAxis);
        double preLefty = xbox.getRawAxis(RobotMap.xBoxLeftYAxis);

        double righty = RobotMap.stickDeadBand.Deaden(preRighty);
        double lefty = RobotMap.stickDeadBand.Deaden(preLefty);

      //  MessageLogger.LogMessage("XBox\t" + preRighty + "\t" + preLefty + "\t" + righty + "\t" + lefty);
        drive.tankDrive(-lefty, righty);
    }

    public void updateStatus()
    {
//        SmartDashboard.putDouble("Gyro: ", gyro.getAngle());
//        ADXL345_I2C.AllAxes accs = accelerometer.getAccelerations();
//        SmartDashboard.putDouble("AcclX: ", accs.XAxis);
//        SmartDashboard.putDouble("AcclY: ", accs.YAxis);
//        SmartDashboard.putDouble("AcclZ: ", accs.ZAxis);
//        SmartDashboard.putDouble("P: ", this.getPIDController().getP());
//        SmartDashboard.putDouble("I: ", this.getPIDController().getI());
//        SmartDashboard.putDouble("D: ", this.getPIDController().getD());
//        SmartDashboard.putDouble("PID Error: ", this.getPIDController().getError());
//        SmartDashboard.putDouble("leftDriveMotor: ", leftMotor.get());
//        SmartDashboard.putDouble("rightDriveMotor: ", rightMotor.get());
//        SmartDashboard.putDouble("rightJoyY: ", rightJoyY);
//        SmartDashboard.putDouble("leftJoyY: ", -leftJoyY);

        MessageLogger.WriteToLCD(RobotMap.GyroLCDLine, RobotMap.GyroLCDCol, "Gy: " + MathLib.round(gyro.getAngle(), 1));
//        MessageLogger.LogMessage(preLeftJoyY + "\t" + preRightJoyY + "\t" + -leftJoyY + "\t" + rightJoyY + "\t" + leftMotor.get() + "\t" + rightMotor.get());
    }

    protected double returnPIDInput()
    {
        // Return your input value for the PID loop
        // e.g. a sensor, like a potentiometer:
        // yourPot.getAverageVoltage() / kYourMaxVoltage;
        return gyro.getAngle();
    }

    protected void usePIDOutput(double output)
    {
        leftRear.set(output);
        leftMotor.set(output);
        rightRear.set(-output);
        rightMotor.set(-output);
    }

    public void drive(double speed)
    {
        drive.tankDrive(-speed, speed);
    }
}


text:
<bill session="110" type="h" number="2555" updated="2009-01-08T22:10:04-05:00">
	<status><introduced date="1179979200" datetime="2007-05-24"/></status>

	<introduced date="1179979200" datetime="2007-05-24"/>
	<titles>
		<title type="short" as="introduced">Renewable Energy Credit Extension Act of 2007</title>
		<title type="official" as="introduced">To amend the Internal Revenue Code of 1986 to extend the credit for electricity produced from certain renewable resources, and for other purposes.</title>
	</titles>
	<sponsor id="400434"/>
	<cosponsors>

	</cosponsors>
	<actions>
		<action date="1179979200" datetime="2007-05-24"><text>Referred to the House Committee on Ways and Means.</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>
	<summary>
	5/24/2007--Introduced.<br/>Renewable Energy Credit Extension Act of 2007 - Amends the Internal Revenue Code to: (1) extend through 2013 the tax credit for electricity produced from certain renewable resources (e.g., wind, biomass, poultry waste); and (2) allow certain organizations, including tax-exempt organizations, state and local governments, and Indian tribal governments, to sell unused amounts of such tax credit.
	</summary>
</bill>


text:
package     Language::Unlambda ;

require     5.8.1 ;

use         strict ;

use         Language::Unlambda::Global ;

use         Language::Unlambda::Parser ;

our $PACKAGE = 'Language::Unlambda' ;
our $VERSION = $Language::Unlambda::Global::VERSION ;

1 ;


text:
package org.apache.jackrabbit.oak.security.user.query;

import java.text.ParseException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import javax.jcr.RepositoryException;
import javax.jcr.Value;

import com.google.common.base.Predicate;
import com.google.common.base.Strings;
import com.google.common.collect.Iterators;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.api.security.user.Group;
import org.apache.jackrabbit.api.security.user.Query;
import org.apache.jackrabbit.api.security.user.QueryBuilder;
import org.apache.jackrabbit.oak.api.Result;
import org.apache.jackrabbit.oak.api.ResultRow;
import org.apache.jackrabbit.oak.api.Root;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
import org.apache.jackrabbit.oak.security.user.DeclaredMembershipPredicate;
import org.apache.jackrabbit.oak.security.user.UserManagerImpl;
import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
import org.apache.jackrabbit.oak.spi.security.user.AuthorizableType;
import org.apache.jackrabbit.oak.spi.security.user.UserConstants;
import org.apache.jackrabbit.util.ISO9075;
import org.apache.jackrabbit.util.Text;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.apache.jackrabbit.oak.api.QueryEngine.NO_BINDINGS;

/**
 * Query manager for user specific searches.
 */
public class UserQueryManager {

    private static final Logger log = LoggerFactory.getLogger(UserQueryManager.class);

    private final UserManagerImpl userManager;
    private final NamePathMapper namePathMapper;
    private final ConfigurationParameters config;
    private final Root root;

    public UserQueryManager(@NotNull UserManagerImpl userManager,
                            @NotNull NamePathMapper namePathMapper,
                            @NotNull ConfigurationParameters config,
                            @NotNull Root root) {
        this.userManager = userManager;
        this.namePathMapper = namePathMapper;
        this.config = config;
        this.root = root;
    }

    /**
     * Find the authorizables matching the specified user {@code Query}.
     *
     * @param query A query object.
     * @return An iterator of authorizables that match the specified query.
     * @throws RepositoryException If an error occurs.
     */
    @NotNull
    public Iterator<Authorizable> findAuthorizables(@NotNull Query query) throws RepositoryException {
        XPathQueryBuilder builder = new XPathQueryBuilder();
        query.build(builder);

        if (builder.getMaxCount() == 0) {
            return Collections.emptyIterator();
        }

        String statement = buildXPathStatement(builder);
        final String groupId = builder.getGroupID();
        if (groupId == null || isEveryone(groupId)) {
            long offset = builder.getOffset();
            Iterator<Authorizable> result = findAuthorizables(statement, builder.getMaxCount(), offset, null);
            if (groupId == null) {
                return result;
            } else {
                return Iterators.filter(result, authorizable -> {
                    try {
                        return authorizable != null && !groupId.equals(authorizable.getID());
                    } catch (RepositoryException e) {
                        return false;
                    }
                });
            }
        } else {
            // filtering by group name included in query -> enforce offset and limit on the result set.
            Iterator<Authorizable> result = findAuthorizables(statement, Long.MAX_VALUE, 0, null);
            Predicate<Authorizable> filter;
            if (builder.isDeclaredMembersOnly()) {
                filter = new DeclaredMembershipPredicate(userManager, groupId);
            } else {
                filter = new GroupPredicate(userManager, groupId, false);

            }
            return ResultIterator.create(builder.getOffset(), builder.getMaxCount(), Iterators.filter(result, filter));
        }
    }

    /**
     * Find the authorizables matching the following search parameters within
     * the sub-tree defined by an authorizable tree:
     *
     * @param relPath          A relative path (or a name) pointing to properties within
     *                         the tree defined by a given authorizable node.
     * @param value            The property value to look for.
     * @param authorizableType Filter the search results to only return authorizable
     *                         trees of a given type. Passing {@link org.apache.jackrabbit.oak.spi.security.user.AuthorizableType#AUTHORIZABLE} indicates that
     *                         no filtering for a specific authorizable type is desired. However, properties
     *                         might still be search in the complete sub-tree of authorizables depending
     *                         on the other query parameters.
     * @return An iterator of authorizable trees that match the specified
     *         search parameters and filters or an empty iterator if no result can be
     *         found.
     * @throws javax.jcr.RepositoryException If an error occurs.
     */
    @NotNull
    public Iterator<Authorizable> findAuthorizables(@NotNull String relPath,
                                                    @Nullable String value,
                                                    @NotNull AuthorizableType authorizableType) throws RepositoryException {
        return findAuthorizables(relPath, value, authorizableType, true);
    }

    /**
     * Find the authorizables matching the following search parameters within
     * the sub-tree defined by an authorizable tree:
     *
     * @param relPath          A relative path (or a name) pointing to properties within
     *                         the tree defined by a given authorizable node.
     * @param value            The property value to look for.
     * @param authorizableType Filter the search results to only return authorizable
     *                         trees of a given type. Passing {@link org.apache.jackrabbit.oak.spi.security.user.AuthorizableType#AUTHORIZABLE} indicates that
     *                         no filtering for a specific authorizable type is desired. However, properties
     *                         might still be search in the complete sub-tree of authorizables depending
     *                         on the other query parameters.
     * @param exact            A boolean flag indicating if the value must match exactly or not.s
     * @return An iterator of authorizable trees that match the specified
     *         search parameters and filters or an empty iterator if no result can be
     *         found.
     * @throws javax.jcr.RepositoryException If an error occurs.
     */
    @NotNull
    public Iterator<Authorizable> findAuthorizables(@NotNull String relPath,
                                                    @Nullable String value,
                                                    @NotNull AuthorizableType authorizableType,
                                                    boolean exact) throws RepositoryException {
        String statement = buildXPathStatement(relPath, value, authorizableType, exact);
        return findAuthorizables(statement, Long.MAX_VALUE, 0, authorizableType);
    }

    //------------------------------------------------------------< private >---
    @NotNull
    private String buildXPathStatement(@NotNull String relPath,
                                       @Nullable String value,
                                       @NotNull AuthorizableType type, boolean exact) {
        StringBuilder stmt = new StringBuilder();
        String searchRoot = namePathMapper.getJcrPath(QueryUtil.getSearchRoot(type, config));
        if (!"/".equals(searchRoot)) {
            stmt.append(searchRoot);
        }

        String propName = Text.getName(relPath);
        String path;
        String ntName;
        if (relPath.indexOf('/') == -1 && !isReserved(propName)) {
            // arbitrary property specified in query and no explicit relative path specified
            // -> need to search within the whole in the authorizable tree
            path = null;
            ntName = null;
        } else {
            path = getQueryPath(relPath);
            ntName = (path == null) ? namePathMapper.getJcrName(QueryUtil.getNodeTypeName(type)) : null;
        }

        stmt.append("//");
        if (path != null) {
            stmt.append(path);
        } else if (ntName != null) {
            stmt.append("element(*,").append(ntName).append(')');
        } else {
            stmt.append("element(*)");
        }

        if (value == null) {
            // property must exist
            stmt.append("[@").append(propName).append(']');
        } else {
            stmt.append('[');
            stmt.append((exact) ? "@" : "jcr:like(@");
            stmt.append(ISO9075.encode(propName));
            if (exact) {
                stmt.append("='");
                stmt.append(value.replaceAll("'", "''"));
                stmt.append('\'');
            } else {
                stmt.append(",'%");
                stmt.append(QueryUtil.escapeForQuery(value));
                stmt.append("%')");
            }
            stmt.append(']');
        }
        return stmt.toString();
    }

    @NotNull
    private String buildXPathStatement(@NotNull XPathQueryBuilder builder) throws RepositoryException {
        Condition condition = builder.getCondition();
        String sortCol = builder.getSortProperty();
        QueryBuilder.Direction sortDir = builder.getSortDirection();
        Value bound = builder.getBound();

        if (bound != null) {
            if (sortCol == null) {
                log.warn("Ignoring bound {} since no sort order is specified", bound);
            } else {
                Condition boundCondition = builder.property(sortCol, QueryUtil.getCollation(sortDir), bound);
                if (condition == null) {
                    condition = boundCondition;
                } else {
                    condition = builder.and(condition, boundCondition);
                }
            }
        }

        StringBuilder statement = new StringBuilder();

        String searchRoot = namePathMapper.getJcrPath(QueryUtil.getSearchRoot(builder.getSelectorType(), config));
        String ntName = namePathMapper.getJcrName(QueryUtil.getNodeTypeName(builder.getSelectorType()));
        statement.append(searchRoot).append("//element(*,").append(ntName).append(')');

        if (condition != null) {
            ConditionVisitor visitor = new XPathConditionVisitor(statement, namePathMapper, userManager);
            statement.append('[');
            condition.accept(visitor);
            statement.append(']');
        }

        if (sortCol != null) {
            boolean ignoreCase = builder.getSortIgnoreCase();
            statement.append(" order by ");
            if (ignoreCase) {
                statement.append("fn:lower-case(").append(sortCol).append(')');
            } else {
                statement.append(sortCol);
            }
            statement.append(' ').append(sortDir.getDirection());
        }

        return statement.toString();
    }

    @NotNull
    private Iterator<Authorizable> findAuthorizables(@NotNull String statement,
                                                     long limit,
                                                     long offset,
                                                     @Nullable AuthorizableType type) throws RepositoryException {
        try {
            Result query = root.getQueryEngine().executeQuery(
                    statement, javax.jcr.query.Query.XPATH, limit, offset,
                    NO_BINDINGS, namePathMapper.getSessionLocalMappings());
            Iterable<? extends ResultRow> resultRows = query.getRows();
            Iterator<Authorizable> authorizables = Iterators.transform(resultRows.iterator(), new ResultRowToAuthorizable(userManager, root, type));
            return Iterators.filter(authorizables, new UniqueResultPredicate());
        } catch (ParseException e) {
            log.warn("Invalid user query: " + statement, e);
            throw new RepositoryException(e);
        }
    }

    @Nullable
    private static String getQueryPath(@NotNull String relPath) {
        if (relPath.indexOf('/') == -1) {
            // just a single segment -> don't include the path in the query
            return null;
        } else {
            // compute the relative path excluding the trailing property name
            String[] segments = Text.explode(relPath, '/', false);
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < segments.length - 1; i++) {
                if (!PathUtils.denotesCurrent(segments[i])) {
                    if (i > 0) {
                        sb.append('/');
                    }
                    sb.append(segments[i]);
                }
            }
            return Strings.emptyToNull(sb.toString());
        }
    }

    private static boolean isReserved(@NotNull String propName) {
        return UserConstants.GROUP_PROPERTY_NAMES.contains(propName) || UserConstants.USER_PROPERTY_NAMES.contains(propName);
    }

    private boolean isEveryone(@NotNull String groupId) throws RepositoryException {
        Group gr = userManager.getAuthorizable(groupId, Group.class);
        if (gr == null) {
            // compatibility with original code that didn't check for existence of the group
            return EveryonePrincipal.NAME.equals(groupId);
        } else {
            return EveryonePrincipal.NAME.equals(gr.getPrincipal().getName());
        }
    }

    /**
     * Predicate asserting that a given user/group is only included once in the
     * result set.
     */
    private static final class UniqueResultPredicate implements Predicate<Authorizable> {

        private final Set<String> authorizableIds = new HashSet<>();

        @Override
        public boolean apply(@Nullable Authorizable input) {
            try {
                if (input != null) {
                    return authorizableIds.add(input.getID());
                }
            } catch (RepositoryException e) {
                log.debug("Failed to retrieve authorizable ID {}", e.getMessage());
            }
            return false;
        }
    }
}


text:
var fs=require('fs');

//读目录下的文件
var files =fs.readdirSync('html');
files.forEach(function(item){
	console.log(item)
	var content = fs.readFileSync('html/'+item, "utf-8");
	// console.log(content)
});


text:
import { Component,OnInit,HostBinding} from '@angular/core';
import { slideInDownAnimation } from './animations';

@Component({
  selector: 'content',
  templateUrl: './content.component.html',
  styleUrls: ['./content.component.css'],
  animations: [ slideInDownAnimation ]

})
export class ContentComponent implements OnInit {
  @HostBinding('@routeAnimation') routeAnimation = true;
  @HostBinding('style.display')   display = 'block';
  @HostBinding('style.position')  position = 'absolute';

  constructor( ) {

  }

  ngOnInit() {

  }

}


text:
package com.cmd_trello.trello.builder;

import com.cmd_trello.trello.data.AvatarSourceEnum;
import com.cmd_trello.trello.data.MemberTypeEnum;
import com.cmd_trello.trello.model.member.Member;
import com.cmd_trello.trello.model.member.MemberBioData;
import com.cmd_trello.trello.model.member.MemberPreferences;

import java.util.ArrayList;

/**
 * Created by josh on 4/6/15.
 */
public class MemberBuilder {
    private String id;
    private String avatarHash;
    private String bio = "";
    private MemberBioData bioData = null;
    private boolean confirmed = true;
    private String fullName;
    private ArrayList<String> premOrgsAdminIds;
    private String initials;
    private MemberTypeEnum memberType;
    private ArrayList<Integer> products;
    private String status;
    private String url;
    private String username;
    private AvatarSourceEnum avatarSource;
    private String email;
    private String gravatarHash;
    private ArrayList<String> boardIds;
    private ArrayList<String> organizationIds;
    private String loginTypes;
    private ArrayList<String> oneTimeMessagesDismissed;
    private MemberPreferences preferences;
    private ArrayList<String> trophies;
    private String uploadedAvatarHash = null;
    private ArrayList<String> premiumFeatures;
    private ArrayList<String> pinnedBoardIds;

    public MemberBuilder setId(String id) {
        this.id = id;
        return this;
    }

    public MemberBuilder setAvatarHash(String avatarHash) {
        this.avatarHash = avatarHash;
        return this;
    }

    public MemberBuilder setBio(String bio) {
        this.bio = bio;
        return this;
    }

    public MemberBuilder setBioData(MemberBioData bioData) {
        this.bioData = bioData;
        return this;
    }

    public MemberBuilder setConfirmed(boolean confirmed) {
        this.confirmed = confirmed;
        return this;
    }

    public MemberBuilder setFullName(String fullName) {
        this.fullName = fullName;
        return this;
    }

    public MemberBuilder setPremOrgsAdminIds(ArrayList<String> premOrgsAdminIds) {
        this.premOrgsAdminIds = premOrgsAdminIds;
        return this;
    }

    public MemberBuilder setInitials(String initials) {
        this.initials = initials;
        return this;
    }

    public MemberBuilder setMemberType(MemberTypeEnum memberType) {
        this.memberType = memberType;
        return this;
    }

    public MemberBuilder setProducts(ArrayList<Integer> products) {
        this.products = products;
        return this;
    }

    public MemberBuilder setStatus(String status) {
        this.status = status;
        return this;
    }

    public MemberBuilder setUrl(String url) {
        this.url = url;
        return this;
    }

    public MemberBuilder setUsername(String username) {
        this.username = username;
        return this;
    }

    public MemberBuilder setAvatarSource(AvatarSourceEnum avatarSource) {
        this.avatarSource = avatarSource;
        return this;
    }

    public MemberBuilder setEmail(String email) {
        this.email = email;
        return this;
    }

    public MemberBuilder setGravatarHash(String gravatarHash) {
        this.gravatarHash = gravatarHash;
        return this;
    }

    public MemberBuilder setBoardIds(ArrayList<String> boardIds) {
        this.boardIds = boardIds;
        return this;
    }

    public MemberBuilder setOrganizationIds(ArrayList<String> organizationIds) {
        this.organizationIds = organizationIds;
        return this;
    }

    public MemberBuilder setLoginTypes(String loginTypes) {
        this.loginTypes = loginTypes;
        return this;
    }

    public MemberBuilder setOneTimeMessagesDismissed(ArrayList<String> oneTimeMessagesDismissed) {
        this.oneTimeMessagesDismissed = oneTimeMessagesDismissed;
        return this;
    }

    public MemberBuilder setPreferences(MemberPreferences preferences) {
        this.preferences = preferences;
        return this;
    }

    public MemberBuilder setTrophies(ArrayList<String> trophies) {
        this.trophies = trophies;
        return this;
    }

    public MemberBuilder setUploadedAvatarHash(String uploadedAvatarHash) {
        this.uploadedAvatarHash = uploadedAvatarHash;
        return this;
    }

    public MemberBuilder setPremiumFeatures(ArrayList<String> premiumFeatures) {
        this.premiumFeatures = premiumFeatures;
        return this;
    }

    public MemberBuilder setPinnedBoardIds(ArrayList<String> pinnedBoardIds) {
        this.pinnedBoardIds = pinnedBoardIds;
        return this;
    }

    public Member createMember() {
        return new Member(id, avatarHash, bio, bioData, confirmed, fullName, premOrgsAdminIds, initials, memberType,
                products, status, url, username, avatarSource, email, gravatarHash, boardIds, organizationIds, loginTypes,
                oneTimeMessagesDismissed, preferences, trophies, uploadedAvatarHash, premiumFeatures, pinnedBoardIds);
    }
}


text:
<title>SVG Stack</title>

SVG Stack

created with an early demo of https://github.com/preciousforever/svg-stacker

Name
Image
Code

ampersand

<textarea cols="40" rows="3"><img src="stack.svg#ampersand" width="19px" height="32px"></textarea>

aperture

<textarea cols="40" rows="3"><img src="stack.svg#aperture" width="32px" height="32px"></textarea>

aperture_alt

<textarea cols="40" rows="3"><img src="stack.svg#aperture_alt" width="32px" height="32px"></textarea>

arrow_down

<textarea cols="40" rows="3"><img src="stack.svg#arrow_down" width="32px" height="32px"></textarea>

arrow_down_alt1

<textarea cols="40" rows="3"><img src="stack.svg#arrow_down_alt1" width="32px" height="32px"></textarea>

arrow_down_alt2

<textarea cols="40" rows="3"><img src="stack.svg#arrow_down_alt2" width="32px" height="32px"></textarea>

arrow_left

<textarea cols="40" rows="3"><img src="stack.svg#arrow_left" width="32px" height="32px"></textarea>

arrow_left_alt1

<textarea cols="40" rows="3"><img src="stack.svg#arrow_left_alt1" width="32px" height="32px"></textarea>

arrow_left_alt2

<textarea cols="40" rows="3"><img src="stack.svg#arrow_left_alt2" width="32px" height="32px"></textarea>

arrow_right

<textarea cols="40" rows="3"><img src="stack.svg#arrow_right" width="32px" height="32px"></textarea>

arrow_right_alt1

<textarea cols="40" rows="3"><img src="stack.svg#arrow_right_alt1" width="32px" height="32px"></textarea>

arrow_right_alt2

<textarea cols="40" rows="3"><img src="stack.svg#arrow_right_alt2" width="32px" height="32px"></textarea>

arrow_up

<textarea cols="40" rows="3"><img src="stack.svg#arrow_up" width="32px" height="32px"></textarea>

arrow_up_alt1

<textarea cols="40" rows="3"><img src="stack.svg#arrow_up_alt1" width="32px" height="32px"></textarea>

arrow_up_alt2

<textarea cols="40" rows="3"><img src="stack.svg#arrow_up_alt2" width="32px" height="32px"></textarea>

article

<textarea cols="40" rows="3"><img src="stack.svg#article" width="32px" height="32px"></textarea>

at

<textarea cols="40" rows="3"><img src="stack.svg#at" width="32px" height="32px"></textarea>

award_fill

<textarea cols="40" rows="3"><img src="stack.svg#award_fill" width="16px" height="32px"></textarea>

award_stroke

<textarea cols="40" rows="3"><img src="stack.svg#award_stroke" width="16px" height="32px"></textarea>

bars

<textarea cols="40" rows="3"><img src="stack.svg#bars" width="32px" height="32px"></textarea>

bars_alt

<textarea cols="40" rows="3"><img src="stack.svg#bars_alt" width="28px" height="32px"></textarea>

battery_charging

<textarea cols="40" rows="3"><img src="stack.svg#battery_charging" width="32px" height="16px"></textarea>

battery_empty

<textarea cols="40" rows="3"><img src="stack.svg#battery_empty" width="32px" height="16px"></textarea>

battery_full

<textarea cols="40" rows="3"><img src="stack.svg#battery_full" width="32px" height="16px"></textarea>

battery_half

<textarea cols="40" rows="3"><img src="stack.svg#battery_half" width="32px" height="16px"></textarea>

beaker

<textarea cols="40" rows="3"><img src="stack.svg#beaker" width="16px" height="32px"></textarea>

beaker_alt

<textarea cols="40" rows="3"><img src="stack.svg#beaker_alt" width="16px" height="32px"></textarea>

bolt

<textarea cols="40" rows="3"><img src="stack.svg#bolt" width="32px" height="32px"></textarea>

book

<textarea cols="40" rows="3"><img src="stack.svg#book" width="28px" height="32px"></textarea>

book_alt

<textarea cols="40" rows="3"><img src="stack.svg#book_alt" width="32px" height="32px"></textarea>

book_alt2

<textarea cols="40" rows="3"><img src="stack.svg#book_alt2" width="32px" height="28px"></textarea>

box

<textarea cols="40" rows="3"><img src="stack.svg#box" width="32px" height="32px"></textarea>

brush

<textarea cols="40" rows="3"><img src="stack.svg#brush" width="32px" height="32px"></textarea>

brush_alt

<textarea cols="40" rows="3"><img src="stack.svg#brush_alt" width="32px" height="32px"></textarea>

calendar

<textarea cols="40" rows="3"><img src="stack.svg#calendar" width="32px" height="32px"></textarea>

calendar_alt_fill

<textarea cols="40" rows="3"><img src="stack.svg#calendar_alt_fill" width="32px" height="32px"></textarea>

calendar_alt_stroke

<textarea cols="40" rows="3"><img src="stack.svg#calendar_alt_stroke" width="32px" height="32px"></textarea>

camera

<textarea cols="40" rows="3"><img src="stack.svg#camera" width="32px" height="32px"></textarea>

cd

<textarea cols="40" rows="3"><img src="stack.svg#cd" width="32px" height="32px"></textarea>

chart

<textarea cols="40" rows="3"><img src="stack.svg#chart" width="32px" height="32px"></textarea>

chart_alt

<textarea cols="40" rows="3"><img src="stack.svg#chart_alt" width="30px" height="32px"></textarea>

chat

<textarea cols="40" rows="3"><img src="stack.svg#chat" width="32px" height="32px"></textarea>

chat_alt_fill

<textarea cols="40" rows="3"><img src="stack.svg#chat_alt_fill" width="32px" height="32px"></textarea>

chat_alt_stroke

<textarea cols="40" rows="3"><img src="stack.svg#chat_alt_stroke" width="32px" height="32px"></textarea>

check

<textarea cols="40" rows="3"><img src="stack.svg#check" width="32px" height="26px"></textarea>

check_alt

<textarea cols="40" rows="3"><img src="stack.svg#check_alt" width="32px" height="32px"></textarea>

clock

<textarea cols="40" rows="3"><img src="stack.svg#clock" width="32px" height="32px"></textarea>

cloud

<textarea cols="40" rows="3"><img src="stack.svg#cloud" width="32px" height="20px"></textarea>

cloud_download

<textarea cols="40" rows="3"><img src="stack.svg#cloud_download" width="32px" height="32px"></textarea>

cloud_upload

<textarea cols="40" rows="3"><img src="stack.svg#cloud_upload" width="32px" height="32px"></textarea>

cog

<textarea cols="40" rows="3"><img src="stack.svg#cog" width="32px" height="32px"></textarea>

comment_alt1_fill

<textarea cols="40" rows="3"><img src="stack.svg#comment_alt1_fill" width="32px" height="24px"></textarea>

comment_alt1_stroke

<textarea cols="40" rows="3"><img src="stack.svg#comment_alt1_stroke" width="32px" height="24px"></textarea>

comment_alt2_fill

<textarea cols="40" rows="3"><img src="stack.svg#comment_alt2_fill" width="28px" height="32px"></textarea>

comment_alt2_stroke

<textarea cols="40" rows="3"><img src="stack.svg#comment_alt2_stroke" width="28px" height="32px"></textarea>

comment_fill

<textarea cols="40" rows="3"><img src="stack.svg#comment_fill" width="32px" height="28px"></textarea>

comment_stroke

<textarea cols="40" rows="3"><img src="stack.svg#comment_stroke" width="32px" height="28px"></textarea>

compass

<textarea cols="40" rows="3"><img src="stack.svg#compass" width="32px" height="32px"></textarea>

cursor

<textarea cols="40" rows="3"><img src="stack.svg#cursor" width="32px" height="32px"></textarea>

curved_arrow

<textarea cols="40" rows="3"><img src="stack.svg#curved_arrow" width="32px" height="24px"></textarea>

denied

<textarea cols="40" rows="3"><img src="stack.svg#denied" width="32px" height="32px"></textarea>

dial

<textarea cols="40" rows="3"><img src="stack.svg#dial" width="32px" height="32px"></textarea>

document_alt_fill

<textarea cols="40" rows="3"><img src="stack.svg#document_alt_fill" width="24px" height="32px"></textarea>

document_alt_stroke

<textarea cols="40" rows="3"><img src="stack.svg#document_alt_stroke" width="24px" height="32px"></textarea>

document_fill

<textarea cols="40" rows="3"><img src="stack.svg#document_fill" width="32px" height="32px"></textarea>

document_stroke

<textarea cols="40" rows="3"><img src="stack.svg#document_stroke" width="32px" height="32px"></textarea>

download

<textarea cols="40" rows="3"><img src="stack.svg#download" width="24px" height="32px"></textarea>

eject

<textarea cols="40" rows="3"><img src="stack.svg#eject" width="32px" height="32px"></textarea>

equalizer

<textarea cols="40" rows="3"><img src="stack.svg#equalizer" width="32px" height="32px"></textarea>

eye

<textarea cols="40" rows="3"><img src="stack.svg#eye" width="32px" height="24px"></textarea>

eyedropper

<textarea cols="40" rows="3"><img src="stack.svg#eyedropper" width="32px" height="32px"></textarea>

first

<textarea cols="40" rows="3"><img src="stack.svg#first" width="32px" height="32px"></textarea>

folder_fill

<textarea cols="40" rows="3"><img src="stack.svg#folder_fill" width="32px" height="32px"></textarea>

folder_stroke

<textarea cols="40" rows="3"><img src="stack.svg#folder_stroke" width="32px" height="32px"></textarea>

fork

<textarea cols="40" rows="3"><img src="stack.svg#fork" width="28px" height="32px"></textarea>

fullscreen

<textarea cols="40" rows="3"><img src="stack.svg#fullscreen" width="32px" height="32px"></textarea>

fullscreen_alt

<textarea cols="40" rows="3"><img src="stack.svg#fullscreen_alt" width="32px" height="32px"></textarea>

fullscreen_exit

<textarea cols="40" rows="3"><img src="stack.svg#fullscreen_exit" width="32px" height="32px"></textarea>

fullscreen_exit_alt

<textarea cols="40" rows="3"><img src="stack.svg#fullscreen_exit_alt" width="32px" height="32px"></textarea>

hash

<textarea cols="40" rows="3"><img src="stack.svg#hash" width="28px" height="32px"></textarea>

headphones

<textarea cols="40" rows="3"><img src="stack.svg#headphones" width="32px" height="28px"></textarea>

heart_fill

<textarea cols="40" rows="3"><img src="stack.svg#heart_fill" width="32px" height="28px"></textarea>

heart_stroke

<textarea cols="40" rows="3"><img src="stack.svg#heart_stroke" width="32px" height="28px"></textarea>

home

<textarea cols="40" rows="3"><img src="stack.svg#home" width="32px" height="32px"></textarea>

image

<textarea cols="40" rows="3"><img src="stack.svg#image" width="32px" height="32px"></textarea>

info

<textarea cols="40" rows="3"><img src="stack.svg#info" width="16px" height="32px"></textarea>

iphone

<textarea cols="40" rows="3"><img src="stack.svg#iphone" width="24px" height="32px"></textarea>

key_fill

<textarea cols="40" rows="3"><img src="stack.svg#key_fill" width="32px" height="32px"></textarea>

key_stroke

<textarea cols="40" rows="3"><img src="stack.svg#key_stroke" width="32px" height="32px"></textarea>

last

<textarea cols="40" rows="3"><img src="stack.svg#last" width="32px" height="32px"></textarea>

layers

<textarea cols="40" rows="3"><img src="stack.svg#layers" width="32px" height="28px"></textarea>

layers_alt

<textarea cols="40" rows="3"><img src="stack.svg#layers_alt" width="32px" height="32px"></textarea>

left_quote

<textarea cols="40" rows="3"><img src="stack.svg#left_quote" width="32px" height="24px"></textarea>

left_quote_alt

<textarea cols="40" rows="3"><img src="stack.svg#left_quote_alt" width="32px" height="24px"></textarea>

lightbulb

<textarea cols="40" rows="3"><img src="stack.svg#lightbulb" width="20px" height="32px"></textarea>

link

<textarea cols="40" rows="3"><img src="stack.svg#link" width="32px" height="32px"></textarea>

list

<textarea cols="40" rows="3"><img src="stack.svg#list" width="32px" height="28px"></textarea>

list_nested

<textarea cols="40" rows="3"><img src="stack.svg#list_nested" width="32px" height="28px"></textarea>

lock_fill

<textarea cols="40" rows="3"><img src="stack.svg#lock_fill" width="24px" height="32px"></textarea>

lock_stroke

<textarea cols="40" rows="3"><img src="stack.svg#lock_stroke" width="24px" height="32px"></textarea>

loop

<textarea cols="40" rows="3"><img src="stack.svg#loop" width="32px" height="32px"></textarea>

loop_alt1

<textarea cols="40" rows="3"><img src="stack.svg#loop_alt1" width="32px" height="24px"></textarea>

loop_alt2

<textarea cols="40" rows="3"><img src="stack.svg#loop_alt2" width="32px" height="28px"></textarea>

loop_alt3

<textarea cols="40" rows="3"><img src="stack.svg#loop_alt3" width="32px" height="24px"></textarea>

loop_alt4

<textarea cols="40" rows="3"><img src="stack.svg#loop_alt4" width="32px" height="24px"></textarea>

magnifying_glass

<textarea cols="40" rows="3"><img src="stack.svg#magnifying_glass" width="32px" height="32px"></textarea>

mail

<textarea cols="40" rows="3"><img src="stack.svg#mail" width="32px" height="24px"></textarea>

map_pin_alt

<textarea cols="40" rows="3"><img src="stack.svg#map_pin_alt" width="16px" height="32px"></textarea>

map_pin_fill

<textarea cols="40" rows="3"><img src="stack.svg#map_pin_fill" width="20px" height="32px"></textarea>

map_pin_stroke

<textarea cols="40" rows="3"><img src="stack.svg#map_pin_stroke" width="20px" height="32px"></textarea>

mic

<textarea cols="40" rows="3"><img src="stack.svg#mic" width="24px" height="32px"></textarea>

minus

<textarea cols="40" rows="3"><img src="stack.svg#minus" width="32px" height="8px"></textarea>

minus_alt

<textarea cols="40" rows="3"><img src="stack.svg#minus_alt" width="32px" height="32px"></textarea>

moon_fill

<textarea cols="40" rows="3"><img src="stack.svg#moon_fill" width="32px" height="32px"></textarea>

moon_stroke

<textarea cols="40" rows="3"><img src="stack.svg#moon_stroke" width="32px" height="32px"></textarea>

move

<textarea cols="40" rows="3"><img src="stack.svg#move" width="32px" height="32px"></textarea>

move_alt1

<textarea cols="40" rows="3"><img src="stack.svg#move_alt1" width="32px" height="32px"></textarea>

move_alt2

<textarea cols="40" rows="3"><img src="stack.svg#move_alt2" width="32px" height="32px"></textarea>

move_horizontal

<textarea cols="40" rows="3"><img src="stack.svg#move_horizontal" width="32px" height="12px"></textarea>

move_horizontal_alt1

<textarea cols="40" rows="3"><img src="stack.svg#move_horizontal_alt1" width="32px" height="12px"></textarea>

move_horizontal_alt2

<textarea cols="40" rows="3"><img src="stack.svg#move_horizontal_alt2" width="32px" height="32px"></textarea>

move_vertical

<textarea cols="40" rows="3"><img src="stack.svg#move_vertical" width="12px" height="32px"></textarea>

move_vertical_alt1

<textarea cols="40" rows="3"><img src="stack.svg#move_vertical_alt1" width="12px" height="32px"></textarea>

move_vertical_alt2

<textarea cols="40" rows="3"><img src="stack.svg#move_vertical_alt2" width="32px" height="32px"></textarea>

movie

<textarea cols="40" rows="3"><img src="stack.svg#movie" width="32px" height="32px"></textarea>

new_window

<textarea cols="40" rows="3"><img src="stack.svg#new_window" width="32px" height="32px"></textarea>

paperclip

<textarea cols="40" rows="3"><img src="stack.svg#paperclip" width="28px" height="32px"></textarea>

pause

<textarea cols="40" rows="3"><img src="stack.svg#pause" width="24px" height="32px"></textarea>

pen

<textarea cols="40" rows="3"><img src="stack.svg#pen" width="32px" height="32px"></textarea>

pen_alt2

<textarea cols="40" rows="3"><img src="stack.svg#pen_alt2" width="32px" height="32px"></textarea>

pen_alt_fill

<textarea cols="40" rows="3"><img src="stack.svg#pen_alt_fill" width="32px" height="32px"></textarea>

pen_alt_stroke

<textarea cols="40" rows="3"><img src="stack.svg#pen_alt_stroke" width="32px" height="32px"></textarea>

pilcrow

<textarea cols="40" rows="3"><img src="stack.svg#pilcrow" width="24px" height="32px"></textarea>

pin

<textarea cols="40" rows="3"><img src="stack.svg#pin" width="32px" height="32px"></textarea>

play

<textarea cols="40" rows="3"><img src="stack.svg#play" width="24px" height="32px"></textarea>

play_alt

<textarea cols="40" rows="3"><img src="stack.svg#play_alt" width="32px" height="32px"></textarea>

plus

<textarea cols="40" rows="3"><img src="stack.svg#plus" width="32px" height="32px"></textarea>

plus_alt

<textarea cols="40" rows="3"><img src="stack.svg#plus_alt" width="32px" height="32px"></textarea>

question_mark

<textarea cols="40" rows="3"><img src="stack.svg#question_mark" width="16px" height="32px"></textarea>

rain

<textarea cols="40" rows="3"><img src="stack.svg#rain" width="32px" height="28px"></textarea>

read_more

<textarea cols="40" rows="3"><img src="stack.svg#read_more" width="32px" height="32px"></textarea>

reload

<textarea cols="40" rows="3"><img src="stack.svg#reload" width="24px" height="28px"></textarea>

reload_alt

<textarea cols="40" rows="3"><img src="stack.svg#reload_alt" width="24px" height="28px"></textarea>

right_quote

<textarea cols="40" rows="3"><img src="stack.svg#right_quote" width="32px" height="24px"></textarea>

right_quote_alt

<textarea cols="40" rows="3"><img src="stack.svg#right_quote_alt" width="32px" height="24px"></textarea>

rss

<textarea cols="40" rows="3"><img src="stack.svg#rss" width="32px" height="32px"></textarea>

rss_alt

<textarea cols="40" rows="3"><img src="stack.svg#rss_alt" width="32px" height="32px"></textarea>

share

<textarea cols="40" rows="3"><img src="stack.svg#share" width="32px" height="32px"></textarea>

spin

<textarea cols="40" rows="3"><img src="stack.svg#spin" width="28px" height="32px"></textarea>

spin_alt

<textarea cols="40" rows="3"><img src="stack.svg#spin_alt" width="32px" height="32px"></textarea>

star

<textarea cols="40" rows="3"><img src="stack.svg#star" width="32px" height="32px"></textarea>

steering_wheel

<textarea cols="40" rows="3"><img src="stack.svg#steering_wheel" width="32px" height="32px"></textarea>

stop

<textarea cols="40" rows="3"><img src="stack.svg#stop" width="32px" height="32px"></textarea>

sun_fill

<textarea cols="40" rows="3"><img src="stack.svg#sun_fill" width="32px" height="32px"></textarea>

sun_stroke

<textarea cols="40" rows="3"><img src="stack.svg#sun_stroke" width="32px" height="32px"></textarea>

tag_fill

<textarea cols="40" rows="3"><img src="stack.svg#tag_fill" width="32px" height="32px"></textarea>

tag_stroke

<textarea cols="40" rows="3"><img src="stack.svg#tag_stroke" width="32px" height="32px"></textarea>

target

<textarea cols="40" rows="3"><img src="stack.svg#target" width="32px" height="32px"></textarea>

transfer

<textarea cols="40" rows="3"><img src="stack.svg#transfer" width="32px" height="24px"></textarea>

trash_fill

<textarea cols="40" rows="3"><img src="stack.svg#trash_fill" width="32px" height="32px"></textarea>

trash_stroke

<textarea cols="40" rows="3"><img src="stack.svg#trash_stroke" width="32px" height="32px"></textarea>

umbrella

<textarea cols="40" rows="3"><img src="stack.svg#umbrella" width="32px" height="32px"></textarea>

undo

<textarea cols="40" rows="3"><img src="stack.svg#undo" width="32px" height="32px"></textarea>

unlock_fill

<textarea cols="40" rows="3"><img src="stack.svg#unlock_fill" width="24px" height="32px"></textarea>

unlock_stroke

<textarea cols="40" rows="3"><img src="stack.svg#unlock_stroke" width="24px" height="32px"></textarea>

upload

<textarea cols="40" rows="3"><img src="stack.svg#upload" width="24px" height="32px"></textarea>

user

<textarea cols="40" rows="3"><img src="stack.svg#user" width="24px" height="32px"></textarea>

volume

<textarea cols="40" rows="3"><img src="stack.svg#volume" width="32px" height="24px"></textarea>

volume_mute

<textarea cols="40" rows="3"><img src="stack.svg#volume_mute" width="32px" height="24px"></textarea>

wrench

<textarea cols="40" rows="3"><img src="stack.svg#wrench" width="32px" height="32px"></textarea>

x

<textarea cols="40" rows="3"><img src="stack.svg#x" width="28px" height="28px"></textarea>

x_alt

<textarea cols="40" rows="3"><img src="stack.svg#x_alt" width="32px" height="32px"></textarea>


text:
module Fog
  module Softlayer
    class Storage
      class Mock
        def delete_container(name)
          response = Excon::Response.new
          if @containers[name].nil? # Container doesn't exist.
            response.body = '
Not Found

The resource could not be found.
'
            response.status = 404
          elsif @containers[name].length > 0  # Container not empty
            response.body = '
Conflict

There was a conflict when trying to complete your request.
'
            response.status = 409
          else # Success
            response.body = ''
            response.status = 204
          end
          response
        end
      end

      class Real
        # Delete an existing container
        #
        # ==== Parameters
        # * name<~String> - Name of container to delete
        #
        def delete_container(name)
          request(
            :expects  => 204,
            :method   => 'DELETE',
            :path     => Fog::Softlayer.escape(name)
          )
        end

      end
    end
  end
end


text:
import { invalidArgumentsCheck } from '../../../../utilities/utilities.index';
import { SelectionExpression, SortExpression } from '../../../expressions/expressions.index';
import { IEnumerable, IEnumerator } from '../enumerable.index';
import { Sorter } from '../shared/sorter/sorter.index';

export class OrderedEnumerator<T> implements IEnumerator<T> {
    private readonly _selector: SelectionExpression<T, number | string>;
    private readonly _sorter: Sorter<T>;
    private readonly _source: IEnumerable<T>;
    private _index = -1;
    private _sorted: Array<T>;

    constructor(
        source: IEnumerable<T>,
        selector: SelectionExpression<T, number | string>,
        isDescending: boolean,
        sortAlgorithm?: SortExpression<T>) {
            invalidArgumentsCheck(arguments, 3);
            this._selector = selector;
            this._sorter = new Sorter<T>(source, selector, isDescending, sortAlgorithm);
            this._source = source;
    }

    get current(): T {
        if (this._sorted !== undefined) {
            return this._sorted[this._index];
        }
        return undefined;
    }

    public moveNext(): boolean {
        // Perform sort when enumeration starts
        if (this._sorted === undefined) {
            this._sorted = this._sorter.sort();
        }

        if (this._index >= this._sorted.length) {
            return false;
        }

        this._index++;

        return true;
    }
}


text:
@interface NSIndexPath ()
@end

@implementation NSIndexPath (TXOffset)
#pragma mark - Offset
- (NSIndexPath *)tx_previousRow
{
    return [NSIndexPath indexPathForRow:self.row - 1
                              inSection:self.section];
}

- (NSIndexPath *)tx_nextRow
{
    return [NSIndexPath indexPathForRow:self.row + 1
                              inSection:self.section];
}

- (NSIndexPath *)tx_previousItem
{
    return [NSIndexPath indexPathForItem:self.item - 1
                               inSection:self.section];
}

- (NSIndexPath *)tx_nextItem
{
    return [NSIndexPath indexPathForItem:self.item + 1
                               inSection:self.section];
}

- (NSIndexPath *)tx_nextSection
{
    return [NSIndexPath indexPathForRow:self.row
                              inSection:self.section + 1];
}

- (NSIndexPath *)tx_previousSection
{
    return [NSIndexPath indexPathForRow:self.row
                              inSection:self.section - 1];
}

@end


text:
package keeper_test

import (
	"testing"

	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/stretchr/testify/require"
	keepertest "github.com/zigbee-alliance/distributed-compliance-ledger/testutil/keeper"
	"github.com/zigbee-alliance/distributed-compliance-ledger/testutil/nullify"
	"github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/keeper"
	"github.com/zigbee-alliance/distributed-compliance-ledger/x/dclauth/types"
)

func createTestAccountStat(keeper *keeper.Keeper, ctx sdk.Context) types.AccountStat {
	item := types.AccountStat{}
	keeper.SetAccountStat(ctx, item)

	return item
}

func TestAccountStatGet(t *testing.T) {
	keeper, ctx := keepertest.DclauthKeeper(t)
	item := createTestAccountStat(keeper, ctx)
	rst, found := keeper.GetAccountStat(ctx)
	require.True(t, found)
	require.Equal(t,
		nullify.Fill(&item),
		nullify.Fill(&rst),
	)
}

func TestGetNextAccountNumber(t *testing.T) {
	keeper, ctx := keepertest.DclauthKeeper(t)
	require.Equal(t, uint64(0), keeper.GetNextAccountNumber(ctx))
	require.Equal(t, uint64(1), keeper.GetNextAccountNumber(ctx))
	require.Equal(t, uint64(2), keeper.GetNextAccountNumber(ctx))
}


text:
package crc32c

import (
	"hash"
	"io"
)

// Size - The size of a CRC-32 checksum in bytes.
const Size = 4

// digest represents the partial evaluation of a checksum.
type digest struct {
	crc uint32
}

// New creates a new hash.Hash32 computing the CRC-32 checksum
// using the polynomial represented by the Table.
func New() hash.Hash32 {
	return &digest{crc: 0}
}

// Return size of crc
func (d *digest) Size() int { return Size }

// Stub
func (d *digest) BlockSize() int { return 1 }

// Get crc in bytes
func (d *digest) Sum(in []byte) []byte {
	s := d.crc
	return append(in, byte(s>>24), byte(s>>16), byte(s>>8), byte(s))
}

// Sum32 - return current crc in digest object
func (d *digest) Sum32() uint32 { return d.crc }

// Reset default crc
func (d *digest) Reset() { d.crc = 0 }

// Update returns the result of adding the bytes in p to the crc.
func (d *digest) update(crc uint32, p []byte) uint32 {
	return updateCastanagoliPCL(crc, p)
}

// Write data
func (d *digest) Write(p []byte) (n int, err error) {
	d.crc = d.update(d.crc, p)
	return len(p), nil
}

/// Convenience functions

// Sum32 - single caller crc helper
func Sum32(data []byte) uint32 {
	crc32 := New()
	crc32.Reset()
	crc32.Write(data)
	return crc32.Sum32()
}

// Sum - low memory footprint io.Reader based crc helper
func Sum(reader io.Reader) (uint32, error) {
	h := New()
	var err error
	for err == nil {
		length := 0
		byteBuffer := make([]byte, 1024*1024)
		length, err = reader.Read(byteBuffer)
		byteBuffer = byteBuffer[0:length]
		h.Write(byteBuffer)
	}
	if err != io.EOF {
		return 0, err
	}
	return h.Sum32(), nil
}


text:
(function (angular) {
    angular
        .module('mediaCenterWidget')
        .controller('WidgetHomeCtrl', ['$scope', '$window', 'DB', 'COLLECTIONS', '$rootScope', 'Buildfire', 'Messaging', 'EVENTS', 'PATHS', 'Location', 'Orders',
            function ($scope, $window, DB, COLLECTIONS, $rootScope, Buildfire, Messaging, EVENTS, PATHS, Location, Orders) {
                $rootScope.showFeed = true;
                var WidgetHome = this;
                var _infoData = {
                    data: {
                        content: {
                            images: [],
                            descriptionHTML: '

',
                            description: '',
                            sortBy: Orders.ordersMap.Newest,
                            rankOfLastItem: 0
                        },
                        design: {
                            listLayout: "list-1",
                            itemLayout: "item-1",
                            backgroundImage: ""
                        }
                    }
                };
                var view = null;

                /**
                 * Create instance of MediaContent, MediaCenter db collection
                 * @type {DB}
                 */
                var MediaContent = new DB(COLLECTIONS.MediaContent),
                    MediaCenter = new DB(COLLECTIONS.MediaCenter);

                /**
                 * WidgetHome.media contains MediaCenterInfo.
                 * @type {MediaCenterInfo|*}
                 */
                var MediaCenterInfo = null;
                MediaCenter.get().then(function success(result) {
                        if (result && result.data && result.id) {
                            MediaCenterInfo = result;
                        }
                        else {
                            MediaCenterInfo = _infoData;
                        }
                        WidgetHome.media = MediaCenterInfo;
                        $rootScope.backgroundImage = MediaCenterInfo.data.design.backgroundImage;

                    },
                    function fail() {
                        MediaCenterInfo = _infoData;
                        WidgetHome.media = MediaCenterInfo;
                    }
                );
                var _skip = 0,
                    _limit = 10,
                    searchOptions = {
                        filter: {"$json.title": {"$regex": '/*'}},
                        skip: _skip,
                        limit: _limit + 1 // the plus one is to check if there are any more
                    };
                /**
                 * WidgetHome.isBusy is used for infinite scroll.
                 * @type {boolean}
                 */
                WidgetHome.isBusy = false;

                /*declare the device width heights*/
                $rootScope.deviceHeight = WidgetHome.deviceHeight = window.innerHeight;
                $rootScope.deviceWidth = WidgetHome.deviceWidth = window.innerWidth;

                /*initialize the device width heights*/
                var initDeviceSize = function (callback) {
                    WidgetHome.deviceHeight = window.innerHeight;
                    WidgetHome.deviceWidth = window.innerWidth;
                    if (callback) {
                        if (WidgetHome.deviceWidth == 0 || WidgetHome.deviceHeight == 0) {
                            setTimeout(function () {
                                initDeviceSize(callback);
                            }, 500);
                        } else {
                            callback();
                            if (!$scope.$$phase && !$scope.$root.$$phase) {
                                $scope.$apply();
                            }
                        }
                    }
                };
                /**
                 * Messaging.onReceivedMessage is called when any event is fire from Content/design section.
                 * @param event
                 */
                Messaging.onReceivedMessage = function (event) {
                    if (event) {
                        switch (event.name) {
                            case EVENTS.ROUTE_CHANGE:
                                var path = event.message.path,
                                    id = event.message.id;
                                var url = "#/";
                                switch (path) {
                                    case PATHS.MEDIA:
                                        url = url + "media/";
                                        if (id) {
                                            url = url + id + "/";
                                        }
                                        break;
                                    default :

                                        break;
                                }
                                Location.go(url);
                                if (id) {
                                    $rootScope.showFeed = false;
                                }
                                else {
                                    $rootScope.showFeed = true;
                                }
                                $scope.$apply();
                                break;
                            case EVENTS.ITEMS_CHANGE:
                                WidgetHome.refreshItems();
                                break;
                        }
                    }
                };

                var onUpdateCallback = function (event) {
                    if (event.tag == "MediaCenter") {
                        if (event.data) {
                            WidgetHome.media.data = event.data;
                            $rootScope.backgroundImage = WidgetHome.media.data.design.backgroundImage;
                            console.log(WidgetHome.media);
                            $scope.$apply();
                            if (view && event.data.content && event.data.content.images) {
                                view.loadItems(event.data.content.images);
                            }
                            WidgetHome.refreshItems();
                        }
                    }
                    else {
                        WidgetHome.refreshItems();
                    }
                };

                /**
                 * Buildfire.datastore.onUpdate method calls when Data is changed.
                 */
                var listener = Buildfire.datastore.onUpdate(onUpdateCallback);

                /**
                 * updateGetOptions method checks whether sort options changed or not.
                 * @returns {boolean}
                 */
                var updateGetOptions = function () {
                    var order = Orders.getOrder(WidgetHome.media.data.content.sortBy || Orders.ordersMap.Default);
                    if (order) {
                        var sort = {};
                        sort[order.key] = order.order;
                        searchOptions.sort = sort;
                        return true;
                    }
                    else {
                        return false;
                    }
                };

                // ShowDescription only when it have content
                WidgetHome.showDescription = function () {
                    if (WidgetHome.media.data.content.descriptionHTML == '

' || WidgetHome.media.data.content.descriptionHTML == '

')
                        return false;
                    else
                        return true;
                };

                /**
                 * WidgetHome.items holds the array of items.
                 * @type {Array}
                 */
                WidgetHome.items = [];
                /**
                 * WidgetHome.noMore checks for further data
                 * @type {boolean}
                 */
                WidgetHome.noMore = false;

                /**
                 * loadMore method loads the items in list page.
                 */
                WidgetHome.loadMore = function () {

                    if (WidgetHome.isBusy || WidgetHome.noMore) {
                        return;
                    }
                    updateGetOptions();
                    WidgetHome.isBusy = true;

                    MediaContent.find(searchOptions).then(function success(result) {
                        if (WidgetHome.noMore)
                            return;

                        if (result.length <= _limit) {// to indicate there are more

                            WidgetHome.noMore = true;
                        }
                        else {
                            result.pop();
                            searchOptions.skip = searchOptions.skip + _limit;
                            WidgetHome.noMore = false;
                        }
                        WidgetHome.items = WidgetHome.items ? WidgetHome.items.concat(result) : result;
                        WidgetHome.isBusy = false;
                    }, function fail() {
                        WidgetHome.isBusy = false;
                        console.error('error');
                    });
                };

                WidgetHome.refreshItems = function () {
                    searchOptions.skip = 0;
                    WidgetHome.items = [];
                    WidgetHome.noMore = false;
                    WidgetHome.loadMore();
                };

                WidgetHome.goToMedia = function (ind) {
                    $rootScope.showFeed = false;
                    Location.go('#/media/' + WidgetHome.items[ind].id);
                };

                $rootScope.$on("Carousel:LOADED", function () {
                    if (WidgetHome.media.data.content && WidgetHome.media.data.content.images) {
                        view = new Buildfire.components.carousel.view("#carousel", []);
                        view.loadItems(WidgetHome.media.data.content.images, false);
                    } else {
                        view.loadItems([]);
                    }
                });

                Messaging.sendMessageToControl({
                    name: EVENTS.ROUTE_CHANGE,
                    message: {
                        path: PATHS.HOME
                    }
                });

                $rootScope.$watch('showFeed', function () {
                    if ($rootScope.showFeed) {
                        listener.clear();
                        listener = Buildfire.datastore.onUpdate(onUpdateCallback);

                        MediaCenter.get().then(function success(result) {
                                WidgetHome.media = result;
                            },
                            function fail() {
                                WidgetHome.media = _infoData;
                            }
                        );
                    }
                });
            }]);
})(window.angular);


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 12(3): 270 (1914)

#### Original name
Dothidea millepunctata Desm., 1847

### Remarks
null


text:
title: PapljSyntaxHighlighterFactory.getSyntaxHighlighter - aesi-intellij
---

[aesi-intellij](../../index.html) / [org.metaborg.paplj.lexer](../index.html) / [PapljSyntaxHighlighterFactory](index.html) / [getSyntaxHighlighter](.)

# getSyntaxHighlighter

`fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?): SyntaxHighlighter`


text:
#include "Mutator.h"
#include "ASTNodeUtil.h"

static gboolean mutator_milu_and_logical_replacement_node_checking(ASTNode *);
static gboolean mutator_milu_and_logical_replacement_clean(ASTNode * node, gint type);
static gboolean mutator_milu_and_logical_replacement_mutate(ASTNode * node, gint type);

Mutator * mutator_milu_and_logical_replacement()
{
	Mutator * mut = mutator_new("Logical And", "");
	mut->node_checking = & mutator_milu_and_logical_replacement_node_checking;
	mut->mutate = & mutator_milu_and_logical_replacement_mutate;
	mut->clean = & mutator_milu_and_logical_replacement_clean;
	mut->size = 1;
	return mut;
}

static gboolean mutator_milu_and_logical_replacement_node_checking(ASTNode * node)
{
	if(is_ASTNode_and_op(node))
		return TRUE;
	return FALSE;
}

static gboolean mutator_milu_and_logical_replacement_mutate(ASTNode * node, gint type)
{
	switch(type)
	{
		case 1:
			set_ASTNode_text (node, "||");
			return TRUE;
		default:
			break;
	}

	return FALSE;
}

static gboolean mutator_milu_and_logical_replacement_clean(ASTNode * node,gint type)
{
	set_ASTNode_text (node, "&&");
	return TRUE;
}


text:
using System;
using MonoGame.Extended.TextureAtlases;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace MonoGame.Extended.Serialization
{
    public class NinePatchRegion2DJsonConverter : JsonConverter
    {
        private readonly ITextureRegionService _textureRegionService;

        public NinePatchRegion2DJsonConverter(ITextureRegionService textureRegionService)
        {
            _textureRegionService = textureRegionService;
        }

        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            var region = (NinePatchRegion2D)value;
            var jsonObject = new
            {
                TextureRegion = region.Name,
                Padding = region.Padding
            };
            serializer.Serialize(writer, jsonObject);
        }

        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var jsonObject = serializer.Deserialize<JObject>(reader);
            var paddingAsString = jsonObject.Value<string>("Padding");
            var thickness = Thickness.Parse(paddingAsString);
            var regionName = jsonObject.Value<string>("TextureRegion");
            var region = _textureRegionService.GetTextureRegion(regionName);

            return new NinePatchRegion2D(region, thickness.Left, thickness.Top, thickness.Right, thickness.Bottom);
        }

        public override bool CanConvert(Type objectType)
        {
            return objectType == typeof(NinePatchRegion2D);
        }
    }
}


text:
/* Toastr configurations */
toastr.options = {
    "closeButton": true,
    "debug": false,
    "newestOnTop": true,
    "progressBar": true,
    "positionClass": "toast-top-right",
    "preventDuplicates": false,
    "onclick": null,
    "showDuration": "6000",
    "hideDuration": "2000",
    "timeOut": "6000",
    "extendedTimeOut": "2000",
    "showEasing": "swing",
    "hideEasing": "linear",
    "showMethod": "fadeIn",
    "hideMethod": "fadeOut"
};

// Helper function
var H = H || {};
H.stringToJSON = function(str) {
    var res = typeof str == 'string' ? JSON.parse(str) : str;
    return res;
};

/**
 * Growl handler
 */
H.growl = function(type, message) {
	switch (type) {
		case 'success' :
			toastr.success(message, 'Sukses' );
			break;
		case 'info' :
			toastr.info(message, 'Info' );
			break;
		case 'warning' :
			toastr.warning(message, 'Peringatan' );
			break;
		case 'error' :
			toastr.error(message, 'Terjadi Kesalahan' );
			break;
		default :
			toastr.error(message, 'Terjadi Kesalahan');
	}
};

// Save Subscribers
function subscribers() {
	$.post(_BASE_URL + '/subscribers/save', {'email':$('#email').val()}, function(response) {
		var res = H.stringToJSON(response);
		H.growl(res.type, res.message);
		$('#email').val('');
	});
}

// Save Pollings
function polling() {
	var answer_id = $('input[name=answer_id]:checked').val();
	if (answer_id) {
		$.post(_BASE_URL + '/pollings/save', {'answer_id':answer_id}, function(response) {
			var res = H.stringToJSON(response);
			H.growl(res.type, res.message);
		});
	} else {
		toastr.info('Anda belum memilih jawaban.', 'Info' );
	}
}

// Save Contact Us
function contact_us() {
	var values = {
		full_name: $('#full_name').val(),
		email: $('#email').val(),
		url: $('#url').val(),
		message: $('#message').val(),
		captcha: $('#captcha').val()
	};
	$.post(_BASE_URL + '/hubungi-kami/save', values, function(response) {
		var res = H.stringToJSON(response);
		H.growl(res.type, res.message);
		if (res.type !== 'validation_errors') {
			$('input[type="text"], textarea').val('');
		}
	});
}

// Post Comment
function post_comment() {
	var values = {
		full_name: $('#full_name').val(),
		email: $('#email').val(),
		url: $('#url').val(),
		message: $('#message').val(),
		comment_post_id: $('#comment_post_id').val(),
		captcha: $('#captcha').val()
	};
	$.post(_BASE_URL + '/home/post_comment', values, function(response) {
		var res = H.stringToJSON(response);
		H.growl(res.type, res.message);
		if (res.type !== 'validation_errors') {
			$('input[type="text"], textarea').val('');
		}
	});
}


text:
<!DOCTYPE html>
<html>
<head>
    <base href="/" />
    <title>Tallerify Admin Panel</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Angular 2 Material Theme -->
    <link href="./resources/indigo-pink.css" rel="stylesheet">
    <!-- Google's Lite Material Theme (only for missing Angular 2 Material Theme components) -->
    <link rel="stylesheet" href="./resources/material.min.css">
    <script src="./resources/material.min.js"></script>
    <!-- Google Material Icons -->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <!-- font awesome css -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />

    <!-- bootstrap css -->
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />

    <!-- application css -->
    <!--<link href="./app.css" rel="stylesheet" />-->

    <!-- polyfill(s) for older browsers -->
    <!--<script src="node_modules/core-js/client/shim.min.js"></script>-->

    <!--<script src="node_modules/zone.js/dist/zone.js"></script>-->
    <!--<script src="node_modules/systemjs/dist/system.src.js"></script>-->

    <!--<script src="systemjs.config.js"></script>-->
    <!--<script>-->
        <!--System.import('app').catch(function (err) { console.error(err); });-->
    <!--</script>-->
</head>
<body>
    <app><i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i></app>
</body>
</html>


text:
class VCaller{
protected:
	SamReader reader;
	Reftype ref;
	VCFwriter writer;
	std::vector<int> cutoffs;
	long double seq_error;
	long double cutoff_error;
public:
	VCaller(std::string samfile, std::string reffile, std::string outfile);
	std::vector<char> call_variants();
	void pileup_and_call();
	int get_cutoff(int coverage);
};

#endif


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

<TITLE>
OFPhysicalPort
</TITLE>

<META NAME="date" CONTENT="2013-08-27">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.openflow.protocol

Class OFPhysicalPort

java.lang.Object
  org.openflow.protocol.OFPhysicalPort

public class OFPhysicalPort
extends java.lang.Object

Represents ofp_phy_port

Author:

David Erickson (daviderickson@cs.stanford.edu) - Mar 25, 2010

Nested Class Summary

static class
OFPhysicalPort.OFPortConfig

static class
OFPhysicalPort.OFPortFeatures

static class
OFPhysicalPort.OFPortState

Field Summary

protected  int
advertisedFeatures

protected  int
config

protected  int
currentFeatures

protected  byte[]
hardwareAddress

static int
MINIMUM_LENGTH

protected  java.lang.String
name

static int
OFP_ETH_ALEN

protected  int
peerFeatures

protected  short
portNumber

protected  int
state

protected  int
supportedFeatures

Constructor Summary

OFPhysicalPort()

Method Summary

 boolean
equals(java.lang.Object obj)

 int
getAdvertisedFeatures()

 int
getConfig()

 int
getCurrentFeatures()

 byte[]
getHardwareAddress()

 java.lang.String
getName()

 int
getPeerFeatures()

 short
getPortNumber()

 int
getState()

 int
getSupportedFeatures()

 int
hashCode()

 void
readFrom(org.jboss.netty.buffer.ChannelBuffer data)

          Read this message off the wire from the specified ByteBuffer

 void
setAdvertisedFeatures(int advertisedFeatures)

 void
setConfig(int config)

 void
setCurrentFeatures(int currentFeatures)

 void
setHardwareAddress(byte[] hardwareAddress)

 void
setName(java.lang.String name)

 void
setPeerFeatures(int peerFeatures)

 void
setPortNumber(short portNumber)

 void
setState(int state)

 void
setSupportedFeatures(int supportedFeatures)

 void
writeTo(org.jboss.netty.buffer.ChannelBuffer data)

          Write this message's binary format to the specified ByteBuffer

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

MINIMUM_LENGTH

public static int MINIMUM_LENGTH

OFP_ETH_ALEN

public static int OFP_ETH_ALEN

portNumber

protected short portNumber

hardwareAddress

protected byte[] hardwareAddress

name

protected java.lang.String name

config

protected int config

state

protected int state

currentFeatures

protected int currentFeatures

advertisedFeatures

protected int advertisedFeatures

supportedFeatures

protected int supportedFeatures

peerFeatures

protected int peerFeatures

Constructor Detail

OFPhysicalPort

public OFPhysicalPort()

Method Detail

getPortNumber

public short getPortNumber()

Returns:
the portNumber

setPortNumber

public void setPortNumber(short portNumber)

Parameters:
portNumber - the portNumber to set

getHardwareAddress

public byte[] getHardwareAddress()

Returns:
the hardwareAddress

setHardwareAddress

public void setHardwareAddress(byte[] hardwareAddress)

Parameters:
hardwareAddress - the hardwareAddress to set

getName

public java.lang.String getName()

Returns:
the name

setName

public void setName(java.lang.String name)

Parameters:
name - the name to set

getConfig

public int getConfig()

Returns:
the config

setConfig

public void setConfig(int config)

Parameters:
config - the config to set

getState

public int getState()

Returns:
the state

setState

public void setState(int state)

Parameters:
state - the state to set

getCurrentFeatures

public int getCurrentFeatures()

Returns:
the currentFeatures

setCurrentFeatures

public void setCurrentFeatures(int currentFeatures)

Parameters:
currentFeatures - the currentFeatures to set

getAdvertisedFeatures

public int getAdvertisedFeatures()

Returns:
the advertisedFeatures

setAdvertisedFeatures

public void setAdvertisedFeatures(int advertisedFeatures)

Parameters:
advertisedFeatures - the advertisedFeatures to set

getSupportedFeatures

public int getSupportedFeatures()

Returns:
the supportedFeatures

setSupportedFeatures

public void setSupportedFeatures(int supportedFeatures)

Parameters:
supportedFeatures - the supportedFeatures to set

getPeerFeatures

public int getPeerFeatures()

Returns:
the peerFeatures

setPeerFeatures

public void setPeerFeatures(int peerFeatures)

Parameters:
peerFeatures - the peerFeatures to set

readFrom

public void readFrom(org.jboss.netty.buffer.ChannelBuffer data)

Read this message off the wire from the specified ByteBuffer

Parameters:
data -

writeTo

public void writeTo(org.jboss.netty.buffer.ChannelBuffer data)

Write this message's binary format to the specified ByteBuffer

Parameters:
data -

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
{{{
  "title": "SafeHaven Checkpoints and RabbitMQ",
  "date": "07-08-2016",
  "author": "Jake Malmad",
  "attachments": [],
  "contentIsHTML": false
}}}

### Article Overview
SafeHaven uses RabbitMQ queues to validate and manage checkpoints. In certain complex configurations, or when setup errors have occurred, the queues will not be created correctly. This document walks through the steps to remediate queue creation failures.

### Detailed Steps
1. Identify a Protection Group with a missing RabbitMQ queue. This can be done via running the cluster diagnostics in the CMS (Help-> "Run Cluster Diagnostics"). The cluster diagnostics may report something like this:
   `IL1XXXSRN01 WARNING RabbitMQ checkpoint queue for IL1XXXPG01 target not active.`

   Another indication that there may not be a queue is if you have a Windows Protection Group that consistently does not generate clean checkpoints. If this is the case, check if there is a queue on the SRN.

2. To check if a RabbitMQ queue resides on the SRN, ssh into the Production SRN node. Issue the command `rabbitmqctl list_queues`. You should see an output similar to the following:

   ```
   root@IL1XXXSRN01:~# rabbitmqctl list_queues
   Listing queues ...
   0.0.0.0_main_thread     0
   iqn.2007-06.com.datagardens:IL1XXXPG01-PG-IL1XXXPG01-external_checkpoint 0
iqn.2007-06.com.datagardens:IL1XXXPG01-PG-IL1XXXPG01-external_monitoring 0
   ...done.
   ```

3. If you do not see the corresponding queue for the Protection Group, it is very simple to create it. First, log on to the Production VM via RDP.

4. Check to see if there is a certificate (cacert.pem) in the `C:\Program Files\SafeHaven-3.1 DRaaS Windows Replication Agent\tools\certs` folder. The date may indicate the source of the problem (i.e., cert exists from a previous protection group). Another indication may be the file size (a 0kb file).

5. Temporarily stop replication. Open up the "Tools" prompt under the SafeHaven DRaaS start menu folder. Check to see if the replication service is running by issuing the command `sc query dgrplctsvc`. Stop the replication service with the command `DgRplctSvc.exe -stop`.

6. The output should look similar to this:

   `C:\Program Files\SafeHaven-3.1 DRaaS Windows Replication Agent\tools>DgRplctSvc.exe -stop`

   `DgStopService: Stopping DgRplctSvc.`

   `DgStopService: DgRplctSvc is stopped.`

7. Open an Internet Browser and go to http://SRN.LOCAL.IP./certs.

8. Download the cacert.pem file to the `C:\Program Files\SafeHaven-3.1 DRaaS Windows Replication Agent\tools\certs` location.

9. Restart replication by issuing the command `DgRplctSvc.exe -start`. The output should look like this:

   `C:\Program Files\SafeHaven-3.1 DRaaS Windows Replication Agent\tools>DgRplctSvc.exe -start`

   `DgStartService: Start DgRplctSvc................................`

   `DgStartService: DgRplctSvc is running.`

10. Back on the Production SRN node, re-run the `rabbitmqctl list_queues` command. You should now see queues for the Protection Group corresponding to the Production VM that you just ran the process on.

11. Repeat as necessary.

If you do not feel comfortable with this process, or require additional assistance, please log a support request via email (help@ctl.io) or chat and the SafeHaven team will assist you.