text:
<?php

/**
 * This class defines the structure of the 'product_i18n' table.
 *
 *
 * This class was autogenerated by Propel 1.4.2 on:
 *
 * Sun Nov 25 11:08:55 2012
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    lib.model.map
 */
class ProductI18nTableMap extends TableMap {

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'lib.model.map.ProductI18nTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
	  // attributes
		$this->setName('product_i18n');
		$this->setPhpName('ProductI18n');
		$this->setClassname('ProductI18n');
		$this->setPackage('lib.model');
		$this->setUseIdGenerator(false);
		// columns
		$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product', 'ID', true, null, null);
		$this->addPrimaryKey('CULTURE', 'Culture', 'VARCHAR', true, 7, null);
		$this->addColumn('NAME', 'Name', 'VARCHAR', false, 50, null);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
    $this->addRelation('Product', 'Product', RelationMap::MANY_TO_ONE, array('id' => 'id', ), null, null);
	} // buildRelations()

	/**
	 *
	 * Gets the list of behaviors registered for this table
	 *
	 * @return array Associative array (name => parameters) of behaviors
	 */
	public function getBehaviors()
	{
		return array(
			'symfony' => array('form' => 'true', 'filter' => 'true', ),
			'symfony_behaviors' => array(),
			'symfony_i18n_translation' => array('culture_column' => 'culture', ),
		);
	} // getBehaviors()

} // ProductI18nTableMap


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace gov.va.medora.mdws.dto.vista.mgt
{
    public class VistaRecordTO : AbstractTO
    {
        public VistaFileTO file;
        public VistaFieldTO[] fields;
        public String ien;
        public String iens;
        public String siteId;

        public VistaRecordTO() { }
    }
}

redpajama_set_name: RedPajamaGithub


text:
class Message{
private:
	QString message;
	QString to;
	QString from;
	bool read;
	int mid;
public:
	void setMessage(QString message){this->message = message;}
	void setTo(QString to){this->to = to;}
	void setFrom(QString from){this->from = from;}
	void setRead(bool read){this->read = read;}
	void setId(int mid){this->mid = mid;}

	QString getMessage(){return this->message;}
	QString getTo(){return this->to;}
	QString getFrom(){return this->from;}
	bool getRead(){return this->read;}
	int getId(){return this->mid;}
};

#endif


text:
package shim

import (
	"context"
	"os"
	"runtime"
	"testing"
)

func TestRuntimeWithEmptyMaxEnvProcs(t *testing.T) {
	var oldGoMaxProcs = runtime.GOMAXPROCS(0)
	defer runtime.GOMAXPROCS(oldGoMaxProcs)

	os.Setenv("GOMAXPROCS", "")
	setRuntime()

	var currentGoMaxProcs = runtime.GOMAXPROCS(0)
	if currentGoMaxProcs != 2 {
		t.Fatal("the max number of procs should be 2")
	}
}

func TestRuntimeWithNonEmptyMaxEnvProcs(t *testing.T) {
	os.Setenv("GOMAXPROCS", "not_empty")
	setRuntime()
	var oldGoMaxProcs2 = runtime.GOMAXPROCS(0)
	if oldGoMaxProcs2 != runtime.NumCPU() {
		t.Fatal("the max number CPU should be equal to available CPUs")
	}
}

