text:
import $ from "../utils/DOMUtils";
import Utils from "../utils/Utils";
import app from "../app";

export default class LinkRow {
	constructor(el) {
		this.el = el;
		this._initUI();
		this.url = null;
	}

	set pattern(val) {
		let url = Utils.getPatternURLStr(val)
		this._pattern = val;
		$.query(".url", this.el).innerText = url || "";
		$.toggleClass(this.el, "disabled", !url);
		$.toggleClass(this.el, "active", !!url);
	}

	showMessage(message) {
		// for some reason this displays one line too low if it's synchronous:
		setTimeout(()=>app.tooltip.toggle.showOn("linkrow", message, $.query(".copy.icon", this.el), true, 0), 1);
	}

	_initUI() {
		this.el.onclick = (evt) => this._onClick(evt);

		let fld=$.query(".url", this.el), copyBtn = $.query(".copy", this.el);
		let clipboard = new Clipboard(copyBtn, { target: () => fld });
		clipboard.on("success", () => app.tooltip.toggle.toggleOn("copy", "Copied to clipboard.", copyBtn, true, 3));
		clipboard.on("error", (e) => app.tooltip.toggle.toggleOn("copy", Utils.getCtrlKey()+"-C to copy.", copyBtn, true, 3)); // TODO: cmd/ctrl
	}

	_onClick(evt) {
		if ($.query(".copy", this.el).contains(evt.target)) { return; }
		if (evt.which === 2 || evt.metaKey || evt.ctrlKey) {
			window.open(Utils.getPatternURL(this._pattern));
		} else {
			app.load(this._pattern);
		}
	}
};

redpajama_set_name: RedPajamaGithub


text:
package docker

import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path"
	"path/filepath"
	"strings"

	"github.com/fsouza/go-dockerclient/vendor/github.com/docker/docker/pkg/archive"
	"github.com/fsouza/go-dockerclient/vendor/github.com/docker/docker/pkg/fileutils"
)

func createTarStream(srcPath, dockerfilePath string) (io.ReadCloser, error) {
	excludes, err := parseDockerignore(srcPath)
	if err != nil {
		return nil, err
	}

	includes := []string{"."}

	// If .dockerignore mentions .dockerignore or the Dockerfile
	// then make sure we send both files over to the daemon
	// because Dockerfile is, obviously, needed no matter what, and
	// .dockerignore is needed to know if either one needs to be
	// removed.  The deamon will remove them for us, if needed, after it
	// parses the Dockerfile.
	//
	// https://github.com/docker/docker/issues/8330
	//
	forceIncludeFiles := []string{".dockerignore", dockerfilePath}

	for _, includeFile := range forceIncludeFiles {
		if includeFile == "" {
			continue
		}
		keepThem, err := fileutils.Matches(includeFile, excludes)
		if err != nil {
			return nil, fmt.Errorf("cannot match .dockerfile: '%s', error: %s", includeFile, err)
		}
		if keepThem {
			includes = append(includes, includeFile)
		}
	}

	if err := validateContextDirectory(srcPath, excludes); err != nil {
		return nil, err
	}
	tarOpts := &archive.TarOptions{
		ExcludePatterns: excludes,
		IncludeFiles:    includes,
		Compression:     archive.Uncompressed,
		NoLchown:        true,
	}
	return archive.TarWithOptions(srcPath, tarOpts)
}

// validateContextDirectory checks if all the contents of the directory
// can be read and returns an error if some files can't be read.
// Symlinks which point to non-existing files don't trigger an error
func validateContextDirectory(srcPath string, excludes []string) error {
	return filepath.Walk(filepath.Join(srcPath, "."), func(filePath string, f os.FileInfo, err error) error {
		// skip this directory/file if it's not in the path, it won't get added to the context
		if relFilePath, err := filepath.Rel(srcPath, filePath); err != nil {
			return err
		} else if skip, err := fileutils.Matches(relFilePath, excludes); err != nil {
			return err
		} else if skip {
			if f.IsDir() {
				return filepath.SkipDir
			}
			return nil
		}

		if err != nil {
			if os.IsPermission(err) {
				return fmt.Errorf("can't stat '%s'", filePath)
			}
			if os.IsNotExist(err) {
				return nil
			}
			return err
		}

		// skip checking if symlinks point to non-existing files, such symlinks can be useful
		// also skip named pipes, because they hanging on open
		if f.Mode()&(os.ModeSymlink|os.ModeNamedPipe) != 0 {
			return nil
		}

		if !f.IsDir() {
			currentFile, err := os.Open(filePath)
			if err != nil && os.IsPermission(err) {
				return fmt.Errorf("no permission to read from '%s'", filePath)
			}
			currentFile.Close()
		}
		return nil
	})
}

func parseDockerignore(root string) ([]string, error) {
	var excludes []string
	ignore, err := ioutil.ReadFile(path.Join(root, ".dockerignore"))
	if err != nil && !os.IsNotExist(err) {
		return excludes, fmt.Errorf("error reading .dockerignore: '%s'", err)
	}
	excludes = strings.Split(string(ignore), "\n")

	return excludes, nil
}


text:
![#f00](https://placehold.it/15/f00/000000?text=+) **Obselete**: please see [shexSpec github repo](https://github.com/shexSpec/shex)

W3C ShEx 1.0 submission
====
This is an archive of the initial Shape Expressions schema language submission to the W3C Data Shapes Working Group


text:
import config from './../config';
import userRoutes from './user/user.routes';
import roleRoutes from './role/role.routes';

export default (server) => {
  server.get('/', (req, res) => {
    res.render('index', {
      name: '我是内容页'
    });
  });

  server.get('/health-check', (req, res) => {
    res.status(200);
    res.set('Cache-Control', 'no-cache, no-store, must-revalidate');
    res.set('Pragma', 'no-cache');
    res.set('Expires', '0');
    res.json({
      health: 'good',
      uptime: process.uptime(),
      memoryUsage: process.memoryUsage()
    });
  });

  server.use('/users', userRoutes);
  server.use('/roles', roleRoutes);
};


text:
<?php
/* @var $this UserController */
/* @var $model User */

$this->breadcrumbs=array(
	'用户组'=>array('index'),
	$model->groupid,
);

?>

查看用户组

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'groupid',
		'name',
		'creditsfrom',
		'creditsto',
        array('name'=>'allowread','type'=>'raw','value'=>CV::statusStr($model->allowread)),
        array('name'=>'allowpost','type'=>'raw','value'=>CV::statusStr($model->allowpost)),
        array('name'=>'allowreply','type'=>'raw','value'=>CV::statusStr($model->allowreply)),
        array('name'=>'allowattach','type'=>'raw','value'=>CV::statusStr($model->allowattach)),
        array('name'=>'allowdown','type'=>'raw','value'=>CV::statusStr($model->allowdown)),
        array('name'=>'allowtop','type'=>'raw','value'=>CV::statusStr($model->allowtop)),
        array('name'=>'allowdigest','type'=>'raw','value'=>CV::statusStr($model->allowdigest)),
        array('name'=>'allowupdate','type'=>'raw','value'=>CV::statusStr($model->allowupdate)),
        array('name'=>'allowdelete','type'=>'raw','value'=>CV::statusStr($model->allowdelete)),
		'version_nums',
	),
)); ?>


text:
import { Check, CheckOptions } from '../types/Check';
import { Deleted } from '../types/Deleted';
import { Downtime } from '../types/Downtime';
import { GroupedMetrics, Metrics } from '../types/Metrics';
import { Nodes } from '../types/Node';
import { Webhook, WebhookOptions } from '../types/Webhook';

import { getChecks } from '../api/getChecks';
import { getCheck, GetCheckOptions } from '../api/getCheck';
import { getDowntimes, GetDowntimesOptions } from '../api/getDowntimes';
import { getMetrics, GetGroupedMetricsOptions, GetMetricsOptions } from '../api/getMetrics';
import { addCheck } from '../api/addCheck';
import { updateCheck } from '../api/updateCheck';
import { deleteCheck } from '../api/deleteCheck';
import { getIpv4Nodes, getIpv6Nodes, getNodes } from '../api/getNodes';
import { getWebhooks } from '../api/getWebhooks';
import { addWebhook } from '../api/addWebhook';
import { deleteWebhook } from '../api/deleteWebhook';

export class UpdownClient {

	private readonly apiKey : string;

	constructor(apiKey : string) {
		this.apiKey = apiKey;
	}

	public getChecks() : Promise<Check[]> {
		return getChecks(this.apiKey);
	}

	public getCheck(token : string, options ?: GetCheckOptions) : Promise<Check> {
		return getCheck(this.apiKey, token, options);
	}

	public getDowntimes(token : string, options ?: GetDowntimesOptions) : Promise<Downtime[]> {
		return getDowntimes(this.apiKey, token, options);
	}

	public getMetrics(token : string, options ?: GetMetricsOptions) : Promise<Metrics>;
	public getMetrics(token : string, options : GetGroupedMetricsOptions) : Promise<GroupedMetrics>;
	public getMetrics(token : string, options : GetGroupedMetricsOptions = {}) : Promise<Metrics | GroupedMetrics> {
		return getMetrics(this.apiKey, token, options);
	}

	public addCheck(options : CheckOptions) : Promise<Check> {
		return addCheck(this.apiKey, options);
	}

	public updateCheck(token : string, options : Partial<CheckOptions>) : Promise<Check> {
		return updateCheck(this.apiKey, token, options);
	}

	public deleteCheck(token : string) : Promise<Deleted> {
		return deleteCheck(this.apiKey, token);
	}

	public getNodes() : Promise<Nodes> {
		return getNodes();
	}

	public getIpv4Nodes() : Promise<string[]> {
		return getIpv4Nodes();
	}

	public getIpv6Nodes() : Promise<string[]> {
		return getIpv6Nodes();
	}

	public getWebhooks() : Promise<Webhook[]> {
		return getWebhooks(this.apiKey);
	}

	public addWebhook(options : WebhookOptions) : Promise<Webhook> {
		return addWebhook(this.apiKey, options);
	}

	public deleteWebhook(id : string) : Promise<Deleted> {
		return deleteWebhook(this.apiKey, id);
	}
}


text:
require 'rspec'
require 'reduce_ranges'