func TestShimOptWithValue(t *testing.T) {
	ctx := context.TODO()
	ctx = context.WithValue(ctx, OptsKey{}, Opts{Debug: true})

	o := ctx.Value(OptsKey{})
	if o == nil {
		t.Fatal("opts nil")
	}
	op, ok := o.(Opts)
	if !ok {
		t.Fatal("opts not of type Opts")
	}
	if !op.Debug {
		t.Fatal("opts.Debug should be true")
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/very_transparent">

    <RelativeLayout
        android:id="@+id/rl_lwq_survey_popup"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:paddingTop="16dp"
        android:paddingBottom="4dp"
        android:background="@color/palette_A100">

        <TextView
            style="@style/TextAppearance.AppCompat.Title"
            android:id="@+id/tv_lwq_survey_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dp"
            android:layout_marginStart="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginEnd="16dp"
            android:textColor="@android:color/white"
            android:text="@string/survey_title"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"/>

        <TextView
            style="@style/TextAppearance.AppCompat.Body1"
            android:id="@+id/tv_lwq_survey_cta"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dp"
            android:layout_marginStart="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginEnd="16dp"
            android:textColor="@android:color/white"
            android:text="@string/survey_cta"
            android:layout_below="@+id/tv_lwq_survey_title"
            android:layout_marginTop="8dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"/>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_below="@+id/tv_lwq_survey_cta"
            android:layout_marginLeft="6dp"
            android:layout_marginStart="6dp"
            android:layout_marginRight="6dp"
            android:layout_marginEnd="6dp"
            android:layout_marginTop="32dp">

            <Button
                style="@style/Widget.AppCompat.Button.Borderless"
                android:id="@+id/btn_lwq_survey_negative"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:gravity="start|left|center_vertical"
                android:text="@string/survey_never"/>

            <Button
                style="@style/Widget.AppCompat.Button.Borderless"
                android:id="@+id/btn_lwq_survey_neutral"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toLeftOf="@+id/btn_lwq_survey_positive"
                android:layout_toStartOf="@+id/btn_lwq_survey_positive"
                android:text="@string/survey_later"/>

            <Button
                style="@style/Widget.AppCompat.Button.Borderless"
                android:id="@+id/btn_lwq_survey_positive"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_alignParentEnd="true"
                android:textColor="@color/palette_900"
                android:text="@string/survey_okay"/>

        </RelativeLayout>

    </RelativeLayout>

</RelativeLayout>


text:
API Key

<input type="text" size="64" id="api_key"/> ?

Forums

<select id="forums">
</select>

Threads


text:
function [ X ] = get_block_diag(dim, n_blocks)
%GET_BLOCK_DIAG Summary of this function goes here
%   Detailed explanation goes here

if ~exist('dim', 'var')
    error('Matrix size not provided.');
end

if ~exist('n_blocks', 'var')
    error('Number of blocks not provided.');
end

if mod(dim, n_blocks)
    error('n_blocks is not a factor of dim');
end

block_size = dim / n_blocks;

X = zeros(dim);

for k = 1 : n_blocks
    X(1 + (k-1)*block_size: k*block_size, 1 + (k-1)*block_size: k*block_size) = k;
end

end


text:
package terminal

// Input just manages a very encapsulated version of a terminal line so it can
// be synchronized for read and write without the sprawling access this data
// had in the original terminal structure
type Input struct {
	Line []rune
	Pos  int
}

// Set overwrites Line and Pos with l and p, respectively
func (i *Input) Set(l []rune, p int) {
	i.Line = l
	i.Pos = p
}

// Clear erases the input line
func (i *Input) Clear() {
	i.Line = i.Line[:0]
	i.Pos = 0
}

// AddKeyToLine inserts the given key at the current position in the current
// line.
func (i *Input) AddKeyToLine(key rune) {
	if len(i.Line) == cap(i.Line) {
		newLine := make([]rune, len(i.Line), 2*(1+len(i.Line)))
		copy(newLine, i.Line)
		i.Line = newLine
	}
	i.Line = i.Line[:len(i.Line)+1]
	copy(i.Line[i.Pos+1:], i.Line[i.Pos:])
	i.Line[i.Pos] = key
	i.Pos++
}

// String just returns the Line runes as a single string
func (i *Input) String() string {
	return string(i.Line)
}

// Split returns everything to the left of the cursor and everything at and to
// the right of the cursor as two strings
func (i *Input) Split() (string, string) {
	return string(i.Line[:i.Pos]), string(i.Line[i.Pos:])
}

// EraseNPreviousChars deletes n characters from i.Line and updates i.Pos
func (i *Input) EraseNPreviousChars(n int) {
	if i.Pos == 0 || n == 0 {
		return
	}

	if i.Pos < n {
		n = i.Pos
	}
	i.Pos -= n

	copy(i.Line[i.Pos:], i.Line[n+i.Pos:])
	i.Line = i.Line[:len(i.Line)-n]
}

// DeleteLine removes all runes after the cursor position
func (i *Input) DeleteLine() {
	i.Line = i.Line[:i.Pos]
}

// DeleteRuneUnderCursor erases the character under the current position
func (i *Input) DeleteRuneUnderCursor() {
	if i.Pos < len(i.Line) {
		i.MoveRight()
		i.EraseNPreviousChars(1)
	}
}

// DeleteToBeginningOfLine removes everything behind the cursor
func (i *Input) DeleteToBeginningOfLine() {
	i.EraseNPreviousChars(i.Pos)
}

// CountToLeftWord returns then number of characters from the cursor to the
// start of the previous word
func (i *Input) CountToLeftWord() int {
	if i.Pos == 0 {
		return 0
	}

	pos := i.Pos - 1
	for pos > 0 {
		if i.Line[pos] != ' ' {
			break
		}
		pos--
	}
	for pos > 0 {
		if i.Line[pos] == ' ' {
			pos++
			break
		}
		pos--
	}

	return i.Pos - pos
}

// MoveToLeftWord moves pos to the first rune of the word to the left
func (i *Input) MoveToLeftWord() {
	i.Pos -= i.CountToLeftWord()
}

// CountToRightWord returns then number of characters from the cursor to the
// start of the next word
func (i *Input) CountToRightWord() int {
	pos := i.Pos
	for pos < len(i.Line) {
		if i.Line[pos] == ' ' {
			break
		}
		pos++
	}
	for pos < len(i.Line) {
		if i.Line[pos] != ' ' {
			break
		}
		pos++
	}
	return pos - i.Pos
}

// MoveToRightWord moves pos to the first rune of the word to the right
func (i *Input) MoveToRightWord() {
	i.Pos += i.CountToRightWord()
}

// MoveLeft moves pos one rune left
func (i *Input) MoveLeft() {
	if i.Pos == 0 {
		return
	}

	i.Pos--
}

// MoveRight moves pos one rune right
func (i *Input) MoveRight() {
	if i.Pos == len(i.Line) {
		return
	}

	i.Pos++
}

// MoveHome moves the cursor to the beginning of the line
func (i *Input) MoveHome() {
	i.Pos = 0
}

// MoveEnd puts the cursor at the end of the line
func (i *Input) MoveEnd() {
	i.Pos = len(i.Line)
}


text:
describe('websites', () => {
  it.async('Facebook', (done, request) => {
    request.get('https://www.facebook.com', (err, res) => {
      expect(err).to.equal(null);
      expect(res.statusCode).to.equal(200);
      done();
    });
  });

  it.async('Halis Technology', (done, request) => {
    request.get('https://www.halistechnology.com', (err, res) => {
      expect(err).to.equal(null);
      expect(res.statusCode).to.equal(200);
      done();
    });
  });
});


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
var sweden = exports.sweden = { "viewBox": "0 0 20 20", "children": [{ "name": "g", "attribs": {} }] };


text:
ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'network'}

DOCUMENTATION = """
---
module: ios_logging
version_added: "2.4"
author: "Trishna Guha (@trishnaguha)"
short_description: Manage logging on network devices
description:
  - This module provides declarative management of logging
    on Cisco Ios devices.
notes:
  - Tested against IOS 15.6
options:
  dest:
    description:
      - Destination of the logs.
    choices: ['on', 'host', console', 'monitor', 'buffered']
  name:
    description:
      - If value of C(dest) is I(file) it indicates file-name,
        for I(user) it indicates username and for I(host) indicates
        the host name to be notified.
  size:
    description:
      - Size of buffer. The acceptable value is in range from 4096 to
        4294967295 bytes.
  facility:
    description:
      - Set logging facility.
  level:
    description:
      - Set logging severity levels.
  aggregate:
    description: List of logging definitions.
  state:
    description:
      - State of the logging configuration.
    default: present
    choices: ['present', 'absent']
"""

EXAMPLES = """
- name: configure host logging
  ios_logging:
    dest: host
    name: 172.16.0.1
    state: present

- name: remove host logging configuration
  ios_logging:
    dest: host
    name: 172.16.0.1
    state: absent

- name: configure console logging level and facility
  ios_logging:
    dest: console
    facility: local7
    level: debugging
    state: present

- name: enable logging to all
  ios_logging:
    dest : on

- name: configure buffer size
  ios_logging:
    dest: buffered
    size: 5000

- name: Configure logging using aggregate
  ios_logging:
    aggregate:
      - { dest: console, level: notifications }
      - { dest: buffered, size: 9000 }

- name: remove logging using aggregate
  ios_logging:
    aggregate:
      - { dest: console, level: notifications }
      - { dest: buffered, size: 9000 }
    state: absent
"""

RETURN = """
commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  type: list
  sample:
    - logging facility local7
    - logging host 172.16.0.1
"""

import re

from copy import deepcopy

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network_common import remove_default_spec
from ansible.module_utils.ios import get_config, load_config
from ansible.module_utils.ios import ios_argument_spec, check_args

def validate_size(value, module):
    if value:
        if not int(4096) <= value <= int(4294967295):
            module.fail_json(msg='size must be between 4096 and 4294967295')
        else:
            return value

def map_obj_to_commands(updates, module):
    commands = list()
    want, have = updates
    for w in want:
        dest = w['dest']
        name = w['name']
        size = w['size']
        facility = w['facility']
        level = w['level']
        state = w['state']
        del w['state']

        if state == 'absent' and w in have:
            if dest == 'host':
                commands.append('no logging host {}'.format(name))
            elif dest:
                commands.append('no logging {}'.format(dest))
            else:
                module.fail_json(msg='dest must be among console, monitor, buffered, host, on')

            if facility:
                commands.append('no logging facility {}'.format(facility))

        if state == 'present' and w not in have:
            if facility:
                commands.append('logging facility {}'.format(facility))

            if dest == 'host':
                commands.append('logging host {}'.format(name))

            elif dest == 'on':
                commands.append('logging on')

            elif dest == 'buffered' and size:
                commands.append('logging buffered {}'.format(size))

            else:
                dest_cmd = 'logging {}'.format(dest)
                if level:
                    dest_cmd += ' {}'.format(level)

                commands.append(dest_cmd)
    return commands

def parse_facility(line):
    match = re.search(r'logging facility (\S+)', line, re.M)
    if match:
        facility = match.group(1)
    else:
        facility = 'local7'

    return facility

def parse_size(line, dest):
    size = None

    if dest == 'buffered':
        match = re.search(r'logging buffered (\S+)', line, re.M)
        if match:
            try:
                int_size = int(match.group(1))
            except ValueError:
                int_size = None

            if int_size:
                if isinstance(int_size, int):
                    size = str(match.group(1))
                else:
                    size = str(4096)

    return size

def parse_name(line, dest):
    if dest == 'host':
        match = re.search(r'logging host (\S+)', line, re.M)
        if match:
            name = match.group(1)
    else:
        name = None

    return name

def parse_level(line, dest):
    level_group = ('emergencies', 'alerts', 'critical', 'errors', 'warnings',
                   'notifications', 'informational', 'debugging')

    if dest == 'host':
        level = 'debugging'

    else:
        match = re.search(r'logging {} (\S+)'.format(dest), line, re.M)
        if match:
            if match.group(1) in level_group:
                level = match.group(1)
            else:
                level = 'debugging'
        else:
            level = 'debugging'

    return level

def map_config_to_obj(module):
    obj = []
    dest_group = ('console', 'host', 'monitor', 'buffered', 'on')

    data = get_config(module, flags=['| section logging'])

    for line in data.split('\n'):
        match = re.search(r'logging (\S+)', line, re.M)
        if match:
            if match.group(1) in dest_group:
                dest = match.group(1)

                obj.append({
                    'dest': dest,
                    'name': parse_name(line, dest),
                    'size': parse_size(line, dest),
                    'facility': parse_facility(line),
                    'level': parse_level(line, dest)
                })

    return obj

def map_params_to_obj(module, required_if=None):
    obj = []
    aggregate = module.params.get('aggregate')

    if aggregate:
        for item in aggregate:
            for key in item:
                if item.get(key) is None:
                    item[key] = module.params[key]

            module._check_required_if(required_if, item)

            d = item.copy()
            if d['dest'] != 'host':
                d['name'] = None

            if d['dest'] == 'buffered':
                if 'size' in d:
                    d['size'] = str(validate_size(d['size'], module))
                elif 'size' not in d:
                    d['size'] = str(4096)
                else:
                    pass

            if d['dest'] != 'buffered':
                d['size'] = None

            obj.append(d)

    else:
        if module.params['dest'] != 'host':
            module.params['name'] = None

        if module.params['dest'] == 'buffered':
            if not module.params['size']:
                module.params['size'] = str(4096)
        else:
            module.params['size'] = None

        if module.params['size'] is None:
            obj.append({
                'dest': module.params['dest'],
                'name': module.params['name'],
                'size': module.params['size'],
                'facility': module.params['facility'],
                'level': module.params['level'],
                'state': module.params['state']
            })

        else:
            obj.append({
                'dest': module.params['dest'],
                'name': module.params['name'],
                'size': str(validate_size(module.params['size'], module)),
                'facility': module.params['facility'],
                'level': module.params['level'],
                'state': module.params['state']
            })

    return obj

def main():
    """ main entry point for module execution
    """
    element_spec = dict(
        dest=dict(type='str', choices=['on', 'host', 'console', 'monitor', 'buffered']),
        name=dict(type='str'),
        size=dict(type='int'),
        facility=dict(type='str', default='local7'),
        level=dict(type='str', default='debugging'),
        state=dict(default='present', choices=['present', 'absent']),
    )

    aggregate_spec = deepcopy(element_spec)

    # remove default in aggregate spec, to handle common arguments
    remove_default_spec(aggregate_spec)

    argument_spec = dict(
        aggregate=dict(type='list', elements='dict', options=aggregate_spec),
    )

    argument_spec.update(element_spec)
    argument_spec.update(ios_argument_spec)

    required_if = [('dest', 'host', ['name'])]

    module = AnsibleModule(argument_spec=argument_spec,
                           required_if=required_if,
                           supports_check_mode=True)

    warnings = list()
    check_args(module, warnings)

    result = {'changed': False}
    if warnings:
        result['warnings'] = warnings

    want = map_params_to_obj(module, required_if=required_if)
    have = map_config_to_obj(module)

    commands = map_obj_to_commands((want, have), module)
    result['commands'] = commands

    if commands:
        if not module.check_mode:
            load_config(module, commands)
        result['changed'] = True

    module.exit_json(**result)

if __name__ == '__main__':
    main()


text:
package testcase;

import java.util.Arrays;

import annotations.READONLY;

public class AGT146_ObjectInstanceVariableArrayComponent_ClassVariableArrayComponent {

	@READONLY
	public Test test = new Test();

	public static void main(String[] args) {
		new AGT146_ObjectInstanceVariableArrayComponent_ClassVariableArrayComponent().foo();
	}

	public void foo(){
		Test o = new Test();
		System.out.println(test);
		Test.f1[0] = o.f2[0];
		System.out.println(test);
	}

}

class Test {
	public static Object[] f1 = new Object[]{ new Object() };
	public Object[] f2 = new Object[]{ new Object() };

	@Override
	public String toString() {
		return "Test [f2=" + Arrays.toString(f2) + "]";
	}
}


text:
 Sound Manager is used to play sound.

			<md-toolbar class="demo-toolbar">

Example

			</md-toolbar>

			<md-content layout-padding class="md-padding">

Complex Audio

Soem text here.

						<md-button class="md-raised">Preload</md-button>
						<md-button class="md-raised md-primary">Play</md-button>
						<md-button class="md-raised md-warn">Stop</md-button>
						<md-button class="md-raised md-warn">Unload</md-button>

					<md-checkbox ng-model="data.cb1" aria-label="Checkbox 1">
						Loop
					</md-checkbox>

Complex Audio

FX Audio

Soem text here.

						<md-button class="md-raised">Preload</md-button>
						<md-button class="md-raised md-primary">Play</md-button>
						<md-button class="md-raised md-warn">Stop</md-button>
						<md-button class="md-raised md-warn">Unload</md-button>

FX Sound

			</md-content>


text:
mod datum;
pub mod term_kind;
pub mod response;
pub mod query_wrapper;
pub mod term;

pub use self::response::Response;
pub use self::datum::Datum;
pub use self::query_wrapper::QueryWrapper;

/// Determines when the server acknowledges writes.
///
/// This setting can be specified multiple times, the latest in the list being the actually used
/// one:
///
/// 1. In the configuration of the table
/// 2. At query execution
/// 3. At query building in various commands
#[derive(Debug)]
pub enum Durability {
    /// **Default:** Writes are committed to disk before acknowledgments are sent.
    Hard,

    /// Writes are acknowledged immediately upon receipt.
    Soft,
}

/// Determines which changes a query reports after execution.
#[derive(Debug)]
pub enum ReturnChanges {
    /// **Default:** Do not return any changes.
    None,

    /// Return changes only including the documents actually updated.
    Updated,

    /// Return changes including all documents whether or not the update was successful. This was
    /// the behavior of `Updated` before RethinkDB 2.0.
    All,
}

/// Determines handling of inserting documents with the same primary key as existing entries.
#[derive(Debug)]
pub enum Conflict {
    /// **Default:** Do not insert the new document and record the conflict as an error.
    Error,

    /// Replace the old document in it's entirety with the new one.
    Replace,

    /// Update fields of the old document with fields from the new one.
    Update,
}

/// Determines the consistency guarantee for the table read.
///
/// This setting can be specified multiple times, the latest in the list being the actually used
/// one:
///
/// 1. At query execution
/// 2. At query building in the `table` command
#[derive(Debug)]
pub enum ReadMode {
    /// **Default:** Returns values that are in memory (but not necessarily written to disk) on the
    /// primary replica.
    Single,

    /// Will return values that are in memory on an arbitrarily selected replica. This is the
    /// fastest but least consistent.
    Outdated,

    /// Will only return values that are safely committed on disk on a majority of replicas. This
    /// requires sending a message to every replica on each read, so it is the slowest but most
    /// consistent.
    Majority,
}

/// This is the first version supporting different protocols. The
/// `Json` protocol became available since this version.
pub const V0_3: u32 = 0x5f75e83e;

/// New feature: Queries execute in parallel.
pub const V0_4: u32 = 0x400c2d20;

/// The Json protocol is available since version `V0_3`.
pub const JSON: u32 = 0x7e6970c7;


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

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>
      SENNA
    </title>
    <link href="senna.css" rel="stylesheet" type="text/css" />

Access denied

Sorry, you must agree with the licensing terms for using SENNA.

Back to the main page.


text:
package prospector.traverse.world.biomes;

import net.minecraft.block.BlockTallGrass;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.passive.EntityParrot;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.init.Biomes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.*;
import prospector.traverse.config.TraverseConfig;
import prospector.traverse.world.WorldGenConstants;

import java.util.Random;

public class BiomeMiniJungle extends Biome implements WorldGenConstants {

    public static BiomeProperties properties = new BiomeProperties("Mini Jungle");

    static {
        properties.setTemperature(Biomes.JUNGLE.getDefaultTemperature());
        properties.setRainfall(Biomes.JUNGLE.getRainfall());
        properties.setBaseHeight(-0.1F);
        properties.setHeightVariation(0.5F);
        properties.setWaterColor(0xFF24B01C);
    }

    public BiomeMiniJungle() {
        super(properties);
        decorator.treesPerChunk = 30;
        decorator.flowersPerChunk = 5;
        decorator.grassPerChunk = 25;
        decorator.reedsPerChunk = 2;
        decorator.clayPerChunk = 3;
        decorator.waterlilyPerChunk = 12;

        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityOcelot.class, 1, 1, 1));
        this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 4, 4, 4));
        this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityParrot.class, 40, 1, 2));

    }

    @Override
    public int getSkyColorByTemp(float currentTemperature) {
        if (TraverseConfig.disableCustomSkies)
            return super.getSkyColorByTemp(currentTemperature);
        else
            return 0xFFC2FFEB;
    }

    public WorldGenerator getRandomWorldGenForGrass(Random rand) {
        return rand.nextInt(4) == 0 ? new WorldGenTallGrass(BlockTallGrass.EnumType.FERN) : new WorldGenTallGrass(BlockTallGrass.EnumType.GRASS);
    }

    @Override
    public WorldGenAbstractTree getRandomTreeFeature(Random rand) {
        return rand.nextInt(10) == 0 ? BIG_TREE_FEATURE : new WorldGenTrees(false, 2 + rand.nextInt(3), JUNGLE_LOG, JUNGLE_LEAVES, true);
    }

    public void decorate(World worldIn, Random rand, BlockPos pos) {
        super.decorate(worldIn, rand, pos);
        int i = rand.nextInt(16) + 8;
        int j = rand.nextInt(16) + 8;
        int height = worldIn.getHeight(pos.add(i, 0, j)).getY() * 2; // could == 0, which crashes nextInt
        if (height < 1) height = 1;
        int k = rand.nextInt(height);
        if (net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN))
            (new WorldGenMelon()).generate(worldIn, rand, pos.add(i, k, j));
        WorldGenVines worldgenvines = new WorldGenVines();

        if (net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS))
            for (j = 0; j < 50; ++j) {
                k = rand.nextInt(16) + 8;
                int l = 128;
                int i1 = rand.nextInt(16) + 8;
                worldgenvines.generate(worldIn, rand, pos.add(k, 128, i1));
                EntityPig pig = new EntityPig(worldIn);
            }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>Blog_App_BDD</groupId>
  <artifactId>Blog_App_BDD</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>Blog_App_BDD</name>
  <description>Blog_App_BDD</description>
  <dependencies>
  <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-core -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-core</artifactId>
    <version>1.2.5</version>
</dependency>
  <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.2.5</version>
</dependency>
  <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-junit -->
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-testng</artifactId>
    <version>1.2.5</version>
    <scope>test</scope>
</dependency>
 <!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.10</version>
    <scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.0.1</version>
</dependency>
<dependency>
    <groupId>com.googlecode.json-simple</groupId>
    <artifactId>json-simple</artifactId>
    <version>1.1.1</version>
</dependency>
  </dependencies>
  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>
  <build>
  <plugins>
  <plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-compiler-plugin</artifactId>
		<version>3.5.1</version>
			<configuration>
				<source>${jdk.level}</source>
				<target>${jdk.level}</target>
			</configuration>
	</plugin>
  <!-- Below plug-in is used to execute tests -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.18.1</version>
				<configuration>
					<suiteXmlFiles>
						<!-- TestNG suite XML files -->
						<suiteXmlFile>CucumberTestSuite.xml</suiteXmlFile>
						<suiteXmlFile>TestSuite.xml</suiteXmlFile>
					</suiteXmlFiles>
				</configuration>
			</plugin>
  </plugins>
  </build>
</project>


text:
void SudokuScene::BoardSolved(EventPtr &event)
{
    Entity congrats{};
    auto pos = std::unique_ptr<PositionComponent>(new PositionComponent(0, 10, 3));
    auto sprite = std::unique_ptr<SpriteComponent>(new SpriteComponent("Congratulations! You solved the sudoku.\n Stats will be here some time.", 0x00));
    sprite->attr = A_REVERSE | A_BOLD;
    congrats.AddComponent(pos);
    congrats.AddComponent(sprite);
    systems.AddEntity(congrats);
}

void SudokuScene::Init(void)
{
    auto solved_delegate = std::make_shared<EventDelegateMemberFunction<SudokuScene>>(this, std::mem_fn(&SudokuScene::BoardSolved));
    dispatch->Register(SolvedEvent::type, solved_delegate, dispatch_id);

    auto logic_system = new SudokuLogicSystem(dispatch, &systems);
    systems.AddSystem(logic_system);

    auto rendering_system = new CursesRenderSystem(dispatch, &systems, render_duration);
    systems.AddSystem(rendering_system);

    auto curses = CursesSingleton::GetCurses();
    auto input_system = new CursesInputSystem(dispatch, &systems, curses->stdscr);
    systems.AddSystem(input_system);

    auto intent_system = new IntentSystem(dispatch, &systems);
    systems.AddSystem(intent_system);

    {
        Entity a{};
        auto pos = std::unique_ptr<PositionComponent>(new PositionComponent(0, 0, 1));
        auto sprite = std::unique_ptr<SpriteComponent>(new SpriteComponent(RESOURCE_PATH "test.sprite"));
        auto movement = std::unique_ptr<KeyboardControlledMovementComponent>(new KeyboardControlledMovementComponent(1));
        a.AddComponent(pos);
        a.AddComponent(sprite);
        a.AddComponent(movement);
        systems.AddEntity(a);
    }
    {
        Entity board_highlights{};
        auto pos = std::unique_ptr<PositionComponent>(new PositionComponent(0, 0, 2));
        auto sprite = std::unique_ptr<SpriteComponent>(new SpriteComponent(RESOURCE_PATH "test_overlay.sprite"));
        sprite->attr = A_BOLD;

        auto movement = std::unique_ptr<KeyboardControlledMovementComponent>(new KeyboardControlledMovementComponent(1));
        board_highlights.AddComponent(pos);
        board_highlights.AddComponent(sprite);
        board_highlights.AddComponent(movement);
        systems.AddEntity(board_highlights);
    }
//    {
//        Entity state{};
//        auto state_component = std::unique_ptr<StateComponent>(new StateComponent());
//        state.AddComponent(state_component);
//        systems.AddEntity(state);
//    }

    std::array<int, 81> values = {
            0,0,0,6,0,0,1,9,0,
            0,2,0,0,0,0,0,0,5,
            0,3,4,5,7,9,0,0,0,
            0,8,9,4,0,0,0,0,0,
            4,0,0,8,5,6,0,0,2,
            0,0,0,0,0,7,8,1,0,
            0,0,0,9,8,1,2,5,0,
            7,0,0,0,0,0,0,8,0,
            0,5,1,0,0,2,0,0,0};

    for (int r = 0; r < 9; r++)
    {
        auto y = r * 2 + 2;

        for (int c = 0; c < 9; c++)
        {
            Entity cell{};
            auto x = 4 * c + 4;
            auto pos = std::unique_ptr<PositionComponent>(new PositionComponent(x, y, 1));
            cell.AddComponent(pos);
            auto cell_component = std::unique_ptr<CellComponent>(new CellComponent(CellComponent::CellType::Free, values[r*9+c], c, r));
            if (cell_component->value != 0)
            {
                cell_component->cell_type = CellComponent::CellType::Starting;
            }
            cell.AddComponent(cell_component);
            auto sprite = std::unique_ptr<SpriteComponent>(new SpriteComponent(0x30 + values[r*9+c]));
            cell.AddComponent(sprite);
            systems.AddEntity(cell);
        }
    }
}

void SudokuScene::Update(ms elapsed)
{
    systems.update(elapsed);
}


text:
#include "mitkCommandLineParser.h"
#include "mitkIOUtil.h"
#include <mitkBoundingObjectCutter.h>
#include <mitkCuboid.h>

int main(int argc, char* argv[])
{
  mitkCommandLineParser parser;

  parser.setTitle("Dicom Loader");
  parser.setCategory("Preprocessing Tools");
  parser.setDescription("");
  parser.setContributor("German Cancer Research Center (DKFZ)");

  parser.setArgumentPrefix("--","-");
  // Add command line argument names
  parser.addArgument("help", "h",mitkCommandLineParser::Bool, "Help:", "Show this help text");
  parser.addArgument("reference", "r", mitkCommandLineParser::Directory, "Input file:", "Input file",us::Any(),false, false, false, mitkCommandLineParser::Input);
  parser.addArgument("input", "i", mitkCommandLineParser::Directory, "Input file:", "Input file",us::Any(),false, false, false, mitkCommandLineParser::Input);
  parser.addArgument("output", "o", mitkCommandLineParser::File, "Output file:", "Output file",us::Any(),false, false, false, mitkCommandLineParser::Output);

  std::map<std::string, us::Any> parsedArgs = parser.parseArguments(argc, argv);

  if (parsedArgs.size()==0)
    return EXIT_FAILURE;

  // Show a help message
  if ( parsedArgs.count("help") || parsedArgs.count("h"))
  {
    std::cout << parser.helpText();
    return EXIT_SUCCESS;
  }

  std::string referenceName = us::any_cast<std::string>(parsedArgs["reference"]);
  std::string inputName = us::any_cast<std::string>(parsedArgs["input"]);
  std::string outputName = us::any_cast<std::string>(parsedArgs["output"]);

  mitk::Image::Pointer imageToCrop = mitk::IOUtil::Load<mitk::Image>(inputName);
  mitk::Image::Pointer referenceImage = mitk::IOUtil::Load<mitk::Image>(referenceName);
  mitk::BoundingObjectCutter::Pointer cutter = mitk::BoundingObjectCutter::New();
  mitk::BoundingObject::Pointer boundingObject = (mitk::Cuboid::New()).GetPointer();
  boundingObject->FitGeometry(referenceImage->GetGeometry());

  cutter->SetBoundingObject(boundingObject);
  cutter->SetInput(imageToCrop);
  cutter->Update();
  mitk::IOUtil::Save(cutter->GetOutput(), outputName);

  return EXIT_SUCCESS;
}


text:
#nullable enable

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Snittlistan.Web.Infrastructure.Database;

public class Bits_TeamRef
{
    [Key]
    public int TeamRefId { get; private set; }

    public int ExternalTeamId { get; set; }

    public string TeamName { get; private set; } = string.Empty;

    public string TeamAlias { get; set; } = string.Empty;

    [InverseProperty(nameof(Bits_Match.HomeTeamRef))]
    public virtual ICollection<Bits_Match> HomeMatches { get; private set; } =
        new HashSet<Bits_Match>();

    [InverseProperty(nameof(Bits_Match.AwayTeamRef))]
    public virtual ICollection<Bits_Match> AwayMatches { get; private set; } =
        new HashSet<Bits_Match>();
}


text:
<?php // @codingStandardsIgnoreFile

// load dependencies
if (is_file(__DIR__ . '/vendor/autoload.php')) {
    // composer root package
    require_once(__DIR__ . '/vendor/autoload.php');
} elseif (is_file(__DIR__ . '/../../../vendor/autoload.php')) {
    // composer dependency package
    require_once(__DIR__ . '/../../../vendor/autoload.php');
} else {
    die("Cannot find `vendor/autoload.php`. Run `composer install`.");
}