describe 'Array#reduce_ranges' do
  let(:ranged_array) { [1..3, 5..8] }
  let(:array) { expand_array(ranged_array) }

  subject { array.reduce_ranges }

  it 'does not modify the existing array' do
    expect { subject }.not_to change { array }
  end

  context 'with no ranges' do
    let(:array) { [1, 3, 5, 7, 9] }

    it 'returns an array with no ranges' do
      expect(subject.select { |el| el.is_a?(Range) }).to be_empty
    end
  end

  context 'with only positive integer ranges' do
    let(:ranged_array) { [0..2, 5, 7..9] }

    it 'returns an array with the given ranges' do
      expect(subject).to eql(ranged_array)
    end
  end

  context 'with only negative integer ranges' do
    let(:ranged_array) { [-10..-8, -5, - 3..0] }

    it 'returns an array with the given ranges' do
      expect(subject).to eql(ranged_array)
    end
  end

  context 'with positive and negative integer ranges' do
    let(:ranged_array) { [-10..-8, 5, 7..9] }

    it 'returns an array with the given ranges' do
      expect(subject).to eql(ranged_array)
    end
  end

  context 'with non-Fixnum elements' do
    context 'with Floats' do
      let(:array) { [1, 2, 3.0, 5.5, 6.5, 7.5] }

      it 'returns an array with the given ranges' do
        expect { subject }.to raise_error(TypeError)
      end
    end

    context 'with non-numeric elements' do
      let(:array) { [-10.2..-8.1, '5.2', 5.3..9] }

      it 'raises an error' do
        expect { subject }.to raise_error(TypeError)
      end
    end
  end
end

def expand_array(ranges)
  ranges.reduce([]) {|s, x| s + Array(x)}
end


text:
from __future__ import unicode_literals

from random_puller.puller import RandomDataPuller

def list_opts():
    return [
        (RandomDataPuller.get_entry_name(),
         RandomDataPuller.get_config_opts()),
    ]


text:
/*Include the necessary libraries to start working*/

#ifndef MICRO_CONFIG_H_
#define MICRO_CONFIG_H_

#ifndef F_CPU
#define F_CPU 1000000UL //1MHz Clock frequency
#endif

#include <avr/io.h>
#include <util/delay.h>

#endif /* MICRO_CONFIG_H_ */


text:
class ScideaSchools99Remove < ActiveRecord::Migration
  def up
    drop_table :schools
    remove_column :profiles, :school_id
    execute "delete from menu_elements where display_name = 'Educational Institutions';"
  end

  def down
    create_table "schools" do |t|
      t.string   "name"
      t.string   "address_1"
      t.string   "address_2"
      t.string   "city"
      t.string   "state"
      t.string   "zipcode"
      t.boolean  "approved"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.string   "phone"
    end

    add_column :profiles, :school_id, :integer

    sql = <<-SQL
      set @course_and_scitent_admins = (select group_concat(id) from roles where symbol in ('course_admin', 'scitent_admin'));
      set @product_and_scitent_admins = (select group_concat(id) from roles where symbol in ('product_admin', 'scitent_admin'));

      SELECT @admin_nav_secondary_id:=id FROM menus WHERE name = 'Admin Navigation: Secondary' LIMIT 1;

      INSERT INTO menu_elements (display_name, menu_id, url, view_role_list, edit_role_list, order_sequence) VALUES ('Educational Institutions', @admin_nav_secondary_id, '/admin/schools', @course_and_scitent_admins, @product_and_scitent_admins, 102);
    SQL

    sql.split("\n").reject{|s| s.strip.start_with?('#') || s.strip.empty? }.each{ |s| execute s.strip }
  end
end


text:
body{
	padding-top: 150px;
	background-image: url('../images/minions.jpg');
	background-repeat: no-repeat;
	background-attachment:fixed;
	background-size: cover;
	color: #FFF;
}

.footerClass{

	padding-top: 400px;
}

.well{
	background-color: transparent;
}

.quoteText{
	font-size: 1.5em;
	font-style: italic;
	font-family: monospace;
}

a{
color: #FFF;
}


text:
package com.lachesis.mnisqm.module.event.domain;

public class AnalysisMeasures {
    private String info;

    private Integer caseNum;

    private String proportion;

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Integer getCaseNum() {
        return caseNum;
    }

    public void setCaseNum(Integer caseNum) {
        this.caseNum = caseNum;
    }

    public String getProportion() {
        return proportion;
    }

    public void setProportion(String proportion) {
        this.proportion = proportion;
    }
}


text:
package sampler

import "net/url"

// The JsonURL type allows us to parse the URL from a JSON document at load
// time, instead of when it's used (which could be multiple times)
type JsonURL struct {
	*url.URL
}

func NewJsonURL(str string) (u *JsonURL, err error) {
	_url, err := url.Parse(str)
	if err == nil {
		u = &JsonURL{_url}
	}

	return
}

func (self *JsonURL) UnmarshalJSON(data []byte) (err error) {
	// strip off leading and trailing double-quotes
	tmp, err := NewJsonURL(string(data[1:len(data) - 1]))

	if err == nil {
		*self = *tmp
	}

	return
}


text:
var pkg = require('./package.json');
var fs = require('fs');
var ugly = require('uglify-js');
var jshint = require('jshint').JSHINT;
var babel = require('babel-core');
var gaze = require('gaze');

function lint(full) {
	jshint(full.toString(), {
		browser: true,
		undef: true,
		unused: true,
		immed: true,
		eqeqeq: true,
		eqnull: true,
		noarg: true,
		immed: false,
		predef: ['define', 'module', 'exports', 'Map']
	});

	if (jshint.errors.length) {
		jshint.errors.forEach(function (err) {
			console.log(err.line+':'+err.character+' '+err.reason);
		});
	} else {
		console.log('linted')
	}

	return true;
}

function build(code) {
	var minified = ugly.minify(code).code;
	var header = [
		`/*!`,
		`	${pkg.name} ${pkg.version}`,
		`	license: ${pkg.license}`,
		`	${pkg.homepage}`,
		`*/`,
		``
	].join('\n');

	fs.writeFile('dist/'+pkg.name+'.js', header+code);
	fs.writeFile('dist/'+pkg.name+'.min.js', header+minified);
	console.log('dist built');
}

function transform(filepath) {
	babel.transformFile(filepath, {
		plugins: [
			"add-module-exports", ["transform-es2015-modules-umd", {"strict": true, "noInterop": true}]
		],
		presets: ["env"],
	}, function (err,res) {
		if (err) {
			return console.log(err);
		} else {
			lint(res.code);
			build(res.code);
		}
	});
}

gaze('src/'+pkg.name+'.js', function(err, watcher){
	// On file changed
	this.on('changed', function(filepath) {
		transform(filepath);
	});

	console.log('watching');
});

transform('src/'+pkg.name+'.js');


text:
import {
  DocumentsController,
  middlewares
} from './dependencies';

const documentRoute = (router) => {
  router
    .route('/documents')
    /**
     * @swagger
     * /api/documents:
     *   post:
     *     description: Creates a new document
     *     tags:
     *      - Create a new ocument
     *     produces:
     *      - application/json
     *     parameters:
     *       - name: Authorization
     *         in: header
     *         description: an authorization header
     *         required: true
     *         type: string
     *       - name: title
     *         description: Document title
     *         in:  body
     *         required: true
     *         type: string
     *       - name: body
     *         description: Document content
     *         in:  body
     *         required: true
     *         type: string
     *       - name: access
     *         description: Document access
     *         in:  body
     *         required: false
     *         type: string
     *     responses:
     *       201:
     *         description: documents
     *         schema:
     *          type: object
     */
    .post(middlewares.validateDocumentInput, DocumentsController.create)
    /**
     * @swagger
     * /api/documents:
     *   get:
     *      description: Returns a list of all documents
     *      tags:
     *        - Get Documents List
     *      produces:
     *        - application/json
     *      parameters:
     *        - name: Authorization
     *          in: header
     *          description: an authorization header
     *          required: false
     *          type: string
     *      responses:
     *          200:
     *              description: documents
     *              schema:
     *                  type: array
     *                  items:
     *                      $type: object
     */
    .get(DocumentsController.findAll);
  router
    .route('/documents/:id')
    /**
     * @swagger
     * /api/documents/{id}:
     *   get:
     *     description: Returns a document by Id
     *     tags:
     *      - Returns a document by Id
     *     produces:
     *      - application/json
     *     parameters:
     *        - name: Authorization
     *          in: header
     *          description: an authorization header
     *          required: false
     *          type: string
     *        - name: id
     *          description: Document Id
     *          in:  path
     *          required: true
     *          type: integer
     *     responses:
     *        200:
     *          description: documents
     *          schema:
     *            type: array
     */
    .get(DocumentsController.findOne)
    /**
     * @swagger
     * /api/documents/{id}:
     *   put:
     *     description: Updates a document by Id
     *     tags:
     *      - Updates a document by Id
     *     produces:
     *      - application/json
     *     parameters:
     *        - name: Authorization
     *          in: header
     *          description: an authorization header
     *          required: true
     *          type: string
     *        - name: id
     *          description: Document Id
     *          in:  path
     *          required: true
     *          type: integer
     *        - name: body
     *          description: Document content
     *          in:  body
     *          required: true
     *          type: string
     *        - name: access
     *          description: Document access
     *          in:  body
     *          required: true
     *          type: string
     *     responses:
     *        200:
     *          description: documents
     *          schema:
     *            type: array
     */
    .put(middlewares.validateDocumentUpdate, DocumentsController.update)
    /**
     * @swagger
     * /api/documents/{id}:
     *   delete:
     *     description: Removes a document by Id
     *     tags:
     *      - Removes a document by Id
     *     produces:
     *      - application/json
     *     parameters:
     *        - name: Authorization
     *          in: header
     *          description: an authorization header
     *          required: true
     *          type: string
     *        - name: id
     *          description: Document Id
     *          in:  path
     *          required: true
     *          type: integer
     *     responses:
     *        200:
     *          description: documents
     *          schema:
     *            type: array
     */
    .delete(middlewares.validateDeleteDocument, DocumentsController.delete);
};

export default documentRoute;


text:
set -e

PROJECT_DIR=$(dirname $0)/../..

source $PROJECT_DIR/scripts/cf-utils.sh

STACK_NAME=$StackPrefix-containers-private

if [[ $ContainersPrivateSubnetACIDRBlock == "" ]] ; then
    ContainersPrivateSubnetACIDRBlock=$(yq r $(dirname $0)/../private.yml \
        Parameters.ContainersPrivateSubnetACIDRBlock.Default)
fi
if [[ $ContainersPrivateSubnetBCIDRBlock == "" ]] ; then
    ContainersPrivateSubnetBCIDRBlock=$(yq r $(dirname $0)/../private.yml \
        Parameters.ContainersPrivateSubnetBCIDRBlock.Default)
fi
if [[ $ContainersPrivateSubnetCCIDRBlock == "" ]] ; then
    ContainersPrivateSubnetCCIDRBlock=$(yq r $(dirname $0)/../private.yml \
        Parameters.ContainersPrivateSubnetCCIDRBlock.Default)
fi