// instance Pico
$pico = new Pico(
    __DIR__,    // root dir
    'config/',  // config dir
    'plugins/', // plugins dir
    'themes/'   // themes dir
);

// override configuration?
//$pico->setConfig(array());

// run application
echo $pico->run();


text:
require "capybara/rspec"
require "selenium-webdriver"

Capybara.default_max_wait_time = 60
Capybara.server = :puma, { Silent: true }

RSpec.configure do |config|
  # set system spec driver depending on whether we use javascript in the test
  config.before(:each, type: :system) do
    driven_by :rack_test
  end

  config.before(:each, type: :system, js: true) do
    if ENV["RUN_IN_BROWSER"]
      driven_by(:selenium_chrome)
    else
      driven_by(:selenium_chrome_headless)
    end
  end
  config.before(:each, type: :system, js: true, in_browser: true) do
    driven_by(:selenium_chrome)
  end
end


text:
<?php

/**
 * Doctrine_Locator
 *
 * @package     Doctrine
 * @subpackage  Doctrine_Locator
 * @category    Locator
 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL
 * @link        http://www.phpdoctrine.net
 * @author      Janne Vanhala <jpvanhal@cc.hut.fi>
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
 * @version     $Revision$
 * @since       1.0
 */
class Doctrine_Locator implements Countable, IteratorAggregate
{
    /**
     * @var array $_resources       an array of bound resources
     */
    protected $_resources = array();

    /**
     * @var string $_classPrefix    the default class prefix
     */
    protected $_classPrefix = 'Doctrine_';

    /**
     * @var array $_instances       a pool of this object's instances
     */
    protected static $_instances = array();

    /**
     * Constructor. Provide an array of resources to set initial contents.
     *
     * @param array
     * @return void
     */
    public function __construct(array $defaults = null)
    {
        if (null !== $defaults) {
            foreach ($defaults as $name => $resource) {
                if ($resource instanceof Doctrine_Locator_Injectable) {
                    $resource->setLocator($this);
                }
                $this->_resources[$name] = $resource;
            }
        }
        self::$_instances[] = $this;
    }

    /**
     * instance
     *
     * @return Sensei_Locator
     */
    public static function instance()
    {
        if (empty(self::$_instances)) {
            $obj = new Doctrine_Locator();
        }
        return current(self::$_instances);
    }

    /**
     * setClassPrefix
     *
     * @param string $prefix
     */
    public function setClassPrefix($prefix)
    {
        $this->_classPrefix = $prefix;
    }

    /**
     * getClassPrefix
     *
     * @return string
     */
    public function getClassPrefix()
    {
        return $this->_classPrefix;
    }

    /**
     * contains
     * checks if a resource exists under the given name
     *
     * @return boolean      whether or not given resource name exists
     */
    public function contains($name)
    {
        return isset($this->_resources[$name]);
    }

    /**
     * bind
     * binds a resource to a name
     *
     * @param string $name      the name of the resource to bind
     * @param mixed $value      the value of the resource
     * @return Sensei_Locator   this object
     */
    public function bind($name, $value)
    {
        $this->_resources[$name] = $value;

        return $this;
    }

    /**
     * locate
     * locates a resource by given name and returns it
     *
     * @throws Doctrine_Locator_Exception     if the resource could not be found
     * @param string $name      the name of the resource
     * @return mixed            the located resource
     */
    public function locate($name)
    {
        if (isset($this->_resources[$name])) {
            return $this->_resources[$name];
        } else {
            $className = $name;

            if ( ! class_exists($className)) {

                $name = explode('.', $name);
                $name = array_map('strtolower', $name);
                $name = array_map('ucfirst', $name);
                $name = implode('_', $name);

                $className = $this->_classPrefix . $name;

                if ( ! class_exists($className)) {
                    throw new Doctrine_Locator_Exception("Couldn't locate resource " . $className);
                }
            }

            $this->_resources[$name] = new $className();

            if ($this->_resources[$name] instanceof Doctrine_Locator_Injectable) {
                $this->_resources[$name]->setLocator($this);
            }

            return $this->_resources[$name];
        }

        throw new Doctrine_Locator_Exception("Couldn't locate resource " . $name);
    }

    /**
     * count
     * returns the number of bound resources associated with
     * this object
     *
     * @see Countable interface
     * @return integer              the number of resources
     */
    public function count()
    {
        return count($this->_resources);
    }

    /**
     * getIterator
     * returns an ArrayIterator that iterates through all
     * bound resources
     *
     * @return ArrayIterator    an iterator for iterating through
     *                          all bound resources
     */
    public function getIterator()
    {
        return new ArrayIterator($this->_resources);
    }
}


text:
package org.mvel2.templates.res;

import org.mvel2.MVEL;
import org.mvel2.integration.VariableResolverFactory;
import org.mvel2.templates.TemplateRuntime;
import org.mvel2.templates.util.TemplateOutputStream;

import static java.lang.String.valueOf;

public class ExpressionNode extends Node {
  public ExpressionNode() {
  }

  public ExpressionNode(int begin, String name, char[] template, int start, int end) {
    this.begin = begin;
    this.name = name;
    this.contents = template;
    this.cStart = start;
    this.cEnd = end - 1;
    this.end = end;
    //    this.contents = subset(template, this.cStart = start, (this.end = this.cEnd = end) - start - 1);
  }

  public ExpressionNode(int begin, String name, char[] template, int start, int end, Node next) {
    this.name = name;
    this.begin = begin;
    this.contents = template;
    this.cStart = start;
    this.cEnd = end - 1;
    this.end = end;
    //   this.contents = subset(template, this.cStart = start, (this.end = this.cEnd = end) - start - 1);
    this.next = next;
  }

  public Object eval(TemplateRuntime runtime, TemplateOutputStream appender, Object ctx, VariableResolverFactory factory) {
    appender.append(valueOf(MVEL.eval(contents, cStart, cEnd - cStart, ctx, factory)));
    return next != null ? next.eval(runtime, appender, ctx, factory) : null;
  }

  public boolean demarcate(Node terminatingNode, char[] template) {
    return false;
  }

  public String toString() {
    return "ExpressionNode:" + name + "{" + (contents == null ? "" : new String(contents, cStart, cEnd - cStart))
        + "} (start=" + begin + ";end=" + end + ")";
  }
}


text:
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

  <changeSet id="blossom_module_article_create_table" author="mgargadennec">

    <createTable tableName="blossom_article">
      <column name="id" type="bigint">
        <constraints primaryKey="true" nullable="false" unique="true"/>
      </column>

      <column name="name" type="varchar(100)">
        <constraints nullable="false"/>
      </column>

      <column name="summary" type="clob">
        <constraints nullable="true"/>
      </column>

      <column name="content" type="clob">
        <constraints nullable="true"/>
      </column>

      <column name="status" type="varchar(20)">
        <constraints nullable="true"/>
      </column>

      <column name="creation_date" type="timestamp">
        <constraints nullable="false"/>
      </column>

      <column name="creation_user" type="varchar(25)">
        <constraints nullable="false"/>
      </column>

      <column name="modification_date" type="timestamp">
        <constraints nullable="false"/>
      </column>

      <column name="modification_user" type="varchar(25)">
        <constraints nullable="false"/>
      </column>
    </createTable>
  </changeSet>

</databaseChangeLog>


text:
#import <UIKit/UIKit.h>

#import "MMDrawerController/MMDrawerController.h"
#import "MainViewController.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate,UITabBarControllerDelegate>
{
@package
    MMDrawerController *mDrawerViewController;
    MainViewController *mMainViewController;
}
@property (strong, nonatomic) UIWindow *window;

@end


text:
describe LiveMetricsMixin do
  subject do
    Class.new do
      include LiveMetricsMixin
    end.new
  end

  context "#adjust_timestamps" do
    it "doesn't change the output when the interval is not hourly" do
      now = Time.now
      firsts = [now.to_i * 1000]
      lasts = [now.to_i * 1000]

      result = subject.adjust_timestamps(firsts, lasts, nil)

      expect(result.first).to be_within(1).of(now.utc)
      expect(result.last).to be_within(1).of(now.utc)
    end

    context "when the interval is not hourly" do
      it "when the first time is less than an hour" do
        now = Time.now
        firsts = [now.to_i * 1000]
        lasts = [now.to_i * 1000]

        result = subject.adjust_timestamps(firsts, lasts, "hourly")

        expect(result.first).to be_nil
        expect(result.last).to be_within(1).of(now.utc)
      end

      it "when the first time is more than an hour ago" do
        now = Time.now
        firsts = [(now - 2.hours).to_i * 1000]
        lasts = [now.to_i * 1000]

        result = subject.adjust_timestamps(firsts, lasts, "hourly")

        expect(result.first).to be_within(1).of(now.utc - 2.hours)
        expect(result.last).to be_within(1).of(now.utc)
      end
    end
  end
end


text:
{% if site.name %}{{site.name}}{% else %}Alan Doe{% endif %}

{% if site.tagline %}{{site.tagline}}{% else %}Full Stack Developer{% endif %}

tips@lumc.nl

071 5262144

URL TIPS

                      Adres LUMC TIPS Group

                      Postzone B5-P-25

                      Albinusdreef 2, 2333 ZA Leiden

                      Postbus 9600, 2300 RC Leiden

           {% include deelnemers.html %}


text:
struct Ray
{
	glm::vec3 origin;
	glm::vec3 direction;
	glm::vec3 inv_direction;

	Ray():
	origin({0.0f, 0.0f, 0.0f}),
	direction({1.0f, 1.0f, 1.0f}),
	inv_direction({-1.0f, -1.0f, -1.0f}){}

	Ray(glm::vec3 const& origin, glm::vec3 const& direction):
	origin(origin),
	direction(glm::normalize(direction)),
	inv_direction({1.0/direction.x, 1.0/direction.y, 1.0/direction.z}){}

	Ray transformRay(glm::mat4 world_transformation){
		glm::vec4 homogeneous_origin{origin,1.0f};
		glm::vec4 homogeneous_direction{direction,0.0f};

		glm::vec4 transformed_origin = world_transformation * homogeneous_origin;
		glm::vec4 transformed_direction = world_transformation * homogeneous_direction;

		glm::vec3 final_origin{transformed_origin};
		glm::vec3 final_direction{transformed_direction};

		Ray new_ray{final_origin,final_direction};
		return new_ray;
	}
};

#endif


text:
package com.sparkwing.localview.Models;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class Photo implements Parcelable
{

    @SerializedName("id")
    @Expose
    private String id;
    @SerializedName("owner")
    @Expose
    private String owner;
    @SerializedName("secret")
    @Expose
    private String secret;
    @SerializedName("server")
    @Expose
    private String server;
    @SerializedName("farm")
    @Expose
    private Integer farm;
    @SerializedName("title")
    @Expose
    private String title;
    @SerializedName("ispublic")
    @Expose
    private Integer ispublic;
    @SerializedName("isfriend")
    @Expose
    private Integer isfriend;
    @SerializedName("isfamily")
    @Expose
    private Integer isfamily;
    public final static Parcelable.Creator<Photo> CREATOR = new Creator<Photo>() {

        @SuppressWarnings({
                "unchecked"
        })
        public Photo createFromParcel(Parcel in) {
            Photo instance = new Photo();
            instance.id = ((String) in.readValue((String.class.getClassLoader())));
            instance.owner = ((String) in.readValue((String.class.getClassLoader())));
            instance.secret = ((String) in.readValue((String.class.getClassLoader())));
            instance.server = ((String) in.readValue((String.class.getClassLoader())));
            instance.farm = ((Integer) in.readValue((Integer.class.getClassLoader())));
            instance.title = ((String) in.readValue((String.class.getClassLoader())));
            instance.ispublic = ((Integer) in.readValue((Integer.class.getClassLoader())));
            instance.isfriend = ((Integer) in.readValue((Integer.class.getClassLoader())));
            instance.isfamily = ((Integer) in.readValue((Integer.class.getClassLoader())));
            return instance;
        }

        public Photo[] newArray(int size) {
            return (new Photo[size]);
        }

    }
            ;

    public String getId() {
        return id;
    }

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

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    public Integer getFarm() {
        return farm;
    }

    public void setFarm(Integer farm) {
        this.farm = farm;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getIspublic() {
        return ispublic;
    }

    public void setIspublic(Integer ispublic) {
        this.ispublic = ispublic;
    }

    public Integer getIsfriend() {
        return isfriend;
    }

    public void setIsfriend(Integer isfriend) {
        this.isfriend = isfriend;
    }

    public Integer getIsfamily() {
        return isfamily;
    }

    public void setIsfamily(Integer isfamily) {
        this.isfamily = isfamily;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(id);
        dest.writeValue(owner);
        dest.writeValue(secret);
        dest.writeValue(server);
        dest.writeValue(farm);
        dest.writeValue(title);
        dest.writeValue(ispublic);
        dest.writeValue(isfriend);
        dest.writeValue(isfamily);
    }

    public int describeContents() {
        return 0;
    }

}


text:
import _ from 'lodash';
import Roll from '../../lib/dice-roller';
import Effect from '../../definitions/effect';
import { Ring as RandomRing } from '../../constants/random';
import GameState from '../../init/gamestate';
import MonsterSpawner from '../../worldgen/monster-spawner';

class SinkKickEffect extends Effect {}

export class BasicEffect extends SinkKickEffect {
  static get probability() { return 7; }
  static use(entity) {
    this.msg(entity, `${entity.name} kicks the sink and it vibrates nosily.`);
    entity.alertAllInRange(50);
  }
}

export class RingGen extends SinkKickEffect {
  static get probability() { return 3; }
  static use(entity, sink) {
    if(sink._gotRing) {
      this.msg(entity, `${entity.name} kicked murky water out of the sink.`);
      return;
    }
    sink._gotRing = true;
    entity.exercise('wis');
    entity.exercise('dex');
    const ring = RandomRing({ bucName: 'uncursed' });
    GameState.world.moveItem(ring, entity.x, entity.y, entity.z);
    this.msg(entity, `${entity.name} found a ring shining in the murky goop!`);
  }
}

export class BadKick extends SinkKickEffect {
  static get probability() { return 1; }
  static use(entity) {
    this.msg(entity, `${entity.name} fumbled while kicking the sink.`);
    entity.alertAllInRange(50);
    entity.abuse('dex');
    entity.abuse('wis');
    const damage = Roll('1d5');
    entity.takeDamage(damage, { name: 'sink' });
  }
}

export class SpawnsPudding extends SinkKickEffect {
  static get probability() { return 1; }
  static use(entity, sink) {
    const validTile = _.sample(this.getEmptyTilesInRange(sink));

    if(!validTile) return;
    this.msg(entity, `${entity.name} caused black ooze to rise out of the sink!`);
    MonsterSpawner.spawnSingle('blackPudding', validTile);
  }
}


text:
<?xml version="1.0" encoding="{charset}"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>

    <title><![CDATA[{wiki_name}]]></title>
    <link>{path:wiki_home}</link>
    <description><![CDATA[{wiki_name}]]></description>
    <dc:language>{language}</dc:language>
    <dc:creator>{webmaster_email}</dc:creator>
    <dc:rights>Copyright {current_time format="%Y"}</dc:rights>
    <dc:date>{gmt_last_updated format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    <admin:generatorAgent rdf:resource="https://ellislab.com/" />

{wiki:recent_changes}
    <item>
      <title><![CDATA[{title}]]></title>
      <link>{path:view_article}</link>
      <guid>{path:view_article}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{title}]]></dc:subject>
      <dc:date>{gmt_revision_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    </item>
{/wiki:recent_changes}

    </channel>
</rss>


text:
require 'test_helper'

class EpayNotificationTest < Test::Unit::TestCase
  include OffsitePayments::Integrations

  def setup
    @epay = Epay::Notification.new(http_raw_data, :credential3 => "secretmd5")
  end

  def test_accessors
    assert @epay.complete?
    assert_equal "9572252", @epay.transaction_id
    assert_equal "189139", @epay.item_id
    assert_equal "3987.50", @epay.gross
    assert_equal "DKK", @epay.currency
    assert_equal Time.parse("2012-04-03 14:42:00"), @epay.received_at
    assert !@epay.test?
  end

  def test_compositions
    assert_equal Money.from_amount(3987.50, 'DKK'), @epay.amount
  end

  def test_acknowledgement
    assert @epay.acknowledge
  end

  def test_failed_acknnowledgement
    @epay = Epay::Notification.new(http_raw_data, :credential3 => "badmd5string")
    assert !@epay.acknowledge
  end

  def test_generate_md5string
    assert_equal "1957225218913939875020820120403144203453903XXXXXX9862secretmd5",
                 @epay.generate_md5string
  end

  def test_generate_md5hash
    assert_equal "6f81086c474f03af80ef894e48f81f99", @epay.generate_md5hash
  end

  def test_respond_to_acknowledge
    assert @epay.respond_to?(:acknowledge)
  end

  private
  def http_raw_data
    "language=1&txnid=9572252&orderid=189139&amount=398750&currency=208&date=20120403&time=1442&txnfee=0&paymenttype=3&cardno=453903XXXXXX9862&hash=6f81086c474f03af80ef894e48f81f99"
  end

end


text:
layout: page
title: "About"
description: ""
---
{% include JB/setup %}

[About me][1]

GISer. Coder. Music Lover.
![Me][2]

Hello,everyone! I am a student from Peking University,majored in Geographic Information System(GIS). I am an active python developer. I love Linux,Vim and Python. I also love music,TVB's series and American TV series.The Chinese Kung Fu novels are my favorites, especially Jinyong ' s swordsman fictions. Feel free to contact me. Thanks for visiting!

[1]: http://www.about.me/kezunlin
[2]: {{ site.url }}/assets/images/kezunlin_sdyxz.jpg


text:
define(
//begin v1.x content
{
	"KHR_displayName": "i-Cambodian Riel",
	"FJD_displayName": "i-Fijian Dollar",
	"KPW_displayName": "i-North Korean Won",
	"XCD_displayName": "i-East Caribbean Dollar",
	"HUF_displayName": "i-Hungarian Forint",
	"IQD_displayName": "i-Iraqi Dinar",
	"EGP_displayName": "i-Egyptian Pound",
	"TTD_displayName": "Idola lase-Trinidad nase-Tobago",
	"GHS_displayName": "i-Ghanaian Cedi",
	"BTN_displayName": "i-Bhutanese Ngultrum",
	"SBD_displayName": "i-Solomon Islands Dollar",
	"CZK_displayName": "i-Czech Republic Koruna",
	"NOK_displayName": "i-Norwegian Krone",
	"MNT_displayName": "i-Mongolian Tugrik",
	"INR_displayName": "i-Indian Rupee",
	"KRW_displayName": "i-South Korean Won",
	"BMD_displayName": "i-Bermudan Dollar",
	"BDT_displayName": "i-Bangladeshi Taka",
	"KGS_displayName": "i-Kyrgystani Som",
	"DJF_displayName": "i-Djiboutian Franc",
	"ANG_displayName": "i-Netherlands Antillean Guilder",
	"USD_displayName": "i-US Dollar",
	"TMT_displayName": "i-Turkmenistani Manat",
	"HTG_displayName": "i-Haitian Gourde",
	"BWP_displayName": "i-Botswana Pula",
	"RSD_displayName": "i-Serbian Dinar",
	"SSP_displayName": "Upondo waseNingizimu Sudan",
	"DKK_displayName": "i-Danish Krone",
	"PAB_displayName": "i-Panamanian Balboa",
	"AWG_displayName": "i-Aruban Florin",
	"NAD_displayName": "i-Namibian Dollar",
	"UGX_displayName": "i-Ugandan Shilling",
	"ZMW_displayName": "i-Zambian Kwacha",
	"HNL_displayName": "i-Honduran Lempira",
	"BHD_displayName": "i-Bahraini Dinar",
	"VEF_displayName": "i-Venezuelan Bolívar",
	"BIF_displayName": "i-Burundian Franc",
	"MKD_displayName": "i-Macedonian Denar",
	"SRD_displayName": "i-Surinamese Dollar",
	"XAF_displayName": "i-CFA Franc BCEA",
	"XOF_displayName": "i-CFA Franc BCEAO",
	"LTL_displayName": "i-Lithuanian Litas",
	"GYD_displayName": "i-Guyanaese Dollar",
	"COP_displayName": "i-Colombian Peso",
	"MMK_displayName": "i-Myanma Kyat",
	"MVR_displayName": "i-Maldivian Rufiyana",
	"SAR_displayName": "i-Saudi Riyal",
	"CHF_displayName": "i-Swiss Franc",
	"STD_displayName": "i-São Tomé kanye ne-Príncipe Dobra",
	"IDR_displayName": "i-Indonesian Rupiah",
	"PYG_displayName": "i-Paraguayan Guarani",
	"IRR_displayName": "i-Iranian Rial",
	"UYU_displayName": "i-Uruguayan Peso",
	"EUR_displayName": "i-Euro",
	"SLL_displayName": "i-Sierra Leonean Leone",
	"SDG_displayName": "i-Sudanese Pound",
	"LKR_displayName": "i-Sri Lankan Rupee",
	"GMD_displayName": "i-Gambian Dalasi",
	"SZL_displayName": "i-Swazi Lilangeni",
	"GNF_displayName": "i-Gunean Franc",
	"SCR_displayName": "i-Seychellois Rupee",
	"ALL_displayName": "i-Albanian Lek",
	"ZAR_symbol": "R",
	"GEL_displayName": "i-Georgian Lari",
	"AMD_displayName": "i-Armenian Dram",
	"NZD_displayName": "i-New Zealand Dollar",
	"AFN_displayName": "i-Afghan Afghani",
	"JMD_displayName": "i-Jamaican Dollar",
	"GTQ_displayName": "i-Guatemalan Quetzal",
	"LVL_displayName": "i-Latvian Lats",
	"NIO_displayName": "i-Nicaraguan Córdoba",
	"OMR_displayName": "i-Omani Rial",
	"KMF_displayName": "i-Comorian Franc",
	"GBP_displayName": "i-British Pound Sterling",
	"AOA_displayName": "i-Angolan Kwanza",
	"VUV_displayName": "i-Vanuatu Vatu",
	"TOP_displayName": "i-Tongan Paʻanga",
	"GIP_displayName": "i-Gibraltar Pound",
	"BZD_displayName": "i-Belize Dollar",
	"MAD_displayName": "i-Moroccan Dirham",
	"CLP_displayName": "i-Chilean Peso",
	"SYP_displayName": "i-Syrian Pound",
	"NPR_displayName": "i-Nepalese Rupee",
	"UZS_displayName": "i-Uzbekistan Som",
	"JOD_displayName": "i-Jordanian Dinar",
	"YER_displayName": "i-Yemeni Rial",
	"BRL_displayName": "i-Brazilian Real",
	"TRY_displayName": "i-Turkish Lira",
	"CVE_displayName": "i-Cape Verdean Escudo",
	"BSD_displayName": "i-Bahamian Dollar",
	"LYD_displayName": "i-Libyan Dinar",
	"BAM_displayName": "i-Bosnia-Herzegovina Convertible Mark",
	"NGN_displayName": "i-Nigerian Naira",
	"WST_displayName": "i-Samoan Tala",
	"TND_displayName": "i-Tunisian Dinar",
	"LRD_displayName": "i-Liberian Dollar",
	"ILS_displayName": "i-Israeli New Sheqel",
	"KZT_displayName": "i-Kazakhstani Tenge",
	"CUC_displayName": "i-Cuban Convertable Peso",
	"BGN_displayName": "i-Bulgarian Lev",
	"MXN_displayName": "i-Mexican Peso",
	"CUP_displayName": "I-Cuban Peso",
	"BYR_displayName": "i-Belarusian Ruble",
	"LSL_displayName": "i-Lesotho Loti",
	"UAH_displayName": "i-Ukrainian Hryvnia",
	"BND_displayName": "i-Brunei Dollar",
	"SEK_displayName": "i-Swedish Krona",
	"MUR_displayName": "i-Mauritian Rupee",
	"ETB_displayName": "i-Ethopian Birr",
	"ARS_displayName": "i-Argentina Peso",
	"TWD_displayName": "i-New Taiwan Dollar",
	"JPY_displayName": "i-Japanese Yen",
	"MZN_displayName": "I-Metical yase-Mozambicque",
	"TJS_displayName": "i-Tajikistani Somoni",
	"PEN_displayName": "i-Peruvian Nuevo Sol",
	"XPF_displayName": "i-CFP Franc",
	"KWD_displayName": "i-Kuwaiti Dinar",
	"LAK_displayName": "i-Laotian Kip",
	"RON_displayName": "I-Romanian Leu",
	"HRK_displayName": "i-Croatian Kuna",
	"THB_displayName": "i-Thai Baht",
	"PLN_displayName": "i-Polish Zloty",
	"DZD_displayName": "i-Algerian Dinar",
	"AZN_displayName": "i-Azerbaijani Manat",
	"PGK_displayName": "i-Papua New Guinean Kina",
	"LBP_displayName": "i-Lebanese Pound",
	"RWF_displayName": "i-Rwandan Franc",
	"SHP_displayName": "i-Saint Helena Pound",
	"TZS_displayName": "i-Tanzanian Shilling",
	"MGA_displayName": "i-Malagasy Ariary",
	"ERN_displayName": "i-Eritrean Nakfa",
	"MDL_displayName": "i-Moldovan Leu",
	"PHP_displayName": "i-Philippine Peso",
	"AED_displayName": "i-Dirham yase-United Arab Emirates",
	"BOB_displayName": "i-Bolivian Boliviano",
	"KYD_displayName": "i-Cayman Islands Dollar",
	"BBD_displayName": "i-Barbadian Dollar",
	"XXX_displayName": "Ikharensi engaziwa",
	"CAD_displayName": "i-Candian Dollar",
	"DOP_displayName": "i-Dominican Peso",
	"MRO_displayName": "i-Mauritanian Ouguiya",
	"ZMK_displayName": "i-Zambian Kwacha (1968-2012)",
	"RUB_displayName": "i-Russian Ruble",
	"QAR_displayName": "i-Qatari Rial",
	"MOP_displayName": "i-Macanese Pataca",
	"SOS_displayName": "i-Somali Shilling",
	"SGD_displayName": "i-Singapore Dollar",
	"MWK_displayName": "i-Malawian Kwacha",
	"KES_displayName": "i-Kenyan Shilling",
	"CRC_displayName": "i-Costa Rican Colón",
	"ZAR_displayName": "i-South African Rand",
	"AUD_displayName": "i-Austrilian Dollar",
	"PKR_displayName": "i-Pakistani Rupee",
	"VND_displayName": "i-Vietnamese Dong",
	"HKD_displayName": "i-Hong Kong Dollar",
	"MYR_displayName": "i-Malaysian Ringgit",
	"CNY_displayName": "i-Chinese Yuan",
	"CDF_displayName": "i-Congolese Franc",
	"ISK_displayName": "i-Icelandic Króna",
	"FKP_displayName": "i-Falkland Islands Pound"
}
//end v1.x content
);


text:
CMAKE_<LANG>_FLAGS_RELWITHDEBINFO
---------------------------------

Flags for RelWithDebInfo type or configuration.

<LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo.  Short for
Release With Debug Information.


text:
#include <rte_ethdev.h>
#include <rte_graph.h>

#include "rte_node_eth_api.h"

#include "ethdev_rx_priv.h"
#include "ethdev_tx_priv.h"
#include "ip4_rewrite_priv.h"
#include "node_private.h"

static struct ethdev_ctrl {
	uint16_t nb_graphs;
} ctrl;

int
rte_node_eth_config(struct rte_node_ethdev_config *conf, uint16_t nb_confs,
		    uint16_t nb_graphs)
{
	struct rte_node_register *ip4_rewrite_node;
	struct ethdev_tx_node_main *tx_node_data;
	uint16_t tx_q_used, rx_q_used, port_id;
	struct rte_node_register *tx_node;
	char name[RTE_NODE_NAMESIZE];
	const char *next_nodes = name;
	struct rte_mempool *mp;
	int i, j, rc;
	uint32_t id;

	ip4_rewrite_node = ip4_rewrite_node_get();
	tx_node_data = ethdev_tx_node_data_get();
	tx_node = ethdev_tx_node_get();
	for (i = 0; i < nb_confs; i++) {
		port_id = conf[i].port_id;

		if (!rte_eth_dev_is_valid_port(port_id))
			return -EINVAL;

		/* Check for mbuf minimum private size requirement */
		for (j = 0; j < conf[i].mp_count; j++) {
			mp = conf[i].mp[j];
			if (!mp)
				continue;
			/* Check for minimum private space */
			if (rte_pktmbuf_priv_size(mp) < NODE_MBUF_PRIV2_SIZE) {
				node_err("ethdev",
					 "Minimum mbuf priv size requirement not met by mp %s",
					 mp->name);
				return -EINVAL;
			}
		}

		rx_q_used = conf[i].num_rx_queues;
		tx_q_used = conf[i].num_tx_queues;
		/* Check if we have a txq for each worker */
		if (tx_q_used < nb_graphs)
			return -EINVAL;

		/* Create node for each rx port queue pair */
		for (j = 0; j < rx_q_used; j++) {
			struct ethdev_rx_node_main *rx_node_data;
			struct rte_node_register *rx_node;
			ethdev_rx_node_elem_t *elem;

			rx_node_data = ethdev_rx_get_node_data_get();
			rx_node = ethdev_rx_node_get();
			snprintf(name, sizeof(name), "%u-%u", port_id, j);
			/* Clone a new rx node with same edges as parent */
			id = rte_node_clone(rx_node->id, name);
			if (id == RTE_NODE_ID_INVALID)
				return -EIO;

			/* Add it to list of ethdev rx nodes for lookup */
			elem = malloc(sizeof(ethdev_rx_node_elem_t));
			memset(elem, 0, sizeof(ethdev_rx_node_elem_t));
			elem->ctx.port_id = port_id;
			elem->ctx.queue_id = j;
			elem->nid = id;
			elem->next = rx_node_data->head;
			rx_node_data->head = elem;

			node_dbg("ethdev", "Rx node %s-%s: is at %u",
				 rx_node->name, name, id);
		}

		/* Create a per port tx node from base node */
		snprintf(name, sizeof(name), "%u", port_id);
		/* Clone a new node with same edges as parent */
		id = rte_node_clone(tx_node->id, name);
		tx_node_data->nodes[port_id] = id;

		node_dbg("ethdev", "Tx node %s-%s: is at %u", tx_node->name,
			 name, id);

		/* Prepare the actual name of the cloned node */
		snprintf(name, sizeof(name), "ethdev_tx-%u", port_id);

		/* Add this tx port node as next to ip4_rewrite_node */
		rte_node_edge_update(ip4_rewrite_node->id, RTE_EDGE_ID_INVALID,
				     &next_nodes, 1);
		/* Assuming edge id is the last one alloc'ed */
		rc = ip4_rewrite_set_next(
			port_id, rte_node_edge_count(ip4_rewrite_node->id) - 1);
		if (rc < 0)
			return rc;
	}

	ctrl.nb_graphs = nb_graphs;
	return 0;
}


text:
using System.Windows.Forms;
using XenAdmin.Commands;
using XenAdmin.Diagnostics.Checks;
using XenAPI;
using XenAdmin.Dialogs.VMDialogs;
using XenAdmin.Actions;
using XenAdmin.Actions.VMActions;
using System.Collections.Generic;

namespace XenAdmin.Diagnostics.Problems.HostProblem
{
    public class NotEnoughMem : HostProblem
    {
        private List<VM> VmsToSuspend = new List<VM>();
        private List<VM> VmsToShutdown = new List<VM>();

        public NotEnoughMem(Check check, Host host)
            : base(check,  host)
        {
        }

        public override string Description
        {
            get { return string.Format(Messages.UPDATES_WIZARD_NO_MEMORY, ServerName); }
        }

        protected override AsyncAction CreateAction(out bool cancelled)
        {
            using (var dlg = new SelectVMsToSuspendDialog(Server))
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    cancelled = false;

                    VmsToSuspend = dlg.SelectedVMsToSuspend;
                    VmsToShutdown = dlg.SelectedVMsToShutdown;

                    return new SuspendAndShutdownVMsAction(Server.Connection, Server, VmsToSuspend, VmsToShutdown);
                }
            }

            cancelled = true;
            return null;
        }

        public override string HelpMessage
        {
            get { return Messages.SUSPEND_VMS; }
        }

        public override AsyncAction UnwindChanges()
        {
            return new ResumeAndStartVMsAction(Server.Connection, Server, VmsToSuspend, VmsToShutdown,VMOperationCommand.WarningDialogHAInvalidConfig,VMOperationCommand.StartDiagnosisForm);
        }

    }
}