update-stack $1 --template-url $AWSMusingsS3URL/containers/private.yml \
    --parameters ParameterKey=ContainersPrivateSubnetACIDRBlock,ParameterValue=$ContainersPrivateSubnetACIDRBlock \
        ParameterKey=ContainersPrivateSubnetBCIDRBlock,ParameterValue=$ContainersPrivateSubnetBCIDRBlock \
        ParameterKey=ContainersPrivateSubnetCCIDRBlock,ParameterValue=$ContainersPrivateSubnetCCIDRBlock \
        ParameterKey=ContainersPrivateSubnetAIPv6CIDRBlock,ParameterValue=$ContainersPrivateSubnetAIPv6CIDRBlock \
        ParameterKey=ContainersPrivateSubnetBIPv6CIDRBlock,ParameterValue=$ContainersPrivateSubnetBIPv6CIDRBlock \
        ParameterKey=ContainersPrivateSubnetCIPv6CIDRBlock,ParameterValue=$ContainersPrivateSubnetCIPv6CIDRBlock \
        ParameterKey=NetworkACLId,ParameterValue=$NetworkACLId \
        ParameterKey=PrivateRouteTableId,ParameterValue=$PrivateRouteTableId \
        ParameterKey=VPCId,ParameterValue=$VPCId

if [[ $OUTPUT_RESULT == "true" ]] ; then
    RESULT=$(describe-stack)

    echo "export ContainersPrivateSubnetAId=$(get-output-value ContainersPrivateSubnetAId)"
    echo "export ContainersPrivateSubnetBId=$(get-output-value ContainersPrivateSubnetBId)"
    echo "export ContainersPrivateSubnetCId=$(get-output-value ContainersPrivateSubnetCId)"
    echo "export PrivateLoadBalancerDNSName=$(get-output-value PrivateLoadBalancerDNSName)"
    echo "export PrivateLoadBalancerCanonicalHostedZoneId=$(get-output-value PrivateLoadBalancerCanonicalHostedZoneId)"
    echo "export PrivateLoadBalancerListenerARN=$(get-output-value PrivateLoadBalancerListenerARN)"
fi


text:
describe Hbc::CLI::Install, :cask do
  it "displays the installation progress" do
    output = Regexp.new <<-EOS.undent
      ==> Downloading file:.*caffeine.zip
      ==> Verifying checksum for Cask local-caffeine
      ==> Installing Cask local-caffeine
      ==> Moving App 'Caffeine.app' to '.*Caffeine.app'.
      .*local-caffeine was successfully installed!
    EOS

    expect {
      Hbc::CLI::Install.run("local-caffeine")
    }.to output(output).to_stdout
  end

  it "allows staging and activation of multiple Casks at once" do
    Hbc::CLI::Install.run("local-transmission", "local-caffeine")

    expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed
    expect(Hbc.appdir.join("Transmission.app")).to be_a_directory
    expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb")).to be_installed
    expect(Hbc.appdir.join("Caffeine.app")).to be_a_directory
  end

  it "skips double install (without nuking existing installation)" do
    Hbc::CLI::Install.run("local-transmission")
    Hbc::CLI::Install.run("local-transmission")
    expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed
  end

  it "prints a warning message on double install" do
    Hbc::CLI::Install.run("local-transmission")

    expect {
      Hbc::CLI::Install.run("local-transmission")
    }.to output(/Warning: Cask 'local-transmission' is already installed./).to_stderr
  end

  it "allows double install with --force" do
    Hbc::CLI::Install.run("local-transmission")

    expect {
      expect {
        Hbc::CLI::Install.run("local-transmission", "--force")
      }.to output(/It seems there is already an App at.*overwriting\./).to_stderr
    }.to output(/local-transmission was successfully installed!/).to_stdout
  end

  it "skips dependencies with --skip-cask-deps" do
    Hbc::CLI::Install.run("with-depends-on-cask-multiple", "--skip-cask-deps")
    expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-depends-on-cask-multiple.rb")).to be_installed
    expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb")).not_to be_installed
    expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).not_to be_installed
  end

  it "properly handles Casks that are not present" do
    expect {
      Hbc::CLI::Install.run("notacask")
    }.to raise_error(Hbc::CaskError, "Install incomplete.")
  end

  it "returns a suggestion for a misspelled Cask" do
    expect {
      begin
        Hbc::CLI::Install.run("localcaffeine")
      rescue Hbc::CaskError
        nil
      end
    }.to output(/Cask 'localcaffeine' is unavailable: No Cask with this name exists\. Did you mean:\nlocal-caffeine/).to_stderr
  end

  it "returns multiple suggestions for a Cask fragment" do
    expect {
      begin
        Hbc::CLI::Install.run("local-caf")
      rescue Hbc::CaskError
        nil
      end
    }.to output(/Cask 'local-caf' is unavailable: No Cask with this name exists\. Did you mean one of:\nlocal-caffeine/).to_stderr
  end

  describe "when no Cask is specified" do
    with_options = lambda do |options|
      it "raises an exception" do
        expect {
          Hbc::CLI::Install.run(*options)
        }.to raise_error(Hbc::CaskUnspecifiedError)
      end
    end

    describe "without options" do
      with_options.call([])
    end

    describe "with --force" do
      with_options.call(["--force"])
    end

    describe "with --skip-cask-deps" do
      with_options.call(["--skip-cask-deps"])
    end

    describe "with an invalid option" do
      it "raises an error" do
        expect {
          Hbc::CLI::Install.run("--notavalidoption")
        }.to raise_error(/invalid option/)
      end
    end
  end
end


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Cart Login</title>

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <link rel="stylesheet" href="css/style.css">

      Order Total:
      $7320.00

        <button>Submit your order</button>

Attendees for Air Conditioning and Refrigeration - Both Days

Fresno, CA

April 11-12, 2016

Attendees

Name

Email

Title

Individual Cost

Jack Kerouac

jackieboy55@gmail.com

Writer

$990

Company Profile

      Tom Carter
      tom.carter@company.com
      Company Name
      3625 Bridle Court
      Forest Hills, NY 11375
      (303) 555-1234

      Edit Information

Payment Method

Mastercard Ending in 1234

      <input type="checkbox" id="speedCheckout">
      Save and create an account for faster checkout next time

Please tell us a bit more about your training needs so we can serve you better.

        <form action="">

            <fieldset>
              <legend class="form-helper">
                Have you previously purchased or attended one or more of our courses?*
              </legend>

                Yes
                  <input class="form-input" id="radio-yes" type="radio" name="attend" value="yes">

                No
                  <input class="form-input" id="radio-no" type="radio" name="attend" value="no">

            </fieldset>

            Your Industry

              <select class="form-input" name="industry" id="industry" required>
                <option value="Electronics" selected>Electronics</option>
                <option value="Plumbing" selected>Plumbing</option>
                <option value="Carpentry" selected>Carpentry</option>
              </select>

            Please choose the role that best describes your role at your company
              or
              facility.*

              <select class="form-input" name="role" id="role">
                <option value="maintenance" selected>I oversee maintenance</option>
                <option value="maintenance">I oversee maintenance</option>
                <option value="maintenance">I oversee maintenance</option>
              </select>

            How often do you use outside training, such as seminar courses,
              at
              your
              company/facility?*

              <select class="form-input" name="frequency" id="frequency">
                <option value="Meh">Meh</option>
                <option value="Regularly">Regularly</option>
                <option value="Oh yea">Oh yea!</option>
              </select>

            About how many employees in our facility need training each
              year?*
            <input class="form-input" type="text" id="employees">

What training topics most interest you and/or your team?*

              <input type="checkbox" id="Electrical">
              Electrical

              <input type="checkbox" id="HVAC">
              HVAC

              <input type="checkbox" id="PlantManagement">
              Plant Management

              <input type="checkbox" id="MechanicalIndustrial">
              Mechanical & Industrial

        </form>

          * Indicates Required Field

    Order Total:
    $7320.00

      <button>Submit your order</button>


text:
require 'spec_helper'
require Rails.root.join('db', 'migrate', '20180831164910_import_common_metrics.rb')

describe ImportCommonMetrics, :migration do
  describe '#up' do
    it "imports all prometheus metrics" do
      expect(PrometheusMetric.common).to be_empty

      migrate!

      expect(PrometheusMetric.common).not_to be_empty
    end
  end
end


text:
<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Comment
 */