text:
require "rulers/version"
require "rulers/routing"

module Rulers
  class Application
    def call(env)
      # TODO fix this hack for routing favicon image
      if env["PATH_INFO"] == "/"
        begin
          text = File.read(File.join('public', 'index.html'))
          return [200, {'Content-type' => "text/html"},[text]]
        rescue Errno::ENOENT
          return [404, {'Content-type' => "text/html"},["Missing Page or File"]]
        end
      elsif env["PATH_INFO"] == "/favicon.ico"
        return [404, {'Content-Type' => "text/html"}, []]
      end

      begin
        klass, act = get_controller_and_action(env)
        controller = klass.new(env)
        text = controller.send(act)
        [200, {'Content-Type' => "text/html"}, [text]]
      rescue => e
        error_body = "
500 Server Error

#{e.message}

Backtrace
#{e.backtrace}"
        [500, {'Content-Type' => "text/html"}, [error_body]]
      end
    end
  end

  class Controller
    def initialize(env)
        @env = env
    end

    def env
      @env
    end
  end
end


text:
using System;

namespace RabbitBus.Configuration
{
	public interface IRouteConfiguration<TRouteInfo> where TRouteInfo : class
	{
		TRouteInfo GetRouteInfo(Type messageType);
		void AddPolicy<TRouteInfoLookupStrategy>(Type messageType, TRouteInfo routeInfo);
		void AddStrategy<TMessage>() where TMessage : IRouteInfoLookupStrategy<TRouteInfo>, new();
	}
}