class Comment
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $title;

    /**
     * @var string
     */
    private $body;

    /**
     * @var \DateTime
     */
    private $createAt;

    /**
     * @var \AppBundle\Entity\User
     */
    private $user;

    /**
     * @var \AppBundle\Entity\Medium
     */
    private $medium;

    public function __construct(){
        $this->createAt = new \DateTime('now');
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     * @return Comment
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set body
     *
     * @param string $body
     * @return Comment
     */
    public function setBody($body)
    {
        $this->body = $body;

        return $this;
    }

    /**
     * Get body
     *
     * @return string
     */
    public function getBody()
    {
        return $this->body;
    }

    /**
     * Set createAt
     *
     * @param \DateTime $createAt
     * @return Comment
     */
    public function setCreateAt($createAt)
    {
        $this->createAt = $createAt;

        return $this;
    }

    /**
     * Get createAt
     *
     * @return \DateTime
     */
    public function getCreateAt()
    {
        return $this->createAt;
    }

    /**
     * Set user
     *
     * @param \AppBundle\Entity\User $user
     * @return Comment
     */
    public function setUser(\AppBundle\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \AppBundle\Entity\User
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Set medium
     *
     * @param \AppBundle\Entity\Medium $medium
     * @return Comment
     */
    public function setMedium(\AppBundle\Entity\Medium $medium = null)
    {
        $this->medium = $medium;

        return $this;
    }

    /**
     * Get medium
     *
     * @return \AppBundle\Entity\Medium
     */
    public function getMedium()
    {
        return $this->medium;
    }
}


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

<title>Uses of Class org.apache.cassandra.exceptions.ConfigurationException (apache-cassandra API)</title>
<meta name="date" content="2016-04-13">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.cassandra.exceptions.ConfigurationException

Packages that use ConfigurationException

Package
Description

org.apache.cassandra.auth

org.apache.cassandra.config

org.apache.cassandra.cql3

org.apache.cassandra.cql3.statements

org.apache.cassandra.db

org.apache.cassandra.db.compaction

org.apache.cassandra.db.marshal

org.apache.cassandra.dht

org.apache.cassandra.exceptions

org.apache.cassandra.index.sasi.conf

org.apache.cassandra.locator

org.apache.cassandra.schema

org.apache.cassandra.service

org.apache.cassandra.thrift

org.apache.cassandra.tools

org.apache.cassandra.utils

Uses of ConfigurationException in org.apache.cassandra.auth

Methods in org.apache.cassandra.auth that throw ConfigurationException

Modifier and Type
Method and Description

void
AllowAllAuthenticator.validateConfiguration()

void
AllowAllInternodeAuthenticator.validateConfiguration()

void
CassandraAuthorizer.validateConfiguration()

void
CassandraRoleManager.validateConfiguration()

void
IAuthenticator.validateConfiguration()

Validates configuration of IAuthenticator implementation (if configurable).

void
IAuthorizer.validateConfiguration()

Validates configuration of IAuthorizer implementation (if configurable).

void
IInternodeAuthenticator.validateConfiguration()

Validates configuration of IInternodeAuthenticator implementation (if configurable).

void
IRoleManager.validateConfiguration()

Hook to perform validation of an implementation's configuration (if supported).

void
PasswordAuthenticator.validateConfiguration()

Uses of ConfigurationException in org.apache.cassandra.config

Methods in org.apache.cassandra.config that throw ConfigurationException

Modifier and Type
Method and Description

CFMetaData
CFMetaData.addColumnDefinition(ColumnDefinition def)

boolean
CFMetaData.apply(CFMetaData cfm)

Updates CFMetaData in-place to match cfm

static void
DatabaseDescriptor.applyConfig(Config config)

static java.lang.Class<? extends AbstractCompactionStrategy>
CFMetaData.createCompactionStrategy(java.lang.String className)

Config
ConfigurationLoader.loadConfig()

Loads a Config object to use to configure a node.

static Config
DatabaseDescriptor.loadConfig()

Config
YamlConfigurationLoader.loadConfig()

Config
YamlConfigurationLoader.loadConfig(java.net.URL url)

CFMetaData
CFMetaData.validate()

void
CFMetaData.validateCompatibility(CFMetaData cfm)

Uses of ConfigurationException in org.apache.cassandra.cql3

Constructors in org.apache.cassandra.cql3 that throw ConfigurationException

Constructor and Description

Custom(java.lang.String className)

Uses of ConfigurationException in org.apache.cassandra.cql3.statements

Methods in org.apache.cassandra.cql3.statements that throw ConfigurationException

Modifier and Type
Method and Description

Event.SchemaChange
AlterTypeStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
CreateTriggerStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
CreateTypeStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
DropIndexStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
DropKeyspaceStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
DropTableStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
DropTriggerStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
DropTypeStatement.announceMigration(boolean isLocalOnly)

Event.SchemaChange
DropViewStatement.announceMigration(boolean isLocalOnly)

java.util.UUID
TableAttributes.getId()

Uses of ConfigurationException in org.apache.cassandra.db

Methods in org.apache.cassandra.db that throw ConfigurationException

Modifier and Type
Method and Description

static void
SystemKeyspace.checkHealth()

One of three things will happen if you try to read the system keyspace:
 1.

Uses of ConfigurationException in org.apache.cassandra.db.compaction

Methods in org.apache.cassandra.db.compaction that throw ConfigurationException

Modifier and Type
Method and Description

static java.util.Map<java.lang.String,java.lang.String>
AbstractCompactionStrategy.validateOptions(java.util.Map<java.lang.String,java.lang.String> options)

static java.util.Map<java.lang.String,java.lang.String>
DateTieredCompactionStrategy.validateOptions(java.util.Map<java.lang.String,java.lang.String> options)

static java.util.Map<java.lang.String,java.lang.String>
LeveledCompactionStrategy.validateOptions(java.util.Map<java.lang.String,java.lang.String> options)

static java.util.Map<java.lang.String,java.lang.String>
SizeTieredCompactionStrategy.validateOptions(java.util.Map<java.lang.String,java.lang.String> options)

static java.util.Map<java.lang.String,java.lang.String>
DateTieredCompactionStrategyOptions.validateOptions(java.util.Map<java.lang.String,java.lang.String> options,
               java.util.Map<java.lang.String,java.lang.String> uncheckedOptions)

static java.util.Map<java.lang.String,java.lang.String>
SizeTieredCompactionStrategyOptions.validateOptions(java.util.Map<java.lang.String,java.lang.String> options,
               java.util.Map<java.lang.String,java.lang.String> uncheckedOptions)

Uses of ConfigurationException in org.apache.cassandra.db.marshal

Methods in org.apache.cassandra.db.marshal that throw ConfigurationException

Modifier and Type
Method and Description

java.util.Map<java.lang.Byte,AbstractType<?>>
TypeParser.getAliasParameters()

java.util.Map<java.nio.ByteBuffer,CollectionType>
TypeParser.getCollectionsParameters()

static ColumnToCollectionType
ColumnToCollectionType.getInstance(TypeParser parser)

static CompositeType
CompositeType.getInstance(TypeParser parser)

static DynamicCompositeType
DynamicCompositeType.getInstance(TypeParser parser)

static AbstractType<?>
FrozenType.getInstance(TypeParser parser)

static ListType<?>
ListType.getInstance(TypeParser parser)

static MapType<?,?>
MapType.getInstance(TypeParser parser)

static SetType<?>
SetType.getInstance(TypeParser parser)

static TupleType
TupleType.getInstance(TypeParser parser)

static UserType
UserType.getInstance(TypeParser parser)

static <T> ReversedType<T>
ReversedType.getInstance(TypeParser parser)

java.util.List<AbstractType<?>>
TypeParser.getTypeParameters()

Pair<Pair<java.lang.String,java.nio.ByteBuffer>,java.util.List<Pair<java.nio.ByteBuffer,AbstractType>>>
TypeParser.getUserTypeParameters()

AbstractType<?>
TypeParser.parse()

Parse an AbstractType from current position of this parser.

static AbstractType<?>
TypeParser.parse(java.lang.CharSequence compareWith)

static AbstractType<?>
TypeParser.parse(java.lang.String str)

Parse a string containing an type definition.

Uses of ConfigurationException in org.apache.cassandra.dht

Methods in org.apache.cassandra.dht that throw ConfigurationException

Modifier and Type
Method and Description

static java.util.Collection<Token>
BootStrapper.getBootstrapTokens(TokenMetadata metadata,
                  java.net.InetAddress address)

if initialtoken was specified, use that (split on comma).

abstract void
Token.TokenFactory.validate(java.lang.String token)

Uses of ConfigurationException in org.apache.cassandra.exceptions

Subclasses of ConfigurationException in org.apache.cassandra.exceptions

Modifier and Type
Class and Description

class
AlreadyExistsException

Uses of ConfigurationException in org.apache.cassandra.index.sasi.conf

Methods in org.apache.cassandra.index.sasi.conf that throw ConfigurationException

Modifier and Type
Method and Description

static IndexMode
IndexMode.getMode(ColumnDefinition column,
       java.util.Map<java.lang.String,java.lang.String> indexOptions)

static IndexMode
IndexMode.getMode(ColumnDefinition column,
       java.util.Optional<IndexMetadata> config)

static void
IndexMode.validateAnalyzer(java.util.Map<java.lang.String,java.lang.String> indexOptions)

Uses of ConfigurationException in org.apache.cassandra.locator

Methods in org.apache.cassandra.locator that throw ConfigurationException

Modifier and Type
Method and Description

static java.lang.Class<AbstractReplicationStrategy>
AbstractReplicationStrategy.getClass(java.lang.String cls)

void
PropertyFileSnitch.reloadConfiguration(boolean isUpdate)

abstract void
AbstractReplicationStrategy.validateOptions()

void
LocalStrategy.validateOptions()

void
NetworkTopologyStrategy.validateOptions()

void
OldNetworkTopologyStrategy.validateOptions()

void
SimpleStrategy.validateOptions()

protected void
AbstractReplicationStrategy.validateReplicationFactor(java.lang.String rf)

static void
AbstractReplicationStrategy.validateReplicationStrategy(java.lang.String keyspaceName,
                           java.lang.Class<? extends AbstractReplicationStrategy> strategyClass,
                           TokenMetadata tokenMetadata,
                           IEndpointSnitch snitch,
                           java.util.Map<java.lang.String,java.lang.String> strategyOptions)

Constructors in org.apache.cassandra.locator that throw ConfigurationException

Constructor and Description

CloudstackSnitch()

Ec2MultiRegionSnitch()

Ec2Snitch()

GoogleCloudSnitch()

GossipingPropertyFileSnitch()

NetworkTopologyStrategy(java.lang.String keyspaceName,
                       TokenMetadata tokenMetadata,
                       IEndpointSnitch snitch,
                       java.util.Map<java.lang.String,java.lang.String> configOptions)

PropertyFileSnitch()

PropertyFileSnitch(int refreshPeriodInSeconds)

Uses of ConfigurationException in org.apache.cassandra.schema

Methods in org.apache.cassandra.schema that throw ConfigurationException

Modifier and Type
Method and Description

static ICompressor
CompressionParams.createCompressor(ParameterizedClass compression)

static void
SchemaKeyspace.mergeSchemaAndAnnounceVersion(java.util.Collection<Mutation> mutations)

Merge remote schema in form of mutations with local and mutate ks/cf metadata objects
 (which also involves fs operations on add/drop ks/cf)

void
CompressionParams.validate()

Constructors in org.apache.cassandra.schema that throw ConfigurationException

Constructor and Description

CompressionParams(java.lang.String sstableCompressorClass,
                 java.lang.Integer chunkLength,
                 java.util.Map<java.lang.String,java.lang.String> otherOptions)

Uses of ConfigurationException in org.apache.cassandra.service

Methods in org.apache.cassandra.service that throw ConfigurationException

Modifier and Type
Method and Description

static void
MigrationManager.announceColumnFamilyDrop(java.lang.String ksName,
                        java.lang.String cfName)

static void
MigrationManager.announceColumnFamilyDrop(java.lang.String ksName,
                        java.lang.String cfName,
                        boolean announceLocally)

static void
MigrationManager.announceColumnFamilyUpdate(CFMetaData cfm,
                          boolean fromThrift)

static void
MigrationManager.announceColumnFamilyUpdate(CFMetaData cfm,
                          boolean fromThrift,
                          boolean announceLocally)

static void
MigrationManager.announceKeyspaceDrop(java.lang.String ksName)

static void
MigrationManager.announceKeyspaceDrop(java.lang.String ksName,
                    boolean announceLocally)

static void
MigrationManager.announceKeyspaceUpdate(KeyspaceMetadata ksm)

static void
MigrationManager.announceKeyspaceUpdate(KeyspaceMetadata ksm,
                      boolean announceLocally)

static void
MigrationManager.announceNewColumnFamily(CFMetaData cfm)

static void
MigrationManager.announceNewColumnFamily(CFMetaData cfm,
                       boolean announceLocally)

static void
MigrationManager.announceNewKeyspace(KeyspaceMetadata ksm)

static void
MigrationManager.announceNewKeyspace(KeyspaceMetadata ksm,
                   boolean announceLocally)

static void
MigrationManager.announceNewKeyspace(KeyspaceMetadata ksm,
                   long timestamp,
                   boolean announceLocally)

static void
MigrationManager.announceNewView(ViewDefinition view,
               boolean announceLocally)

static void
MigrationManager.announceViewDrop(java.lang.String ksName,
                java.lang.String viewName,
                boolean announceLocally)

static void
MigrationManager.announceViewUpdate(ViewDefinition view,
                  boolean announceLocally)

void
StorageService.checkForEndpointCollision()

static void
MigrationManager.forceAnnounceNewColumnFamily(CFMetaData cfm)

Announces the table even if the definition is already know locally.

void
StorageService.initServer()

void
StorageService.initServer(int delay)

java.util.Collection<Token>
StorageService.prepareReplacementInfo()

void
StorageService.unsafeInitialize()

Uses of ConfigurationException in org.apache.cassandra.thrift

Methods in org.apache.cassandra.thrift that throw ConfigurationException

Modifier and Type
Method and Description

static CFMetaData
ThriftConversion.fromThrift(CfDef cf_def)

static KeyspaceMetadata
ThriftConversion.fromThrift(KsDef ksd,
          CFMetaData... cfDefs)

static ColumnDefinition
ThriftConversion.fromThrift(java.lang.String ksName,
          java.lang.String cfName,
          AbstractType<?> thriftComparator,
          AbstractType<?> thriftSubcomparator,
          ColumnDef thriftColumnDef)

static CFMetaData
ThriftConversion.fromThriftForUpdate(CfDef cf_def,
                   CFMetaData toUpdate)

Uses of ConfigurationException in org.apache.cassandra.tools

Methods in org.apache.cassandra.tools that throw ConfigurationException

Modifier and Type
Method and Description

static void
SSTableExport.main(java.lang.String[] args)

Given arguments specifying an SSTable, and optionally an output file, export the contents of the SSTable to JSON.

Uses of ConfigurationException in org.apache.cassandra.utils

Methods in org.apache.cassandra.utils that throw ConfigurationException

Modifier and Type
Method and Description

static <T> java.lang.Class<T>
FBUtilities.classForName(java.lang.String classname,
            java.lang.String readable)

static <T> T
FBUtilities.construct(java.lang.String classname,
         java.lang.String readable)

Constructs an instance of the given class, which must have a no-arg or default constructor.

static <T> T
FBUtilities.instanceOrConstruct(java.lang.String classname,
                   java.lang.String readable)

Constructs an instance of the given class, which must have a no-arg or default constructor.

static IAuthenticator
FBUtilities.newAuthenticator(java.lang.String className)

static IAuthorizer
FBUtilities.newAuthorizer(java.lang.String className)

static IPartitioner
FBUtilities.newPartitioner(java.lang.String partitionerClassName)

static IRoleManager
FBUtilities.newRoleManager(java.lang.String className)

static java.lang.String
FBUtilities.resourceToFile(java.lang.String filename)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016 The Apache Software Foundation


text:
@class NSMutableArray, NSString;

@interface WCNewShareCardLayoutCacheItem : MMObject <PBCoding>
{
    _Bool entryShowNew;
    _Bool entryShowRedDot;
    unsigned int lastUpdateTime;
    NSMutableArray *localCityList;
    NSMutableArray *otherCityList;
    NSString *cityName;
    NSString *entryTip;
    NSMutableArray *entryIcons;
}

+ (void)initialize;
@property(nonatomic) _Bool entryShowRedDot; // @synthesize entryShowRedDot;
@property(nonatomic) _Bool entryShowNew; // @synthesize entryShowNew;
@property(retain, nonatomic) NSMutableArray *entryIcons; // @synthesize entryIcons;
@property(retain, nonatomic) NSString *entryTip; // @synthesize entryTip;
@property(nonatomic) unsigned int lastUpdateTime; // @synthesize lastUpdateTime;
@property(retain, nonatomic) NSString *cityName; // @synthesize cityName;
@property(retain, nonatomic) NSMutableArray *otherCityList; // @synthesize otherCityList;
@property(retain, nonatomic) NSMutableArray *localCityList; // @synthesize localCityList;
- (void).cxx_destruct;
- (const map_0e718273 *)getValueTagIndexMap;
- (id)getValueTypeTable;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


text:
<?php

namespace Tests\Models;

use Illuminate\Database\Eloquent\Model;

class Image extends Model
{
    protected $table = 'test_images';
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link rel="shortcut icon" href="http://media.mongodb.org/favicon.ico" />

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

    <title>MongoClient or how to connect in a new and better way — MongoDB Node.JS Driver 1.4.9 documentation</title>

    <link rel="stylesheet" href="../_static/mongodb-docs.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="top" title="MongoDB Node.JS Driver 1.4.9 documentation" href="../index.html" />

Navigation

| GitHub

Jira

MongoDB Node.JS Driver 1.4.9 documentation (index)  »

MongoClient or how to connect in a new and better way¶

From driver version 1.2 we introduced a new connection Class that
has the same name across all of our official drivers. This is to ensure
that we present a recognizable front for all our API’s. This does not
mean that your existing application will break, but rather that we
encourage you to use the new connection api to simplify your application
development.

Furthermore, the new connection class MongoClient acknowledges all
writes to MongoDB, in contrast to the existing connection class Db that
has acknowledgements turned off. Let’s take a tour of the MongoClient
functions.

MongoClient = function(server, options);

MongoClient.prototype.open

MongoClient.prototype.close

MongoClient.prototype.db

MongoClient.connect

Outlined above is the complete MongoClient interface. The methods
open, close and db work very similar to the existing methods
on the Db class. The main difference is that the constructor is
missing the database name from Db. Let’s show a simple connection
using open as a code example speaks a thousand words.

var MongoClient = require('mongodb').MongoClient
  , Server = require('mongodb').Server;

var mongoClient = new MongoClient(new Server('localhost', 27017));
mongoClient.open(function(err, mongoClient) {
  var db1 = mongoClient.db("mydb");

  mongoClient.close();
});

Notice that you configure the MongoClient just as you would have done
the Db object. The main difference is that you access the db instances
using the db method on the MongoClient object instead of using the
Db instance directly as you would previously. MongoClient supports the
same options as the previous Db instance you would have created.

So, with a minimal change in our app, we can apply the new MongoClient
connection code. But there is more and one direction you might consider
int the future. That is the mongodb connection string.

The URL connection format¶

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

The URL format is unified across official drivers from 10gen with some
options not supported on some drivers due to natural reasons. The ones
not supported by the Node.js driver are left out for simplicities sake.

Basic parts of the url¶

mongodb:// is a required prefix to identify that this is a string
in the standard connection format.

username:password@ is optional. If given, the driver will attempt
to login to a database after connecting to a database server.

host1 is the only required part of the URI. It identifies either
a hostname, IP address, or unix domain socket

:portX is optional and defaults to :27017 if not provided.

/database is the name of the database to login to and thus is
only relevant if the username:password@ syntax is used. If not
specified the “admin” database will be used by default.

?options are connection options. Note that if database is absent
there is still a / required between the last host and the ?
introducing the options. Options are name=value pairs and the pairs
are separated by “&”. For any unrecognized or unsupported option, a
driver should log a warning and continue processing. A driver should
not support any options that are not explicitly defined in this
specification. This is in order to reduce the likelihood that
different drivers will support overlapping that differ in small but
incompatible ways (like different name, different values, or
different default value).

Replica set configuration:¶

replicaSet=name

The driver verifies that the name of the replica set it connects
to matches this name. Implies that the hosts given are a seed
list, and the driver will attempt to find all members of the set.

No default value.

Connection Configuration:¶

ssl=true|false|prefer

true: the driver initiates each connections with SSL

false: the driver initiates each connection without SSL

prefer: the driver tries to initiate each connection with SSL, and
falls back to without SSL if it fails.

Default value is false.

connectTimeoutMS=ms

How long a connection can take to be opened before timing out.

Current driver behavior already differs on this, so the default
must be left to each driver. For new implementations, the default
should be to never timeout.

socketTimeoutMS=ms

How long a send or receive on a socket can take before timing out.

Current driver behavior already differs on this, so the default
must be left to each driver. For new implementations, the default
should be to never timeout.

Connection pool configuration:¶

maxPoolSize=n: The maximum number of connections in the
connection pool

Default value is 5

Write concern configuration:¶

More detailed information about write concerns can be found at
http://www.mongodb.org/display/DOCS/getLastError+Command

w=wValue

For numeric values above 1, the driver adds { w : wValue } to the
getLastError command.

wValue is typically a number, but can be any string in order to
allow for specifications like “majority”

Default value is 1.

wValue == -1 ignore network errors

wValue == 0 no write acknowledgement

wValue == 1 perform a write acknowledgement

wValue == 2 perform a write acknowledgement across primary and one
secondary

wValue == ‘majority’ perform a write acknowledgement across the
majority of servers in the replicaset

wValue == ‘tag name’ perform a write acknowledgement against the
replicaset tag name

wtimeoutMS=ms

The driver adds { wtimeout : ms } to the getlasterror command.

Used in combination with w

No default value

journal=true|false

true: Sync to journal.

false: the driver does not add j to the getlasterror command

Default value is false

fsync=true|false

true: Sync to disk.

false: the driver does not add fsync to the getlasterror command

Default value is false

If conflicting values for fireAndForget, and any write concern are
passed the driver should raise an exception about the conflict.

Auth options¶

authSource=string: Used when the user for authentication is
stored in another database using indirect authentication.

Default value is null

Read Preference¶

slaveOk=true|false: Whether a driver connected to a replica set
will send reads to slaves/secondaries.

Default value is false

readPreference=enum: The read preference for this connection. If
set, it overrides any slaveOk value.

Enumerated values:

primary

primaryPreferred

secondary

secondaryPreferred

nearest

Default value is primary

readPreferenceTags=string. A representation of a tag set as a
comma-separated list of colon-separated key-value pairs, e.g.
dc:ny,rack:1. Spaces should be stripped from beginning and end of
all keys and values. To specify a list of tag sets, using multiple
readPreferenceTags, e.g.
readPreferenceTags=dc:ny,rack:1&readPreferenceTags=dc:ny&readPreferenceTags=

Note the empty value, it provides for fallback to any other
secondary server if none is available

Order matters when using multiple readPreferenceTags

There is no default value

MongoClient.connect¶

The url format can be used with MongoClient.connect. Where possible
MongoClient will pick the best possible default values for options but
they can be overridden. This includes setting auto_reconnect to
true and native_parser to true if it’s available. Below are some
example on how to connect to a single server a replicaset and a sharded
system using MongoClient.connect

The single server connection¶

var MongoClient = require('mongodb').MongoClient;

MongoClient.connect("mongodb://localhost:27017/integration_test", function(err, db) {
  test.equal(null, err);
  test.ok(db != null);

  db.collection("replicaset_mongo_client_collection").update({a:1}, {b:1}, {upsert:true}, function(err, result) {
    test.equal(null, err);
    test.equal(1, result);

    db.close();
    test.done();
  });
});

A replicaset connect using no acknowledgment by default and readPreference for secondary¶

var MongoClient = require('mongodb').MongoClient;

MongoClient.connect("mongodb://localhost:30000,localhost:30001/integration_test_?w=0&readPreference=secondary", function(err, db) {
  test.equal(null, err);
  test.ok(db != null);

  db.collection("replicaset_mongo_client_collection").update({a:1}, {b:1}, {upsert:true}, function(err, result) {
    test.equal(null, err);
    test.equal(1, result);

    db.close();
    test.done();
  });
});

A sharded connect using no acknowledgment by default and readPreference for secondary¶

var MongoClient = require('mongodb').MongoClient;

MongoClient.connect("mongodb://localhost:50000,localhost:50001/integration_test_?w=0&readPreference=secondary", function(err, db) {
  test.equal(null, err);
  test.ok(db != null);

  db.collection("replicaset_mongo_client_collection").update({a:1}, {b:1}, {upsert:true}, function(err, result) {
    test.equal(null, err);
    test.equal(1, result);

    db.close();
    test.done();
  });
});

Notice that when connecting to the sharded system it’s pretty much the
same url as for connecting to the replicaset. This is because the driver
itself figures out if it’s a replicaset or a set of Mongos proxies it’s
connecting to. No special care is needed to specify if it’s one or the
other. This is in contrast to having to use the ReplSet or
Mongos instances when using the open command.

MongoClient connection pooling¶

A Connection Pool is a cache of database connections maintained by the
driver so that connections can be re-used when new connections to the
database are required. To reduce the number of connection pools created
by your application, we recommend calling MongoClient.connect once
and reusing the database variable returned by the callback:

var express = require('express');
var mongodb = require('mongodb');
var app = express();

var MongoClient = require('mongodb').MongoClient;
var db;

// Initialize connection once
MongoClient.connect("mongodb://localhost:27017/integration_test", function(err, database) {
  if(err) throw err;

  db = database;

  // Start the application after the database connection is ready
  app.listen(3000);
  console.log("Listening on port 3000");
});

// Reuse database object in request handlers
app.get("/", function(req, res) {
  db.collection("replicaset_mongo_client_collection").find({}, function(err, docs) {
    docs.each(function(err, doc) {
      if(doc) {
        console.log(doc);
      }
      else {
        res.end();
      }
    });
  });
});

MongoClient.connect options¶

The connect function also takes a hash of options divided into
db/server/replset/mongos allowing you to tweak options not directly
supported by the unified url string format. To use these options you do
pass in a hash like this:

var MongoClient = require('mongodb').MongoClient;

MongoClient.connect("mongodb://localhost:27017/integration_test_?", {
    db: {
      native_parser: false
    },
    server: {
      socketOptions: {
        connectTimeoutMS: 500
      }
    },
    replSet: {},
    mongos: {}
  }, function(err, db) {
  test.equal(null, err);
  test.ok(db != null);

  db.collection("replicaset_mongo_client_collection").update({a:1}, {b:1}, {upsert:true}, function(err, result) {
    test.equal(null, err);
    test.equal(1, result);

    db.close();
    test.done();
  });
});

Below are all the options supported for db/server/replset/mongos.

db: A hash of options at the db level overriding or adjusting functionality not supported by the url¶

w, {Number/String, > -1 || ‘majority’} the write concern for
the operation where < 1 is no acknowledgment of write and w >= 1 or w
= ‘majority’ acknowledges the write

wtimeout, {Number, 0} set the timeout for waiting for write
concern to finish (combines with w option)

fsync, (Boolean, default:false) write waits for fsync before
returning

journal, (Boolean, default:false) write waits for journal sync
before returning

readPreference {String}, the preferred read preference
(ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED,
ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED,
ReadPreference.NEAREST).

native_parser {Boolean, default:false}, use c++ bson parser.

forceServerObjectId {Boolean, default:false}, force server to
create _id fields instead of client.

pkFactory {Object}, object overriding the basic ObjectID primary
key generation.

serializeFunctions {Boolean, default:false}, serialize functions.

raw {Boolean, default:false}, perform operations using raw bson
buffers.

recordQueryStats {Boolean, default:false}, record query
statistics during execution.

retryMiliSeconds {Number, default:5000}, number of milliseconds
between retries.

numberOfRetries {Number, default:5}, number of retries off
connection.

bufferMaxEntries {Number, default: -1}, sets a cap on how many
operations the driver will buffer up before giving up on getting a
working connection, default is -1 which is unlimited.

server: A hash of options at the server level not supported by the url.¶

readPreference {String, default:null}, set’s the read preference
(ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED,
ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED,
ReadPreference.NEAREST)

ssl {Boolean, default:false}, use ssl connection (needs to have a
mongod server with ssl support)

slaveOk {Boolean, default:false}, legacy option allowing reads
from secondary, use readPrefrence instead.

poolSize {Number, default:1}, number of connections in the
connection pool, set to 1 as default for legacy reasons.

socketOptions {Object, default:null}, an object containing socket
options to use (noDelay:(boolean), keepAlive:(number),
connectTimeoutMS:(number), socketTimeoutMS:(number))

logger {Object, default:null}, an object representing a logger
that you want to use, needs to support functions debug, log, error
({error:function(message, object) {}, log:function(message, object)
{}, debug:function(message, object) {}}).

auto_reconnect {Boolean, default:false}, reconnect on error.

disableDriverBSONSizeCheck {Boolean, default:false}, force the
server to error if the BSON message is to big

replSet: A hash of options at the replSet level not supported by the url.¶

ha {Boolean, default:true}, turn on high availability.

haInterval {Number, default:2000}, time between each replicaset
status check.

reconnectWait {Number, default:1000}, time to wait in
milliseconds before attempting reconnect.

retries {Number, default:30}, number of times to attempt a
replicaset reconnect.

rs_name {String}, the name of the replicaset to connect to.

socketOptions {Object, default:null}, an object containing socket
options to use (noDelay:(boolean), keepAlive:(number),
connectTimeoutMS:(number), socketTimeoutMS:(number))

readPreference {String}, the preferred read preference
(ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED,
ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED,
ReadPreference.NEAREST).

strategy {String, default:null}, selection strategy for reads
choose between (ping and statistical, default is round-robin)

secondaryAcceptableLatencyMS {Number, default:15}, sets the range
of servers to pick when using NEAREST (lowest ping ms + the latency
fence, ex: range of 1 to (1 + 15) ms)

connectArbiter {Boolean, default:false}, sets if the driver
should connect to arbiters or not.

mongos: A hash of options at the mongos level not supported by the url.¶

socketOptions {Object, default:null}, an object containing socket
options to use (noDelay:(boolean), keepAlive:(number),
connectTimeoutMS:(number), socketTimeoutMS:(number))

ha {Boolean, default:true}, turn on high availability, attempts
to reconnect to down proxies

haInterval {Number, default:2000}, time between each replicaset
status check.

Contents

MongoClient or how to connect in a new and better way

The URL connection format

Basic parts of the url

Replica set configuration:

Connection Configuration:

Connection pool configuration:

Write concern configuration:

Auth options

Read Preference

MongoClient.connect

The single server connection

A replicaset connect using no acknowledgment by default and readPreference for secondary

A sharded connect using no acknowledgment by default and readPreference for secondary

MongoClient connection pooling

MongoClient.connect options

db: A hash of options at the db level overriding or adjusting functionality not supported by the url

server: A hash of options at the server level not supported by the url.

replSet: A hash of options at the replSet level not supported by the url.

mongos: A hash of options at the mongos level not supported by the url.

Manual

MongoClient()

Db()

Collection()

Admin()

Cursor()

CursorStream()

Grid()

GridStore()

ReadStream()

BSON()

ObjectID()

Binary()

Code()

Double()

Long()

Timestamp()

MaxKey()

Symbol()

Home: MongoDB Node.JS Driver Manual Home

Contents: MongoDB Node.JS Driver Manual Contents

Index: MongoDB Node.JS Driver Manual Index

Search

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

Search the MongoDB wiki.
    <form class="search" action="http://www.mongodb.org/dosearchsite.action" method="get">
      <input type="text" name="queryString" />
      <input type="submit" value="Wiki" />
    </form>

MongoDB Wiki

Getting Started

Quickstart

Introduction

Downloads

Features

SQL to MongoDB Mapping

Developer Documentation

Connections

Databases

Collections

Documents

GridFS

Indexes

Querying

Aggregation

Optimization

Inserting

Updating

Removing

MapReduce

Administrative Documentation

Components

Journaling

Production Notes

Replication

Sharding

Monitoring and Diagnostics

Backups

Durability and Repair

Security and Authentication

Starting/Stopping MongoDB

GridFS Tools

DB Operations from the Shell

Architecture and Components

Windows

Troubleshooting

Community and Ecosystem

10gen

MongoDB Events

MongoDB Masters

Slides and Video

Cookbook

Hosting Center

MongoDB Monitoring Service (docs)

Administrative Interfaces

International Documentation

MongoDB Books

Drivers

JavaScript (wiki, docs)

Python (wiki, docs)

Ruby (wiki, docs)

PHP (wiki, docs)

Perl (wiki, docs)

Java (wiki, docs)

Scala (wiki, docs)

C# (wiki, docs)

C (wiki, docs)

C++ (wiki, docs)

Haskell (wiki, docs)

Erlang (wiki, docs)

Quick search

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

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

Navigation

| GitHub

Jira

MongoDB Node.JS Driver 1.4.9 documentation (index)  »

        © Copyright 2013, MongoDB Node.JS Team
      Created using Sphinx 1.2b3.

The MongoDB Documentation Project uses GitHub. Fork the repository and submit pull requests to contribute.

If you find any issues with the documentation feel free to open a Jira Case and we'll work to resolve it promptly.


text:
package com.maxiee.heartbeat.ui.common;

import android.content.Context;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.maxiee.heartbeat.R;

/**
 * ItemDecoration implementation that applies an inset margin
 * around each child of the RecyclerView. The inset value is controlled
 * by a dimension resource.
 *
 * by Dave Smith at: https://github.com/devunwired/recyclerview-playground
 */
public class RecyclerInsetsDecoration extends RecyclerView.ItemDecoration {

    private int mInsets;

    public RecyclerInsetsDecoration(Context context) {
        mInsets = context.getResources().getDimensionPixelSize(R.dimen.insets);
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {

        //We can supply forced insets for each item view here in the Rect
        super.getItemOffsets(outRect, view, parent, state);
        outRect.set(mInsets, mInsets, mInsets, mInsets);
    }
}


text: Ресурсы для лампочек Yeelight


text:
<?php

/**
 * @file
 * Contains \Drupal\Console\Generator\PluginTypeAnnotationGenerator.
 */

namespace Drupal\Console\Generator;

use Drupal\Console\Core\Generator\Generator;
use Drupal\Console\Extension\Manager;

class PluginTypeAnnotationGenerator extends Generator
{
    /**
     * @var Manager
     */
    protected $extensionManager;

    /**
     * PluginTypeAnnotationGenerator constructor.
     *
     * @param Manager $extensionManager
     */
    public function __construct(
        Manager $extensionManager
    ) {
        $this->extensionManager = $extensionManager;
    }

    /**
     * Generator for Plugin type with annotation discovery.
     *
     * @param $module
     * @param $class_name
     * @param $machine_name
     * @param $label
     */
    public function generate($module, $class_name, $machine_name, $label)
    {
        $parameters = [
            'module' => $module,
            'class_name' => $class_name,
            'machine_name' => $machine_name,
            'label' => $label,
            'file_exists' => file_exists($this->extensionManager->getModule($module)->getPath() .'/'.$module.'.services.yml'),
        ];

        $directory = $this->extensionManager->getModule($module)->getSourcePath() . '/Plugin/' . $class_name;

        if (!is_dir($directory)) {
            mkdir($directory, 0777, true);
        }

        $this->renderFile(
            'module/src/Annotation/plugin-type.php.twig',
            $this->extensionManager->getModule($module)->getSourcePath() . '/Annotation/' . $class_name . '.php',
            $parameters
        );

        $this->renderFile(
            'module/src/plugin-type-annotation-base.php.twig',
            $this->extensionManager->getModule($module)->getSourcePath() .'/Plugin/' . $class_name . 'Base.php',
            $parameters
        );

        $this->renderFile(
            'module/src/plugin-type-annotation-interface.php.twig',
            $this->extensionManager->getModule($module)->getSourcePath() .'/Plugin/' . $class_name . 'Interface.php',
            $parameters
        );

        $this->renderFile(
            'module/src/plugin-type-annotation-manager.php.twig',
            $this->extensionManager->getModule($module)->getSourcePath() .'/Plugin/' . $class_name . 'Manager.php',
            $parameters
        );
        $this->renderFile(
            'module/plugin-annotation-services.yml.twig',
            $this->extensionManager->getModule($module)->getPath() . '/' . $module . '.services.yml',
            $parameters,
            FILE_APPEND
        );
    }
}


text:
My life
*Just coding...*
where to go.
go go go.
home
chuang
Laravel 日志 so log
Home
Wending
Num ok
No back
Yes
GO`
BBQ`
Back
BeiJing
Sleep
Go
ByeBye
Dif
Mulan
New Home
OK
Phone
Weibo
Go


text:
namespace Fortran::parser {

llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const CharBlock &x) {
  return os << x.ToString();
}

} // namespace Fortran::parser


text:
var Func = {};
var analysischoise = [2]
var options;
var series = [];

Func.createseries = function (dataset) {
    var array = []
    for (var i = 0; i < 11; i++) {
        array[i] = [];
    };
    //for each [3] put first two variables in a dataset with same industry
    dataset.forEach(function (element) {
        array[Number(index[element[0]])].push([element[1], element[2]]);
    }); //return array of arrays for each industry with [fscore,return]
    LinearReg.setData(array);
    return array;
};

Func.analysis = function (method) {
    var industryarr = JSON.parse('[' + $('#selectInd').val() + ']');
    var selectHoldingP = JSON.parse('['+ $('#selectHoldingP').val() + ']'); //need to check if OK
//    if(industryarr == 'null')
    if (method != 2) {
        dataSet = Func.master(industryarr,JSON.parse(method),JSON.parse(selectHoldingP));
        series = Func.createseries(dataSet);
    };

    Func.createPlot(JSON.parse(method), series);
};

Func.createPlot = function (method, series) {
    if (method < 2) {
        LinearReg.setData(series);
    }
    else { ScatterPlot.run() };
};

Func.filterFunction = function () {
    var input, filter, ul, li, option, i;
    input = document.getElementById("myInput");
    filter = input.value.toUpperCase();
    div = document.getElementById("myDropdown");
    option = div.getElementsByTagName("option");
    for (i = 0; i < option.length; i++) {
        if (option[i].innerHTML.toUpperCase().indexOf(filter) > -1) {
            option[i].style.display = "";
        } else {
            option[i].style.display = "none";
        }
    }
};

var FSReturn = [];
var FSAvgReturn = [];

Func.master = function (indcode, method, selectHoldingP) {
    //Anuj helped considerably to write this code below...
    var focusCode;
    function f(d) {
        // d is each row from the data.input variable
        // return alls the rows which have industry codes set by the industry codes
        // we remove the first year from calculating the change in F-Score
        // we remove the last year from calculating the 2nd year return value

        if (method == 1 && d[5] == "Year_1") {
            return;
        }
        else if (selectHoldingP == 1 && d[7] == "N/A") {
            return;
        }
        else { return parseInt(d[2]) == focusCode }

    };

    function m(d) {
        // d is each row from the filtered variable
        // i is the index of the row in filtered

        // find the firstIndex (whtehr its 5 or 6) and the secondIndex (whether its 7 or 8)
        var firstIndex = method;
        var secondIndex = selectHoldingP;

        if (firstIndex === 0) {
            firstIndex = 4;
        }
        else {
            firstIndex = 5;
        }

        if (secondIndex === 0) {
            secondIndex = 6;
        }
        else {
            secondIndex = 7;
        }
        array = [JSON.parse(d[2]), JSON.parse(d[firstIndex]), JSON.parse(d[secondIndex])];
        if(JSON.parse(d[firstIndex])<0){
            console.log(array);
        };
        return (array);
    }

    // loops over the data input and map it based on the looper function
    //results will be the array of all the industry information and analysis techniques
    var results = [];

    console.log(indcode);

    indcode.forEach(function (c) {
        //focusCode provides the individual industry within the webData[0] array
        focusCode = c;

        //filters over the data to grab only the industry
        var filtered = data.input.filter(f);

        //takes the filtered data and grabs the significant variables that we want within the row (depending on the analysis we want))
        var mapped = filtered.map(m);

        //pops out the array within the array and just makes mapped an array
        results = results.concat(mapped);
    });

    return results;
};

/*
Func.FScoreReturn = function (input) {
    //grabs the fScore and the return from the data base (fourth and sixth column)
    FSReturn.push(input[4], input[6]);
};

//loops over each of the arrays in the database and send it to the FScoreReturn function
data.input.forEach(FScoreReturn);

Func.average = function (input) {
    for (j = 0; j < 10; j++) {
        //loops over all FScores 1 through 9, clears the sum and the quantity each time
        var returnSum = 0;
        var count = 0;
        var newarray = [];
        for (i = 1; i < input.length; i = i + 2) {
            if (input[i - 1] == j) {
                //finds the total sum of the specific FScore (j) returns
                count += 1
                returnSum += Number(input[i])
            }
        }
        newarray.push(j, returnSum / count, count)
        //this will return an array with 27 items in it (one for each FScore)
        //the items are arranged within the array as follows: 1 = FScore, 2 = Avg return, 3 = No. of companies with that FScore
        FSAvgReturn.push(newarray)
    }
    return (FSAvgReturn)
}
console.log("FScore, Return, Qty of Companies " + average(FSReturn))

//---------------

//Change in F_score linked to one year avg return
var ChangeFSReturn = [];
function dFScoreReturn(input) {
    //grabs the fScore and the return from the data base (fourth and sixth column)
    ChangeFSReturn.push(input[5], input[6]);
}

//loops over each of the arrays in the database and send it to the FScoreReturn function
data.input.forEach(dFScoreReturn);

ChangeFSAvgReturn = [];
function changeAverage(input) {
    for (j = -7; j < 7; j++) {
        //loops over all change in FScores -7 through 7, clears the sum and the quantity each time
        var returnSum = 0;
        var count = 0;
        var newarray = [];
        for (i = 1; i < input.length; i = i + 2) {
            if (input[i] == "Year_1") {
                //skip this, ie add nothing to array
            } else if (input[i - 1] == j) {
                //finds the total sum of the specific FScore (j) returns
                count += 1
                returnSum += Number(input[i])
            }
        }
        newarray.push(j, returnSum / count, count)
        //this will return an array with 27 items in it (one for each FScore)
        //the items are arranged within the array as follows: 1 = Change in FScore, 2 = Avg return, 3 = No. of companies with that FScore
        ChangeFSAvgReturn.push(newarray)
    }
    return (ChangeFSAvgReturn)
}
console.log("Change in FScore, Return, qty of companies " + changeAverage(ChangeFSReturn))

//---------------

//2-Year Buy and Hold Strategy year return to current year FScore
var FSSecondReturn = [];
function FScore2ndReturn(input) {
    //grabs the fScore and the return from the data base (fourth and sixth column)
    FSSecondReturn.push(input[4], input[7]);
}

//loops over each of the arrays in the database and send it to the FScoreReturn function
data.input.forEach(FScore2ndReturn);

FSAvgSecondYrReturn = [];
function averageSecondYear(input) {
    for (j = 0; j < 10; j++) {
        //loops over all change in FScores 0 through 9, clears the sum and the quantity each time
        var returnSum = 0;
        var count = 0;
        var newarray = [];
        for (i = 1; i < input.length; i = i + 2) {
            if (input[i] == "N/A") {
                //since this is the last year in the data, it'll skip over this return, ie add nothing to array
            } else if (input[i - 1] == j) {
                //finds the total sum of the specific FScore (j) 2nd year returns
                count += 1
                returnSum += Number(input[i])
            }
        }
        newarray.push(j, returnSum / count, count)
        //this will return an array with 27 items in it (one for each FScore)
        //the items are arranged within the array as follows: 1 = FScore, 2 = Avg 2nd year Return, 3 = No. of companies with that FScore
        FSAvgSecondYrReturn.push(newarray)
    }
    return (FSAvgSecondYrReturn)
}
console.log("FScore, 2nd Year Return, qty of companies " + averageSecondYear(FSSecondReturn))

//---------------
//Change in F Score + 2 year buy and hold
var ChangeFSSecondReturn = [];
function ChangeFScore2ndReturn(input) {
    //grabs the fScore and the return from the data base (fourth and sixth column)
    ChangeFSSecondReturn.push(input[5], input[7]);
}

//loops over each of the arrays in the database and send it to the FScoreReturn function
data.input.forEach(ChangeFScore2ndReturn);

ChangeFSSecondYrReturn = [];
function changeFSavgSecondYear(input) {
    for (j = -7; j < 7; j++) {
        //loops over all change in FScores 0 through 9, clears the sum and the quantity each time
        var returnSum = 0;
        var count = 0;
        var newarray = [];
        for (i = 1; i < input.length; i = i + 2) {
            if (input[i] == "N/A") {
                //since this is the last year in the data, it'll skip over this return, ie add nothing to array
            } else if (input[i - 1] == "Year_1") {
                //since this is the first year in the data for a company, it'll skip over this return
            } else if (input[i - 1] == j) {
                //finds the total sum of the specific FScore (j) 2nd year returns
                count += 1
                returnSum += Number(input[i])
            }
        }
        newarray.push(j, returnSum / count, count)
        //this will return an array with 27 items in it (one for each FScore)
        //the items are arranged within the array as follows: 1 = Change in FScore, 2 = Avg 2nd year Return, 3 = No. of companies with that FScore
        ChangeFSSecondYrReturn.push(newarray)
    }
    return (ChangeFSSecondYrReturn)
}
console.log("Change in FScore, 2nd Year Return, qty of companies " + changeFSavgSecondYear(ChangeFSSecondReturn))

var ene = [] //10 - Array of energy companies only and their performance
var mat = [] //15 - Material companies only and their performance
var ind = [] //20 - Industrial (transportaiton included) companies only and their performance
var dis = [] //25 - Consumer Discretionary companies only and their performance
var sta = [] //30 - Consumer Staples (food, drug, household products) Communications, Electric, Gas and Sanitary service
var hcc = [] //35 - Health Care companies
var fin = [] //40 - Finance, Insurance, and Banking companies
var itc = [] //45 - IT
var tel = [] //50 - Telecommunications
var utl = [] //55 - Utilities
var rea = [] //60 - Real Estate
// reference: https://en.wikipedia.org/wiki/Global_Industry_Classification_Standard

// -------
// Previous code before filter came into play for web data

function industry(input) {
    //for a given industry input this will push an array into the array of company name, year, fScore and return

    if (Number(input[2]) == 10) {
        ene.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 15) {
        mat.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 20) {
        ind.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 25) {
        dis.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 30) {
        sta.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 35) {
        hcc.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 40) {
        fin.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 45) {
        itc.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 50) {
        tel.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 55) {
        utl.push([input[1], input[3], input[4], input[6]])
    }
    else if (Number(input[2]) == 60) {
        rea.push([input[1], input[3], input[4], input[6]])
    }
}

data.input.forEach(industry);

console.log("Qty of Companies :  " + "Energy = " + ene.length + ", Materials = " + mat.length + ", Industrial = " + ind.length +
    ", Consumer Discretionary = " + dis.length + ", Consumer Staples = " + sta.length +
    ", Health Care = " + hcc.length + ", Finance = " + fin.length + ", Information Technology " + itc.length + ", Telecommunications = " + tel.length +
    ", Utilities = " + utl.length + ", Real Estate = " + rea.length)
*/


text:
function mat_sm = smooth(kgrid, mat, restore_max, window_type)
%SMOOTH     Smooth a matrix.
%
% DESCRIPTION:
%       smooth filters an input matrix using an n-dimensional
%       frequency domain window created using getWin. If no window type is
%       specified, a Blackman window is used.
%
% USAGE:
%       mat_sm = smooth(kgrid, mat)
%       mat_sm = smooth(kgrid, mat, restore_max)
%       mat_sm = smooth(kgrid, mat, [], window_type)
%       mat_sm = smooth(kgrid, mat, restore_max, window_type)
%
% INPUTS:
%       kgrid       - k-Wave grid structure returned by makeGrid
%       mat         - spatial distribution to smooth
%
% OPTIONAL INPUTS:
%       restore_max - Boolean controlling whether the maximum value is
%                     restored after smoothing (default = false).
%       window_type - shape of the smoothing window; any valid inputs to
%                     getWin are supported (default = 'Blackman').
%
% OUTPUTS:
%       mat_sm      - smoothed spatial distribution
%
% ABOUT:
%       author      - Bradley Treeby
%       date        - 29th April 2009
%       last update - 19th July 2011
%
% This function is part of the k-Wave Toolbox (http://www.k-wave.org)
% Copyright (C) 2009-2014 Bradley Treeby and Ben Cox
%
% See also fft, ifft, fft2, ifft2, fftn, ifftn, makeGrid, getWin, numDim

% This file is part of k-Wave. k-Wave is free software: you can
% redistribute it and/or modify it under the terms of the GNU Lesser
% General Public License as published by the Free Software Foundation,
% either version 3 of the License, or (at your option) any later version.
%
% k-Wave is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
% more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with k-Wave. If not, see <http://www.gnu.org/licenses/>.

% define literals
DEFAULT_WINDOW_TYPE = 'Blackman';
USE_ROTATION = true;
SYMMETRIC_WINDOW = true;

% check optional inputs
if nargin < 3 || isempty(restore_max)
    restore_max = false;
end

if nargin < 4
    window_type = DEFAULT_WINDOW_TYPE;
end

% check for release B.0.1 inputs of smooth(mat, kgrid, restore_max)
if ~strcmp(class(kgrid), 'kWaveGrid') && ~isstruct(kgrid) %#ok<STISA>
    disp('WARNING: smooth function inputs changed, please update usage');
    mat_sm = smooth(mat, kgrid, restore_max);
    return
end

% extract the number of dimensions and create the filter
switch numDim(mat)
    case 1
        win = getWin(kgrid.Nx, window_type, 'Rotation', USE_ROTATION , 'Symmetric', SYMMETRIC_WINDOW);
    case 2
        win = getWin([kgrid.Nx, kgrid.Ny], window_type, 'Rotation', USE_ROTATION , 'Symmetric', SYMMETRIC_WINDOW);
    case 3
        win = getWin([kgrid.Nx, kgrid.Ny, kgrid.Nz], window_type, 'Rotation', USE_ROTATION , 'Symmetric', SYMMETRIC_WINDOW);
end

% apply the filter
mat_sm = real(ifftn(fftn(mat).*ifftshift(win)));

% restore magnitude if required
if restore_max
    mat_sm = (max(abs(mat(:)))/max(abs(mat_sm(:))))*mat_sm;
end


text:
/*
 * TOP.h
 *
 *  Created on: 2013/12/31
 *      Author: Kuniyasu
 */

#ifndef TOP_H_
#define TOP_H_

#include <systemc.h>

#include "amba4_apb_if.h"

//#define ioMode TLM2LT
#define ioMode PIN

class InitiatorDUT:public sc_module{
public:
	sc_in<bool> clk;
	sc_in<bool> nrst;

	apb4_port<32U,32U,ioMode> port;

	SC_HAS_PROCESS(InitiatorDUT);
	InitiatorDUT(const sc_module_name name):sc_module(name),clk("clk"),nrst("nrst"),port("i_port"){
		port.pclk(clk);
		port.nreset(nrst);
		end_module();
	}
};

class TargetDUT:public sc_module, public apb4_interface<32U,32U>{
public:
	sc_in<bool> clk;
	sc_in<bool> nrst;

	apb4_export<32U,32U,ioMode> ex_port;

	SC_HAS_PROCESS(TargetDUT);
	TargetDUT(const sc_module_name name):sc_module(name),clk("clk"),nrst("nrst"),ex_port("cb"){
		ex_port.pclk(clk);
		ex_port.nreset(nrst);

		ex_port.bind(*this);
		end_module();
	}

	typedef apb4_interface<32U,32U> if_type;
	typedef if_type::data_type    data_type;
	typedef if_type::strb_type 	  strb_type;
	typedef if_type::address_type address_type;
	typedef if_type::prot_type 	  prot_type;

	virtual void apb_reset(){}
	virtual bool apb_write(const prot_type& prot, const address_type& ad, const strb_type& strb, const data_type& dt){
		return false;
	}

	virtual bool  apb_read(const prot_type& prot, const address_type& ad, data_type& dt){
		return false;
	}
};

class TOP : public sc_module{
public:
	sc_clock clk;
	sc_signal<bool> nrst;

	InitiatorDUT initiatorDUT;
	TargetDUT targetDUT;
	apb4_simple_bus<32U,32U,ioMode> bus;

	SC_HAS_PROCESS(TOP);
	TOP(const sc_module_name name):sc_module(name),
		clk("CLK", 25, SC_NS, 0.5, 5, SC_NS, true ),nrst("nrst"),
		initiatorDUT("initiatorDUT"),
		targetDUT("targetDUT"),
		bus("bus"){

		initiatorDUT.clk(clk);
		initiatorDUT.nrst(nrst);
		initiatorDUT.port(bus.initiator_port);

		targetDUT.clk(clk);
		targetDUT.nrst(nrst);
		targetDUT.ex_port(bus.target_port);

		SC_THREAD(timeout_thread);
		end_module();
	}

	void set_trace(sc_trace_file* tf){
		sc_trace(tf, clk,  clk.name());
		sc_trace(tf, nrst, nrst.name());
	}

	void timeout_thread(){
		nrst = false;
		wait(100,SC_NS);

		nrst = true;
		wait(10,SC_MS);

		sc_stop();
	}
};

#endif /* TOP_H_ */


text:
package net.imagej.ops.map.neighborhood;

import net.imagej.ops.AbstractComputerOp;
import net.imglib2.util.Pair;

/**
 * Abstract superclass for {@link CenterAwareComputerOp} implementations.
 *
 * @author Jonathan Hale (University of Konstanz)
 */
public abstract class AbstractCenterAwareComputerOp<I, O> extends
	AbstractComputerOp<Pair<I, Iterable<I>>, O> implements
	CenterAwareComputerOp<I, O>
{
	// NB: Empty.
}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Storage;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Management.Storage
{
    /// <summary>
    /// Lists all storage services underneath the subscription.
    /// </summary>
    [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "StorageAccount", SupportsShouldProcess = true), OutputType(typeof(void))]
    public class RemoveAzureStorageAccountCommand : StorageAccountBaseCmdlet
    {
        [Parameter(
            Position = 0,
            Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "Resource Group Name.")]
        [ResourceGroupCompleter]
        [ValidateNotNullOrEmpty]
        public string ResourceGroupName { get; set; }

        [Parameter(
            Position = 1,
            Mandatory = true,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "Storage Account Name.")]
        [Alias(StorageAccountNameAlias, AccountNameAlias)]
        [ValidateNotNullOrEmpty]
        public string Name { get; set; }

        [Parameter(HelpMessage = "Force to Delete the Storage Account")]
        public SwitchParameter Force { get; set; }

        [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
        public SwitchParameter AsJob { get; set; }

        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            if (ShouldProcess(this.Name, "Remove Storage Account"))
            {
                if (this.Force || ShouldContinue(string.Format("Remove Storage Account '{0}' and all content in it", this.Name), ""))
                {
                    this.StorageClient.StorageAccounts.Delete(
                    this.ResourceGroupName,
                    this.Name);
                }
            }
        }
    }
}


text: Some TODO list