text:
ART (Auburn Redirect Tool)
=
Authors/Copyright: Jake Harris (javakatdesign@gmail.com), Clay Miller (clay@smockle.com) and Tyler Atwell (sta0003@auburn.edu).

ART allows for use of simple, shorthand pseudo-domains in frequent
use by the CWS team. It makes visiting the web apps we develop much more intuitive, since now we can type their
names the same way we speak them.

Table of Contents:
-
1. Use and Features
2. Known Errors and Bugs
3. Todo List

1. Use and Features
-
ART is an extension to make our lives just that little bit easier here at CWS. Now, visiting sites on our most
frequented domains is simple and intuitive. We can type them much like we speak them!
If you want someone to visit a site, for debugging purposes or what-have-you, you might say something like,
"Go to domain, containing folder, project name," or, "Go to domain, project name."
Now they can visit that site the same way!

Example:
Say we had a subdomain "cats" that demanded the secure HTTP protocol. Say this subdomain was a part of the
"internet" domain, and imagine for a moment we had a project named "flying" on this subdomain.

The full URL for this hypothetical project would be:

```` cats.internet.com/flying ````

and, if ART handled that subdomain properly, you could type:

```` cats/flying ````

to get redirected to the right place! Now, wasn't that easy?

NOTE: List of properly-handled subdomains can be found on the team site announcements under "ART-handled subdomains".

2. Known Errors and Bugs
-
ART frequently breaks on a person's first attempt to visit a particular project. To work around this, for now,
add "http://" to the front of your shorthand attempts THE FIRST TIME. After that, everything should run fine.

3. Todo List
-
* Make this modular and customizable for external use!
* Add Clay's Auburn Link Fixer (auburn.user.js by clay@smockle.com) for easy team use stuff!
* Add AJAX calls so we can avoid redirecting to 404's


text:
/**
 * This is PAMther's core package containing object-oriented
 * wrappers and exception classes.
 */
package org.pamther;


text:
ExcelVBA-Javascript-Bridge
==========================

to facilitate data exchange between Excel VBA and Javascript through evoking msscriptcontrol and JSON-parse


text:
require 'faker'
require_relative '../config/application'

Task.transaction do
    10.times do
        Task.create(description: Faker::Lorem.sentence)
    end
end


text: We're Awesome-Sauce


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

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

	<title>Transparent Fills</title>

	<link rel="stylesheet" type="text/css" href="style.css" />

Examples of Transparent Fills

			Aliquam lectus orci, adipiscing et, sodales ac, feugiat non, lacus. Ut dictum velit nec est. Quisque posuere, purus sit amet malesuada blandit, sapien sapien auctor arcu, sed pulvinar felis mi sollicitudin tortor. Maecenas volutpat, nisl et dignissim pharetra, urna lectus ultrices est, vel pretium pede turpis id velit. Aliquam sagittis magna in felis egestas rutrum. Proin wisi libero, vestibulum eget, pulvinar nec, suscipit ut, mi. Integer in arcu ultricies leo dapibus ultricies. Sed rhoncus lobortis dolor. Suspendisse dolor. Mauris sapien velit, pulvinar non, rutrum non, consectetuer eget, metus. Morbi tincidunt lorem at urna. Etiam porta. Ut mauris. Phasellus tristique rhoncus magna. Nam tincidunt consequat urna. Sed tempor.

				Aliquam lectus orci, adipiscing et, sodales ac, feugiat non, lacus. Ut dictum velit nec est. Quisque posuere, purus sit amet malesuada blandit, sapien sapien auctor arcu, sed pulvinar felis mi sollicitudin tortor. Maecenas volutpat, nisl et dignissim pharetra, urna lectus ultrices est,

				Aliquam lectus orci, adipiscing et, sodales ac, feugiat non, lacus. Ut dictum velit nec est. Quisque posuere, purus sit amet malesuada blandit, sapien sapien auctor arcu, sed pulvinar felis mi sollicitudin tortor. Maecenas volutpat, nisl et dignissim pharetra, urna lectus ultrices est,

				Aliquam lectus orci, adipiscing et, sodales ac, feugiat non, lacus. Ut dictum velit nec est. Quisque posuere, purus sit amet malesuada blandit, sapien sapien auctor arcu, sed pulvinar felis mi sollicitudin tortor. Maecenas volutpat, nisl et dignissim pharetra, urna lectus ultrices est,


text:
document.addEventListener("DOMContentLoaded", function() {
    setLinkToApp();
});

function setLinkToApp() {
    var linkContainer = document.getElementById('appLinkContainer');
    var linkEl = document.getElementById('appLink');
    var osIconEl = document.getElementById('osIcon');
    if (!linkEl || !osIconEl ) {
        return;
    }
    var os = getMobileOperatingSystem();
    switch(os) {
        case "Android":
            linkEl.setAttribute('href', 'https://play.google.com/store/apps/details?id=nz.org.geonet.quake&hl=en');
            osIconEl.classList = 'fa-brands fa-android fa-1';
            break;
        case "iOS":
            linkEl.setAttribute('href', 'https://itunes.apple.com/nz/app/geonet-quake/id533054360?mt=8');
            osIconEl.classList = 'fa-brands fa-apple fa-1';
            break;
        default:
            linkContainer.classList.replace("d-md-none", "d-none");
            break;
    }
};

/**
 * Determines the mobile OS, returning 'iOS', 'Android', or 'unknown'.
 * @returns {string} "Android", "iOS", or "unknown"
 */
function getMobileOperatingSystem() {
    var userAgent = navigator.userAgent || navigator.vendor || window.opera;

    if (/android/i.test(userAgent)) {
        return "Android";
    }
    if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
        return "iOS";
    }
    return "unknown";
}


text:
package mkl.testarea.pdfbox2.meta;

import java.io.IOException;
import java.io.InputStream;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;
import org.junit.Assert;
import org.junit.Test;

/**
 * @author mkl
 */
public class DecryptRC4 {
    /**
     *
     * PDFBOX2.X - Read wrong Data from acroForm
     *
     *

     *
     * 2AF-0088-NA-LMF35-40-01-2019-01-18-14-25-52(1).pdf
     *
     *

     * Indeed, PDFBox before commit 2888ec6b19c7ea30535eb85db9d9ce6c04dc947c
     * (2019-02-02 12:40:52 by Tilman Hausherr) returned a wrong value here.
     *

     */
    @Test
    public void test2AF_0088_NA_LMF35_40_01_2019_01_18_14_25_52_1_() throws IOException {
        try (   InputStream resource = getClass().getResourceAsStream("2AF-0088-NA-LMF35-40-01-2019-01-18-14-25-52(1).pdf") ) {
            PDDocument pdDocument = PDDocument.load(resource);
            PDAcroForm pdAcroForm = pdDocument.getDocumentCatalog().getAcroForm();
            String value = pdAcroForm.getField("totalBuyoffCount").getValueAsString();
            Assert.assertEquals("The value of the field totalBuyoffCount is incorrect,", "3", value);
        }
    }

}


text:
<?php
namespace SpsBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints as Assert;

class Tag
{
	public $name;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/item_share"
        android:title="@string/share" />
</menu>


text:
<?php

namespace Pum\Core\BuilderRegistry;

/**
 * A build registry contains all data types and behaviors.
 *
 * It is also responsible of resolving data types.
 */
interface BuilderRegistryInterface
{
    /**
     * Returns instance of data type
     *
     * @return object
     */
    public function getType($name);

    /**
     * Returns names of all registered data types
     *
     * @return string[]
     */
    public function getTypeNames();

    /**
     * Returns instance of all registered data types extension of a type
     *
     * @return string[]
     */
    public function getTypeExtensions($name);

    /**
     * @return BehaviorInterface
     *
     * @throws DefinitionNotFoundException
     */
    public function getBehavior($name);

    /**
     * Returns names of all registered behaviors
     *
     * @return string[]
     */
    public function getBehaviorNames();

    /**
     * Returns all types and type extensions associated to a given type name.
     *
     * @param string $name       a type name
     * @param string $instanceOf filter types per class or interface name
     *
     * @return array
     *
     * @throws DefinitionNotFoundException
     */
    public function getHierarchy($name, $instanceOf = null);
}


text:
package com.lht.justdraw.jcdemo;

import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.Log;

import com.lht.justcanvas.common.CloneablePaint;
import com.lht.justcanvas.draw.AbstractDraw;
import com.lht.justcanvas.draw.shape.DrawPath;

import java.util.ArrayList;

/**
 * Created by lht on 16/12/23.
 */

public class JCDemoString {

    private final static String LOG_TAG = "JCDemoLog";

    private boolean bNewStart = true;

    private CloneablePaint mPaintStroke = new CloneablePaint();

    private float mStartX = 0, mStartY = 0;
    private Path mPath = new Path();

    private ArrayList<AbstractDraw> mShapeList = new ArrayList<>();
    public ArrayList<AbstractDraw> getShapeList() {
        return mShapeList;
    }

    public void clearShapeList() {
        mShapeList.clear();
    }

    public JCDemoString() {
        mPaintStroke.setStyle(Paint.Style.STROKE);
    }

    public void call(String call) {
        int index = call.indexOf(']');
        int length = call.length();
        String name = call.substring(1, index);
        String[] parameter = null;
        if (index != length - 1) {
            parameter = splitBy(call.substring(index + 1, length), 10, ',');
        }

        switch (name) {
            case "log":
                log(parameter);
                break;
            case "beginPath":
                beginPath();
                break;
            case "closePath":
                closePath();
                break;
            case "stroke":
                stroke();
                break;
            case "moveTo":
                moveTo(parameter);
                break;
            case "lineTo":
                lineTo(parameter);
                break;
            case "arc":
                arc(parameter);
                break;
            case "rect":
                rect(parameter);
                break;
        }
    }

    private void log(String[] parameter) {
        Log.d(LOG_TAG, parameter[0]);
    }

    private void beginPath() {
        mPath = new Path();
        bNewStart = true;
    }

    private void closePath() {
        lineTo(mStartX, mStartY);
    }

    private void stroke() {
        mShapeList.add(new DrawPath(mPath, new CloneablePaint(mPaintStroke)));
    }

    private void moveTo(String[] parameter) {
        moveTo(getFloat(parameter[0]), getFloat(parameter[1]));
    }

    private void moveTo(float x, float y) {
        bNewStart = false;
        mStartX = x;
        mStartY = y;
        mPath.moveTo(mStartX, mStartY);
    }

    private void lineTo(String[] parameter) {
        lineTo(getFloat(parameter[0]), getFloat(parameter[1]));
    }

    private void lineTo(float x, float y) {
        if (bNewStart) {
            moveTo(x, y);
        }
        else {
            mPath.lineTo(x, y);
        }
    }

    private void arc(String[] parameter) {
        float x = getFloat(parameter[0]), y = getFloat(parameter[1]),
                r = getFloat(parameter[2]), sAngle = getFloat(parameter[3]),
                eAngle = getFloat(parameter[4]);
        boolean counterclockwise = getBoolean(parameter[5]);

        RectF rectF = new RectF(x - r, y - r, x + r, y + r);

        //弧度与角度转换
        sAngle = (float)(sAngle / Math.PI * 180);
        eAngle = (float)(eAngle / Math.PI * 180);

        if (counterclockwise) {
            sAngle = -sAngle;
            eAngle = -eAngle;
        }

        mPath.addArc(rectF, sAngle, eAngle - sAngle);
    }

    private void rect(String[] parameter) {
        float x = getFloat(parameter[0]), y = getFloat(parameter[1]),
                width = getFloat(parameter[2]), height = getFloat(parameter[3]);
        mPath.addRect(x, y, x + width, y + height, Path.Direction.CW);
    }

    private int getInt(Object param) {
        return Integer.parseInt(param.toString());
    }

    private float getFloat(Object param) {
        return Float.parseFloat(param.toString());
    }

    private boolean getBoolean(Object param) {
        return Boolean.parseBoolean(param.toString());
    }

    public static String[] splitBy(String content, int size, char symbol) {
        String[] result = new String[size];
        int index = 0, length = content.length(), start, end;
        int[] posForSymbol = new int[size];

        for (int i = 0; i < length; i++) {
            if (content.charAt(i) == symbol) {
                posForSymbol[index++] = i;
            }
        }

        start = 0;
        for (int i = 0; i < index; i++) {
            end = posForSymbol[i];
            result[i] = content.substring(start, end);
            start = end + 1;
        }

        return result;
    }
}


text:
import React, { PureComponent as Component } from "react";
import { A, Icon } from "../common";
import { isAncestor } from "../../util/dom";
import { getGamePlayerOtherRole } from "../../model/game";
import type { GameChannel, GameRole, User } from "../../model";

type Props = {
  currentUser: User,
  game: GameChannel,
  isOurMove: boolean,
  scoring: boolean,
  onPass: (GameChannel) => any,
  onUndo: (GameChannel) => any,
  onResign: (GameChannel) => any,
  onLeaveGame: Function,
  onAddTime: (game: GameChannel, role: GameRole, seconds: number) => any,
  onDoneScoring: (GameChannel) => any,
};

type State = {
  moreShowing: boolean,
};

export default class GamePlayActions extends Component<Props, State> {
  state = {
    moreShowing: false,
  };

  _moreEl: any;

  _onDocumentClick = (e: Object) => {
    if (this.state.moreShowing && this._moreEl) {
      if (e.target !== this._moreEl && !isAncestor(e.target, this._moreEl)) {
        this.setState({ moreShowing: false });
      }
    }
  };

  componentDidMount() {
    document.addEventListener("click", this._onDocumentClick);
  }

  componentWillUnmount() {
    document.removeEventListener("click", this._onDocumentClick);
  }

  render() {
    let { isOurMove, scoring } = this.props;
    let { moreShowing } = this.state;
    let passClassName =
      "GamePlayActions-item-button GamePlayActions-pass" +
      (isOurMove ? "" : " GamePlayActions-pass-disabled");
    return (

        {scoring ? (

              Done

        ) : (

              Pass

        )}

            Undo

            Resign

              More <Icon name="angle-down" />

            {moreShowing ? (

                  Add 1 Minute

                  Add 5 Minutes

                  Leave Game

            ) : null}

    );
  }

  _setMoreEl = (ref: HTMLElement | null) => {
    this._moreEl = ref;
  };

  _onPass = () => {
    if (this.props.isOurMove) {
      this.props.onPass(this.props.game);
    }
  };

  _onUndo = () => {
    this.props.onUndo(this.props.game);
  };

  _onResign = () => {
    this.props.onResign(this.props.game);
  };

  _onToggleMore = () => {
    this.setState({ moreShowing: !this.state.moreShowing });
  };

  _onAdd1Minute = () => {
    this._onToggleMore();
    let { currentUser, game, onAddTime } = this.props;
    let otherRole = getGamePlayerOtherRole(currentUser.name, game.players);
    if (otherRole) {
      onAddTime(game, otherRole, 60);
    }
  };

  _onAdd5Minutes = () => {
    this._onToggleMore();
    let { currentUser, game, onAddTime } = this.props;
    let otherRole = getGamePlayerOtherRole(currentUser.name, game.players);
    if (otherRole) {
      onAddTime(game, otherRole, 60 * 5);
    }
  };

  _onLeaveGame = () => {
    this._onToggleMore();
    this.props.onLeaveGame();
  };

  _onDone = () => {
    this.props.onDoneScoring(this.props.game);
  };
}


text:
import { Updater, Matchers } from 'redux-elm'
import { ADD_INPUT } from './action_types'
import textInputUpdater, { init as textInputInit } from '../TextInput/updater'

const initialModel = {
  inputs: {
    geolocation: [
      textInputInit
    ],
    password: [
      textInputInit
    ]
  }
}

export default new Updater(initialModel)
  .case(
    ADD_INPUT,
    (model, { role }) => ({
      ...model,
      inputs: {
        ...model.inputs,
        [role]: [
          ...model.inputs[role],
          textInputInit
        ]
      }
    })
  )
  .case(
    'TextInput',
    (model, action) => {
      const { role, matching } = action
      const idx = parseInt(matching.args.param, 10)

      return {
        ...model,
        inputs: {
          [role]: model.inputs[role].map((textInputModel, inputIdx) => {
            if (inputIdx === idx) {
              return textInputUpdater(textInputModel, action)
            } else {
              return textInputModel
            }
          })
        }
      }
    },
    Matchers.parameterizedMatcher
  )
  .toReducer()


text:
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import { LoginComponent } from './login.component';
import { RegisterComponent } from './register/register.component';

const loginRoutes: Routes = [
    {path: 'login', component: LoginComponent},
    {path: 'register', component: RegisterComponent}
];

@NgModule({
    imports: [
        RouterModule.forChild(loginRoutes)
    ],
    exports: [
        RouterModule
    ]
})
export class LoginRoutingModule {}


text:
class Admin::ArticlesController < Admin::BaseController
  mongosteen

  has_scope :sport_articles, type: :boolean

  json_config methods: [ :test_method ]
end


text:
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Data center-specific AI completes tasks twice as fast)
[#]: via: (https://www.networkworld.com/article/3434597/data-center-specific-ai-completes-tasks-twice-as-fast.html)
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)

Data center-specific AI completes tasks twice as fast
======
Researchers at MIT have developed an artificial intelligence-powered system based on reinforcement learning that could revolutionize data center operations.
Matejmo / Getty Images

Data centers running artificial intelligence (AI) will be significantly more efficient than those operating with hand-edited algorithm schedules, say experts at MIT. The researchers there say they have developed an automated scheduler that speeds cluster jobs by up to 20 or 30 percent, and even faster (2x) in peak periods.

The school's AI job scheduler works on a type of AI called "reinforcement learning" (RL). That's a trial-and-error-based machine-learning method that modifies scheduling decisions depending on actual workloads in a specific cluster. AI, when done right, could supersede the current state-of-the-art method, which is algorithms. They often must be fine-tuned by humans, introducing inefficiency.

"The system could enable data centers to handle the same workload at higher speeds, using fewer resources," [the school says in a news article related to the tech][1]. The MIT researchers say the data center-adapted form of RL could revolutionize operations.

**Also read: [AI boosts data center availability and efficiency][2]**

"If you have a way of doing trial and error using machines, they can try different ways of scheduling jobs and automatically figure out which strategy is better than others," says Hongzi Mao, a student in the university's Department of Electrical Engineering and Computer Science, in the article. "Any slight improvement in utilization, even 1%, can save millions of dollars and a lot of energy."

### What's wrong with today's data center algorithms

The problem with the current algorithms for running tasks on thousands of servers at the same time is that they're not very efficient. Theoretically, they should be, but because workloads (combinations of tasks) are varied, humans get involved in tweaking the performance—a resource, say, might need to be shared between jobs, or some jobs might need to be performed faster than others—but humans can't handle the range or scope of the edits; the job is just too big.

Unfathomable permutations for humans in the manually edited scheduling can include the fact that a lower node (smaller computational task) can't start work until an upper node (larger, more power-requiring computational task) has completed its work. It gets highly complicated allocating the computational resources, the scientists explain.

Decima, MIT's system, can process dynamic graphs (representations) of nodes and edges (edges connect nodes, linking tasks), the school says. That hasn't been possible before with RL because RL hasn't been able to understand the graphs well enough at scale.

"Traditional RL systems are not accustomed to processing such dynamic graphs," MIT says.

MIT's graph-oriented AI is different than other forms of AI that are more commonly used with images. Robots, for example, learn the difference between objects in different scenarios by processing images and getting reward signals when they get it right.

Similar, though, to presenting images to robots, workloads in the Decima system are mimicked until the system, through the receipt of AI reward signals, improves its decisions. A special kind of baselining (comparison to history) then helps Decima figure out which actions are good and which ones are bad, even when the workload sequences only supply poor reward signals due to the complication of the job structures slowing everything down. That baselining is a key differentiator in the MIT system.

"Decima can find opportunities for [scheduling] optimization that are simply too onerous to realize via manual design/tuning processes," says Aditya Akella, a professor at University of Wisconsin at Madison, in the MIT article. The team there has developed a number of high-performance schedulers. "Decima can go a step further," Akella says.

Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.

--------------------------------------------------------------------------------

via: https://www.networkworld.com/article/3434597/data-center-specific-ai-completes-tasks-twice-as-fast.html

作者:[Patrick Nelson][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

[a]: https://www.networkworld.com/author/Patrick-Nelson/
[b]: https://github.com/lujun9972
[1]: http://news.mit.edu/2019/decima-data-processing-0821
[2]: https://www.networkworld.com/article/3274654/ai-boosts-data-center-availability-efficiency.html
[3]: https://www.facebook.com/NetworkWorld/
[4]: https://www.linkedin.com/company/network-world


text:
// ==========================================================================
// Project:  Ember Runtime
// Copyright: ©2011 Strobe Inc.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================
/*globals testBoth */

require('ember-runtime/~tests/props_helper');

module('Function.prototype.observes() helper');

testBoth('global observer helper takes multiple params', function(get, set) {

  if (Ember.EXTEND_PROTOTYPES === false) {
    ok('Function.prototype helper disabled');
    return ;
  }

  var MyMixin = Ember.Mixin.create({

    count: 0,

    foo: function() {
      set(this, 'count', get(this, 'count')+1);
    }.observes('bar', 'baz')

  });

  var obj = Ember.mixin({}, MyMixin);
  equal(get(obj, 'count'), 0, 'should not invoke observer immediately');

  set(obj, 'bar', "BAZ");
  set(obj, 'baz', "BAZ");
  equal(get(obj, 'count'), 2, 'should invoke observer after change');
});


text:
  Neuilly-le-Brignon est
       un village
       géographiquement positionné dans le département de l'Indre-et-Loire en Centre. On dénombrait 315 habitants en 2008.

À coté de Neuilly-le-Brignon sont localisées les villes de
Saint-Rémy-sur-Creuse localisée à 7 km, 401 habitants,
Paulmy localisée à 3 km, 259 habitants,
Buxeuil à 8 km, 925 habitants,
Cussay localisée à 5 km, 562 habitants,
Descartes à 6 km, 3 855 habitants,
La Celle-Guenand à 8 km, 371 habitants,
 entre autres. De plus, Neuilly-le-Brignon est située à seulement 25 km de Châtellerault.

Si vous envisagez de venir habiter à Neuilly-le-Brignon, vous pourrez aisément trouver une maison à vendre.

La commune compte quelques  équipements, elle dispose, entre autres, de un terrain de sport et une boucle de randonnée.

Le nombre de logements, à Neuilly-le-Brignon, était réparti en 2011 en un appartements et 179 maisons soit
 un marché plutôt équilibré.