code stringlengths 4 991k | repo_name stringlengths 6 116 | path stringlengths 4 249 | language stringclasses 30 values | license stringclasses 15 values | size int64 4 991k | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|
/**
* Copyright 2012-2018, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
module.exports = {
moduleType: 'locale',
name: 'gu',
dictionary: {},
format: {
days: ['રવિવાર', 'સોમવાર', 'મંગળવાર', 'બુધવાર', 'ગુરુવાર', 'શુક્રવાર', 'શનિવાર'],
shortDays: ['રવિ', 'સોમ', 'મંગળ', 'બુધ', 'ગુરુ', 'શુક્ર', 'શનિ'],
months: [
'જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન',
'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટેમ્બર', 'ઑક્ટોબર', 'નવેમ્બર', 'ડિસેમ્બર'
],
shortMonths: [
'જાન્યુ', 'ફેબ્રુ', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન',
'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટે', 'ઑક્ટો', 'નવે', 'ડિસે'
],
date: '%d-%b-%Y'
}
};
| iongroup/plotly.js | lib/locales/gu.js | JavaScript | mit | 1,238 | [
30522,
1013,
1008,
1008,
1008,
9385,
2262,
1011,
2760,
1010,
5436,
2135,
1010,
4297,
1012,
1008,
2035,
2916,
9235,
1012,
1008,
1008,
2023,
3120,
3642,
2003,
7000,
2104,
1996,
10210,
6105,
2179,
1999,
1996,
1008,
6105,
5371,
1999,
1996,
71... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# This migration comes from curation_concerns (originally 20160427155928)
class CreateOperations < ActiveRecord::Migration
def change
create_table :curation_concerns_operations do |t|
t.string :status
t.string :operation_type
t.string :job_class
t.string :job_id
t.string :type # For Single Table Inheritance
t.text :message
t.references :user, index: true, foreign_key: true
t.integer :parent_id, null: true, index: true
t.integer :lft, null: false, index: true
t.integer :rgt, null: false, index: true
# optional fields
t.integer :depth, null: false, default: 0
t.integer :children_count, null: false, default: 0
t.timestamps null: false
end
end
end
| pulibrary/plum | db/migrate/20170103194041_create_operations.hyrax.rb | Ruby | apache-2.0 | 751 | [
30522,
1001,
2023,
30524,
2795,
1024,
12731,
8156,
1035,
5936,
1035,
3136,
2079,
1064,
1056,
1064,
1056,
1012,
5164,
1024,
3570,
1056,
1012,
5164,
1024,
3169,
1035,
2828,
1056,
1012,
5164,
1024,
3105,
1035,
2465,
1056,
1012,
5164,
1024,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
use super::Cursor;
use crate::msgpack::decode::*;
#[test]
fn from_fixext1_read_fixext1() {
let buf: &[u8] = &[0xd4, 0x01, 0x02];
let mut cur = Cursor::new(buf);
assert_eq!((1, 2), read_fixext1(&mut cur).unwrap());
assert_eq!(3, cur.position());
}
#[test]
fn from_fixext2_read_fixext2() {
let buf = [0xd5, 0x01, 0x00, 0x02];
let mut cur = Cursor::new(&buf[..]);
assert_eq!((1, [0x00, 0x02]), read_fixext2(&mut cur).unwrap());
assert_eq!(4, cur.position());
}
#[test]
fn from_fixext4_read_fixext4() {
let buf = [0xd6, 0x01, 0x00, 0x00, 0x00, 0x02];
let mut cur = Cursor::new(&buf[..]);
assert_eq!((1, [0x00, 0x00, 0x00, 0x02]), read_fixext4(&mut cur).unwrap());
assert_eq!(6, cur.position());
}
#[test]
fn from_fixext8_read_fixext8() {
let buf = [0xd7, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08];
let mut cur = Cursor::new(&buf[..]);
assert_eq!((1, [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]),
read_fixext8(&mut cur).unwrap());
assert_eq!(10, cur.position());
}
#[test]
fn from_fixext16_read_fixext16() {
let buf = [
0xd8,
0x01,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
];
let mut cur = Cursor::new(&buf[..]);
assert_eq!((1, [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]),
read_fixext16(&mut cur).unwrap());
assert_eq!(18, cur.position());
}
#[test]
fn from_fixext1_read_ext_meta() {
let buf: &[u8] = &[0xd4, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 1 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(2, cur.position());
}
#[test]
fn from_fixext2_read_ext_meta() {
let buf: &[u8] = &[0xd5, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 2 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(2, cur.position());
}
#[test]
fn from_fixext4_read_ext_meta() {
let buf: &[u8] = &[0xd6, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 4 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(2, cur.position());
}
#[test]
fn from_fixext8_read_ext_meta() {
let buf: &[u8] = &[0xd7, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 8 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(2, cur.position());
}
#[test]
fn from_fixext16_read_ext_meta() {
let buf: &[u8] = &[0xd8, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 16 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(2, cur.position());
}
#[test]
fn from_ext8_read_ext_meta() {
let buf: &[u8] = &[0xc7, 0xff, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 255 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(3, cur.position());
}
#[test]
fn from_ext16_read_ext_meta() {
let buf: &[u8] = &[0xc8, 0xff, 0xff, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 65535 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(4, cur.position());
}
#[test]
fn from_ext32_read_ext_meta() {
let buf: &[u8] = &[0xc9, 0xff, 0xff, 0xff, 0xff, 0x01];
let mut cur = Cursor::new(buf);
assert_eq!(ExtMeta { typeid: 1, size: 4294967295 }, read_ext_meta(&mut cur).unwrap());
assert_eq!(6, cur.position());
}
| 3Hren/msgpack-rust | rmp/tests/func/decode/ext.rs | Rust | mit | 3,471 | [
30522,
2224,
3565,
1024,
1024,
12731,
25301,
2099,
1025,
2224,
27297,
1024,
1024,
5796,
21600,
8684,
1024,
1024,
21933,
3207,
1024,
1024,
1008,
1025,
1001,
1031,
3231,
1033,
1042,
2078,
2013,
1035,
8081,
10288,
2102,
2487,
1035,
3191,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using Microsoft.CodeAnalysis;
namespace ErrorProne.NET.Extensions
{
public static class SyntaxNodeExtensions
{
public static IEnumerable<SyntaxNode> EnumerateParents(this SyntaxNode node)
{
Contract.Requires(node != null);
while (node.Parent != null)
{
yield return node.Parent;
node = node.Parent;
}
}
}
} | SergeyTeplyakov/ErrorProne.NET | src/ErrorProne.NET/ErrorProne.NET/Extensions/SyntaxNodeExtensions.cs | C# | mit | 496 | [
30522,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
16474,
2015,
1012,
8311,
1025,
2478,
7513,
1012,
3642,
25902,
1025,
3415,
15327,
7561,
21572,
2638,
1012,
5658,
1012,
14305,
1063,
2270,
10763,
2465,
20231,
3630,
26095,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Backend\Modules\Locale\Actions;
/*
* This file is part of Fork CMS.
*
* For the full copyright and license information, please view the license
* file that was distributed with this source code.
*/
use Common\Uri as CommonUri;
use Backend\Core\Engine\Base\ActionEdit as BackendBaseActionEdit;
use Backend\Core\Engine\Authentication as BackendAuthentication;
use Backend\Core\Engine\Form as BackendForm;
use Backend\Core\Language\Language as BL;
use Backend\Core\Engine\Model as BackendModel;
use Backend\Modules\Locale\Engine\Model as BackendLocaleModel;
/**
* This is the edit action, it will display a form to edit an existing locale item.
*/
class Edit extends BackendBaseActionEdit
{
/**
* Filter variables
*
* @var array
*/
private $filter;
/**
* @var string
*/
private $filterQuery;
/**
* Execute the action
*/
public function execute()
{
$this->id = $this->getParameter('id', 'int');
// does the item exists
if ($this->id !== null && BackendLocaleModel::exists($this->id)) {
parent::execute();
$this->setFilter();
$this->getData();
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
} else {
$this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
}
}
/**
* Get the data
*/
private function getData()
{
$this->record = BackendLocaleModel::get($this->id);
}
/**
* Load the form
*/
private function loadForm()
{
$this->frm = new BackendForm('edit', BackendModel::createURLForAction(null, null, null, array('id' => $this->id)) . $this->filterQuery);
$this->frm->addDropdown('application', array('Backend' => 'Backend', 'Frontend' => 'Frontend'), $this->record['application']);
$this->frm->addDropdown('module', BackendModel::getModulesForDropDown(), $this->record['module']);
$this->frm->addDropdown('type', BackendLocaleModel::getTypesForDropDown(), $this->record['type']);
$this->frm->addText('name', $this->record['name']);
$this->frm->addTextarea('value', $this->record['value'], null, null, true);
$this->frm->addDropdown('language', BL::getWorkingLanguages(), $this->record['language']);
}
/**
* Parse the form
*/
protected function parse()
{
parent::parse();
// prevent XSS
$filter = \SpoonFilter::arrayMapRecursive('htmlspecialchars', $this->filter);
// parse filter
$this->tpl->assign($filter);
$this->tpl->assign('filterQuery', $this->filterQuery);
// assign id, name
$this->tpl->assign('name', $this->record['name']);
$this->tpl->assign('id', $this->record['id']);
}
/**
* Sets the filter based on the $_GET array.
*/
private function setFilter()
{
$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();
$this->filter['application'] = $this->getParameter('application');
$this->filter['module'] = $this->getParameter('module');
$this->filter['type'] = $this->getParameter('type', 'array');
$this->filter['name'] = $this->getParameter('name');
$this->filter['value'] = $this->getParameter('value');
// build query for filter
$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);
}
/**
* Validate the form
*/
private function validateForm()
{
if ($this->frm->isSubmitted()) {
$this->frm->cleanupFields();
// redefine fields
$txtName = $this->frm->getField('name');
$txtValue = $this->frm->getField('value');
// name checks
if ($txtName->isFilled(BL::err('FieldIsRequired'))) {
// allowed regex (a-z and 0-9)
if ($txtName->isValidAgainstRegexp('|^([a-z0-9])+$|i', BL::err('InvalidName'))) {
// first letter does not seem to be a capital one
if (!in_array(mb_substr($txtName->getValue(), 0, 1), range('A', 'Z'))) {
$txtName->setError(BL::err('InvalidName'));
} else {
// check if exists
if (BackendLocaleModel::existsByName($txtName->getValue(), $this->frm->getField('type')->getValue(), $this->frm->getField('module')->getValue(), $this->frm->getField('language')->getValue(), $this->frm->getField('application')->getValue(), $this->id)) {
$txtName->setError(BL::err('AlreadyExists'));
}
}
}
}
// value checks
if ($txtValue->isFilled(BL::err('FieldIsRequired'))) {
// in case this is a 'act' type, there are special rules concerning possible values
if ($this->frm->getField('type')->getValue() == 'act') {
if (rawurlencode($txtValue->getValue()) != CommonUri::getUrl($txtValue->getValue())) {
$txtValue->addError(BL::err('InvalidValue'));
}
}
}
// module should be 'Core' for any other application than backend
if ($this->frm->getField('application')->getValue() != 'Backend' && $this->frm->getField('module')->getValue() != 'Core') {
$this->frm->getField('module')->setError(BL::err('ModuleHasToBeCore', $this->getModule()));
}
if ($this->frm->isCorrect()) {
// build item
$item['id'] = $this->id;
$item['user_id'] = BackendAuthentication::getUser()->getUserId();
$item['language'] = $this->frm->getField('language')->getValue();
$item['application'] = $this->frm->getField('application')->getValue();
$item['module'] = $this->frm->getField('module')->getValue();
$item['type'] = $this->frm->getField('type')->getValue();
$item['name'] = $this->frm->getField('name')->getValue();
$item['value'] = $this->frm->getField('value')->getValue();
$item['edited_on'] = BackendModel::getUTCDate();
// update item
BackendLocaleModel::update($item);
// trigger event
BackendModel::triggerEvent($this->getModule(), 'after_edit', array('item' => $item));
// everything is saved, so redirect to the overview
$this->redirect(BackendModel::createURLForAction('Index', null, null, null) . '&report=edited&var=' . rawurlencode($item['name']) . '&highlight=row-' . $item['id'] . $this->filterQuery);
}
}
}
}
| Thijzer/forkcms | src/Backend/Modules/Locale/Actions/Edit.php | PHP | mit | 6,990 | [
30522,
1026,
1029,
25718,
3415,
15327,
2067,
10497,
1032,
14184,
1032,
2334,
2063,
1032,
4506,
1025,
1013,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
9292,
4642,
2015,
1012,
1008,
1008,
2005,
1996,
2440,
9385,
1998,
6105,
2592,
1010,
3531,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base data-ice="baseUrl" href="../../../../">
<title data-ice="title">SubscriptionCondition | Service Framework API Document</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
<script src="script/prettify/prettify.js"></script>
<script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">
<header>
<a href="./">Home</a>
<a href="identifiers.html">Reference</a>
<a href="source.html">Source</a>
<a href="test.html" data-ice="testLink">Test</a>
<div class="search-box">
<span>
<img src="./image/search.png">
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
</span>
<ul class="search-result"></ul>
</div>
</header>
<nav class="navigation" data-ice="nav"><div>
<ul>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">allocation</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/allocation/AddressAllocation.js~AddressAllocation.html">AddressAllocation</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">bus</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/bus/Bus.js~Bus.html">Bus</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/bus/MessageBus.js~MessageBus.html">MessageBus</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/bus/MiniBus.js~MiniBus.html">MiniBus</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/bus/Pipeline.js~Pipeline.html">Pipeline</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">discovery</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/discovery/CoreDiscovery.js~CoreDiscovery.html">CoreDiscovery</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">graphconnector</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/graphconnector/BloomFilter.js~BloomFilter.html">BloomFilter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/graphconnector/GlobalRegistryRecord.js~GlobalRegistryRecord.html">GlobalRegistryRecord</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/graphconnector/GraphConnector.js~GraphConnector.html">GraphConnector</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/graphconnector/GraphConnectorContactData.js~GraphConnectorContactData.html">GraphConnectorContactData</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">identity</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/identity/Crypto.js~Crypto.html">Crypto</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/identity/GuiFake.js~GuiFake.html">GuiFake</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/identity/Identity.js~Identity.html">Identity</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/identity/IdentityModule.js~IdentityModule.html">IdentityModule</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/identity/OpenIdLib.js~OpenIdLib.html">OpenIdLib</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">policy</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/ActionsService.js~ActionsService.html">ActionsService</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/CombiningAlgorithm.js~CombiningAlgorithm.html">CombiningAlgorithm</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/Operators.js~Operators.html">Operators</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/PDP.js~PDP.html">PDP</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/PEP.js~PEP.html">PEP</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/Policy.js~Policy.html">Policy</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/ReThinkCtx.js~ReThinkCtx.html">ReThinkCtx</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/Rule.js~Rule.html">Rule</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">policy/combiningAlgorithms</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/combiningAlgorithms/AllowOverrides.js~AllowOverrides.html">AllowOverrides</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/combiningAlgorithms/BlockOverrides.js~BlockOverrides.html">BlockOverrides</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/combiningAlgorithms/FirstApplicable.js~FirstApplicable.html">FirstApplicable</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">policy/conditions</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/conditions/AdvancedCondition.js~AdvancedCondition.html">AdvancedCondition</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/conditions/Condition.js~Condition.html">Condition</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/conditions/SubscriptionCondition.js~SubscriptionCondition.html">SubscriptionCondition</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">policy/context</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/policy/context/RuntimeCoreCtx.js~RuntimeCoreCtx.html">RuntimeCoreCtx</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">protostub</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/protostub/IdpProxyStub.js~IdpProxyStub.html">IdpProxyStub</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-activate">activate</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">registry</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/registry/HypertyInstance.js~HypertyInstance.html">HypertyInstance</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/registry/Registry.js~Registry.html">Registry</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/registry/RegistryDataModel.js~RegistryDataModel.html">RegistryDataModel</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">runtime</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/runtime/Descriptors.js~Descriptors.html">Descriptors</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/runtime/Loader.js~Loader.html">Loader</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/runtime/RuntimeUA.js~RuntimeUA.html">RuntimeUA</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-runtimeConfiguration">runtimeConfiguration</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-runtimeUtils">runtimeUtils</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">sandbox</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/sandbox/Sandbox.js~Sandbox.html">Sandbox</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/sandbox/SandboxRegistry.js~SandboxRegistry.html">SandboxRegistry</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SandboxType">SandboxType</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">store-objects</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/store-objects/DataObjectsStorage.js~DataObjectsStorage.html">DataObjectsStorage</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">syncher</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/syncher/ObserverObject.js~ObserverObject.html">ObserverObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/syncher/ReporterObject.js~ReporterObject.html">ReporterObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/syncher/Subscription.js~Subscription.html">Subscription</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/syncher/SyncherManager.js~SyncherManager.html">SyncherManager</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">utils</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/utils/EventEmitter.js~EventEmitter.html">EventEmitter</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-schemaValidation">schemaValidation</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-assign">assign</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-buildURL">buildURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-checkAttribute">checkAttribute</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-convertToUserURL">convertToUserURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-deepClone">deepClone</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-divideEmail">divideEmail</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-divideURL">divideURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-emptyObject">emptyObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateGUID">generateGUID</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getConfigurationResources">getConfigurationResources</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getUserEmailFromURL">getUserEmailFromURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getUserIdentityDomain">getUserIdentityDomain</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getUserURLFromEmail">getUserURLFromEmail</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isBackendServiceURL">isBackendServiceURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isDataObjectURL">isDataObjectURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isHypertyURL">isHypertyURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isLegacy">isLegacy</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isURL">isURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isUserURL">isUserURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-parseAttributes">parseAttributes</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-removePathFromURL">removePathFromURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-splitObjectURL">splitObjectURL</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-tv4">tv4</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-divideURL">divideURL</a></span></span></li>
</ul>
</div>
</nav>
<div class="content" data-ice="content"><div class="header-notice">
<div data-ice="importPath" class="import-path"><pre class="prettyprint"><code data-ice="importPathCode">import SubscriptionCondition from '<span><a href="file/src/policy/conditions/SubscriptionCondition.js.html#lineNumber30">runtime-core/src/policy/conditions/SubscriptionCondition.js</a></span>'</code></pre></div>
<span data-ice="access">public</span>
<span data-ice="kind">class</span>
<span data-ice="source">| <span><a href="file/src/policy/conditions/SubscriptionCondition.js.html#lineNumber30">source</a></span></span>
</div>
<div class="self-detail detail">
<h1 data-ice="name">SubscriptionCondition</h1>
<div class="flat-list" data-ice="extendsChain"><h4>Extends:</h4><div><span><a href="class/src/policy/conditions/Condition.js~Condition.html">Condition</a></span> → SubscriptionCondition</div></div>
</div>
<div data-ice="constructorSummary"><h2>Constructor Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3">Public Constructor</td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/policy/conditions/SubscriptionCondition.js~SubscriptionCondition.html#instance-constructor-constructor">constructor</a></span></span><span data-ice="signature">(attribute: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, operator: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, params: <span>*</span>)</span>
</p>
</div>
<div>
<div data-ice="description"><p>Creates a new SubscriptionCondition.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div data-ice="methodSummary"><h2>Method Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3">Public Methods</td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/policy/conditions/SubscriptionCondition.js~SubscriptionCondition.html#instance-method-isApplicable">isApplicable</a></span></span><span data-ice="signature">(context: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, message: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Verifies if the subscription condition is applicable to the message.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div class="inherited-summary" data-ice="inheritedSummary"><h2>Inherited Summary</h2><table class="summary" data-ice="summary">
<thead><tr><td data-ice="title" colspan="3"><span class="toggle closed"></span> From class <span><a href="class/src/policy/conditions/Condition.js~Condition.html">Condition</a></span></td></tr></thead>
<tbody>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/policy/conditions/Condition.js~Condition.html#instance-member-attribute">attribute</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/policy/conditions/Condition.js~Condition.html#instance-member-operator">operator</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/policy/conditions/Condition.js~Condition.html#instance-member-operators">operators</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/policy/conditions/Condition.js~Condition.html#instance-member-params">params</a></span></span><span data-ice="signature">: <span>*</span></span>
</p>
</div>
<div>
</div>
</td>
<td>
</td>
</tr>
<tr data-ice="target">
<td>
<span class="access" data-ice="access">public</span>
<span class="override" data-ice="override"></span>
</td>
<td>
<div>
<p>
<span data-ice="name"><span><a href="class/src/policy/conditions/Condition.js~Condition.html#instance-method-isApplicable">isApplicable</a></span></span><span data-ice="signature">(context: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, message: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span>*</span></span>
</p>
</div>
<div>
<div data-ice="description"><p>Verifies if the condition is applicable to the message.</p>
</div>
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div data-ice="constructorDetails"><h2 data-ice="title">Public Constructors</h2>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-constructor-constructor">
<span class="access" data-ice="access">public</span>
<span data-ice="name">constructor</span><span data-ice="signature">(attribute: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, operator: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span>, params: <span>*</span>)</span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/policy/conditions/SubscriptionCondition.js.html#lineNumber39">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>Creates a new SubscriptionCondition.</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/policy/conditions/Condition.js~Condition.html#instance-constructor-constructor">Condition#constructor</a></span></div>
<div data-ice="properties"><div data-ice="properties">
<h4 data-ice="title">Params:</h4>
<table class="params">
<thead>
<tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
</thead>
<tbody>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">attribute</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"></td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">operator</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"></td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">params</td>
<td data-ice="type"><span>*</span></td>
<td data-ice="appendix"></td>
<td data-ice="description"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div data-ice="methodDetails"><h2 data-ice="title">Public Methods</h2>
<div class="detail" data-ice="detail">
<h3 data-ice="anchor" id="instance-method-isApplicable">
<span class="access" data-ice="access">public</span>
<span data-ice="name">isApplicable</span><span data-ice="signature">(context: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, message: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></span>
<span class="right-info">
<span data-ice="source"><span><a href="file/src/policy/conditions/SubscriptionCondition.js.html#lineNumber48">source</a></span></span>
</span>
</h3>
<div data-ice="description"><p>Verifies if the subscription condition is applicable to the message. First, verifies if the message is of the subscription type; second, verifies if the message is from a remote runtime to guarantee that the subscription is being validated in the destination runtime; third, verifies if the subscription preference is met.</p>
</div>
<div data-ice="override"><h4>Override:</h4><span><a href="class/src/policy/conditions/Condition.js~Condition.html#instance-method-isApplicable">Condition#isApplicable</a></span></div>
<div data-ice="properties"><div data-ice="properties">
<h4 data-ice="title">Params:</h4>
<table class="params">
<thead>
<tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
</thead>
<tbody>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">context</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"><p>environment where the Policy Engine is being used</p>
</td>
</tr>
<tr data-ice="property" data-depth="0">
<td data-ice="name" data-depth="0">message</td>
<td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
<td data-ice="appendix"></td>
<td data-ice="description"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="return-params" data-ice="returnParams">
<h4>Return:</h4>
<table>
<tbody>
<tr>
<td class="return-type" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></span></td>
</tr>
</tbody>
</table>
<div data-ice="returnProperties">
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.5.2)</span><img src="./image/esdoc-logo-mini-black.png"></a>
</footer>
<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
| reTHINK-project/dev-runtime-core | docs/api/class/src/policy/conditions/SubscriptionCondition.js~SubscriptionCondition.html | HTML | apache-2.0 | 29,325 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
2918,
2951,
1011,
3256,
1027,
1000,
2918,
3126,
2140,
1000,
17850,
12879,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using SuperSocket.Common;
using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Config;
using SuperSocket.SocketBase.Logging;
using SuperSocket.SocketBase.Provider;
using SuperSocket.SocketEngine.Configuration;
using SuperSocket.SocketBase.Metadata;
namespace SuperSocket.SocketEngine
{
class AppDomainWorkItemFactoryInfoLoader : WorkItemFactoryInfoLoader
{
public AppDomainWorkItemFactoryInfoLoader(IConfigurationSource config, ILogFactory passedInLogFactory)
: base(config, passedInLogFactory)
{
InitliazeValidationAppDomain();
}
public AppDomainWorkItemFactoryInfoLoader(IConfigurationSource config)
: base(config)
{
InitliazeValidationAppDomain();
}
private AppDomain m_ValidationAppDomain;
private TypeValidator m_Validator;
private void InitliazeValidationAppDomain()
{
m_ValidationAppDomain = AppDomain.CreateDomain("ValidationDomain", AppDomain.CurrentDomain.Evidence, AppDomain.CurrentDomain.BaseDirectory, string.Empty, false);
var validatorType = typeof(TypeValidator);
m_Validator = (TypeValidator)m_ValidationAppDomain.CreateInstanceAndUnwrap(validatorType.Assembly.FullName, validatorType.FullName);
}
protected override string ValidateProviderType(string typeName)
{
if (!m_Validator.ValidateTypeName(typeName))
throw new Exception(string.Format("Failed to load type {0}!", typeName));
return typeName;
}
protected override ServerTypeMetadata GetServerTypeMetadata(string typeName)
{
return m_Validator.GetServerTypeMetadata(typeName);
}
public override void Dispose()
{
if (m_ValidationAppDomain != null)
{
AppDomain.Unload(m_ValidationAppDomain);
m_ValidationAppDomain = null;
}
base.Dispose();
}
}
class DefaultBootstrapAppDomainWrap : DefaultBootstrap
{
private IBootstrap m_Bootstrap;
public DefaultBootstrapAppDomainWrap(IBootstrap bootstrap, IConfigurationSource config, string startupConfigFile)
: base(config, startupConfigFile)
{
m_Bootstrap = bootstrap;
}
protected override IWorkItem CreateWorkItemInstance(string serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
{
return new AppDomainAppServer(serviceTypeName, serverStatusMetadata);
}
internal override bool SetupWorkItemInstance(IWorkItem workItem, WorkItemFactoryInfo factoryInfo)
{
return workItem.Setup(m_Bootstrap, factoryInfo.Config, factoryInfo.ProviderFactories.ToArray());
}
internal override WorkItemFactoryInfoLoader GetWorkItemFactoryInfoLoader(IConfigurationSource config, ILogFactory logFactory)
{
return new AppDomainWorkItemFactoryInfoLoader(config, logFactory);
}
}
/// <summary>
/// AppDomainBootstrap
/// </summary>
partial class AppDomainBootstrap : MarshalByRefObject, ILoggerProvider, IBootstrap, IDisposable
{
private IBootstrap m_InnerBootstrap;
/// <summary>
/// Gets all the app servers running in this bootstrap
/// </summary>
public IEnumerable<IWorkItem> AppServers
{
get { return m_InnerBootstrap.AppServers; }
}
/// <summary>
/// Gets the config.
/// </summary>
public IRootConfig Config
{
get { return m_InnerBootstrap.Config; }
}
/// <summary>
/// Gets the bootstrap logger.
/// </summary>
ILog ILoggerProvider.Logger
{
get
{
var loggerProvider = m_InnerBootstrap as ILoggerProvider;
if (loggerProvider == null)
return null;
return loggerProvider.Logger;
}
}
/// <summary>
/// Gets the startup config file.
/// </summary>
public string StartupConfigFile
{
get { return m_InnerBootstrap.StartupConfigFile; }
}
/// <summary>
/// Initializes a new instance of the <see cref="AppDomainBootstrap"/> class.
/// </summary>
public AppDomainBootstrap(IConfigurationSource config)
{
string startupConfigFile = string.Empty;
if (config == null)
throw new ArgumentNullException("config");
var configSectionSource = config as ConfigurationSection;
if (configSectionSource != null)
startupConfigFile = configSectionSource.GetConfigSource();
//Keep serializable version of configuration
if(!config.GetType().IsSerializable)
config = new ConfigurationSource(config);
//Still use raw configuration type to bootstrap
m_InnerBootstrap = CreateBootstrapWrap(this, config, startupConfigFile);
AppDomain.CurrentDomain.SetData("Bootstrap", this);
}
protected virtual IBootstrap CreateBootstrapWrap(IBootstrap bootstrap, IConfigurationSource config, string startupConfigFile)
{
return new DefaultBootstrapAppDomainWrap(this, config, startupConfigFile);
}
/// <summary>
/// Initializes the bootstrap with the configuration
/// </summary>
/// <returns></returns>
public bool Initialize()
{
return m_InnerBootstrap.Initialize();
}
/// <summary>
/// Initializes the bootstrap with the configuration and config resolver.
/// </summary>
/// <param name="serverConfigResolver">The server config resolver.</param>
/// <returns></returns>
public bool Initialize(Func<IServerConfig, IServerConfig> serverConfigResolver)
{
return m_InnerBootstrap.Initialize(serverConfigResolver);
}
/// <summary>
/// Initializes the bootstrap with the configuration and config resolver.
/// </summary>
/// <param name="logFactory">The log factory.</param>
/// <returns></returns>
public bool Initialize(ILogFactory logFactory)
{
return m_InnerBootstrap.Initialize(logFactory);
}
/// <summary>
/// Initializes the bootstrap with a listen endpoint replacement dictionary
/// </summary>
/// <param name="listenEndPointReplacement">The listen end point replacement.</param>
/// <returns></returns>
public bool Initialize(IDictionary<string, System.Net.IPEndPoint> listenEndPointReplacement)
{
return m_InnerBootstrap.Initialize(listenEndPointReplacement);
}
/// <summary>
/// Initializes the bootstrap with the configuration
/// </summary>
/// <param name="serverConfigResolver">The server config resolver.</param>
/// <param name="logFactory">The log factory.</param>
/// <returns></returns>
public bool Initialize(Func<IServerConfig, IServerConfig> serverConfigResolver, ILogFactory logFactory)
{
if (logFactory != null)
throw new Exception("You cannot pass in logFactory, if your isolation level is AppDomain!");
return m_InnerBootstrap.Initialize(serverConfigResolver, logFactory);
}
/// <summary>
/// Starts this bootstrap.
/// </summary>
/// <returns></returns>
public StartResult Start()
{
return m_InnerBootstrap.Start();
}
/// <summary>
/// Stops this bootstrap.
/// </summary>
public void Stop()
{
m_InnerBootstrap.Stop();
}
public string BaseDirectory
{
get { return m_InnerBootstrap.BaseDirectory; }
}
void IDisposable.Dispose()
{
var disposableBootstrap = m_InnerBootstrap as IDisposable;
if (disposableBootstrap != null)
disposableBootstrap.Dispose();
}
}
}
| jmptrader/SuperSocket | SocketEngine/AppDomainBootstrap.cs | C# | apache-2.0 | 8,407 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
9563,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
2478,
3565,
6499,
19869,
2102,
1012,
2691,
1025,
2478,
3565,
6499,
19869,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# coding: utf-8
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.mixins import UserPassesTestMixin
from django.views.generic import ListView
from django.views import View
from django.db.models import Q
import posgradmin.models as models
from posgradmin import authorization as auth
from django.conf import settings
from django.shortcuts import render, HttpResponseRedirect
import posgradmin.forms as forms
from dal import autocomplete
from django.urls import reverse
from django.forms.models import model_to_dict
from pdfrw import PdfReader, PdfWriter, PageMerge
from django.template.loader import render_to_string
from sh import pandoc, mkdir
from tempfile import NamedTemporaryFile
import datetime
from django.utils.text import slugify
from .settings import BASE_DIR, MEDIA_ROOT, MEDIA_URL
class AcademicoAutocomplete(LoginRequiredMixin, UserPassesTestMixin, autocomplete.Select2QuerySetView):
login_url = settings.APP_PREFIX + 'accounts/login/'
def test_func(self):
if auth.is_academico(self.request.user):
if self.request.user.academico.acreditacion in ['D', 'M', 'P', 'E',
'candidato profesor']:
return True
return False
def get_queryset(self):
qs = models.Academico.objects.filter(Q(acreditacion='candidato profesor')
| Q(acreditacion='P')
| Q(acreditacion='M')
| Q(acreditacion='D')
| Q(acreditacion='E'))
if self.q:
qs = qs.filter(Q(user__first_name__istartswith=self.q)
| Q(user__last_name__icontains=self.q))
return qs
class ProponerAsignatura(LoginRequiredMixin, UserPassesTestMixin, View):
login_url = settings.APP_PREFIX + 'accounts/login/'
template = 'posgradmin/proponer_asignatura.html'
form_class = forms.AsignaturaModelForm
def test_func(self):
if auth.is_academico(self.request.user):
if self.request.user.academico.acreditacion in ['D', 'M', 'P',
'candidato profesor']:
return True
return False
def get(self, request, *args, **kwargs):
form = self.form_class(initial={'academicos': [request.user.academico, ]})
breadcrumbs = ((settings.APP_PREFIX + 'inicio/', 'Inicio'),
('', 'Proponer Asignatura')
)
return render(request,
self.template,
{
'title': 'Proponer Asignatura',
'breadcrumbs': breadcrumbs,
'form': form
})
def post(self, request, *args, **kwargs):
form = self.form_class(request.POST, request.FILES)
if form.is_valid():
a = models.Asignatura(
asignatura=request.POST['asignatura'],
tipo='Optativa',
estado='propuesta',
programa=request.FILES['programa'])
a.save()
return HttpResponseRedirect(reverse('inicio'))
else:
print(form.errors)
class SolicitaCurso(LoginRequiredMixin, UserPassesTestMixin, View):
login_url = settings.APP_PREFIX + 'accounts/login/'
template = 'posgradmin/solicita_curso.html'
form_class = forms.CursoModelForm
def test_func(self):
if auth.is_academico(self.request.user):
if self.request.user.academico.acreditacion in ['D', 'M', 'P', 'E',
'candidato profesor']:
return True
return False
def get(self, request, *args, **kwargs):
convocatoria = models.ConvocatoriaCurso.objects.get(pk=int(kwargs['pk']))
if convocatoria.status == 'cerrada':
return HttpResponseRedirect(reverse('mis_cursos'))
asignatura = models.Asignatura.objects.get(pk=int(kwargs['as_id']))
form = self.form_class(initial={'academicos': [request.user.academico, ]})
breadcrumbs = ((settings.APP_PREFIX + 'inicio/', 'Inicio'),
(reverse('elige_asignatura', args=[convocatoria.id,]),
"Convocatoria para cursos %s-%s" % (convocatoria.year, convocatoria.semestre))
)
return render(request,
self.template,
{
'title': 'Solicitar curso',
'breadcrumbs': breadcrumbs,
'convocatoria': convocatoria,
'asignatura': asignatura,
'form': form
})
def post(self, request, *args, **kwargs):
convocatoria = models.ConvocatoriaCurso.objects.get(pk=int(kwargs['pk']))
if convocatoria.status == 'cerrada':
return HttpResponseRedirect(reverse('mis_cursos'))
asignatura = models.Asignatura.objects.get(pk=int(kwargs['as_id']))
form = self.form_class(request.POST)
if form.is_valid():
curso = models.Curso(
convocatoria=convocatoria,
asignatura=asignatura,
year=convocatoria.year,
semestre=convocatoria.semestre,
sede=request.POST['sede'],
aula=request.POST['aula'],
horario=request.POST['horario'])
curso.save()
for ac_id in request.POST.getlist('academicos'):
ac = models.Academico.objects.get(pk=int(ac_id))
curso.academicos.add(ac)
curso.academicos.add(request.user.academico)
curso.save()
return HttpResponseRedirect(reverse('mis_cursos'))
class CursoView(LoginRequiredMixin, UserPassesTestMixin, View):
login_url = settings.APP_PREFIX + 'accounts/login/'
template = 'posgradmin/solicita_curso.html'
form_class = forms.CursoModelForm
def test_func(self):
curso = models.Curso.objects.get(pk=int(self.kwargs['pk']))
if auth.is_academico(self.request.user):
if self.request.user.academico.acreditacion in ['D', 'M', 'P', 'E',
'candidato profesor']:
if self.request.user.academico in curso.academicos.all():
return True
return False
def get(self, request, *args, **kwargs):
curso = models.Curso.objects.get(pk=int(kwargs['pk']))
form = self.form_class(initial=model_to_dict(curso))
breadcrumbs = ((reverse('inicio'), 'Inicio'),
(reverse('mis_cursos'), "Mis cursos"))
return render(request,
self.template,
{
'title': 'Editar curso',
'breadcrumbs': breadcrumbs,
'convocatoria': curso.convocatoria,
'asignatura': curso.asignatura,
'form': form
})
def post(self, request, *args, **kwargs):
curso = models.Curso.objects.get(pk=int(kwargs['pk']))
convocatoria = curso.convocatoria
if convocatoria.status == 'cerrada':
return HttpResponseRedirect(reverse('mis_cursos'))
asignatura = curso.asignatura
form = self.form_class(request.POST)
if form.is_valid():
curso.sede = request.POST['sede']
curso.aula = request.POST['aula']
curso.horario = request.POST['horario']
curso.save()
curso.academicos.clear()
for ac_id in request.POST.getlist('academicos'):
ac = models.Academico.objects.get(pk=int(ac_id))
curso.academicos.add(ac)
curso.save()
return HttpResponseRedirect(reverse('mis_cursos'))
class CursoConstancia(LoginRequiredMixin, UserPassesTestMixin, View):
login_url = settings.APP_PREFIX + 'accounts/login/'
template = 'posgradmin/curso_constancia.html'
form_class = forms.CursoConstancia
def test_func(self):
curso = models.Curso.objects.get(pk=int(self.kwargs['pk']))
if auth.is_academico(self.request.user):
if self.request.user.academico.acreditacion in ['D', 'M', 'P', 'E',
'candidato profesor']:
if self.request.user.academico in curso.academicos.all():
return True
return False
def get(self, request, *args, **kwargs):
curso = models.Curso.objects.get(pk=int(kwargs['pk']))
form = self.form_class(initial=model_to_dict(curso))
breadcrumbs = ((reverse('inicio'), 'Inicio'),
(reverse('mis_cursos'), "Mis cursos"))
return render(request,
self.template,
{
'title': 'Emitir constancia de participación',
'breadcrumbs': breadcrumbs,
'convocatoria': curso.convocatoria,
'asignatura': curso.asignatura,
'form': form
})
def post(self, request, *args, **kwargs):
curso = models.Curso.objects.get(pk=int(kwargs['pk']))
profesor_invitado = request.POST['profesor_invitado']
fecha_participacion = datetime.date(int(request.POST['fecha_de_participación_year']),
int(request.POST['fecha_de_participación_month']),
int(request.POST['fecha_de_participación_day']))
with NamedTemporaryFile(mode='r+', encoding='utf-8') as carta_md:
carta_md.write(
render_to_string('posgradmin/constancia_curso.md',
{'fecha': datetime.date.today(),
'profesor_invitado': profesor_invitado,
'tema': request.POST['tema'],
'curso': curso,
'fecha_participacion': fecha_participacion,
'profesor': request.user.get_full_name() }))
carta_md.seek(0)
outdir = '%s/perfil-academico/%s/' % (MEDIA_ROOT,
request.user.academico.id)
tmpname = 'cursoplain_%s_%s.pdf' % (curso.id,
slugify(profesor_invitado)
)
final_name = tmpname.replace('cursoplain', 'constancia_curso')
mkdir("-p", outdir)
pandoc(carta_md.name, output=outdir + tmpname)
C = PdfReader(outdir + tmpname)
M = PdfReader(BASE_DIR + '/docs/membrete_pcs.pdf')
w = PdfWriter()
merger = PageMerge(M.pages[0])
merger.add(C.pages[0]).render()
w.write(outdir + final_name, M)
return HttpResponseRedirect(MEDIA_URL+"perfil-academico/%s/%s" % (request.user.academico.id, final_name))
class CursoConstanciaEstudiante(LoginRequiredMixin, UserPassesTestMixin, View):
login_url = settings.APP_PREFIX + 'accounts/login/'
template = 'posgradmin/curso_constancia.html'
form_class = forms.CursoConstanciaEstudiante
def test_func(self):
curso = models.Curso.objects.get(pk=int(self.kwargs['pk']))
if auth.is_academico(self.request.user):
if self.request.user.academico.acreditacion in ['D', 'M', 'P', 'E',
'candidato profesor']:
if self.request.user.academico in curso.academicos.all():
return True
return False
def get(self, request, *args, **kwargs):
curso = models.Curso.objects.get(pk=int(kwargs['pk']))
form = self.form_class(initial=model_to_dict(curso))
breadcrumbs = ((reverse('inicio'), 'Inicio'),
(reverse('mis_cursos'), "Mis cursos"))
return render(request,
self.template,
{
'title': 'Emitir constancia para estudiante',
'breadcrumbs': breadcrumbs,
'convocatoria': curso.convocatoria,
'asignatura': curso.asignatura,
'form': form
})
def post(self, request, *args, **kwargs):
curso = models.Curso.objects.get(pk=int(kwargs['pk']))
form = self.form_class(request.POST, request.FILES)
if form.is_valid():
estudiante_invitado = request.POST['estudiante_invitado']
calificacion = request.POST['calificacion']
with NamedTemporaryFile(mode='r+', encoding='utf-8') as carta_md:
carta_md.write(
render_to_string('posgradmin/constancia_curso_estudiante.md',
{'fecha': datetime.date.today(),
'estudiante_invitado': estudiante_invitado,
'calificacion': calificacion,
'curso': curso,
'profesor': request.user.get_full_name() }))
carta_md.seek(0)
outdir = '%s/perfil-academico/%s/' % (MEDIA_ROOT,
request.user.academico.id)
tmpname = 'cursoplain_%s_%s.pdf' % (curso.id,
slugify(estudiante_invitado)
)
final_name = tmpname.replace('cursoplain', 'constancia_curso')
mkdir("-p", outdir)
pandoc(carta_md.name, output=outdir + tmpname)
C = PdfReader(outdir + tmpname)
M = PdfReader(BASE_DIR + '/docs/membrete_pcs.pdf')
w = PdfWriter()
merger = PageMerge(M.pages[0])
merger.add(C.pages[0]).render()
w.write(outdir + final_name, M)
return HttpResponseRedirect(
MEDIA_URL + "perfil-academico/%s/%s" % (request.user.academico.id,
final_name))
else:
return render(request,
self.template,
{
'title': 'Emitir constancia para estudiante',
'breadcrumbs': breadcrumbs,
'convocatoria': curso.convocatoria,
'asignatura': curso.asignatura,
'form': form
})
class EligeAsignatura(LoginRequiredMixin, UserPassesTestMixin, View):
login_url = settings.APP_PREFIX + 'accounts/login/'
template = 'posgradmin/elige_asignatura.html'
def test_func(self):
return auth.is_academico(self.request.user)
def get(self, request, *args, **kwargs):
pk = int(kwargs['pk'])
convocatoria = models.ConvocatoriaCurso.objects.get(pk=pk)
asignaturas = models.Asignatura.objects.filter(
Q(tipo='Optativa') &
(Q(estado='aceptada') | Q(estado='propuesta')))
breadcrumbs = ((settings.APP_PREFIX + 'inicio/', 'Inicio'),
('', "Convocatoria para cursos %s-%s" % (convocatoria.year, convocatoria.semestre))
)
return render(request,
self.template,
{
'title': 'Asignaturas',
'breadcrumbs': breadcrumbs,
'asignaturas': asignaturas,
'convocatoria': convocatoria,
})
class MisEstudiantesView(LoginRequiredMixin, UserPassesTestMixin, ListView):
login_url = settings.APP_PREFIX + 'accounts/login/'
def test_func(self):
return auth.is_academico(self.request.user)
model = models.Estudiante
template_name = 'posgradmin/mis_estudiantes_list.html'
def get_queryset(self):
new_context = self.request.user.academico.estudiantes()
return new_context
class MisCursos(LoginRequiredMixin, UserPassesTestMixin, ListView):
login_url = settings.APP_PREFIX + 'accounts/login/'
def test_func(self):
return auth.is_academico(self.request.user)
model = models.Curso
template_name = 'posgradmin/mis_cursos_list.html'
def get_queryset(self):
return self.request.user.academico.curso_set.all()
def get_context_data(self, **kwargs):
ctxt = super(MisCursos, self).get_context_data(**kwargs)
ctxt['MEDIA_URL'] = MEDIA_URL
return ctxt
| sostenibilidad-unam/posgrado | posgradmin/posgradmin/views_academico.py | Python | gpl-3.0 | 17,170 | [
30522,
1001,
16861,
1024,
21183,
2546,
1011,
1022,
2013,
6520,
23422,
1012,
9530,
18886,
2497,
1012,
8740,
2705,
1012,
4666,
7076,
12324,
8833,
2378,
2890,
15549,
5596,
4328,
20303,
2013,
6520,
23422,
1012,
9530,
18886,
2497,
1012,
8740,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
Template Name: WP Riddle Single Page
*/
?>
<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<title><?php echo esc_attr(get_option('index_page_title')); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="stylesheet" href="<?php echo get_bloginfo('url') . '/wp-includes/css/buttons.min.css'; ?>">
<link rel="stylesheet" href="<?php echo get_bloginfo('url') . '/wp-admin/css/login.min.css'; ?>">
<link rel="stylesheet" href="<?php echo plugin_dir_url(__FILE__);?>../css/single.css">
<link rel="stylesheet" href="<?php echo plugin_dir_url(__FILE__);?>../css/index.css">
<link rel='stylesheet' id='open-sans-css' href='//fonts.useso.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=4.0' type='text/css' media='all' />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
<![endif]-->
</head>
<body class="login login-action-login wp-core-ui">
<ul id="pjax_nav">
<li class="left"><a href="<?php echo home_url(); ?>/" class="pjax"><?php echo esc_attr(get_option('index_page_heading')); ?></a></li>
<li class="right"><a href="<?php echo wp_logout_url(); ?>">Logout</a></li>
<li class="right"><?php
global $current_user;
get_currentuserinfo();
if (current_user_can("administrator"))
echo "<a href='wp-admin/'>" . $current_user->user_login . "</a>";
else
echo "<span id='username'>" . $current_user->user_login . "</span>";
?></li>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'pjax' ) ); ?>
</ul>
<div id="pjax_layer" class="fade-out"></div>
<div class="pjax_content">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<a href="<?php echo home_url(); ?>/" class="pjax">Back</a>
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<form id="loginform" name="keyform" method="post" action="<?php echo admin_url();?>admin-post.php">
<p>
<label for="key"><?php echo esc_attr(get_option('index_page_key_input')); ?><br/>
<input type="text" name="wpr_key" id="key" class="input" value="" placeholder="<?php echo get_option('index_page_input_placeholder'); ?>" autocomplete="off" /></label>
</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Submit" />
<input type="hidden" name="action" value="submit_key" />
</p>
</form>
</div><!-- #content -->
<p id="nav"><?php echo esc_attr(get_option('single_page_footer')); ?></p>
</div><!-- #primary -->
</div>
<script src="<?php echo plugin_dir_url(__FILE__);?>../js/push_state.js"></script>
</body>
</html>
| quietshu/wpriddle | template/wpr_single.php | PHP | mit | 3,458 | [
30522,
1026,
1029,
25718,
1013,
1008,
23561,
2171,
1024,
1059,
2361,
21834,
2309,
3931,
1008,
1013,
1029,
1028,
1026,
999,
9986,
13874,
16129,
1028,
1026,
999,
1011,
1011,
1031,
2065,
29464,
1021,
1033,
1028,
1026,
16129,
2465,
1027,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<div id="graphs-trade-partner" class="container">
<nav class="nav-graph col-xs-12 col-sm-3 col-md-3" >
<h3>{%trans%}Preview{%endtrans%}:</h3>
<div class="list-group panel">
<h4>{% trans %}Trade Balance{% endtrans %}</h4>
<a href="#trade-balance-product" class="list-group-item" data-toggle="collapse" data-parent="#trade-balance-product">{% trans %}Product{% endtrans %}</a>
<div class="collapse" id="trade-balance-product">
<!-- <a href="/{{ g.locale }}/embed/line/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/balance/?time=year"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'trade-balance-product-line' or not graph }}" data-parent="#trade-balance-product">
{% trans %}Line{% endtrans %}
</a> -->
<a href="/{{ g.locale }}/line/secex/type/value?values=value+kg&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-trade-balance-product-line' or not graph}}" data-parent="#new-api-trade-balance-product">
{% trans %}Line{% endtrans %}
</a>
</div>
<h4>{%trans%}Exports By{%endtrans%}</h4>
{% if not is_municipality%}
<a href="#exports-municipality" class="list-group-item" data-toggle="collapse" data-parent="#exports-municipality">{%trans%}Municipality{%endtrans%}</a>
<div class="collapse" id="exports-municipality">
<!-- <a href="/{{ g.locale }}/embed/tree_map/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/bra/?size=export_val&depth=bra_9&color=color"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'exports-municipality-tree_map'}}" data-parent="#exports-municipality">
TreeMap
</a> -->
<a href="/{{ g.locale }}/tree_map/secex/municipality/value?year=2018&type=export{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-municipality-tree_map'}}" data-parent="#new-api-exports-municipality">
TreeMap
</a>
<!-- <a href="/{{ g.locale }}/embed/geo_map/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/bra/?color=export_val"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'exports-municipality-geo_map'}}" data-parent="#exports-municipality">
{%trans%}Map{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/map/secex/value/{{ id_ibge if id_ibge }}?values=value+kg&type=export{% if product.id %}&product={{ product.id }}{% endif %}&year=2018"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-municipality-geo_map'}}" data-parent="#new-api-exports-municipality">
{%trans%}Map{%endtrans%}
</a>
<!-- <a href="/{{ g.locale }}/embed/stacked/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/bra/?y=export_val&layout=value&sort=asc"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'exports-municipality-stacked'}}" data-parent="#exports-municipality">
{%trans%}Stacked{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/stacked/secex/municipality/value?values=value+kg&group=region&depths=region+state+mesoregion+microregion+municipality&type=export{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-municipality-stacked'}}" data-parent="#new-api-exports-municipality">
{%trans%}Stacked{%endtrans%}
</a>
</div>
{% endif %}
<a href="#exports-destination" class="list-group-item" data-toggle="collapse" data-parent="#exports-destination">{%trans%}Destination{%endtrans%}</a>
<div class="collapse" id="exports-destination">
<!-- <a href="/{{ g.locale }}/embed/tree_map/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/wld/?size=export_val&depth=wld_5"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'exports-destination-tree_map'}}" data-parent="#exports-destination">
TreeMap
</a> -->
<a href="/{{ g.locale }}/tree_map/secex/country/value?year=2018&type=export{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-destination-tree_map'}}" data-parent="#new-api-exports-destination">
TreeMap
</a>
<!-- <a href="/{{ g.locale }}/embed/line/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/wld/?y=export_val&color=color"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'exports-destination-line'}}" data-parent="#exports-destination">
{%trans%}Line{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/line/secex/country/value?values=value+kg&type=export&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-destination-line'}}" data-parent="#new-api-exports-destination">
{% trans %}Line{% endtrans %}
</a>
<!-- <a href="/{{ g.locale }}/embed/stacked/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/wld/?y=export_val?y=export_val&time=year&order=color&layout=value&sort=asc&color=color"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'exports-destination-stacked'}}" data-parent="#exports-destination">
{%trans%}Stacked{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/stacked/secex/country/value?values=value+kg&group=continent&depths=continent+country&type=export{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-destination-stacked'}}" data-parent="#new-api-exports-destination">
{%trans%}Stacked{%endtrans%}
</a>
</div>
<a href="#exports-port" class="list-group-item" data-toggle="collapse" data-parent="#exports-port">{%trans%}Port{%endtrans%}</a>
<div class="collapse" id="exports-port">
<a href="/{{ g.locale }}/line/secex/port/value?&values=value+kg&type=export&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge}}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-port-line'}}" data-parent="#exports-port">
{% trans %}Line{% endtrans %}
</a>
<a href="/{{ g.locale }}/bar/secex/value,kg/port?type=export&excluded_year=2018&options=singlecolor,month&product={{product.id}}{{ '&id_ibge=%s' % id_ibge if id_ibge}}{{ '&subtitle=%s' % ('exporting_municipality' if depth == 'municipality' else 'state_production') }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'exports-port-bar'}}" data-parent="#exports-destination">
{%trans%}Bar{%endtrans%}
<a href="/{{ g.locale }}/tree_map/secex/port/value?values=value+kg&type=export&year=2017&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-exports-port-tree_map'}}" data-parent="#new-api-exports-port">
TreeMap
</a>
</div>
<h4>{%trans%}Imports By{%endtrans%}</h4>
{% if not is_municipality%}
<a href="#imports-municipality" class="list-group-item" data-toggle="collapse" data-parent="#imports-municipality">{%trans%}Municipality{%endtrans%}</a>
<div class="collapse" id="imports-municipality">
<!-- <a href="/{{ g.locale }}/embed/tree_map/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/bra/?size=import_val&depth=bra_9&color=color"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'imports-municipality-tree_map'}}" data-parent="#imports-municipality">
TreeMap
</a> -->
<a href="/{{ g.locale }}/tree_map/secex/municipality/value?year=2018&type=import{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-municipality-tree_map'}}" data-parent="#new-api-imports-municipality">
TreeMap
</a>
<!-- <a href="/{{ g.locale }}/embed/geo_map/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/bra/?color=import_val"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'imports-municipality-geo_map'}}" data-parent="#imports-municipality">
{%trans%}Map{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/map/secex/value/{{ id_ibge if id_ibge }}?values=value+kg&type=import{% if product.id %}&product={{ product.id }}{% endif %}&year=2018"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-municipality-geo_map'}}" data-parent="#new-api-imports-municipality">
{%trans%}Map{%endtrans%}
</a>
<!-- <a href="/{{ g.locale }}/embed/stacked/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/bra/?y=import_val&time=year&order=color&layout=value&sort=asc&color=color"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'imports-municipality-stacked'}}" data-parent="#imports-municipality">
{%trans%}Stacked{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/stacked/secex/municipality/value?values=value+kg&group=region&depths=region+state+mesoregion+microregion+municipality&type=import{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-municipality-stacked'}}" data-parent="#new-api-imports-municipality">
{%trans%}Stacked{%endtrans%}
</a>
</div>
{% endif %}
<a href="#imports-origin" class="list-group-item" data-toggle="collapse" data-parent="#imports-origin">{%trans%}Origin{%endtrans%}</a>
<div class="collapse" id="imports-origin">
<!-- <a href="/{{ g.locale }}/embed/tree_map/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/wld/?size=import_val&depth=wld_5"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'imports-origin-tree_map'}}" data-parent="#imports-origin">
TreeMap
</a> -->
<a href="/{{ g.locale }}/tree_map/secex/country/value?year=2018&type=import{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-origin-tree_map'}}" data-parent="#new-api-imports-origin">
TreeMap
</a>
<!-- <a href="/{{ g.locale }}/embed/line/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/wld/?y=import_val&time=year&color=color"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'imports-origin-line'}}" data-parent="#imports-origin">
{%trans%}Line{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/line/secex/country/value?values=value+kg&type=import&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-origin-line'}}" data-parent="#new-api-imports-origin">
{% trans %}Line{% endtrans %}
</a>
<!-- <a href="/{{ g.locale }}/embed/stacked/secex/{{ location.id if location else 'all' }}/{{product.id}}/all/wld/?y=import_val&time=year&order=color&layout=value&sort=asc&color=color"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'imports-origin-stacked'}}" data-parent="#imports-origin">
{%trans%}Stacked{%endtrans%}
</a> -->
<a href="/{{ g.locale }}/stacked/secex/country/value?values=value+kg&group=continent&depths=continent+country&type=import{% if product.id %}&product={{ product.id }}{% endif %}{{ '&id_ibge=%s' % id_ibge if id_ibge }}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-origin-stacked'}}" data-parent="#new-api-imports-origin">
{%trans%}Stacked{%endtrans%}
</a>
</div>
<a href="#imports-port" class="list-group-item" data-toggle="collapse" data-parent="#imports-port">{%trans%}Port{%endtrans%}</a>
<div class="collapse" id="imports-port">
<a href="/{{ g.locale }}/line/secex/port/value?&values=value+kg&type=import&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge}}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-port-line'}}" data-parent="#new-api-imports-port">
{% trans %}Line{% endtrans %}
</a>
<a href="/{{ g.locale }}/bar/secex/value,kg/port?type=import&excluded_year=2018&options=singlecolor,month&product={{product.id}}{{ '&id_ibge=%s' % id_ibge if id_ibge}}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'imports-port-bar'}}" data-parent="#imports-destination">
{%trans%}Bar{%endtrans%}
<a href="/{{ g.locale }}/tree_map/secex/port/value?values=value+kg&type=import&year=2017&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge}}"
target="graphs-frame-trade-partner" class="list-group-item {{'selected' if graph.menu == 'new-api-imports-port-tree_map'}}" data-parent="#new-api-imports-port">
TreeMap
</a>
</div>
</div>
</nav>
<div class="responsive-frame col-xs-12 col-sm-9 col-md-9">
<div class="embed-responsive responsive-wrapper">
<iframe src="
{% if not graph %}
/{{ g.locale }}/line/secex/type/value?values=value+kg&product={{ product.id }}{{ '&id_ibge=%s' % id_ibge if id_ibge }}
{% else %}
/{{ g.locale }}/{{ graph.url }}
{% endif %}"
name="graphs-frame-trade-partner"
id="graphs-frame-trade-partner"
class="embed-responsive-item">
</iframe>
</div>
</div>
</div>
| DataViva/dataviva-site | dataviva/apps/product/templates/product/graphs-trade-partner.html | HTML | mit | 16,573 | [
30522,
1026,
4487,
2615,
8909,
1027,
1000,
19287,
1011,
3119,
1011,
4256,
1000,
2465,
1027,
1000,
11661,
1000,
1028,
1026,
6583,
2615,
2465,
1027,
1000,
6583,
2615,
1011,
10629,
8902,
1011,
1060,
2015,
1011,
2260,
8902,
1011,
15488,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
// Buildbot Instance Manager
// Copyright (c) 2014, Adam Rehn
//
// ---
//
// Base class for classes representing buildbot instances.
//
// ---
//
// This file is part of Buildbot Instance Manager.
//
// Buildbot Instance Manager is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// Buildbot Instance Manager. If not, see <http://www.gnu.org/licenses/>.
*/
#include "BuildbotInstance.h"
#include "BuildbotInstanceObserver.h"
#include "Utility.h"
namespace BuildbotInstanceState
{
QString toString(BIState s)
{
switch (s)
{
case BuildbotInstanceState::Stopped:
return "Stopped";
case BuildbotInstanceState::Starting:
return "Starting";
case BuildbotInstanceState::Running:
return "Running";
case BuildbotInstanceState::Stopping:
return "Stopping";
default:
return "";
}
}
}
BuildbotInstance::BuildbotInstance()
{
this->currentState = BuildbotInstanceState::Stopped;
this->observer = NULL;
//Connect the signals of the QProcess object to our handlers
QObject::connect(&this->process, SIGNAL(started()), this, SLOT(ProcessStarted()));
QObject::connect(&this->process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(ProcessFinished(int, QProcess::ExitStatus)));
QObject::connect(&this->process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(ProcessError(QProcess::ProcessError)));
QObject::connect(&this->process, SIGNAL(readyReadStandardOutput()), this, SLOT(ReadStdOut()));
QObject::connect(&this->process, SIGNAL(readyReadStandardError()), this, SLOT(ReadStdErr()));
}
BuildbotInstance::~BuildbotInstance()
{
this->observer = NULL;
}
void BuildbotInstance::RegisterObserver(BuildbotInstanceObserver* observer) {
this->observer = observer;
}
void BuildbotInstance::UnRegisterObserver(BuildbotInstanceObserver* observer)
{
if (this->observer == observer) {
this->observer = NULL;
}
}
BuildbotInstanceState::BIState BuildbotInstance::GetState() const {
return this->currentState;
}
void BuildbotInstance::ProcessStarted()
{
this->process.closeWriteChannel();
this->currentState = BuildbotInstanceState::Running;
this->NotifyObserverInstanceStateChanged();
}
void BuildbotInstance::ProcessFinished(int, QProcess::ExitStatus)
{
this->currentState = BuildbotInstanceState::Stopped;
this->NotifyObserverInstanceStateChanged();
}
void BuildbotInstance::ProcessError(QProcess::ProcessError error)
{
if (error == QProcess::FailedToStart)
{
this->currentState = BuildbotInstanceState::Stopped;
this->NotifyObserverInstanceStartFailed();
}
}
void BuildbotInstance::ReadStdOut()
{
QString newData( this->process.readAllStandardOutput() );
this->AppendOutput(newData);
}
void BuildbotInstance::ReadStdErr()
{
QString newData( this->process.readAllStandardError() );
this->AppendOutput(newData);
}
QString BuildbotInstance::GetOutput() const {
return this->output;
}
QString BuildbotInstance::GetBuildbotVersion()
{
QString buildmasterVersion = Utility::RegexRetrieveFirstSubMatch("Buildbot version: (.*)\n", BuildbotInstance::EBCUPSynchronousAndRetrieveOutput("buildbot", QStringList() << "--version"));
QString buildslaveVersion = Utility::RegexRetrieveFirstSubMatch("Buildslave version: (.*)\n", BuildbotInstance::EBCUPSynchronousAndRetrieveOutput("buildslave", QStringList() << "--version"));
return ((buildslaveVersion != "") ? buildslaveVersion : buildmasterVersion);
}
QString BuildbotInstance::GetMinimumRequiredBuildbotVersion() {
return "0.8.8";
}
bool BuildbotInstance::DoesBuildbotVersionSatisfyMinimumRequirements()
{
QString detectedVersion = BuildbotInstance::GetBuildbotVersion();
QString requiredVersion = BuildbotInstance::GetMinimumRequiredBuildbotVersion();
uint64_t detectedVerInt = Utility::ConvertVersionStringToInteger(detectedVersion);
uint64_t requiredVerInt = Utility::ConvertVersionStringToInteger(requiredVersion);
return (detectedVerInt >= requiredVerInt);
}
void BuildbotInstance::ClearOutput()
{
this->output.clear();
this->NotifyObserverOutputUpdated();
}
void BuildbotInstance::AppendOutput(const QString& newData)
{
this->output.append(newData);
this->NotifyObserverOutputUpdated();
}
void BuildbotInstance::NotifyObserverInstanceStateChanged()
{
if (this->observer != NULL) {
this->observer->OnInstanceStateChanged(this, this->currentState);
}
}
void BuildbotInstance::NotifyObserverInstanceStartFailed()
{
if (this->observer != NULL) {
this->observer->OnInstanceStartFailed(this);
}
}
void BuildbotInstance::NotifyObserverOutputUpdated()
{
if (this->observer != NULL) {
this->observer->OnInstanceOutputUpdated(this);
}
}
#ifdef Q_OS_WIN
void BuildbotInstance::ExecuteBuildbotComponentUsingPython(QProcess& proc, const QString& buildbotComponent, const QStringList& args)
{
//Locate the buildbot component batch script
QString buildbotBatchLoc = Utility::LocateFileInSystemPathDirectories(buildbotComponent + ".bat");
if (buildbotBatchLoc != "")
{
//Use the location of the batch script to locate python itself
QString pythonLoc = QString(buildbotBatchLoc).replace("/Scripts/" + buildbotComponent + ".bat", "/python.exe", Qt::CaseInsensitive);
QString pythonScriptLoc = QString(buildbotBatchLoc).replace(".bat", "");
//Execute the buildbot component directly, using python
proc.start(pythonLoc, QStringList() << "-u" << pythonScriptLoc << args);
}
//Failed to locate the buildbot component batch script
}
#else
void BuildbotInstance::ExecuteBuildbotComponentUsingPython(QProcess& proc, const QString& buildbotComponent, const QStringList& args)
{
//Locate the buildbot component python script
QString buildbotScriptLoc = Utility::LocateFileInSystemPathDirectories(buildbotComponent);
if (buildbotScriptLoc != "")
{
//Read the contents of the script file and use the hash-bang to locate python itself
QString scriptData = Utility::GetFileContents(buildbotScriptLoc);
QString pythonLoc = Utility::RegexRetrieveFirstSubMatch("#!(.*)\n", scriptData);
//Execute the buildbot component directly, using python
proc.start(pythonLoc, QStringList() << "-u" << buildbotScriptLoc << args);
}
//Failed to locate the buildbot component python script
}
#endif
QString BuildbotInstance::EBCUPSynchronousAndRetrieveOutput(const QString& buildbotComponent, const QStringList& args)
{
QProcess process;
process.setProcessChannelMode(QProcess::MergedChannels);
BuildbotInstance::ExecuteBuildbotComponentUsingPython(process, buildbotComponent, args);
if (!process.waitForStarted()) {
return "";
}
process.closeWriteChannel();
if (!process.waitForFinished()) {
return "";
}
return QString( process.readAll() );
}
| adamrehn/buildbot-instance-manager | BuildbotInstance.cpp | C++ | gpl-3.0 | 7,210 | [
30522,
1013,
1008,
1013,
1013,
3857,
18384,
6013,
3208,
1013,
1013,
9385,
1006,
1039,
1007,
2297,
1010,
4205,
2128,
7295,
1013,
1013,
1013,
1013,
1011,
1011,
1011,
1013,
1013,
1013,
1013,
2918,
2465,
2005,
4280,
5052,
3857,
18384,
12107,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*******************************************************************************
* Copyright (c) 2007, 2018 Stefaan Van Cauwenberge
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0 (the "License"). If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The Initial Developer of the Original Code is
* Stefaan Van Cauwenberge. Portions created by
* the Initial Developer are Copyright (C) 2007, 2018 by
* Stefaan Van Cauwenberge. All Rights Reserved.
*
* Contributor(s): none so far.
* Stefaan Van Cauwenberge: Initial API and implementation
*******************************************************************************/
package info.vancauwenberge.filedriver.filereader.csv;
import java.io.File;
import java.io.FileInputStream;
import java.io.Reader;
import java.util.Map;
import com.novell.nds.dirxml.driver.Trace;
import com.novell.nds.dirxml.driver.xds.Constraint;
import com.novell.nds.dirxml.driver.xds.DataType;
import com.novell.nds.dirxml.driver.xds.Parameter;
import com.novell.nds.dirxml.driver.xds.XDSParameterException;
import info.vancauwenberge.filedriver.api.AbstractStrategy;
import info.vancauwenberge.filedriver.api.IFileReadStrategy;
import info.vancauwenberge.filedriver.exception.ReadException;
import info.vancauwenberge.filedriver.filepublisher.IPublisher;
import info.vancauwenberge.filedriver.filereader.RecordQueue;
import info.vancauwenberge.filedriver.shim.driver.GenericFileDriverShim;
import info.vancauwenberge.filedriver.util.TraceLevel;
import info.vancauwenberge.filedriver.util.Util;
public class CSVFileReader extends AbstractStrategy implements IFileReadStrategy {
private boolean useHeaderNames;
private char seperator;
private String encoding;
private boolean hasHeader;
private boolean skipEmptyLines;
private Thread parsingThread;
private RecordQueue queue;
private String[] schema;
private Trace trace;
private CSVFileParser handler;
protected enum Parameters implements IStrategyParameters {
//@formatter:off
SKIP_EMPTY_LINES("csvReader_skipEmptyLines","true",DataType.BOOLEAN),
USE_HEADER_NAMES("csvReader_UseHeaderNames","true",DataType.BOOLEAN),
HAS_HEADER ("csvReader_hasHeader" ,"true",DataType.BOOLEAN),
FORCED_ENCODING ("csvReader_forcedEncoding",null ,DataType.STRING),
SEPERATOR ("csvReader_seperator" ,"," ,DataType.STRING);
//@formatter:on
private Parameters(final String name, final String defaultValue, final DataType dataType) {
this.name = name;
this.defaultValue = defaultValue;
this.dataType = dataType;
}
private final String name;
private final String defaultValue;
private final DataType dataType;
@Override
public String getParameterName() {
return name;
}
@Override
public String getDefaultValue() {
return defaultValue;
}
@Override
public DataType getDataType() {
return dataType;
}
@Override
public Constraint[] getConstraints() {
return null;
}
}
/*
* (non-Javadoc)
*
* @see
* info.vancauwenberge.filedriver.api.IFileReader#init(com.novell.nds.dirxml
* .driver.Trace, java.util.Map)
*/
@Override
public void init(final Trace trace, final Map<String, Parameter> driverParams, final IPublisher publisher)
throws XDSParameterException {
if (trace.getTraceLevel() > TraceLevel.TRACE) {
trace.trace("CSVFileReader.init() driverParams:" + driverParams);
}
this.trace = trace;
useHeaderNames = getBoolValueFor(Parameters.USE_HEADER_NAMES, driverParams);
// driverParams.get(TAG_USE_HEADER_NAMES).toBoolean().booleanValue();
encoding = getStringValueFor(Parameters.FORCED_ENCODING, driverParams);
// driverParams.get(TAG_FORCED_ENCODING).toString();
hasHeader = getBoolValueFor(Parameters.HAS_HEADER, driverParams);
// driverParams.get(TAG_HAS_HEADER).toBoolean().booleanValue();
skipEmptyLines = getBoolValueFor(Parameters.SKIP_EMPTY_LINES, driverParams);
// driverParams.get(TAG_SKIP_EMPTY_LINES).toBoolean().booleanValue();
if ("".equals(encoding)) {
encoding = Util.getSystemDefaultEncoding();
trace.trace("No encoding given. Using system default of " + encoding, TraceLevel.ERROR_WARN);
}
// Tabs and spaces in the driver config are removed by Designer, so we
// need to use a special 'encoding' for the tab character.
final String strSeperator = getStringValueFor(Parameters.SEPERATOR, driverParams);
// driverParams.get(TAG_SEPERATOR).toString();
if ("{tab}".equalsIgnoreCase(strSeperator)) {
seperator = '\t';
} else if ("{space}".equalsIgnoreCase(strSeperator)) {
seperator = ' ';
} else if ((strSeperator != null) && !"".equals(strSeperator)) {
seperator = strSeperator.charAt(0);// This is a required field, so
// we should have at least one
// character
} else {
throw new XDSParameterException("Invalid parameter value for seperator:" + strSeperator);
}
schema = GenericFileDriverShim.getSchemaAsArray(driverParams);
}
/*
* (non-Javadoc)
*
* @see
* info.vancauwenberge.filedriver.api.IFileReader#openFile(com.novell.nds.
* dirxml.driver.Trace, java.io.File)
*/
@Override
public void openFile(final File f) throws ReadException {
try {
// Start the parser that will parse this document
final FileInputStream fr = new FileInputStream(f);
final Reader reader = new UnicodeReader(fr, encoding);
handler = new CSVFileParser(seperator, schema, skipEmptyLines, hasHeader, useHeaderNames);
handler.resetParser();
queue = handler.getQueue();
parsingThread = new Thread() {
@Override
public void run() {
try {
handler.doParse(reader);
} catch (final Exception e) {
Util.printStackTrace(trace, e);
queue.setFinishedInError(e);
}
}
};
parsingThread.setDaemon(true);
parsingThread.setName("CSVParser");
parsingThread.start();
} catch (final Exception e1) {
trace.trace("Exception while handeling CSV document:" + e1.getMessage(), TraceLevel.ERROR_WARN);
throw new ReadException("Exception while handeling CSV document:" + e1.getMessage(), e1);
}
}
/*
* (non-Javadoc)
*
* @see
* info.vancauwenberge.filedriver.api.IFileReader#readRecord(com.novell.nds.
* dirxml.driver.Trace)
*/
@Override
public Map<String, String> readRecord() throws ReadException {
try {
return queue.getNextRecord();
} catch (final Exception e) {
throw new ReadException(e);
}
}
/*
* (non-Javadoc)
*
* @see info.vancauwenberge.filedriver.api.IFileReader#close()
*/
@Override
public void close() throws ReadException {
queue = null;
if (parsingThread.isAlive()) {
trace.trace("WARN: parsing thread is still alive...", TraceLevel.ERROR_WARN);
try {
parsingThread.join();
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
// Thread is dead. Normal situation.
parsingThread = null;
handler = null;
}
@SuppressWarnings("unchecked")
@Override
public <E extends Enum<?> & IStrategyParameters> Class<E> getParametersEnum() {
return (Class<E>) Parameters.class;
}
@Override
public String[] getActualSchema() {
// The parsing is done in a seperate thread. We need to make sure that
// at least one record is read.
return handler.getCurrentSchema();
}
}
| scauwe/Generic-File-Driver-for-IDM | shim/src/main/java/info/vancauwenberge/filedriver/filereader/csv/CSVFileReader.java | Java | mpl-2.0 | 7,573 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
The MIT License (MIT)
Copyright (c) 2017 Marcin Zajkowski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
| mzajkowski/umbraco-image-crop-picker | LICENSE.md | Markdown | mit | 1,084 | [
30522,
1996,
10210,
6105,
1006,
10210,
1007,
9385,
1006,
1039,
1007,
2418,
7871,
2378,
23564,
15992,
15249,
6656,
2003,
2182,
3762,
4379,
1010,
2489,
1997,
3715,
1010,
2000,
2151,
2711,
11381,
1037,
6100,
1997,
2023,
4007,
1998,
3378,
12653... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from .tornadoconnection import TornadoLDAPConnection
| Noirello/bonsai | src/bonsai/tornado/__init__.py | Python | mit | 53 | [
30522,
2013,
1012,
11352,
8663,
2638,
7542,
12324,
11352,
15150,
15042,
18256,
7542,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
---
layout: post
title: "Sequester"
date: 2015-01-12
source: PHB.274
tags: [archivist, wizard, level7, transmutation]
---
**7th-level transmutation**
**Casting Time**: 1 action
**Range**: Touch
**Components**: V, S, M (a powder of diamond, emerald, rube and sapphire dust worth at least 5,000 gp, which the spell consumes)
**Duration**: Until dispelled
**Saving Throw**:
**Save For**:
**Damage**: []
By means of this spell, a willing creature or an object can be hidden away, safe from detection for the duration. When you cast the spell and touch the target, it becomes invisible and can't be targeted by divination spells or perceived through scrying sensors created by divination spells.
If the target is a creature, it falls into a state of suspended animation. Time ceases to flow for it, and it doesn't grow older.
You can set a condition for the spell to end early. The condition can be anything you choose, but it must occur or be visible within 1 mile of the target. Examples include "after 1,000 years" or "when the tarrasque awakens." This spell also ends if the target takes any damage.
| whiplashomega/elthelas2 | data/spells/sequester.markdown | Markdown | mit | 1,116 | [
30522,
1011,
1011,
1011,
9621,
1024,
2695,
2516,
1024,
1000,
7367,
15500,
2121,
1000,
3058,
1024,
2325,
1011,
5890,
1011,
2260,
3120,
1024,
6887,
2497,
1012,
25586,
22073,
1024,
1031,
7905,
21997,
1010,
10276,
1010,
2504,
2581,
1010,
9099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
require 'nil/file'
require 'nil/http'
class Rune
attr_reader :id, :name, :description
def initialize(id, name, description)
@id = id
@name = name
@description = description
end
end
def processTier(tier)
host = 'http://na.leagueoflegends.com'
url = "#{host}/runes/#{tier}"
puts "Downloading tier #{tier}: #{url}"
contents = Nil.httpDownload(url)
if contents == nil
raise 'Unable to download rune data'
end
pattern = /<td class="rune_type"><img src="(.+?(\d+)\.png)"><\/td>.*?<td class="rune_name">(.+?)<\/td>.*?<td class="rune_description">(.+?)<\/td>/m
output = []
contents.scan(pattern) do |match|
path = match[0]
id = match[1].to_i
name = match[2]
description = match[3]
rune = Rune.new(id, name, description)
output << rune
imageURL = "#{host}#{path}"
filename = "../Image/Rune/#{id}.png"
if !File.exists?(filename)
puts "Downloading rune image: #{imageURL}"
download = Nil.httpDownload(imageURL)
if download == nil
raise "Unable to retrieve #{imageURL}"
end
Nil.writeFile(filename, download)
end
end
return output
end
def javaScriptString(input)
output = input.gsub('"', "\\\"")
return "\"#{output}\""
end
runes = []
(1..3).each do |i|
runes += processTier(i)
end
runes.sort! do |x, y|
x.id <=> y.id
end
output = "function Rune(name, description)\n"
output += "{\n"
output += " this.name = name;\n"
output += " this.description = description;\n"
output += "}\n\n"
output += "function getRune(id)\n"
output += "{\n"
output += " switch(id)\n"
output += " {\n"
runes.each do |rune|
output += " case #{rune.id}:\n"
output += " return new Rune(#{javaScriptString(rune.name)}, #{javaScriptString(rune.description)});\n"
end
output += " default:\n"
output += " return new Rune('Unknown rune', 'Unknown');\n"
output += " }\n"
output += "}"
Nil.writeFile('../Script/Module/Runes.js', output)
| epicvrvs/RiotControl | Web/Generation/runes.rb | Ruby | gpl-3.0 | 1,965 | [
30522,
5478,
1005,
9152,
2140,
1013,
5371,
1005,
5478,
1005,
9152,
2140,
1013,
8299,
1005,
2465,
23276,
2012,
16344,
1035,
8068,
1024,
8909,
1010,
1024,
2171,
1010,
1024,
6412,
13366,
3988,
4697,
1006,
8909,
1010,
2171,
1010,
6412,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var searchData=
[
['revision_20history_20of_20cmsis_2dpack',['Revision History of CMSIS-Pack',['../pack_revisionHistory.html',1,'index']]]
];
| STMicroelectronics/cmsis_core | docs/Pack/html/search/pages_6.js | JavaScript | apache-2.0 | 144 | [
30522,
13075,
3945,
2850,
2696,
1027,
1031,
1031,
1005,
13921,
1035,
2322,
24158,
7062,
1035,
2322,
11253,
1035,
2322,
27487,
6190,
1035,
14134,
23947,
1005,
1010,
1031,
1005,
13921,
2381,
1997,
4642,
6190,
1011,
5308,
1005,
1010,
1031,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "read_factor.h"
using namespace std;
void read_factor(ifstream& fin, Freq& f, vector<double>& fa, vector<double>& fb)
{
string s;
while (getline(fin, s)) {
if (s.find("%") == string::npos) {
// input frequency range and count
if(s.find("begin") != string::npos) f.begin = input_factor(s);
else if (s.find("end") != string::npos) f.end = input_factor(s);
else if (s.find("count") != string::npos) f.count = input_factor(s);
// input factor
else if (s.find("a") != string::npos) input_factor(fa, s);
else if (s.find("b") != string::npos) input_factor(fb, s);
}
}
if ( f.begin > f.end ) throw out_of_range("error: 'begin' must be less than 'end'.");
if ( f.count <= 0 ) throw out_of_range("error: 'count' must be greater than 0.");
if( fa.empty() || fb.empty() ) throw invalid_argument("error: Factors not found.");
}
double input_factor (const string& s)
{
auto i = find_if(s.begin(), s.end(), isNumber);
if (i != s.end()) {
const string tmp(i, s.end());
return atof(tmp.c_str());
} else
throw invalid_argument("error: Invalid factor error.");
}
void input_factor (vector<double>& f, const string& s)
{
auto i = num_beg(s.begin(), s.end());
if (i != s.end()) {
const string tmp(i, s.end());
const double num = atof(tmp.c_str());
f.push_back(num);
} else
throw invalid_argument("error: Invalid factor error.");
}
string::const_iterator
num_beg( string::const_iterator b, string::const_iterator e)
{
auto i = find_if(b, e, isNumber);
if (i != e) {
i = find_if(++i, e, isNumber);
if(i != e) return i;
else return e;
} else return e;
}
int isNumber(const char c)
{
return isdigit(c) || c == '-';
}
| kmiya/iir | src/read_factor.cpp | C++ | mit | 1,790 | [
30522,
1001,
2421,
1000,
3191,
1035,
5387,
1012,
1044,
1000,
2478,
3415,
15327,
2358,
2094,
1025,
11675,
3191,
1035,
5387,
1006,
2065,
21422,
1004,
10346,
1010,
10424,
2063,
4160,
1004,
1042,
1010,
9207,
1026,
3313,
1028,
1004,
6904,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 Rasmus Mikkelsen
// Copyright (c) 2015-2016 eBay Software Foundation
// https://github.com/rasmus/EventFlow
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using EventFlow.Sql.ReadModels.Attributes;
namespace EventFlow.MsSql.ReadStores.Attributes
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class MsSqlReadModelIdentityColumnAttribute : SqlReadModelIdentityColumnAttribute
{
}
} | AntoineGa/EventFlow | Source/EventFlow.MsSql/ReadStores/Attributes/MsSqlReadModelIdentityColumnAttribute.cs | C# | mit | 1,534 | [
30522,
1013,
1013,
1996,
10210,
6105,
1006,
10210,
1007,
1013,
1013,
1013,
1013,
9385,
1006,
1039,
1007,
2325,
1011,
2355,
20710,
7606,
2771,
19658,
9050,
2368,
1013,
1013,
9385,
1006,
1039,
1007,
2325,
1011,
2355,
1041,
15907,
4007,
3192,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Basic tests for TF-TensorRT integration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_test
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.platform import test
class ReshapeTest(trt_test.TfTrtIntegrationTestBase):
def GraphFn(self, inp):
outputs = []
# Here we test two types of reshapes, one changes the batch dimension and
# the other does not. Note that we're not able to test reshaping to
# scalar, since TRT requires input tensor to be of rank at least 2, so a
# reshape with scalar input will be filtered out of the segment before
# conversion.
#
# These reshapes happen at batch dimension, thus conversion should fail.
for shape in [[2, 50, 24, 24, 2], [-1, 50, 24, 24, 2], [2, 50, -1, 24, 2]]:
incompatible_reshape = array_ops.reshape(inp, shape)
reshape_back = array_ops.reshape(incompatible_reshape, [-1, 24, 24, 2])
outputs.append(self.trt_incompatible_op(reshape_back))
# Add another block with many reshapes that don't change the batch
# dimension.
compatible_reshape = array_ops.reshape(
inp, [-1, 24 * 24, 2], name="reshape-0")
compatible_reshape = array_ops.reshape(
compatible_reshape, [100, 24, -1], name="reshape-1")
compatible_reshape = array_ops.reshape(
compatible_reshape, [100, 24 * 2, 24], name="reshape-2")
compatible_reshape = array_ops.reshape(
compatible_reshape, [-1, 24, 24 * 2], name="reshape-3")
compatible_reshape = array_ops.reshape(
compatible_reshape, [-1, 6, 4, 24, 2], name="reshape-4")
compatible_reshape = array_ops.reshape(
compatible_reshape, [-1, 6, 4, 6, 4, 2, 1], name="reshape-5")
compatible_reshape = array_ops.reshape(
compatible_reshape, [-1, 24, 24, 2], name="reshape-6")
outputs.append(self.trt_incompatible_op(compatible_reshape))
return math_ops.add_n(outputs, name="output_0")
def GetParams(self):
return self.BuildParams(self.GraphFn, dtypes.float32, [[100, 24, 24, 2]],
[[100, 24, 24, 2]])
def ExpectedEnginesToBuild(self, run_params):
"""Return the expected engines to build."""
return {
"TRTEngineOp_0": ["reshape-%d" % i for i in range(7)] +
["reshape-%d/shape" % i for i in range(7)]
}
def ShouldRunTest(self, run_params):
"""Whether to run the test."""
return (not trt_test.IsQuantizationMode(run_params.precision_mode) and
not run_params.dynamic_engine)
class TransposeTest(trt_test.TfTrtIntegrationTestBase):
def GraphFn(self, inp):
# Add a block with compatible transposes.
compatible_transpose = array_ops.transpose(
inp, [0, 3, 1, 2], name="transpose-1")
compatible_transpose = array_ops.transpose(
compatible_transpose, [0, 2, 3, 1], name="transposeback")
# Add an incompatible op so the first block will not be in the same
# subgraph where the following block belongs.
bridge = self.trt_incompatible_op(compatible_transpose)
# Add a block with incompatible transposes.
#
# Note: by default Grappler will run the TRT optimizer twice. At the
# first time it will group the two transpose ops below to same segment
# then fail the conversion due to the expected batch dimension problem.
# At the second time, since the input of bridge op is TRTEngineOp_0, it
# will fail to do shape inference which then cause conversion to fail.
# TODO(laigd): support shape inference, make TRT optimizer run only
# once, and fix this.
incompatible_transpose = array_ops.transpose(
bridge, [2, 1, 0, 3], name="transpose-2")
excluded_transpose = array_ops.transpose(
incompatible_transpose, [0, 2, 3, 1], name="transpose-3")
return array_ops.identity(excluded_transpose, name="output_0")
def GetParams(self):
return self.BuildParams(self.GraphFn, dtypes.float32, [[100, 24, 24, 2]],
[[24, 100, 2, 24]])
def ExpectedEnginesToBuild(self, run_params):
"""Return the expected engines to build."""
return {
"TRTEngineOp_0": [
"transpose-1", "transpose-1/perm", "transposeback",
"transposeback/perm"
]
}
def ShouldRunTest(self, run_params):
"""Whether to run the test."""
return (not trt_test.IsQuantizationMode(run_params.precision_mode) and
not run_params.dynamic_engine)
if __name__ == "__main__":
test.main()
| ghchinoy/tensorflow | tensorflow/python/compiler/tensorrt/test/reshape_transpose_test.py | Python | apache-2.0 | 5,407 | [
30522,
1001,
9385,
2760,
1996,
23435,
12314,
6048,
1012,
2035,
2916,
9235,
1012,
1001,
1001,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1001,
2017,
2089,
2025,
2224,
2023,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<h1 align="center">Viserio Support Contract</h1>
<p align="center">
<a href="https://github.com/narrowspark/framework/releases"><img src="https://img.shields.io/packagist/v/narrowspark/framework.svg?style=flat-square"></a>
<a href="https://php.net/"><img src="https://img.shields.io/badge/php-%5E7.4.0-8892BF.svg?style=flat-square"></a>
<a href="https://codecov.io/gh/narrowspark/framework"><img src="https://img.shields.io/codecov/c/github/narrowspark/framework/master.svg?style=flat-square"></a>
<a href="http://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square"></a>
</p>
> **Note:** This package is part of the [Narrowspark framework](https://github.com/narrowspark/framework). <br> If you want to build an app using Narrowspark, visit the main [source](https://github.com/narrowspark/framework).
Installation
-------------
Use [Composer](https://getcomposer.org/) to install this package:
```sh
composer require viserio/support-contract
```
Official Documentation
-------------
Documentation for the framework can be found on the [Narrowspark site](https://narrowspark.com/docs).
Contributing
-------------
Issues for this package shall be posted on [Narrowspark framework issues](https://github.com/narrowspark/framework/issues). <br>
Thank you for considering contributing to the Narrowspark framework! The contribution guide can be found in the [Narrowspark contributing](/CONTRIBUTING.md).
License
-------------
The Narrowspark framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
| narrowspark/framework | src/Viserio/Contract/Support/README.md | Markdown | mit | 1,632 | [
30522,
1026,
1044,
2487,
25705,
1027,
1000,
2415,
1000,
1028,
25292,
11124,
2080,
2490,
3206,
1026,
1013,
1044,
2487,
1028,
1026,
1052,
25705,
1027,
1000,
2415,
1000,
1028,
1026,
1037,
17850,
12879,
1027,
1000,
16770,
1024,
1013,
1013,
2102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Copyright 2006-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.solmix.generator.codegen.mybatis.javamapper.elements.annotated;
import static org.solmix.generator.api.OutputUtilities.javaIndent;
import java.util.Iterator;
import org.solmix.generator.api.IntrospectedColumn;
import org.solmix.generator.api.java.FullyQualifiedJavaType;
import org.solmix.generator.api.java.Interface;
import org.solmix.generator.api.java.Method;
import org.solmix.generator.codegen.mybatis.javamapper.elements.SelectByExampleWithBLOBsMethodGenerator;
/**
*
* @author Jeff Butler
*/
public class AnnotatedSelectByExampleWithBLOBsMethodGenerator extends SelectByExampleWithBLOBsMethodGenerator {
public AnnotatedSelectByExampleWithBLOBsMethodGenerator() {
super();
}
@Override
public void addMapperAnnotations(Interface interfaze, Method method) {
FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
StringBuilder sb = new StringBuilder();
sb.append("@SelectProvider(type=");
sb.append(fqjt.getShortName());
sb.append(".class, method=\"");
sb.append(introspectedTable.getSelectByExampleWithBLOBsStatementId());
sb.append("\")");
method.addAnnotation(sb.toString());
if (introspectedTable.isConstructorBased()) {
method.addAnnotation("@ConstructorArgs({");
} else {
method.addAnnotation("@Results({");
}
Iterator<IntrospectedColumn> iterPk = introspectedTable.getPrimaryKeyColumns().iterator();
Iterator<IntrospectedColumn> iterNonPk = introspectedTable.getNonPrimaryKeyColumns().iterator();
while (iterPk.hasNext()) {
IntrospectedColumn introspectedColumn = iterPk.next();
sb.setLength(0);
javaIndent(sb, 1);
sb.append(getResultAnnotation(interfaze, introspectedColumn, true,
introspectedTable.isConstructorBased()));
if (iterPk.hasNext() || iterNonPk.hasNext()) {
sb.append(',');
}
method.addAnnotation(sb.toString());
}
while (iterNonPk.hasNext()) {
IntrospectedColumn introspectedColumn = iterNonPk.next();
sb.setLength(0);
javaIndent(sb, 1);
sb.append(getResultAnnotation(interfaze, introspectedColumn, false,
introspectedTable.isConstructorBased()));
if (iterNonPk.hasNext()) {
sb.append(',');
}
method.addAnnotation(sb.toString());
}
method.addAnnotation("})");
}
@Override
public void addExtraImports(Interface interfaze) {
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.SelectProvider"));
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.type.JdbcType"));
if (introspectedTable.isConstructorBased()) {
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Arg"));
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.ConstructorArgs"));
} else {
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Result"));
interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Results"));
}
}
}
| solmix/datax | generator/core/src/main/java/org/solmix/generator/codegen/mybatis/javamapper/elements/annotated/AnnotatedSelectByExampleWithBLOBsMethodGenerator.java | Java | lgpl-2.1 | 4,098 | [
30522,
1013,
1008,
1008,
1008,
9385,
2294,
1011,
2418,
1996,
2434,
3166,
2030,
6048,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
$("#btnAddButton").on('click', addButton);
$("#btnRemoveButton").on('click', removeButton);
$('#btnAddTrail').on('click', loadFiles);
$(document).ready(function() {
});
var counter = 0;
function addButton(event) {
if(counter >= 10){
alert("Only 10 textboxes are allowed");
return false;
}
var newTextBoxDiv = $(document.createElement('div')).attr("id", 'TextBoxDiv' + counter);
var str =
'<input id="inputPicture" type="file" name="addpic">' +
'<input id="inputPictureLon" type="text" placeholder="lon" size="8">' +
'<input id="inputPictureLat" type="text" placeholder="lat" size="8">' +
'<input id="inputPictureAlt" type="text" placeholder="alt" size="8">' +
'<input id="inputPictureTimestamp" type="text" placeholder="timestamp" size="8">' +
'<input id="inputPictureName" type="text" placeholder="picturename" size="8">' +
'<input id="inputPictureDescription" type="text" placeholder="description" size="8">';
newTextBoxDiv.after().html(str);
newTextBoxDiv.appendTo("#TextBoxesGroup");
counter++;
}
function removeButton(event) {
if (counter == 0) {
alert("No more textbox to remove");
return false;
}
counter--;
$("#TextBoxDiv" + counter).remove();
}
var log = function(text) {
var elem = document.getElementsByTagName('span')[1];
elem.innerHTML = text;
elem.style.backgroundColor="yellow";
elem.style.color="black";
setTimeout(function() {
document.getElementsByTagName('span')[1].innerHTML = "";
}, 60000);
};
var picDataArray = [];
var readers = [];
var readerInd = 0;
function loadFiles(event) {
var elem;
var file;
picDataArray = [];
readers = [];
readerInd = 0;
event.preventDefault();
if (window.File && window.FileReader && window.FileList && window.Blob) {
//alert("File API supported.!");
for (var i=0; i<counter; i++) {
readers[i] = new FileReader();
readers[i].onload = function(e) {
if (e.target.error) {
log("couldn't read file");
return;
}
picDataArray.push(btoa(e.target.result));
readerInd++;
if (readerInd == counter) {
sendTrail();
}
};
var elem = document.getElementById('TextBoxDiv' + (i).toString());
var file = elem.children[0].files[0];
readers[i].readAsBinaryString(file);
}
if (counter == 0) {
sendTrail();
}
}
else {
alert('The File APIs are not fully supported in this browser.\nI will not send pictures');
sendTrail();
}
}
function sendTrail() {
var obj;
var locArray = [];
var picArray = [];
var coords = [];
var lines = $('#textareaCoordinates').val().split('\n');
for (var i=0; i<lines.length; i++) {
var words = lines[i].split(',');
if (words.length == 4) {
coords = [];
for (var j=0; j<3; j++) {
coords.push(parseFloat(words[j]));
}
obj = { 'timestamp': words[3],
'loc': { 'type': 'Point', 'coordinates': coords }
};
locArray.push(obj);
}
}
for (var i=0; i<counter; i++) {
coords = [];
coords.push($('#TextBoxDiv' + i + ' #inputPictureLon').val());
coords.push($('#TextBoxDiv' + i + ' #inputPictureLat').val());
coords.push($('#TextBoxDiv' + i + ' #inputPictureAlt').val());
obj = { 'timestamp': $('#TextBoxDiv' + i + ' #inputPictureTimestamp').val(),
'picturename': $('#TextBoxDiv' + i + ' #inputPictureName').val(),
'description': $('#TextBoxDiv' + i + ' #inputPictureDescription').val(),
'filename': $('#TextBoxDiv' + i + ' #inputPicture').val(),
'file': picDataArray[i],
'loc': { 'type': 'Point', 'coordinates': coords }
};
picArray.push(obj);
}
var data = { 'newtrail' : [
{ 'type': 'LocationCollection',
'locations': locArray
},
{ 'type': 'PictureCollection',
'pictures': picArray
},
{ 'type': 'TrailInfo',
'access': $('#inputAccess').val(),
'trailname': $('#inputTrailName').val(),
'description': $('#inputDescription').val(),
'date': $('#inputDate').val(),
'locationname': $('#inputLocationName').val()
},
{ 'type': 'UserInfo',
'username': $('#inputUsername').val(),
'password': $('#inputPassword').val(),
}
] };
$.ajax({
type: 'POST',
data: data,
url: '/addtrail',
dataType: 'JSON',
success: function(res) {
if (res.status == 'ok') {
var elem = document.getElementsByTagName('span')[0];
elem.innerHTML = res.msg;
elem.style.backgroundColor="blue";
elem.style.color="white";
setTimeout(function() {
document.getElementsByTagName('span')[0].innerHTML = "";
}, 5000);
}
else {
var elem = document.getElementsByTagName('span')[0];
elem.innerHTML = res.msg;
elem.style.backgroundColor="red";
elem.style.color="white";
setTimeout(function() {
document.getElementsByTagName('span')[0].innerHTML = "";
}, 5000);
}
},
error: function(xhr, textStatus) {
alert("HTTP error code: " + xhr.status + " response:\n" + xhr.responseText);
},
complete: function(xhr, textstatus) {
}
});
}
| vesapehkonen/jatrailmap | nodejs/public/js/cli-trailbuilder.js | JavaScript | mit | 5,082 | [
30522,
1002,
1006,
1000,
1001,
18411,
25389,
18939,
4904,
2669,
1000,
1007,
1012,
2006,
1006,
1005,
11562,
1005,
1010,
5587,
8569,
15474,
1007,
1025,
1002,
1006,
1000,
1001,
18411,
16118,
6633,
21818,
8569,
15474,
1000,
1007,
1012,
2006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
//
// @author George A. Shulinok <sgazeos@gmail.com>
//
#include <system/op_boilerplate.h>
#if NOT_EXCLUDED(OP_bitcast)
#include <array/DataTypeUtils.h>
#include <ops/declarable/CustomOperations.h>
namespace sd {
namespace ops {
CUSTOM_OP_IMPL(bitcast, 1, 1, false, 0, 1) {
auto input = INPUT_VARIABLE(0);
auto output = OUTPUT_VARIABLE(0);
// when empty - nothing to do
DataType newType = DataTypeUtils::fromInt(INT_ARG(0));
DataType oldType = input->dataType();
// correct output shape to conform with output data type
auto inputSize = DataTypeUtils::sizeOf(oldType);
auto outputSize = DataTypeUtils::sizeOf(newType);
auto lastSize = outputSize / inputSize;
if (inputSize < outputSize) {
REQUIRE_TRUE(input->sizeAt(-1) == lastSize, 0,
"BITCAST: %llu > %llu. So last dimension should be %i, but %i given.", inputSize,
outputSize, lastSize, input->sizeAt(-1));
}
if(input->isEmpty()){
REQUIRE_TRUE(output->isEmpty(), 0, "BITCAST: If input is empty, output array must also be empty.");
return Status::OK();
}
// just memcpy data
DataBuffer::memcpy(*output->dataBuffer(), *input->dataBuffer());
return Status::OK();
}
DECLARE_SYN(BitCast, bitcast);
DECLARE_SHAPE_FN(bitcast) {
auto inShape = inputShape->at(0);
auto inputRank = shape::rank(inShape);
auto it = INT_ARG(0);
DataType newType = DataTypeUtils::fromInt(it);
DataType oldType = ArrayOptions::dataType(inShape);
// correct output shape to conform with output data type
auto inputSize = DataTypeUtils::sizeOf(oldType);
auto outputSize = DataTypeUtils::sizeOf(newType);
if (shape::length(inShape) == 0)
return SHAPELIST(ConstantShapeHelper::getInstance()->createShapeInfo(ShapeDescriptor(inShape, newType)));
if (inputSize == outputSize) {
// only type should be changed
return SHAPELIST(ConstantShapeHelper::getInstance()->createShapeInfo(ShapeDescriptor(inShape, newType)));
}
else if (inputSize > outputSize) {
// range of output increased by 1 with inputSize / outputSize as last dimension
std::vector<Nd4jLong> shapeOf(inputRank + 1);
int i;
for (i = 0; i < inputRank; ++i) {
shapeOf[i] = inShape[i + 1];
}
shapeOf[i] = inputSize / outputSize;
auto outputShape = ConstantShapeHelper::getInstance()->createShapeInfo(newType, shape::order(inShape), shapeOf);
return SHAPELIST(outputShape);
}
REQUIRE_TRUE(shape::sizeAt(inShape, -1) == outputSize / inputSize, 0, "BITCAST: %llu > %llu. So last dimension should be %i, but %i given.", inputSize, outputSize, outputSize / inputSize, shape::sizeAt(inShape, -1));
std::vector<Nd4jLong> shapeOf(inputRank - 1);
for (auto i = 0; i < shapeOf.size(); ++i) {
shapeOf[i] = inShape[i + 1];
}
auto outputShape = ConstantShapeHelper::getInstance()->createShapeInfo(newType, shape::order(inShape), shapeOf);
return SHAPELIST(outputShape);
}
DECLARE_TYPES(bitcast) {
getOpDescriptor()
->setAllowedInputTypes(sd::DataType::ANY)
->setAllowedOutputTypes(sd::DataType::ANY);
}
}
}
#endif | deeplearning4j/deeplearning4j | libnd4j/include/ops/declarable/generic/datatypes/bitcast.cpp | C++ | apache-2.0 | 4,503 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/** Zend_Form */
require_once 'Zend/Form.php';
/**
* Zend_Form_SubForm
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: SubForm.php 23775 2011-03-01 17:25:24Z ralph $
*/
class Shaw_Form_SubForm extends Shaw_Form
{
/**
* Whether or not form elements are members of an array
* @var bool
*/
protected $_isArray = true;
/**
* Load the default decorators
*
* @return Zend_Form_SubForm
*/
/*
public function loadDefaultDecorators()
{
if ($this->loadDefaultDecoratorsIsDisabled()) {
return $this;
}
$decorators = $this->getDecorators();
if (empty($decorators)) {
$this->addDecorator('FormElements')
->addDecorator('HtmlTag', array('tag' => 'dl'))
->addDecorator('Fieldset')
->addDecorator('DtDdWrapper');
}
return $this;
}
*/
}
| dav-m85/shaw-core | Form/SubForm.php | PHP | mit | 1,106 | [
30522,
1026,
30524,
1025,
1013,
1008,
1008,
1008,
16729,
2094,
1035,
2433,
1035,
4942,
14192,
1008,
1008,
1030,
4696,
16729,
2094,
1008,
1030,
7427,
16729,
2094,
1035,
2433,
1008,
1030,
9385,
9385,
1006,
1039,
1007,
2384,
1011,
2249,
16729,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* eslint prefer-arrow-callback: 0, func-names: 0, 'react/jsx-filename-extension': [1, { "extensions": [".js", ".jsx"] }] */
import React from 'react';
import assert from 'assert';
import { shallow } from 'enzyme';
import sinon from 'sinon';
import DisplayNameSlugEditor from '../partials/display-name-slug-editor';
import CollectionSettings from './settings';
import Thumbnail from '../components/thumbnail';
const collectionWithDefaultSubject = {
id: '1',
default_subject_src: 'subject.png',
display_name: 'A collection',
private: false,
slug: 'username/a-collection'
};
const collectionWithoutDefaultSubject = {
id: '1',
display_name: 'A collection',
private: false,
slug: 'username/a-collection'
};
describe('<CollectionSettings />', function () {
let wrapper;
let confirmationSpy;
let deleteButton;
let handleDescriptionInputChangeStub;
before(function () {
confirmationSpy = sinon.spy(CollectionSettings.prototype, 'confirmDelete');
handleDescriptionInputChangeStub = sinon.stub(CollectionSettings.prototype, 'handleDescriptionInputChange');
wrapper = shallow(<CollectionSettings
canCollaborate={true}
collection={collectionWithoutDefaultSubject}
/>,
{ context: { router: {}}}
);
deleteButton = wrapper.find('button.error');
});
it('should render without crashing', function () {
assert.equal(wrapper, wrapper);
});
it('should render a <DisplayNameSlugEditor /> component', function () {
assert.equal(wrapper.find(DisplayNameSlugEditor).length, 1);
});
it('should render the correct default checked attribute for visibility', function () {
const privateChecked = wrapper.find('input[type="radio"]').first().props().defaultChecked;
const publicChecked = wrapper.find('input[type="radio"]').last().props().defaultChecked;
assert.equal(privateChecked, collectionWithoutDefaultSubject.private);
assert.notEqual(publicChecked, collectionWithoutDefaultSubject.private);
});
it('should render the thumbnail correctly depending on presence of default_subject_src', function () {
const thumbnailFirstInstance = wrapper.find(Thumbnail);
assert.equal(thumbnailFirstInstance.length, 0);
wrapper.setProps({ collection: collectionWithDefaultSubject });
const thumbnailSecondInstance = wrapper.find(Thumbnail);
assert.equal(thumbnailSecondInstance.length, 1);
});
it('should call this.handleDescriptionInputChange() when a user changes description text', function () {
wrapper.find('textarea').simulate('change');
sinon.assert.calledOnce(handleDescriptionInputChangeStub);
});
it('should render permission messaging if there is no user', function () {
wrapper.setProps({ canCollaborate: false, user: null });
const permissionMessage = wrapper.contains(<p>Not allowed to edit this collection</p>);
assert(permissionMessage, true);
});
it('should call this.confirmDelete() when the delete button is clicked', function () {
deleteButton.simulate('click');
sinon.assert.calledOnce(confirmationSpy);
});
});
| jelliotartz/Panoptes-Front-End | app/collections/settings.spec.js | JavaScript | apache-2.0 | 3,078 | [
30522,
30524,
5371,
18442,
1011,
5331,
1005,
1024,
1031,
1015,
1010,
1063,
1000,
14305,
1000,
1024,
1031,
1000,
1012,
1046,
2015,
1000,
1010,
1000,
1012,
1046,
2015,
2595,
1000,
1033,
1065,
1033,
1008,
1013,
12324,
10509,
2013,
1005,
10509,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goog.provide('ol.DeviceOrientation');
goog.provide('ol.DeviceOrientationProperty');
goog.require('goog.events');
goog.require('goog.math');
goog.require('ol.Object');
goog.require('ol.has');
/**
* @enum {string}
*/
ol.DeviceOrientationProperty = {
ALPHA: 'alpha',
BETA: 'beta',
GAMMA: 'gamma',
HEADING: 'heading',
TRACKING: 'tracking'
};
/**
* @classdesc
* The ol.DeviceOrientation class provides access to DeviceOrientation
* information and events, see the [HTML 5 DeviceOrientation Specification](
* http://www.w3.org/TR/orientation-event/) for more details.
*
* Many new computers, and especially mobile phones
* and tablets, provide hardware support for device orientation. Web
* developers targetting mobile devices will be especially interested in this
* class.
*
* Device orientation data are relative to a common starting point. For mobile
* devices, the starting point is to lay your phone face up on a table with the
* top of the phone pointing north. This represents the zero state. All
* angles are then relative to this state. For computers, it is the same except
* the screen is open at 90 degrees.
*
* Device orientation is reported as three angles - `alpha`, `beta`, and
* `gamma` - relative to the starting position along the three planar axes X, Y
* and Z. The X axis runs from the left edge to the right edge through the
* middle of the device. Similarly, the Y axis runs from the bottom to the top
* of the device through the middle. The Z axis runs from the back to the front
* through the middle. In the starting position, the X axis points to the
* right, the Y axis points away from you and the Z axis points straight up
* from the device lying flat.
*
* The three angles representing the device orientation are relative to the
* three axes. `alpha` indicates how much the device has been rotated around the
* Z axis, which is commonly interpreted as the compass heading (see note
* below). `beta` indicates how much the device has been rotated around the X
* axis, or how much it is tilted from front to back. `gamma` indicates how
* much the device has been rotated around the Y axis, or how much it is tilted
* from left to right.
*
* For most browsers, the `alpha` value returns the compass heading so if the
* device points north, it will be 0. With Safari on iOS, the 0 value of
* `alpha` is calculated from when device orientation was first requested.
* ol.DeviceOrientation provides the `heading` property which normalizes this
* behavior across all browsers for you.
*
* It is important to note that the HTML 5 DeviceOrientation specification
* indicates that `alpha`, `beta` and `gamma` are in degrees while the
* equivalent properties in ol.DeviceOrientation are in radians for consistency
* with all other uses of angles throughout OpenLayers.
*
* @see http://www.w3.org/TR/orientation-event/
*
* @constructor
* @extends {ol.Object}
* @fires change Triggered when the device orientation changes.
* @param {olx.DeviceOrientationOptions=} opt_options Options.
* @api
*/
ol.DeviceOrientation = function(opt_options) {
goog.base(this);
var options = goog.isDef(opt_options) ? opt_options : {};
/**
* @private
* @type {goog.events.Key}
*/
this.listenerKey_ = null;
goog.events.listen(this,
ol.Object.getChangeEventType(ol.DeviceOrientationProperty.TRACKING),
this.handleTrackingChanged_, false, this);
this.setTracking(goog.isDef(options.tracking) ? options.tracking : false);
};
goog.inherits(ol.DeviceOrientation, ol.Object);
/**
* @inheritDoc
*/
ol.DeviceOrientation.prototype.disposeInternal = function() {
this.setTracking(false);
goog.base(this, 'disposeInternal');
};
/**
* @private
* @param {goog.events.BrowserEvent} browserEvent Event.
*/
ol.DeviceOrientation.prototype.orientationChange_ = function(browserEvent) {
var event = /** @type {DeviceOrientationEvent} */
(browserEvent.getBrowserEvent());
if (goog.isDefAndNotNull(event.alpha)) {
var alpha = goog.math.toRadians(event.alpha);
this.set(ol.DeviceOrientationProperty.ALPHA, alpha);
// event.absolute is undefined in iOS.
if (goog.isBoolean(event.absolute) && event.absolute) {
this.set(ol.DeviceOrientationProperty.HEADING, alpha);
} else if (goog.isDefAndNotNull(event.webkitCompassHeading) &&
goog.isDefAndNotNull(event.webkitCompassAccuracy) &&
event.webkitCompassAccuracy != -1) {
var heading = goog.math.toRadians(event.webkitCompassHeading);
this.set(ol.DeviceOrientationProperty.HEADING, heading);
}
}
if (goog.isDefAndNotNull(event.beta)) {
this.set(ol.DeviceOrientationProperty.BETA,
goog.math.toRadians(event.beta));
}
if (goog.isDefAndNotNull(event.gamma)) {
this.set(ol.DeviceOrientationProperty.GAMMA,
goog.math.toRadians(event.gamma));
}
this.dispatchChangeEvent();
};
/**
* @return {number|undefined} The euler angle in radians of the device from the
* standard Z axis.
* @observable
* @api
*/
ol.DeviceOrientation.prototype.getAlpha = function() {
return /** @type {number|undefined} */ (
this.get(ol.DeviceOrientationProperty.ALPHA));
};
goog.exportProperty(
ol.DeviceOrientation.prototype,
'getAlpha',
ol.DeviceOrientation.prototype.getAlpha);
/**
* @return {number|undefined} The euler angle in radians of the device from the
* planar X axis.
* @observable
* @api
*/
ol.DeviceOrientation.prototype.getBeta = function() {
return /** @type {number|undefined} */ (
this.get(ol.DeviceOrientationProperty.BETA));
};
goog.exportProperty(
ol.DeviceOrientation.prototype,
'getBeta',
ol.DeviceOrientation.prototype.getBeta);
/**
* @return {number|undefined} The euler angle in radians of the device from the
* planar Y axis.
* @observable
* @api
*/
ol.DeviceOrientation.prototype.getGamma = function() {
return /** @type {number|undefined} */ (
this.get(ol.DeviceOrientationProperty.GAMMA));
};
goog.exportProperty(
ol.DeviceOrientation.prototype,
'getGamma',
ol.DeviceOrientation.prototype.getGamma);
/**
* @return {number|undefined} The heading of the device relative to north, in
* radians, normalizing for different browser behavior.
* @observable
* @api
*/
ol.DeviceOrientation.prototype.getHeading = function() {
return /** @type {number|undefined} */ (
this.get(ol.DeviceOrientationProperty.HEADING));
};
goog.exportProperty(
ol.DeviceOrientation.prototype,
'getHeading',
ol.DeviceOrientation.prototype.getHeading);
/**
* Are we tracking the device's orientation?
* @return {boolean} The status of tracking changes to alpha, beta and gamma.
* If true, changes are tracked and reported immediately.
* @observable
* @api
*/
ol.DeviceOrientation.prototype.getTracking = function() {
return /** @type {boolean} */ (
this.get(ol.DeviceOrientationProperty.TRACKING));
};
goog.exportProperty(
ol.DeviceOrientation.prototype,
'getTracking',
ol.DeviceOrientation.prototype.getTracking);
/**
* @private
*/
ol.DeviceOrientation.prototype.handleTrackingChanged_ = function() {
if (ol.has.DEVICE_ORIENTATION) {
var tracking = this.getTracking();
if (tracking && goog.isNull(this.listenerKey_)) {
this.listenerKey_ = goog.events.listen(goog.global, 'deviceorientation',
this.orientationChange_, false, this);
} else if (!tracking && !goog.isNull(this.listenerKey_)) {
goog.events.unlistenByKey(this.listenerKey_);
this.listenerKey_ = null;
}
}
};
/**
* Enable or disable tracking of DeviceOrientation events.
* @param {boolean} tracking The status of tracking changes to alpha, beta and
* gamma. If true, changes are tracked and reported immediately.
* @observable
* @api
*/
ol.DeviceOrientation.prototype.setTracking = function(tracking) {
this.set(ol.DeviceOrientationProperty.TRACKING, tracking);
};
goog.exportProperty(
ol.DeviceOrientation.prototype,
'setTracking',
ol.DeviceOrientation.prototype.setTracking);
| Koriyama-City/papamama | js/v3.0.0/ol/ol/deviceorientation.js | JavaScript | mit | 8,345 | [
30522,
27571,
2290,
1012,
3073,
1006,
1005,
19330,
1012,
5080,
10050,
19304,
1005,
1007,
1025,
27571,
2290,
1012,
3073,
1006,
1005,
19330,
1012,
5080,
10050,
19304,
21572,
4842,
3723,
1005,
1007,
1025,
27571,
2290,
1012,
5478,
1006,
1005,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifndef V4LTEST_H
#define V4LTEST_H
void F4Ltest();
#endif // V4LTEST_H
| zycet/iTRLib | itrdevice_test/V4Ltest.h | C | lgpl-3.0 | 80 | [
30522,
1001,
2065,
13629,
2546,
1058,
2549,
7096,
4355,
1035,
1044,
1001,
9375,
1058,
2549,
7096,
4355,
1035,
1044,
11675,
1042,
2549,
7096,
4355,
1006,
1007,
1025,
1001,
2203,
10128,
1013,
1013,
1058,
2549,
7096,
4355,
1035,
1044,
102,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/env python
#
# Copyright 2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import imp
import optparse
import os
import platform
import re
import signal
import subprocess
import sys
import tempfile
import time
import threading
import utils
from os.path import join, dirname, abspath, basename, isdir, exists
from datetime import datetime
from Queue import Queue, Empty
VERBOSE = False
# ---------------------------------------------
# --- P r o g r e s s I n d i c a t o r s ---
# ---------------------------------------------
class ProgressIndicator(object):
def __init__(self, cases):
self.cases = cases
self.queue = Queue(len(cases))
for case in cases:
self.queue.put_nowait(case)
self.succeeded = 0
self.remaining = len(cases)
self.total = len(cases)
self.failed = [ ]
self.crashed = 0
self.terminate = False
self.lock = threading.Lock()
def PrintFailureHeader(self, test):
if test.IsNegative():
negative_marker = '[negative] '
else:
negative_marker = ''
print "=== %(label)s %(negative)s===" % {
'label': test.GetLabel(),
'negative': negative_marker
}
print "Path: %s" % "/".join(test.path)
def Run(self, tasks):
self.Starting()
threads = []
# Spawn N-1 threads and then use this thread as the last one.
# That way -j1 avoids threading altogether which is a nice fallback
# in case of threading problems.
for i in xrange(tasks - 1):
thread = threading.Thread(target=self.RunSingle, args=[])
threads.append(thread)
thread.start()
try:
self.RunSingle()
# Wait for the remaining threads
for thread in threads:
# Use a timeout so that signals (ctrl-c) will be processed.
thread.join(timeout=10000000)
except Exception, e:
# If there's an exception we schedule an interruption for any
# remaining threads.
self.terminate = True
# ...and then reraise the exception to bail out
raise
self.Done()
return not self.failed
def RunSingle(self):
while not self.terminate:
try:
test = self.queue.get_nowait()
except Empty:
return
case = test.case
self.lock.acquire()
self.AboutToRun(case)
self.lock.release()
try:
start = datetime.now()
output = case.Run()
case.duration = (datetime.now() - start)
except IOError, e:
assert self.terminate
return
if self.terminate:
return
self.lock.acquire()
if output.UnexpectedOutput():
self.failed.append(output)
if output.HasCrashed():
self.crashed += 1
else:
self.succeeded += 1
self.remaining -= 1
self.HasRun(output)
self.lock.release()
def EscapeCommand(command):
parts = []
for part in command:
if ' ' in part:
# Escape spaces. We may need to escape more characters for this
# to work properly.
parts.append('"%s"' % part)
else:
parts.append(part)
return " ".join(parts)
class SimpleProgressIndicator(ProgressIndicator):
def Starting(self):
print 'Running %i tests' % len(self.cases)
def Done(self):
print
for failed in self.failed:
self.PrintFailureHeader(failed.test)
if failed.output.stderr:
print "--- stderr ---"
print failed.output.stderr.strip()
if failed.output.stdout:
print "--- stdout ---"
print failed.output.stdout.strip()
print "Command: %s" % EscapeCommand(failed.command)
if failed.HasCrashed():
print "--- CRASHED ---"
if failed.HasTimedOut():
print "--- TIMEOUT ---"
if len(self.failed) == 0:
print "==="
print "=== All tests succeeded"
print "==="
else:
print
print "==="
print "=== %i tests failed" % len(self.failed)
if self.crashed > 0:
print "=== %i tests CRASHED" % self.crashed
print "==="
class VerboseProgressIndicator(SimpleProgressIndicator):
def AboutToRun(self, case):
print 'Starting %s...' % case.GetLabel()
sys.stdout.flush()
def HasRun(self, output):
if output.UnexpectedOutput():
if output.HasCrashed():
outcome = 'CRASH'
else:
outcome = 'FAIL'
else:
outcome = 'pass'
print 'Done running %s: %s' % (output.test.GetLabel(), outcome)
class DotsProgressIndicator(SimpleProgressIndicator):
def AboutToRun(self, case):
pass
def HasRun(self, output):
total = self.succeeded + len(self.failed)
if (total > 1) and (total % 50 == 1):
sys.stdout.write('\n')
if output.UnexpectedOutput():
if output.HasCrashed():
sys.stdout.write('C')
sys.stdout.flush()
elif output.HasTimedOut():
sys.stdout.write('T')
sys.stdout.flush()
else:
sys.stdout.write('F')
sys.stdout.flush()
else:
sys.stdout.write('.')
sys.stdout.flush()
class TapProgressIndicator(SimpleProgressIndicator):
def Starting(self):
print '1..%i' % len(self.cases)
self._done = 0
def AboutToRun(self, case):
pass
def HasRun(self, output):
self._done += 1
command = basename(output.command[-1])
if output.UnexpectedOutput():
print 'not ok %i - %s' % (self._done, command)
for l in output.output.stderr.splitlines():
print '#' + l
for l in output.output.stdout.splitlines():
print '#' + l
else:
print 'ok %i - %s' % (self._done, command)
duration = output.test.duration
# total_seconds() was added in 2.7
total_seconds = (duration.microseconds +
(duration.seconds + duration.days * 24 * 3600) * 10**6) / 10**6
print ' ---'
print ' duration_ms: %d.%d' % (total_seconds, duration.microseconds / 1000)
print ' ...'
def Done(self):
pass
class CompactProgressIndicator(ProgressIndicator):
def __init__(self, cases, templates):
super(CompactProgressIndicator, self).__init__(cases)
self.templates = templates
self.last_status_length = 0
self.start_time = time.time()
def Starting(self):
pass
def Done(self):
self.PrintProgress('Done')
def AboutToRun(self, case):
self.PrintProgress(case.GetLabel())
def HasRun(self, output):
if output.UnexpectedOutput():
self.ClearLine(self.last_status_length)
self.PrintFailureHeader(output.test)
stdout = output.output.stdout.strip()
if len(stdout):
print self.templates['stdout'] % stdout
stderr = output.output.stderr.strip()
if len(stderr):
print self.templates['stderr'] % stderr
print "Command: %s" % EscapeCommand(output.command)
if output.HasCrashed():
print "--- CRASHED ---"
if output.HasTimedOut():
print "--- TIMEOUT ---"
def Truncate(self, str, length):
if length and (len(str) > (length - 3)):
return str[:(length-3)] + "..."
else:
return str
def PrintProgress(self, name):
self.ClearLine(self.last_status_length)
elapsed = time.time() - self.start_time
status = self.templates['status_line'] % {
'passed': self.succeeded,
'remaining': (((self.total - self.remaining) * 100) // self.total),
'failed': len(self.failed),
'test': name,
'mins': int(elapsed) / 60,
'secs': int(elapsed) % 60
}
status = self.Truncate(status, 78)
self.last_status_length = len(status)
print status,
sys.stdout.flush()
class ColorProgressIndicator(CompactProgressIndicator):
def __init__(self, cases):
templates = {
'status_line': "[%(mins)02i:%(secs)02i|\033[34m%%%(remaining) 4d\033[0m|\033[32m+%(passed) 4d\033[0m|\033[31m-%(failed) 4d\033[0m]: %(test)s",
'stdout': "\033[1m%s\033[0m",
'stderr': "\033[31m%s\033[0m",
}
super(ColorProgressIndicator, self).__init__(cases, templates)
def ClearLine(self, last_line_length):
print "\033[1K\r",
class MonochromeProgressIndicator(CompactProgressIndicator):
def __init__(self, cases):
templates = {
'status_line': "[%(mins)02i:%(secs)02i|%%%(remaining) 4d|+%(passed) 4d|-%(failed) 4d]: %(test)s",
'stdout': '%s',
'stderr': '%s',
'clear': lambda last_line_length: ("\r" + (" " * last_line_length) + "\r"),
'max_length': 78
}
super(MonochromeProgressIndicator, self).__init__(cases, templates)
def ClearLine(self, last_line_length):
print ("\r" + (" " * last_line_length) + "\r"),
PROGRESS_INDICATORS = {
'verbose': VerboseProgressIndicator,
'dots': DotsProgressIndicator,
'color': ColorProgressIndicator,
'tap': TapProgressIndicator,
'mono': MonochromeProgressIndicator
}
# -------------------------
# --- F r a m e w o r k ---
# -------------------------
class CommandOutput(object):
def __init__(self, exit_code, timed_out, stdout, stderr):
self.exit_code = exit_code
self.timed_out = timed_out
self.stdout = stdout
self.stderr = stderr
self.failed = None
class TestCase(object):
def __init__(self, context, path, mode):
self.path = path
self.context = context
self.duration = None
self.mode = mode
def IsNegative(self):
return False
def CompareTime(self, other):
return cmp(other.duration, self.duration)
def DidFail(self, output):
if output.failed is None:
output.failed = self.IsFailureOutput(output)
return output.failed
def IsFailureOutput(self, output):
return output.exit_code != 0
def GetSource(self):
return "(no source available)"
def RunCommand(self, command):
full_command = self.context.processor(command)
output = Execute(full_command,
self.context,
self.context.GetTimeout(self.mode))
self.Cleanup()
return TestOutput(self,
full_command,
output,
self.context.store_unexpected_output)
def BeforeRun(self):
pass
def AfterRun(self, result):
pass
def Run(self):
self.BeforeRun()
try:
result = self.RunCommand(self.GetCommand())
finally:
# Tests can leave the tty in non-blocking mode. If the test runner
# tries to print to stdout/stderr after that and the tty buffer is
# full, it'll die with a EAGAIN OSError. Ergo, put the tty back in
# blocking mode before proceeding.
if sys.platform != 'win32':
from fcntl import fcntl, F_GETFL, F_SETFL
from os import O_NONBLOCK
for fd in 0,1,2: fcntl(fd, F_SETFL, ~O_NONBLOCK & fcntl(fd, F_GETFL))
self.AfterRun(result)
return result
def Cleanup(self):
return
class TestOutput(object):
def __init__(self, test, command, output, store_unexpected_output):
self.test = test
self.command = command
self.output = output
self.store_unexpected_output = store_unexpected_output
def UnexpectedOutput(self):
if self.HasCrashed():
outcome = CRASH
elif self.HasTimedOut():
outcome = TIMEOUT
elif self.HasFailed():
outcome = FAIL
else:
outcome = PASS
return not outcome in self.test.outcomes
def HasPreciousOutput(self):
return self.UnexpectedOutput() and self.store_unexpected_output
def HasCrashed(self):
if utils.IsWindows():
return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.output.exit_code)
else:
# Timed out tests will have exit_code -signal.SIGTERM.
if self.output.timed_out:
return False
return self.output.exit_code < 0 and \
self.output.exit_code != -signal.SIGABRT
def HasTimedOut(self):
return self.output.timed_out;
def HasFailed(self):
execution_failed = self.test.DidFail(self.output)
if self.test.IsNegative():
return not execution_failed
else:
return execution_failed
def KillProcessWithID(pid):
if utils.IsWindows():
os.popen('taskkill /T /F /PID %d' % pid)
else:
os.kill(pid, signal.SIGTERM)
MAX_SLEEP_TIME = 0.1
INITIAL_SLEEP_TIME = 0.0001
SLEEP_TIME_FACTOR = 1.25
SEM_INVALID_VALUE = -1
SEM_NOGPFAULTERRORBOX = 0x0002 # Microsoft Platform SDK WinBase.h
def Win32SetErrorMode(mode):
prev_error_mode = SEM_INVALID_VALUE
try:
import ctypes
prev_error_mode = ctypes.windll.kernel32.SetErrorMode(mode);
except ImportError:
pass
return prev_error_mode
def RunProcess(context, timeout, args, **rest):
if context.verbose: print "#", " ".join(args)
popen_args = args
prev_error_mode = SEM_INVALID_VALUE;
if utils.IsWindows():
if context.suppress_dialogs:
# Try to change the error mode to avoid dialogs on fatal errors. Don't
# touch any existing error mode flags by merging the existing error mode.
# See http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx.
error_mode = SEM_NOGPFAULTERRORBOX;
prev_error_mode = Win32SetErrorMode(error_mode);
Win32SetErrorMode(error_mode | prev_error_mode);
process = subprocess.Popen(
shell = utils.IsWindows(),
args = popen_args,
**rest
)
if utils.IsWindows() and context.suppress_dialogs and prev_error_mode != SEM_INVALID_VALUE:
Win32SetErrorMode(prev_error_mode)
# Compute the end time - if the process crosses this limit we
# consider it timed out.
if timeout is None: end_time = None
else: end_time = time.time() + timeout
timed_out = False
# Repeatedly check the exit code from the process in a
# loop and keep track of whether or not it times out.
exit_code = None
sleep_time = INITIAL_SLEEP_TIME
while exit_code is None:
if (not end_time is None) and (time.time() >= end_time):
# Kill the process and wait for it to exit.
KillProcessWithID(process.pid)
exit_code = process.wait()
timed_out = True
else:
exit_code = process.poll()
time.sleep(sleep_time)
sleep_time = sleep_time * SLEEP_TIME_FACTOR
if sleep_time > MAX_SLEEP_TIME:
sleep_time = MAX_SLEEP_TIME
return (process, exit_code, timed_out)
def PrintError(str):
sys.stderr.write(str)
sys.stderr.write('\n')
def CheckedUnlink(name):
try:
os.unlink(name)
except OSError, e:
PrintError("os.unlink() " + str(e))
def Execute(args, context, timeout=None):
(fd_out, outname) = tempfile.mkstemp()
(fd_err, errname) = tempfile.mkstemp()
(process, exit_code, timed_out) = RunProcess(
context,
timeout,
args = args,
stdout = fd_out,
stderr = fd_err,
)
os.close(fd_out)
os.close(fd_err)
output = file(outname).read()
errors = file(errname).read()
CheckedUnlink(outname)
CheckedUnlink(errname)
return CommandOutput(exit_code, timed_out, output, errors)
def ExecuteNoCapture(args, context, timeout=None):
(process, exit_code, timed_out) = RunProcess(
context,
timeout,
args = args,
)
return CommandOutput(exit_code, False, "", "")
def CarCdr(path):
if len(path) == 0:
return (None, [ ])
else:
return (path[0], path[1:])
class TestConfiguration(object):
def __init__(self, context, root):
self.context = context
self.root = root
def Contains(self, path, file):
if len(path) > len(file):
return False
for i in xrange(len(path)):
if not path[i].match(file[i]):
return False
return True
def GetTestStatus(self, sections, defs):
pass
class TestSuite(object):
def __init__(self, name):
self.name = name
def GetName(self):
return self.name
# Use this to run several variants of the tests, e.g.:
# VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']]
VARIANT_FLAGS = [[]]
class TestRepository(TestSuite):
def __init__(self, path):
normalized_path = abspath(path)
super(TestRepository, self).__init__(basename(normalized_path))
self.path = normalized_path
self.is_loaded = False
self.config = None
def GetConfiguration(self, context):
if self.is_loaded:
return self.config
self.is_loaded = True
file = None
try:
(file, pathname, description) = imp.find_module('testcfg', [ self.path ])
module = imp.load_module('testcfg', file, pathname, description)
self.config = module.GetConfiguration(context, self.path)
finally:
if file:
file.close()
return self.config
def GetBuildRequirements(self, path, context):
return self.GetConfiguration(context).GetBuildRequirements()
def AddTestsToList(self, result, current_path, path, context, mode):
for v in VARIANT_FLAGS:
tests = self.GetConfiguration(context).ListTests(current_path, path, mode)
for t in tests: t.variant_flags = v
result += tests
def GetTestStatus(self, context, sections, defs):
self.GetConfiguration(context).GetTestStatus(sections, defs)
class LiteralTestSuite(TestSuite):
def __init__(self, tests):
super(LiteralTestSuite, self).__init__('root')
self.tests = tests
def GetBuildRequirements(self, path, context):
(name, rest) = CarCdr(path)
result = [ ]
for test in self.tests:
if not name or name.match(test.GetName()):
result += test.GetBuildRequirements(rest, context)
return result
def ListTests(self, current_path, path, context, mode):
(name, rest) = CarCdr(path)
result = [ ]
for test in self.tests:
test_name = test.GetName()
if not name or name.match(test_name):
full_path = current_path + [test_name]
test.AddTestsToList(result, full_path, path, context, mode)
result.sort(cmp=lambda a, b: cmp(a.GetName(), b.GetName()))
return result
def GetTestStatus(self, context, sections, defs):
for test in self.tests:
test.GetTestStatus(context, sections, defs)
SUFFIX = {
'debug' : '_g',
'release' : '' }
FLAGS = {
'debug' : ['--enable-slow-asserts', '--debug-code', '--verify-heap'],
'release' : []}
TIMEOUT_SCALEFACTOR = {
'debug' : 4,
'release' : 1 }
class Context(object):
def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppress_dialogs, store_unexpected_output):
self.workspace = workspace
self.buildspace = buildspace
self.verbose = verbose
self.vm_root = vm
self.timeout = timeout
self.processor = processor
self.suppress_dialogs = suppress_dialogs
self.store_unexpected_output = store_unexpected_output
def GetVm(self, mode):
if mode == 'debug':
name = 'out/Debug/node'
else:
name = 'out/Release/node'
# Currently GYP does not support output_dir for MSVS.
# http://code.google.com/p/gyp/issues/detail?id=40
# It will put the builds into Release/node.exe or Debug/node.exe
if utils.IsWindows():
out_dir = os.path.join(dirname(__file__), "..", "out")
if not exists(out_dir):
if mode == 'debug':
name = os.path.abspath('Debug/node.exe')
else:
name = os.path.abspath('Release/node.exe')
else:
name = os.path.abspath(name + '.exe')
return name
def GetVmCommand(self, testcase, mode):
return [self.GetVm(mode)] + self.GetVmFlags(testcase, mode)
def GetVmFlags(self, testcase, mode):
return testcase.variant_flags + FLAGS[mode]
def GetTimeout(self, mode):
return self.timeout * TIMEOUT_SCALEFACTOR[mode]
def RunTestCases(cases_to_run, progress, tasks):
progress = PROGRESS_INDICATORS[progress](cases_to_run)
return progress.Run(tasks)
def BuildRequirements(context, requirements, mode, scons_flags):
command_line = (['scons', '-Y', context.workspace, 'mode=' + ",".join(mode)]
+ requirements
+ scons_flags)
output = ExecuteNoCapture(command_line, context)
return output.exit_code == 0
# -------------------------------------------
# --- T e s t C o n f i g u r a t i o n ---
# -------------------------------------------
SKIP = 'skip'
FAIL = 'fail'
PASS = 'pass'
OKAY = 'okay'
TIMEOUT = 'timeout'
CRASH = 'crash'
SLOW = 'slow'
class Expression(object):
pass
class Constant(Expression):
def __init__(self, value):
self.value = value
def Evaluate(self, env, defs):
return self.value
class Variable(Expression):
def __init__(self, name):
self.name = name
def GetOutcomes(self, env, defs):
if self.name in env: return ListSet([env[self.name]])
else: return Nothing()
class Outcome(Expression):
def __init__(self, name):
self.name = name
def GetOutcomes(self, env, defs):
if self.name in defs:
return defs[self.name].GetOutcomes(env, defs)
else:
return ListSet([self.name])
class Set(object):
pass
class ListSet(Set):
def __init__(self, elms):
self.elms = elms
def __str__(self):
return "ListSet%s" % str(self.elms)
def Intersect(self, that):
if not isinstance(that, ListSet):
return that.Intersect(self)
return ListSet([ x for x in self.elms if x in that.elms ])
def Union(self, that):
if not isinstance(that, ListSet):
return that.Union(self)
return ListSet(self.elms + [ x for x in that.elms if x not in self.elms ])
def IsEmpty(self):
return len(self.elms) == 0
class Everything(Set):
def Intersect(self, that):
return that
def Union(self, that):
return self
def IsEmpty(self):
return False
class Nothing(Set):
def Intersect(self, that):
return self
def Union(self, that):
return that
def IsEmpty(self):
return True
class Operation(Expression):
def __init__(self, left, op, right):
self.left = left
self.op = op
self.right = right
def Evaluate(self, env, defs):
if self.op == '||' or self.op == ',':
return self.left.Evaluate(env, defs) or self.right.Evaluate(env, defs)
elif self.op == 'if':
return False
elif self.op == '==':
inter = self.left.GetOutcomes(env, defs).Intersect(self.right.GetOutcomes(env, defs))
return not inter.IsEmpty()
else:
assert self.op == '&&'
return self.left.Evaluate(env, defs) and self.right.Evaluate(env, defs)
def GetOutcomes(self, env, defs):
if self.op == '||' or self.op == ',':
return self.left.GetOutcomes(env, defs).Union(self.right.GetOutcomes(env, defs))
elif self.op == 'if':
if self.right.Evaluate(env, defs): return self.left.GetOutcomes(env, defs)
else: return Nothing()
else:
assert self.op == '&&'
return self.left.GetOutcomes(env, defs).Intersect(self.right.GetOutcomes(env, defs))
def IsAlpha(str):
for char in str:
if not (char.isalpha() or char.isdigit() or char == '_'):
return False
return True
class Tokenizer(object):
"""A simple string tokenizer that chops expressions into variables,
parens and operators"""
def __init__(self, expr):
self.index = 0
self.expr = expr
self.length = len(expr)
self.tokens = None
def Current(self, length = 1):
if not self.HasMore(length): return ""
return self.expr[self.index:self.index+length]
def HasMore(self, length = 1):
return self.index < self.length + (length - 1)
def Advance(self, count = 1):
self.index = self.index + count
def AddToken(self, token):
self.tokens.append(token)
def SkipSpaces(self):
while self.HasMore() and self.Current().isspace():
self.Advance()
def Tokenize(self):
self.tokens = [ ]
while self.HasMore():
self.SkipSpaces()
if not self.HasMore():
return None
if self.Current() == '(':
self.AddToken('(')
self.Advance()
elif self.Current() == ')':
self.AddToken(')')
self.Advance()
elif self.Current() == '$':
self.AddToken('$')
self.Advance()
elif self.Current() == ',':
self.AddToken(',')
self.Advance()
elif IsAlpha(self.Current()):
buf = ""
while self.HasMore() and IsAlpha(self.Current()):
buf += self.Current()
self.Advance()
self.AddToken(buf)
elif self.Current(2) == '&&':
self.AddToken('&&')
self.Advance(2)
elif self.Current(2) == '||':
self.AddToken('||')
self.Advance(2)
elif self.Current(2) == '==':
self.AddToken('==')
self.Advance(2)
else:
return None
return self.tokens
class Scanner(object):
"""A simple scanner that can serve out tokens from a given list"""
def __init__(self, tokens):
self.tokens = tokens
self.length = len(tokens)
self.index = 0
def HasMore(self):
return self.index < self.length
def Current(self):
return self.tokens[self.index]
def Advance(self):
self.index = self.index + 1
def ParseAtomicExpression(scan):
if scan.Current() == "true":
scan.Advance()
return Constant(True)
elif scan.Current() == "false":
scan.Advance()
return Constant(False)
elif IsAlpha(scan.Current()):
name = scan.Current()
scan.Advance()
return Outcome(name.lower())
elif scan.Current() == '$':
scan.Advance()
if not IsAlpha(scan.Current()):
return None
name = scan.Current()
scan.Advance()
return Variable(name.lower())
elif scan.Current() == '(':
scan.Advance()
result = ParseLogicalExpression(scan)
if (not result) or (scan.Current() != ')'):
return None
scan.Advance()
return result
else:
return None
BINARIES = ['==']
def ParseOperatorExpression(scan):
left = ParseAtomicExpression(scan)
if not left: return None
while scan.HasMore() and (scan.Current() in BINARIES):
op = scan.Current()
scan.Advance()
right = ParseOperatorExpression(scan)
if not right:
return None
left = Operation(left, op, right)
return left
def ParseConditionalExpression(scan):
left = ParseOperatorExpression(scan)
if not left: return None
while scan.HasMore() and (scan.Current() == 'if'):
scan.Advance()
right = ParseOperatorExpression(scan)
if not right:
return None
left= Operation(left, 'if', right)
return left
LOGICALS = ["&&", "||", ","]
def ParseLogicalExpression(scan):
left = ParseConditionalExpression(scan)
if not left: return None
while scan.HasMore() and (scan.Current() in LOGICALS):
op = scan.Current()
scan.Advance()
right = ParseConditionalExpression(scan)
if not right:
return None
left = Operation(left, op, right)
return left
def ParseCondition(expr):
"""Parses a logical expression into an Expression object"""
tokens = Tokenizer(expr).Tokenize()
if not tokens:
print "Malformed expression: '%s'" % expr
return None
scan = Scanner(tokens)
ast = ParseLogicalExpression(scan)
if not ast:
print "Malformed expression: '%s'" % expr
return None
if scan.HasMore():
print "Malformed expression: '%s'" % expr
return None
return ast
class ClassifiedTest(object):
def __init__(self, case, outcomes):
self.case = case
self.outcomes = outcomes
class Configuration(object):
"""The parsed contents of a configuration file"""
def __init__(self, sections, defs):
self.sections = sections
self.defs = defs
def ClassifyTests(self, cases, env):
sections = [s for s in self.sections if s.condition.Evaluate(env, self.defs)]
all_rules = reduce(list.__add__, [s.rules for s in sections], [])
unused_rules = set(all_rules)
result = [ ]
all_outcomes = set([])
for case in cases:
matches = [ r for r in all_rules if r.Contains(case.path) ]
outcomes = set([])
for rule in matches:
outcomes = outcomes.union(rule.GetOutcomes(env, self.defs))
unused_rules.discard(rule)
if not outcomes:
outcomes = [PASS]
case.outcomes = outcomes
all_outcomes = all_outcomes.union(outcomes)
result.append(ClassifiedTest(case, outcomes))
return (result, list(unused_rules), all_outcomes)
class Section(object):
"""A section of the configuration file. Sections are enabled or
disabled prior to running the tests, based on their conditions"""
def __init__(self, condition):
self.condition = condition
self.rules = [ ]
def AddRule(self, rule):
self.rules.append(rule)
class Rule(object):
"""A single rule that specifies the expected outcome for a single
test."""
def __init__(self, raw_path, path, value):
self.raw_path = raw_path
self.path = path
self.value = value
def GetOutcomes(self, env, defs):
set = self.value.GetOutcomes(env, defs)
assert isinstance(set, ListSet)
return set.elms
def Contains(self, path):
if len(self.path) > len(path):
return False
for i in xrange(len(self.path)):
if not self.path[i].match(path[i]):
return False
return True
HEADER_PATTERN = re.compile(r'\[([^]]+)\]')
RULE_PATTERN = re.compile(r'\s*([^: ]*)\s*:(.*)')
DEF_PATTERN = re.compile(r'^def\s*(\w+)\s*=(.*)$')
PREFIX_PATTERN = re.compile(r'^\s*prefix\s+([\w\_\.\-\/]+)$')
def ReadConfigurationInto(path, sections, defs):
current_section = Section(Constant(True))
sections.append(current_section)
prefix = []
for line in utils.ReadLinesFrom(path):
header_match = HEADER_PATTERN.match(line)
if header_match:
condition_str = header_match.group(1).strip()
condition = ParseCondition(condition_str)
new_section = Section(condition)
sections.append(new_section)
current_section = new_section
continue
rule_match = RULE_PATTERN.match(line)
if rule_match:
path = prefix + SplitPath(rule_match.group(1).strip())
value_str = rule_match.group(2).strip()
value = ParseCondition(value_str)
if not value:
return False
current_section.AddRule(Rule(rule_match.group(1), path, value))
continue
def_match = DEF_PATTERN.match(line)
if def_match:
name = def_match.group(1).lower()
value = ParseCondition(def_match.group(2).strip())
if not value:
return False
defs[name] = value
continue
prefix_match = PREFIX_PATTERN.match(line)
if prefix_match:
prefix = SplitPath(prefix_match.group(1).strip())
continue
print "Malformed line: '%s'." % line
return False
return True
# ---------------
# --- M a i n ---
# ---------------
ARCH_GUESS = utils.GuessArchitecture()
def BuildOptions():
result = optparse.OptionParser()
result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)",
default='release')
result.add_option("-v", "--verbose", help="Verbose output",
default=False, action="store_true")
result.add_option("-S", dest="scons_flags", help="Flag to pass through to scons",
default=[], action="append")
result.add_option("-p", "--progress",
help="The style of progress indicator (verbose, dots, color, mono, tap)",
choices=PROGRESS_INDICATORS.keys(), default="mono")
result.add_option("--no-build", help="Don't build requirements",
default=True, action="store_true")
result.add_option("--build-only", help="Only build requirements, don't run the tests",
default=False, action="store_true")
result.add_option("--report", help="Print a summary of the tests to be run",
default=False, action="store_true")
result.add_option("-s", "--suite", help="A test suite",
default=[], action="append")
result.add_option("-t", "--timeout", help="Timeout in seconds",
default=60, type="int")
result.add_option("--arch", help='The architecture to run tests for',
default='none')
result.add_option("--snapshot", help="Run the tests with snapshot turned on",
default=False, action="store_true")
result.add_option("--simulator", help="Run tests with architecture simulator",
default='none')
result.add_option("--special-command", default=None)
result.add_option("--use-http1", help="Pass --use-http1 switch to node",
default=False, action="store_true")
result.add_option("--valgrind", help="Run tests through valgrind",
default=False, action="store_true")
result.add_option("--cat", help="Print the source of the tests",
default=False, action="store_true")
result.add_option("--warn-unused", help="Report unused rules",
default=False, action="store_true")
result.add_option("-j", help="The number of parallel tasks to run",
default=1, type="int")
result.add_option("--time", help="Print timing information after running",
default=False, action="store_true")
result.add_option("--suppress-dialogs", help="Suppress Windows dialogs for crashing tests",
dest="suppress_dialogs", default=True, action="store_true")
result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for crashing tests",
dest="suppress_dialogs", action="store_false")
result.add_option("--shell", help="Path to V8 shell", default="shell")
result.add_option("--store-unexpected-output",
help="Store the temporary JS files from tests that fails",
dest="store_unexpected_output", default=True, action="store_true")
result.add_option("--no-store-unexpected-output",
help="Deletes the temporary JS files from tests that fails",
dest="store_unexpected_output", action="store_false")
return result
def ProcessOptions(options):
global VERBOSE
VERBOSE = options.verbose
options.mode = options.mode.split(',')
for mode in options.mode:
if not mode in ['debug', 'release']:
print "Unknown mode %s" % mode
return False
if options.simulator != 'none':
# Simulator argument was set. Make sure arch and simulator agree.
if options.simulator != options.arch:
if options.arch == 'none':
options.arch = options.simulator
else:
print "Architecture %s does not match sim %s" %(options.arch, options.simulator)
return False
# Ensure that the simulator argument is handed down to scons.
options.scons_flags.append("simulator=" + options.simulator)
else:
# If options.arch is not set by the command line and no simulator setting
# was found, set the arch to the guess.
if options.arch == 'none':
options.arch = ARCH_GUESS
options.scons_flags.append("arch=" + options.arch)
if options.snapshot:
options.scons_flags.append("snapshot=on")
return True
REPORT_TEMPLATE = """\
Total: %(total)i tests
* %(skipped)4d tests will be skipped
* %(nocrash)4d tests are expected to be flaky but not crash
* %(pass)4d tests are expected to pass
* %(fail_ok)4d tests are expected to fail that we won't fix
* %(fail)4d tests are expected to fail that we should fix\
"""
def PrintReport(cases):
def IsFlaky(o):
return (PASS in o) and (FAIL in o) and (not CRASH in o) and (not OKAY in o)
def IsFailOk(o):
return (len(o) == 2) and (FAIL in o) and (OKAY in o)
unskipped = [c for c in cases if not SKIP in c.outcomes]
print REPORT_TEMPLATE % {
'total': len(cases),
'skipped': len(cases) - len(unskipped),
'nocrash': len([t for t in unskipped if IsFlaky(t.outcomes)]),
'pass': len([t for t in unskipped if list(t.outcomes) == [PASS]]),
'fail_ok': len([t for t in unskipped if IsFailOk(t.outcomes)]),
'fail': len([t for t in unskipped if list(t.outcomes) == [FAIL]])
}
class Pattern(object):
def __init__(self, pattern):
self.pattern = pattern
self.compiled = None
def match(self, str):
if not self.compiled:
pattern = "^" + self.pattern.replace('*', '.*') + "$"
self.compiled = re.compile(pattern)
return self.compiled.match(str)
def __str__(self):
return self.pattern
def SplitPath(s):
stripped = [ c.strip() for c in s.split('/') ]
return [ Pattern(s) for s in stripped if len(s) > 0 ]
def GetSpecialCommandProcessor(value):
if (not value) or (value.find('@') == -1):
def ExpandCommand(args):
return args
return ExpandCommand
else:
pos = value.find('@')
import urllib
prefix = urllib.unquote(value[:pos]).split()
suffix = urllib.unquote(value[pos+1:]).split()
def ExpandCommand(args):
return prefix + args + suffix
return ExpandCommand
BUILT_IN_TESTS = ['simple', 'pummel', 'message', 'internet', 'gc']
def GetSuites(test_root):
def IsSuite(path):
return isdir(path) and exists(join(path, 'testcfg.py'))
return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ]
def FormatTime(d):
millis = round(d * 1000) % 1000
return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis)
def Main():
parser = BuildOptions()
(options, args) = parser.parse_args()
if not ProcessOptions(options):
parser.print_help()
return 1
workspace = abspath(join(dirname(sys.argv[0]), '..'))
suites = GetSuites(join(workspace, 'test'))
repositories = [TestRepository(join(workspace, 'test', name)) for name in suites]
repositories += [TestRepository(a) for a in options.suite]
root = LiteralTestSuite(repositories)
if len(args) == 0:
paths = [SplitPath(t) for t in BUILT_IN_TESTS]
else:
paths = [ ]
for arg in args:
path = SplitPath(arg)
paths.append(path)
# Check for --valgrind option. If enabled, we overwrite the special
# command flag with a command that uses the run-valgrind.py script.
if options.valgrind:
run_valgrind = join(workspace, "tools", "run-valgrind.py")
options.special_command = "python -u " + run_valgrind + " @"
shell = abspath(options.shell)
buildspace = dirname(shell)
processor = GetSpecialCommandProcessor(options.special_command)
if options.use_http1:
def wrap(processor):
return lambda args: processor(args[:1] + ['--use-http1'] + args[1:])
processor = wrap(processor)
context = Context(workspace,
buildspace,
VERBOSE,
shell,
options.timeout,
processor,
options.suppress_dialogs,
options.store_unexpected_output)
# First build the required targets
if not options.no_build:
reqs = [ ]
for path in paths:
reqs += root.GetBuildRequirements(path, context)
reqs = list(set(reqs))
if len(reqs) > 0:
if options.j != 1:
options.scons_flags += ['-j', str(options.j)]
if not BuildRequirements(context, reqs, options.mode, options.scons_flags):
return 1
# Just return if we are only building the targets for running the tests.
if options.build_only:
return 0
# Get status for tests
sections = [ ]
defs = { }
root.GetTestStatus(context, sections, defs)
config = Configuration(sections, defs)
# List the tests
all_cases = [ ]
all_unused = [ ]
unclassified_tests = [ ]
globally_unused_rules = None
for path in paths:
for mode in options.mode:
if not exists(context.GetVm(mode)):
print "Can't find shell executable: '%s'" % context.GetVm(mode)
continue
env = {
'mode': mode,
'system': utils.GuessOS(),
'arch': options.arch,
'simulator': options.simulator
}
test_list = root.ListTests([], path, context, mode)
unclassified_tests += test_list
(cases, unused_rules, all_outcomes) = config.ClassifyTests(test_list, env)
if globally_unused_rules is None:
globally_unused_rules = set(unused_rules)
else:
globally_unused_rules = globally_unused_rules.intersection(unused_rules)
all_cases += cases
all_unused.append(unused_rules)
if options.cat:
visited = set()
for test in unclassified_tests:
key = tuple(test.path)
if key in visited:
continue
visited.add(key)
print "--- begin source: %s ---" % test.GetLabel()
source = test.GetSource().strip()
print source
print "--- end source: %s ---" % test.GetLabel()
return 0
if options.warn_unused:
for rule in globally_unused_rules:
print "Rule for '%s' was not used." % '/'.join([str(s) for s in rule.path])
if options.report:
PrintReport(all_cases)
result = None
def DoSkip(case):
return SKIP in case.outcomes or SLOW in case.outcomes
cases_to_run = [ c for c in all_cases if not DoSkip(c) ]
if len(cases_to_run) == 0:
print "No tests to run."
return 0
else:
try:
start = time.time()
if RunTestCases(cases_to_run, options.progress, options.j):
result = 0
else:
result = 1
duration = time.time() - start
except KeyboardInterrupt:
print "Interrupted"
return 1
if options.time:
# Write the times to stderr to make it easy to separate from the
# test output.
print
sys.stderr.write("--- Total time: %s ---\n" % FormatTime(duration))
timed_tests = [ t.case for t in cases_to_run if not t.case.duration is None ]
timed_tests.sort(lambda a, b: a.CompareTime(b))
index = 1
for entry in timed_tests[:20]:
t = FormatTime(entry.duration)
sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
index += 1
return result
if __name__ == '__main__':
sys.exit(Main())
| x684867/nemesis | src/node/tools/test.py | Python | mit | 42,571 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
4372,
2615,
18750,
1001,
1001,
9385,
2263,
1996,
15754,
2622,
6048,
1012,
2035,
2916,
9235,
1012,
1001,
25707,
1998,
2224,
1999,
3120,
1998,
12441,
3596,
1010,
2007,
2030,
2302,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __javax_security_auth_login_Configuration__
#define __javax_security_auth_login_Configuration__
#pragma interface
#include <java/lang/Object.h>
#include <gcj/array.h>
extern "Java"
{
namespace javax
{
namespace security
{
namespace auth
{
namespace login
{
class AppConfigurationEntry;
class Configuration;
}
}
}
}
}
class javax::security::auth::login::Configuration : public ::java::lang::Object
{
public: // actually protected
Configuration();
public:
static ::javax::security::auth::login::Configuration * getConfiguration();
static void setConfiguration(::javax::security::auth::login::Configuration *);
virtual JArray< ::javax::security::auth::login::AppConfigurationEntry * > * getAppConfigurationEntry(::java::lang::String *) = 0;
virtual void refresh() = 0;
public: // actually package-private
static ::javax::security::auth::login::Configuration * getConfig();
private:
static ::javax::security::auth::login::Configuration * config;
public:
static ::java::lang::Class class$;
};
#endif // __javax_security_auth_login_Configuration__
| SanDisk-Open-Source/SSD_Dashboard | uefi/gcc/gcc-4.6.3/libjava/javax/security/auth/login/Configuration.h | C | gpl-2.0 | 1,221 | [
30522,
1013,
1013,
2079,
2025,
10086,
2023,
5371,
1011,
2009,
2003,
3698,
7013,
1011,
1008,
1011,
1039,
1009,
1009,
1011,
1008,
1011,
1001,
2065,
13629,
2546,
1035,
1035,
9262,
2595,
1035,
3036,
1035,
8740,
2705,
1035,
8833,
2378,
1035,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!-- phone mask -->
<div class="form-group">
<label>US phone mask:</label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-phone"></i>
</div>
<input type="text" class="form-control" data-inputmask='"mask": "(999) 999-9999"' data-mask/>
</div><!-- /.input group -->
</div><!-- /.form group --> | rmak78/talentagency | example-widgets/phone-mask.php | PHP | mit | 505 | [
30522,
1026,
999,
1011,
1011,
3042,
7308,
1011,
1011,
1028,
1026,
4487,
2615,
2465,
1027,
1000,
2433,
1011,
2177,
1000,
1028,
1026,
3830,
1028,
2149,
3042,
7308,
1024,
1026,
1013,
3830,
1028,
1026,
4487,
2615,
2465,
1027,
1000,
7953,
1011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package fr.inria.jessy.transaction.termination.vote;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import fr.inria.jessy.ConstantPool;
/**
*
* @author Masoud Saeida Ardekani
*
*/
public class VotePiggyback implements Externalizable {
private static final long serialVersionUID = -ConstantPool.JESSY_MID;
Object piggyback;
public VotePiggyback() {
}
public VotePiggyback(Object piggyback) {
this.piggyback = piggyback;
}
public Object getPiggyback() {
return piggyback;
}
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
piggyback = in.readObject();
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(piggyback);
}
}
| EvilMcJerkface/jessy | src/fr/inria/jessy/transaction/termination/vote/VotePiggyback.java | Java | mit | 817 | [
30522,
7427,
10424,
1012,
1999,
4360,
1012,
12245,
2100,
1012,
12598,
1012,
18287,
1012,
3789,
1025,
12324,
9262,
30524,
1012,
22834,
1012,
22834,
10288,
24422,
1025,
12324,
9262,
1012,
22834,
1012,
4874,
2378,
18780,
1025,
12324,
9262,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Niphobolus calvatus Diels SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | mdoering/backbone | life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Polypodiaceae/Pyrrosia/Niphobolus calvatus/README.md | Markdown | apache-2.0 | 175 | [
30522,
1001,
9152,
8458,
16429,
4747,
2271,
10250,
22879,
2271,
3280,
4877,
2427,
1001,
1001,
1001,
1001,
3570,
3970,
1001,
1001,
1001,
1001,
2429,
2000,
2248,
3269,
3415,
5950,
1001,
1001,
1001,
1001,
2405,
1999,
19701,
1001,
1001,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Başardım :)
| PAU-Projects/Github-Odev | sefa.md | Markdown | mit | 14 | [
30522,
19021,
4232,
11722,
2213,
1024,
1007,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace wcf\system\html\output\node;
use wcf\system\html\node\AbstractHtmlNodeProcessor;
use wcf\system\WCF;
use wcf\util\StringUtil;
/**
* Processes spoilers.
*
* @author Alexander Ebert
* @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Html\Output\Node
* @since 3.0
*/
class HtmlOutputNodeWoltlabSpoiler extends AbstractHtmlOutputNode {
/**
* @inheritDoc
*/
protected $tagName = 'woltlab-spoiler';
/**
* @inheritDoc
*/
public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProcessor) {
/** @var \DOMElement $element */
foreach ($elements as $element) {
if ($this->outputType === 'text/html') {
$nodeIdentifier = StringUtil::getRandomID();
$htmlNodeProcessor->addNodeData($this, $nodeIdentifier, ['label' => $element->getAttribute('data-label')]);
$htmlNodeProcessor->renameTag($element, 'wcfNode-' . $nodeIdentifier);
}
else if ($this->outputType === 'text/simplified-html' || $this->outputType === 'text/plain') {
$htmlNodeProcessor->replaceElementWithText(
$element,
WCF::getLanguage()->getDynamicVariable('wcf.bbcode.spoiler.simplified', ['label' => $element->getAttribute('data-label')]),
true
);
}
}
}
/**
* @inheritDoc
*/
public function replaceTag(array $data) {
WCF::getTPL()->assign([
'buttonLabel' => $data['label']
]);
return WCF::getTPL()->fetch('spoilerMetaCode');
}
}
| 0xLeon/WCF | wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeWoltlabSpoiler.class.php | PHP | lgpl-2.1 | 1,553 | [
30522,
1026,
1029,
25718,
3415,
15327,
15868,
2546,
1032,
2291,
1032,
16129,
1032,
6434,
1032,
13045,
1025,
2224,
15868,
2546,
1032,
2291,
1032,
16129,
1032,
13045,
1032,
10061,
11039,
19968,
3630,
3207,
21572,
9623,
21748,
1025,
2224,
15868,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package com.ai.tris.server.dao.interfaces;
import com.ai.tris.server.orm.impl.ClientAppInfoBean;
import java.util.List;
/**
* Common Database Access Object.
* <p/>
* Created by Sam on 2015/6/9.
*/
public interface ICommonDao {
void querySomething();
/**
* get all client app information from tris.client_app_info
*/
List<ClientAppInfoBean> getTrisClientAppInfo();
void insertSomething(long id);
} | zhoufan2013/TRIS_Platform | server/src/main/java/com/ai/tris/server/dao/interfaces/ICommonDao.java | Java | apache-2.0 | 433 | [
30522,
7427,
4012,
1012,
9932,
1012,
13012,
2015,
1012,
8241,
1012,
4830,
2080,
1012,
19706,
1025,
12324,
4012,
1012,
9932,
1012,
13012,
2015,
1012,
8241,
1012,
2030,
2213,
1012,
17727,
2140,
1012,
7396,
29098,
2378,
14876,
4783,
2319,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class AboutBox1
Inherits System.Windows.Forms.Form
'Form 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Friend WithEvents TableLayoutPanel As System.Windows.Forms.TableLayoutPanel
Friend WithEvents LogoPictureBox As System.Windows.Forms.PictureBox
Friend WithEvents LabelProductName As System.Windows.Forms.Label
Friend WithEvents LabelVersion As System.Windows.Forms.Label
Friend WithEvents LabelCompanyName As System.Windows.Forms.Label
Friend WithEvents TextBoxDescription As System.Windows.Forms.TextBox
Friend WithEvents OKButton As System.Windows.Forms.Button
Friend WithEvents LabelCopyright As System.Windows.Forms.Label
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AboutBox1))
Me.TableLayoutPanel = New System.Windows.Forms.TableLayoutPanel
Me.LogoPictureBox = New System.Windows.Forms.PictureBox
Me.LabelProductName = New System.Windows.Forms.Label
Me.LabelVersion = New System.Windows.Forms.Label
Me.LabelCopyright = New System.Windows.Forms.Label
Me.LabelCompanyName = New System.Windows.Forms.Label
Me.TextBoxDescription = New System.Windows.Forms.TextBox
Me.OKButton = New System.Windows.Forms.Button
Me.TableLayoutPanel.SuspendLayout()
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'TableLayoutPanel
'
Me.TableLayoutPanel.ColumnCount = 2
Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.0!))
Me.TableLayoutPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67.0!))
Me.TableLayoutPanel.Controls.Add(Me.LogoPictureBox, 0, 0)
Me.TableLayoutPanel.Controls.Add(Me.LabelProductName, 1, 0)
Me.TableLayoutPanel.Controls.Add(Me.LabelVersion, 1, 1)
Me.TableLayoutPanel.Controls.Add(Me.LabelCopyright, 1, 2)
Me.TableLayoutPanel.Controls.Add(Me.LabelCompanyName, 1, 3)
Me.TableLayoutPanel.Controls.Add(Me.TextBoxDescription, 1, 4)
Me.TableLayoutPanel.Controls.Add(Me.OKButton, 1, 5)
Me.TableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill
Me.TableLayoutPanel.Location = New System.Drawing.Point(9, 9)
Me.TableLayoutPanel.Name = "TableLayoutPanel"
Me.TableLayoutPanel.RowCount = 6
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.TableLayoutPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TableLayoutPanel.Size = New System.Drawing.Size(396, 258)
Me.TableLayoutPanel.TabIndex = 0
'
'LogoPictureBox
'
Me.LogoPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.LogoPictureBox.Image = CType(resources.GetObject("LogoPictureBox.Image"), System.Drawing.Image)
Me.LogoPictureBox.Location = New System.Drawing.Point(3, 3)
Me.LogoPictureBox.Name = "LogoPictureBox"
Me.TableLayoutPanel.SetRowSpan(Me.LogoPictureBox, 6)
Me.LogoPictureBox.Size = New System.Drawing.Size(124, 64)
Me.LogoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.LogoPictureBox.TabIndex = 0
Me.LogoPictureBox.TabStop = False
'
'LabelProductName
'
Me.LabelProductName.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelProductName.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelProductName.Location = New System.Drawing.Point(136, 0)
Me.LabelProductName.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelProductName.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelProductName.Name = "LabelProductName"
Me.LabelProductName.Size = New System.Drawing.Size(257, 17)
Me.LabelProductName.TabIndex = 0
Me.LabelProductName.Text = "产品名称"
Me.LabelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'LabelVersion
'
Me.LabelVersion.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelVersion.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelVersion.Location = New System.Drawing.Point(136, 25)
Me.LabelVersion.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelVersion.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelVersion.Name = "LabelVersion"
Me.LabelVersion.Size = New System.Drawing.Size(257, 17)
Me.LabelVersion.TabIndex = 0
Me.LabelVersion.Text = "版本"
Me.LabelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'LabelCopyright
'
Me.LabelCopyright.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelCopyright.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelCopyright.Location = New System.Drawing.Point(136, 50)
Me.LabelCopyright.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelCopyright.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelCopyright.Name = "LabelCopyright"
Me.LabelCopyright.Size = New System.Drawing.Size(257, 17)
Me.LabelCopyright.TabIndex = 0
Me.LabelCopyright.Text = "版权"
Me.LabelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'LabelCompanyName
'
Me.LabelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill
Me.LabelCompanyName.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelCompanyName.Location = New System.Drawing.Point(136, 75)
Me.LabelCompanyName.Margin = New System.Windows.Forms.Padding(6, 0, 3, 0)
Me.LabelCompanyName.MaximumSize = New System.Drawing.Size(0, 17)
Me.LabelCompanyName.Name = "LabelCompanyName"
Me.LabelCompanyName.Size = New System.Drawing.Size(257, 17)
Me.LabelCompanyName.TabIndex = 0
Me.LabelCompanyName.Text = "公司名称"
Me.LabelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'TextBoxDescription
'
Me.TextBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill
Me.TextBoxDescription.Location = New System.Drawing.Point(136, 103)
Me.TextBoxDescription.Margin = New System.Windows.Forms.Padding(6, 3, 3, 3)
Me.TextBoxDescription.Multiline = True
Me.TextBoxDescription.Name = "TextBoxDescription"
Me.TextBoxDescription.ReadOnly = True
Me.TextBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.TextBoxDescription.Size = New System.Drawing.Size(257, 123)
Me.TextBoxDescription.TabIndex = 0
Me.TextBoxDescription.TabStop = False
Me.TextBoxDescription.Text = "说明 :" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "(在运行时,将用应用程序的程序集信息替换这些标签的文本。" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "在"
'
'OKButton
'
Me.OKButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.OKButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.OKButton.Location = New System.Drawing.Point(318, 232)
Me.OKButton.Name = "OKButton"
Me.OKButton.Size = New System.Drawing.Size(75, 23)
Me.OKButton.TabIndex = 0
Me.OKButton.Text = "确定(&O)"
'
'AboutBox1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.OKButton
Me.ClientSize = New System.Drawing.Size(414, 276)
Me.Controls.Add(Me.TableLayoutPanel)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "AboutBox1"
Me.Padding = New System.Windows.Forms.Padding(9)
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "AboutBox1"
Me.TableLayoutPanel.ResumeLayout(False)
Me.TableLayoutPanel.PerformLayout()
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
End Class
| luanshixia/ProjectCollection | iWord/iWord/AboutBox1.Designer.vb | Visual Basic | gpl-2.0 | 10,546 | [
30522,
1026,
3795,
1012,
7513,
1012,
5107,
22083,
2594,
1012,
21624,
8043,
7903,
2229,
1012,
5859,
6914,
16848,
1006,
1007,
1028,
1035,
7704,
2465,
2055,
8758,
2487,
22490,
2015,
2291,
1012,
3645,
1012,
3596,
1012,
2433,
1005,
2433,
100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Serialization;
namespace SharpFtpServer
{
// TODO: Implement a real user store.
[Obsolete]
public static class UserStore
{
private static List<User> _users;
static UserStore()
{
_users = new List<User>();
XmlSerializer serializer = new XmlSerializer(_users.GetType(), new XmlRootAttribute("Users"));
if (File.Exists("users.xml"))
{
_users = serializer.Deserialize(new StreamReader("users.xml")) as List<User>;
}
else
{
_users.Add(new User {
Username = "rick",
Password = "test",
HomeDir = "C:\\Utils"
});
using (StreamWriter w = new StreamWriter("users.xml"))
{
serializer.Serialize(w, _users);
}
}
}
public static User Validate(string username, string password)
{
User user = (from u in _users where u.Username == username && u.Password == password select u).SingleOrDefault();
return user;
}
}
}
| staywarde/windows-iot-miniFTPServer | windows-iot-miniFTPServer/windows-iot-miniFTPServer/FTPServer/UserStore.cs | C# | gpl-3.0 | 1,300 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
11409,
4160,
1025,
2478,
2291,
1012,
3793,
1025,
2478,
2291,
1012,
22834,
1025,
2478,
2291,
1012,
20950,
1012,
7642,
3989,
1025,
3415,
15327,
4629,
6199,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../circle.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Lenovo</td><td>IdeaTab A2207A-H</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a>
<!-- Modal Structure -->
<div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
[family] => Lenovo IdeaTab A2207A-H
[brand] => Lenovo
[model] => IdeaTab A2207A-H
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>Android 4.0</td><td>WebKit </td><td>Android 4.0</td><td style="border-left: 1px solid #555"></td><td></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.012</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a>
<!-- Modal Structure -->
<div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapFull result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.4\.0.* build\/.*\).*applewebkit\/.*\(.*khtml,.*like gecko.*\).*version\/4\.0.*safari.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android?4.0* build/*)*applewebkit/*(*khtml,*like gecko*)*version/4.0*safari*
[parent] => Android Browser 4.0
[comment] => Android Browser 4.0
[browser] => Android
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Google Inc
[browser_modus] => unknown
[version] => 4.0
[majorver] => 4
[minorver] => 0
[platform] => Android
[platform_version] => 4.0
[platform_description] => Android OS
[platform_bits] => 32
[platform_maker] => Google Inc
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] =>
[javascript] => 1
[vbscript] =>
[javaapplets] => 1
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[isfake] =>
[isanonymized] =>
[ismodified] =>
[cssversion] => 3
[aolversion] => 0
[device_name] => general Mobile Phone
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => touchscreen
[device_code_name] => general Mobile Phone
[device_brand_name] => unknown
[renderingengine_name] => WebKit
[renderingengine_version] => unknown
[renderingengine_description] => For Google Chrome, iOS (including both mobile Safari, WebViews within third-party apps, and web clips), Safari, Arora, Midori, OmniWeb, Shiira, iCab since version 4, Web, SRWare Iron, Rekonq, and in Maxthon 3.
[renderingengine_maker] => Apple Inc
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td><td>Android 4.0</td><td><i class="material-icons">close</i></td><td>Android </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.004</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-42bb56ba-b834-47c5-bea0-c0270e9ab371">Detail</a>
<!-- Modal Structure -->
<div id="modal-42bb56ba-b834-47c5-bea0-c0270e9ab371" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapLite result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.* build\/.*\).*applewebkit\/.*\(.*khtml,.*like gecko.*\).*version\/4\.0.*safari.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android* build/*)*applewebkit/*(*khtml,*like gecko*)*version/4.0*safari*
[parent] => Android Browser 4.0
[comment] => Android Browser 4.0
[browser] => Android
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => unknown
[browser_modus] => unknown
[version] => 4.0
[majorver] => 0
[minorver] => 0
[platform] => Android
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] => false
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => unknown
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>Android 4.0</td><td><i class="material-icons">close</i></td><td>Android </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.008</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a>
<!-- Modal Structure -->
<div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/5\.0 \(.*linux.*android.* build\/.*\).*applewebkit\/.*\(.*khtml,.*like gecko.*\).*version\/4\.0.*safari.*$/
[browser_name_pattern] => mozilla/5.0 (*linux*android* build/*)*applewebkit/*(*khtml,*like gecko*)*version/4.0*safari*
[parent] => Android Browser 4.0
[comment] => Android Browser 4.0
[browser] => Android
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => Google Inc
[browser_modus] => unknown
[version] => 4.0
[majorver] => 4
[minorver] => 0
[platform] => Android
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] => false
[crawler] =>
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Mobile Phone
[device_pointing_method] => touchscreen
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>Android Browser 4.0</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a>
<!-- Modal Structure -->
<div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] => Android
[browser] => Android Browser
[version] => 4.0
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td>Safari 4.0</td><td><i class="material-icons">close</i></td><td>AndroidOS 4.0.4</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a>
<!-- Modal Structure -->
<div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>JenssegersAgent result detail</h4>
<p><pre><code class="php">Array
(
[browserName] => Safari
[browserVersion] => 4.0
[osName] => AndroidOS
[osVersion] => 4.0.4
[deviceModel] => LenovoTablet
[isMobile] => 1
[isRobot] =>
[botName] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td>Android Webkit 4.0</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555">Lenovo</td><td>A2207</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.30602</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a>
<!-- Modal Structure -->
<div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 1024
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Lenovo
[mobile_model] => A2207
[version] => 4.0
[is_android] => 1
[browser_name] => Android Webkit
[operating_system_family] => Android
[operating_system_version] => 4.0.4
[is_ios] =>
[producer] => Google Inc.
[operating_system] => Android 4.0.x Ice Cream Sandwich
[mobile_screen_width] => 600
[mobile_browser] => Android Webkit
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td>Android Browser </td><td>WebKit </td><td>Android 4.0</td><td style="border-left: 1px solid #555">Lenovo</td><td>IdeaTab A2207A</td><td>tablet</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.003</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a>
<!-- Modal Structure -->
<div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] => Array
(
[type] => browser
[name] => Android Browser
[short_name] => AN
[version] =>
[engine] => WebKit
)
[operatingSystem] => Array
(
[name] => Android
[short_name] => AND
[version] => 4.0
[platform] =>
)
[device] => Array
(
[brand] => LE
[brandName] => Lenovo
[model] => IdeaTab A2207A
[device] => 2
[deviceName] => tablet
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] =>
[isTablet] => 1
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td><td>Navigator 4.0</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ec1cd248-02b0-457e-8a9d-35bb99af008c">Detail</a>
<!-- Modal Structure -->
<div id="modal-ec1cd248-02b0-457e-8a9d-35bb99af008c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>SinergiBrowserDetector result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Sinergi\BrowserDetector\Browser Object
(
[userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
)
[name:Sinergi\BrowserDetector\Browser:private] => Navigator
[version:Sinergi\BrowserDetector\Browser:private] => 4.0
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
[isFacebookWebView:Sinergi\BrowserDetector\Browser:private] =>
[isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => Android
[version:Sinergi\BrowserDetector\Os:private] => 4.0.4
[isMobile:Sinergi\BrowserDetector\Os:private] => 1
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
)
)
[device] => Sinergi\BrowserDetector\Device Object
(
[name:Sinergi\BrowserDetector\Device:private] => unknown
[userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td>Android 4.0.4</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555">Lenovo</td><td>IdeaTab A2207A-H</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a>
<!-- Modal Structure -->
<div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] => 4
[minor] => 0
[patch] => 4
[family] => Android
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] => 4
[minor] => 0
[patch] => 4
[patchMinor] =>
[family] => Android
)
[device] => UAParser\Result\Device Object
(
[brand] => Lenovo
[model] => IdeaTab A2207A-H
[family] => Lenovo IdeaTab A2207A-H
)
[originalUserAgent] => Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td>Safari 534.30</td><td>WebKit 534.30</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.15301</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a>
<!-- Modal Structure -->
<div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[platform_name] => Android
[platform_version] => 4.0.4
[platform_type] => Mobile
[browser_name] => Safari
[browser_version] => 534.30
[engine_name] => WebKit
[engine_version] => 534.30
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small><br /></td><td>Android Webkit Browser </td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.062</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee">Detail</a>
<!-- Modal Structure -->
<div id="modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentStringCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[agent_type] => Browser
[agent_name] => Android Webkit Browser
[agent_version] => --
[os_type] => Android
[os_name] => Android
[os_versionName] =>
[os_versionNumber] => 4.0.4
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] => German - Germany
[agent_languageTag] => de-de
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td>Android Browser 4.0</td><td>WebKit 534.30</td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.23801</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] => Android
[simple_sub_description_string] =>
[simple_browser_string] => Android Browser 4 on Android (Ice Cream Sandwich)
[browser_version] => 4
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => stdClass Object
(
[System Build] => IMM76D
)
[layout_engine_name] => WebKit
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => android-browser
[operating_system_version] => Ice Cream Sandwich
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] => 534.30
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] => Android (Ice Cream Sandwich)
[operating_system_version_full] => 4.0.4
[operating_platform_code] =>
[browser_name] => Android Browser
[operating_system_name_code] => android
[user_agent] => Mozilla/5.0 (Linux; U; Android 4.0.4; de-de; IdeaTabA2207A-H Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
[browser_version_full] => 4.0
[browser] => Android Browser 4
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td>Android Browser </td><td>Webkit 534.30</td><td>Android 4.0.4</td><td style="border-left: 1px solid #555">Lenovo</td><td>IdeaTab A2207</td><td>tablet</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a>
<!-- Modal Structure -->
<div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => Android Browser
)
[engine] => Array
(
[name] => Webkit
[version] => 534.30
)
[os] => Array
(
[name] => Android
[version] => 4.0.4
)
[device] => Array
(
[type] => tablet
[manufacturer] => Lenovo
[model] => IdeaTab A2207
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td><td>Safari 4.0</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>smartphone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9">Detail</a>
<!-- Modal Structure -->
<div id="modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => Safari
[vendor] => Apple
[version] => 4.0
[category] => smartphone
[os] => Android
[os_version] => 4.0.4
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td>Android Webkit 4.0.4</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555">Lenovo</td><td>A2207</td><td>Tablet</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.019</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a>
<!-- Modal Structure -->
<div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => true
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => true
[is_mobile] => true
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => true
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => false
[is_html_preferred] => true
[advertised_device_os] => Android
[advertised_device_os_version] => 4.0.4
[advertised_browser] => Android Webkit
[advertised_browser_version] => 4.0.4
[complete_device_name] => Lenovo A2207 (LePad A2207)
[device_name] => Lenovo LePad A2207
[form_factor] => Tablet
[is_phone] => false
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Lenovo
[model_name] => A2207
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => true
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] => Android
[mobile_browser] => Android Webkit
[mobile_browser_version] =>
[device_os_version] => 4.0
[pointing_method] => touchscreen
[release_date] => 2012_october
[marketing_name] => LePad A2207
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => false
[is_tablet] => true
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => true
[softkey_support] => false
[table_support] => true
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => true
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => true
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => true
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => wtai://wp/mc;
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => true
[xhtml_supports_forms_in_table] => true
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => true
[xhtml_supports_css_cell_table_coloring] => true
[xhtml_format_as_css_property] => false
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #FFFFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => true
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => iso-8859-1
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => text/html
[xhtml_table_support] => true
[xhtml_send_sms_string] => sms:
[xhtml_send_mms_string] => mms:
[xhtml_file_upload] => supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => full
[xhtml_avoid_accesskeys] => true
[xhtml_can_embed_video] => none
[ajax_support_javascript] => true
[ajax_manipulate_css] => true
[ajax_support_getelementbyid] => true
[ajax_support_inner_html] => true
[ajax_xhr_type] => standard
[ajax_manipulate_dom] => true
[ajax_support_events] => true
[ajax_support_event_listener] => true
[ajax_preferred_geoloc_api] => w3c_api
[xhtml_support_level] => 4
[preferred_markup] => html_web_4_0
[wml_1_1] => false
[wml_1_2] => false
[wml_1_3] => false
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => false
[html_wi_imode_html_2] => false
[html_wi_imode_html_3] => false
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => false
[html_web_3_2] => true
[html_web_4_0] => true
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 600
[resolution_height] => 1024
[columns] => 60
[max_image_width] => 320
[max_image_height] => 480
[rows] => 40
[physical_screen_width] => 90
[physical_screen_height] => 154
[dual_orientation] => true
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => true
[transparent_png_index] => true
[svgt_1_1] => true
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => true
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 3600
[wifi] => true
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 2000000
[max_url_length_in_requests] => 256
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => true
[inline_support] => false
[oma_support] => true
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => true
[streaming_3gpp] => true
[streaming_mp4] => true
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => 10
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => 2
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => 3.0
[streaming_acodec_amr] => nb
[streaming_acodec_aac] => lc
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => apple_live_streaming
[wap_push_support] => false
[connectionless_service_indication] => false
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => true
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => true
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => true
[mp3] => true
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => true
[css_supports_width_as_percentage] => true
[css_border_image] => webkit
[css_rounded_corners] => webkit
[css_gradient] => none
[css_spriting] => true
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => true
[progressive_download] => true
[playback_vcodec_h263_0] => 10
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => 0
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => 3.0
[playback_real_media] => none
[playback_3gpp] => true
[playback_3g2] => false
[playback_mp4] => true
[playback_mov] => false
[playback_acodec_amr] => nb
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => true
[html_preferred_dtd] => html4
[viewport_supported] => true
[viewport_width] => device_width_token
[viewport_userscalable] => no
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => full
[image_inlining] => true
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => A
[is_sencha_touch_ok] => false
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td>Android Webkit 4.0</td><td><i class="material-icons">close</i></td><td>Android 4.0.4</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a>
<!-- Modal Structure -->
<div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Zsxsoft result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[link] => http://developer.android.com/reference/android/webkit/package-summary.html
[title] => Android Webkit 4.0
[name] => Android Webkit
[version] => 4.0
[code] => android-webkit
[image] => img/16/browser/android-webkit.png
)
[os] => Array
(
[link] => http://www.android.com/
[name] => Android
[version] => 4.0.4
[code] => android
[x64] =>
[title] => Android 4.0.4
[type] => os
[dir] => os
[image] => img/16/os/android.png
)
[device] => Array
(
[link] =>
[title] =>
[model] =>
[brand] =>
[code] => null
[dir] => device
[type] => device
[image] => img/16/device/null.png
)
[platform] => Array
(
[link] => http://www.android.com/
[name] => Android
[version] => 4.0.4
[code] => android
[x64] =>
[title] => Android 4.0.4
[type] => os
[dir] => os
[image] => img/16/os/android.png
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-05-10 07:54:37</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | ThaDafinser/UserAgentParserComparison | v5/user-agent-detail/32/3b/323beaee-aba0-47f6-a805-9ffa9961bcfe.html | HTML | mit | 56,593 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1013,
1028,
1026,
2516,
1028,
5310,
4005,
6987,
1011,
9587... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/////////////////////////////////////////////////////////////////////////////
// Name: src/osx/artmac.cpp
// Purpose: wxArtProvider instance with native Mac stock icons
// Author: Alan Shouls
// Created: 2006-10-30
// Copyright: (c) wxWindows team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ---------------------------------------------------------------------------
// headers
// ---------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#pragma hdrstop
#endif
#include "wx/artprov.h"
#ifndef WX_PRECOMP
#include "wx/image.h"
#endif
#include "wx/osx/private.h"
// ----------------------------------------------------------------------------
// wxMacArtProvider
// ----------------------------------------------------------------------------
class wxMacArtProvider : public wxArtProvider
{
protected:
#if wxOSX_USE_COCOA_OR_CARBON
virtual wxIconBundle CreateIconBundle(const wxArtID& id,
const wxArtClient& client);
#endif
#if wxOSX_USE_COCOA_OR_IPHONE
virtual wxBitmap CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size)
{
return wxOSXCreateSystemBitmap(id, client, size);
}
#endif
};
/* static */ void wxArtProvider::InitNativeProvider()
{
PushBack(new wxMacArtProvider);
}
#if wxOSX_USE_COCOA_OR_CARBON
// ----------------------------------------------------------------------------
// helper macros
// ----------------------------------------------------------------------------
#define CREATE_STD_ICON(iconId, xpmRc) \
{ \
wxIconBundle icon(wxT(iconId), wxBITMAP_TYPE_ICON_RESOURCE); \
return icon; \
}
// Macro used in CreateBitmap to get wxICON_FOO icons:
#define ART_MSGBOX(artId, iconId, xpmRc) \
if ( id == artId ) \
{ \
CREATE_STD_ICON(#iconId, xpmRc) \
}
static wxIconBundle wxMacArtProvider_CreateIconBundle(const wxArtID& id)
{
ART_MSGBOX(wxART_ERROR, wxICON_ERROR, error)
ART_MSGBOX(wxART_INFORMATION, wxICON_INFORMATION, info)
ART_MSGBOX(wxART_WARNING, wxICON_WARNING, warning)
ART_MSGBOX(wxART_QUESTION, wxICON_QUESTION, question)
ART_MSGBOX(wxART_FOLDER, wxICON_FOLDER, folder)
ART_MSGBOX(wxART_FOLDER_OPEN, wxICON_FOLDER_OPEN, folder_open)
ART_MSGBOX(wxART_NORMAL_FILE, wxICON_NORMAL_FILE, deffile)
ART_MSGBOX(wxART_EXECUTABLE_FILE, wxICON_EXECUTABLE_FILE, exefile)
ART_MSGBOX(wxART_CDROM, wxICON_CDROM, cdrom)
ART_MSGBOX(wxART_FLOPPY, wxICON_FLOPPY, floppy)
ART_MSGBOX(wxART_HARDDISK, wxICON_HARDDISK, harddisk)
ART_MSGBOX(wxART_REMOVABLE, wxICON_REMOVABLE, removable)
ART_MSGBOX(wxART_DELETE, wxICON_DELETE, delete)
ART_MSGBOX(wxART_GO_BACK, wxICON_GO_BACK, back)
ART_MSGBOX(wxART_GO_FORWARD, wxICON_GO_FORWARD, forward)
ART_MSGBOX(wxART_GO_HOME, wxICON_GO_HOME, home)
ART_MSGBOX(wxART_HELP_SETTINGS, wxICON_HELP_SETTINGS, htmoptns)
ART_MSGBOX(wxART_HELP_PAGE, wxICON_HELP_PAGE, htmpage)
return wxNullIconBundle;
}
// ----------------------------------------------------------------------------
// CreateIconBundle
// ----------------------------------------------------------------------------
wxIconBundle wxMacArtProvider::CreateIconBundle(const wxArtID& id, const wxArtClient& client)
{
// On the Mac folders in lists are always drawn closed, so if an open
// folder icon is asked for we will ask for a closed one in its place
if ( client == wxART_LIST && id == wxART_FOLDER_OPEN )
return wxMacArtProvider_CreateIconBundle(wxART_FOLDER);
return wxMacArtProvider_CreateIconBundle(id);
}
#endif
// ----------------------------------------------------------------------------
// wxArtProvider::GetNativeSizeHint()
// ----------------------------------------------------------------------------
/*static*/
wxSize wxArtProvider::GetNativeSizeHint(const wxArtClient& client)
{
if ( client == wxART_TOOLBAR )
{
// See http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIcons/chapter_15_section_9.html:
// "32 x 32 pixels is the recommended size"
return wxSize(32, 32);
}
else if ( client == wxART_BUTTON || client == wxART_MENU )
{
// Mac UI doesn't use any images in neither buttons nor menus in
// general but the code using wxArtProvider can use wxART_BUTTON to
// find the icons of a roughly appropriate size for the buttons and
// 16x16 seems to be the best choice for this kind of use
return wxSize(16, 16);
}
return wxDefaultSize;
}
| vivier/SCSI2SD | software/scsi2sd-util/wxWidgets/src/osx/artmac.cpp | C++ | gpl-3.0 | 4,957 | [
30522,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
1013,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jsonp({"cep":"38706084","logradouro":"Pra\u00e7a Iraci Rodrigues Rosa","bairro":"Jardim Paulistano","cidade":"Patos de Minas","uf":"MG","estado":"Minas Gerais"});
| lfreneda/cepdb | api/v1/38706084.jsonp.js | JavaScript | cc0-1.0 | 163 | [
30522,
1046,
3385,
2361,
1006,
1063,
1000,
8292,
2361,
1000,
1024,
1000,
4229,
19841,
16086,
2620,
2549,
1000,
1010,
1000,
8833,
12173,
8162,
2080,
1000,
1024,
1000,
10975,
2050,
1032,
1057,
8889,
2063,
2581,
2050,
11209,
6895,
8473,
22934,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
Copyright 2011-2014 Nick Korbel
This file is part of Booked Scheduler is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Booked Scheduler. If not, see <http://www.gnu.org/licenses/>.
*/
require_once(ROOT_DIR . 'lib/Graphics/Image.php');
require_once(ROOT_DIR . 'lib/Graphics/ImageFactory.php');
?> | pluanant/booktu | lib/Graphics/namespace.php | PHP | gpl-3.0 | 784 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
9385,
2249,
1011,
2297,
4172,
12849,
15185,
2884,
2023,
5371,
2003,
2112,
1997,
17414,
6134,
2099,
2003,
2489,
4007,
1024,
2017,
2064,
2417,
2923,
3089,
8569,
2618,
2009,
1998,
1013,
2030,
19933,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* font server atom manipulations
*/
/*
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* Copyright 1990, 1991 Network Computing Devices;
* Portions Copyright 1987 by Digital Equipment Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of Network Computing Devices,
* or Digital not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Network Computing Devices, or Digital
* make no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, OR DIGITAL BE
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
#include "config.h"
#include "misc.h"
#include "fsresource.h"
#include "difs.h"
#define InitialTableSize 100
#define FSA_LAST_PREDEFINED 0 /* only None is predefined */
typedef struct _Node {
struct _Node *left,
*right;
Atom a;
unsigned int fingerPrint;
char *string;
} NodeRec, *NodePtr;
static Atom lastAtom = None;
static NodePtr atomRoot = (NodePtr) NULL;
static unsigned long tableLength;
static NodePtr *nodeTable;
Atom
MakeAtom(const char *string, unsigned int len, Bool makeit)
{
register NodePtr *np;
unsigned i;
int comp;
register unsigned int fp = 0;
np = &atomRoot;
for (i = 0; i < (len + 1) / 2; i++) {
fp = fp * 27 + string[i];
fp = fp * 27 + string[len - 1 - i];
}
while (*np != (NodePtr) NULL) {
if (fp < (*np)->fingerPrint)
np = &((*np)->left);
else if (fp > (*np)->fingerPrint)
np = &((*np)->right);
else { /* now start testing the strings */
comp = strncmp(string, (*np)->string, len);
if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string))))
np = &((*np)->left);
else if (comp > 0)
np = &((*np)->right);
else
return (*np)->a;
}
}
if (makeit) {
register NodePtr nd;
nd = (NodePtr) fsalloc(sizeof(NodeRec));
if (!nd)
return BAD_RESOURCE;
#if FSA_LAST_PREDEFINED > 0
if (lastAtom < FSA_LAST_PREDEFINED) {
nd->string = string;
} else
#endif
{
nd->string = (char *) fsalloc(len + 1);
if (!nd->string) {
fsfree(nd);
return BAD_RESOURCE;
}
strncpy(nd->string, string, len);
nd->string[len] = 0;
}
if ((lastAtom + 1) >= tableLength) {
NodePtr *table;
table = (NodePtr *) fsrealloc(nodeTable,
tableLength * (2 * sizeof(NodePtr)));
if (!table) {
if (nd->string != string)
fsfree(nd->string);
fsfree(nd);
return BAD_RESOURCE;
}
tableLength <<= 1;
nodeTable = table;
}
*np = nd;
nd->left = nd->right = (NodePtr) NULL;
nd->fingerPrint = fp;
nd->a = (++lastAtom);
*(nodeTable + lastAtom) = nd;
return nd->a;
} else
return None;
}
int
ValidAtom(Atom atom)
{
return (atom != None) && (atom <= lastAtom);
}
char *
NameForAtom(Atom atom)
{
NodePtr node;
if (atom > lastAtom)
return NULL;
if ((node = nodeTable[atom]) == (NodePtr) NULL)
return NULL;
return node->string;
}
static void
atom_error(void)
{
FatalError("initializing atoms\n");
}
static void
free_atom(NodePtr patom)
{
if (patom->left)
free_atom(patom->left);
if (patom->right)
free_atom(patom->right);
if (patom->a > FSA_LAST_PREDEFINED)
fsfree(patom->string);
fsfree(patom);
}
static void
free_all_atoms(void)
{
if (atomRoot == (NodePtr) NULL)
return;
free_atom(atomRoot);
atomRoot = (NodePtr) NULL;
fsfree(nodeTable);
nodeTable = (NodePtr *) NULL;
lastAtom = None;
}
void
InitAtoms(void)
{
free_all_atoms();
tableLength = InitialTableSize;
nodeTable = (NodePtr *) fsalloc(InitialTableSize * sizeof(NodePtr));
if (!nodeTable)
atom_error();
nodeTable[None] = (NodePtr) NULL;
lastAtom = FSA_LAST_PREDEFINED;
}
| execunix/vinos | xsrc/external/mit/xfs/dist/difs/atom.c | C | apache-2.0 | 5,680 | [
30522,
1013,
1008,
1008,
15489,
8241,
13787,
16924,
2015,
1008,
1013,
1013,
1008,
9385,
3055,
1010,
2687,
1996,
2330,
2177,
6656,
2000,
2224,
1010,
6100,
1010,
19933,
1010,
16062,
1010,
1998,
5271,
2023,
4007,
1998,
2049,
12653,
2005,
2151,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
// $Id$
/**
* @file
* Default theme implementation to present all user profile data.
*
* This template is used when viewing a registered member's profile page,
* e.g., example.com/user/123. 123 being the users ID.
*
* Use render($user_profile) to print all profile items, or print a subset
* such as render($content['field_example']). Always call render($user_profile)
* at the end in order to print all remaining items. If the item is a category,
* it will contain all its profile items. By default, $user_profile['summary']
* is provided which contains data on the user's history. Other data can be
* included by modules. $user_profile['user_picture'] is available
* for showing the account picture.
*
* Available variables:
* - $user_profile: An array of profile items. Use render() to print them.
* - Field variables: for each field instance attached to the user a
* corresponding variable is defined; e.g., $user->field_example has a
* variable $field_example defined. When needing to access a field's raw
* values, developers/themers are strongly encouraged to use these
* variables. Otherwise they will have to explicitly specify the desired
* field language, e.g. $user->field_example['en'], thus overriding any
* language negotiation rule that was previously applied.
*
* @see user-profile-category.tpl.php
* Where the html is handled for the group.
* @see user-profile-item.tpl.php
* Where the html is handled for each item in the group.
* @see template_preprocess_user_profile()
*/
?>
<div class="profile"<?php print $attributes; ?>>
<?php print render($user_profile); ?>
</div>
| danmuzyka/FooProject | modules/user/user-profile.tpl.php | PHP | gpl-2.0 | 1,661 | [
30522,
1026,
1029,
25718,
1013,
1013,
1002,
8909,
1002,
1013,
1008,
1008,
1008,
1030,
5371,
1008,
12398,
4323,
7375,
2000,
2556,
2035,
5310,
6337,
2951,
1012,
1008,
1008,
2023,
23561,
2003,
2109,
2043,
10523,
1037,
5068,
2266,
1005,
1055,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from gnuradio import blocks
from gnuradio import filter
from gnuradio import gr
from gnuradio.filter import firdes
import grgsm
import math
class clock_offset_corrector(gr.hier_block2):
def __init__(self, fc=936.6e6, ppm=0, samp_rate_in=1625000.0/6.0*4.0):
gr.hier_block2.__init__(
self, "Clock offset corrector",
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
)
##################################################
# Parameters
##################################################
self.fc = fc
self.ppm = ppm
self.samp_rate_in = samp_rate_in
##################################################
# Variables
##################################################
self.samp_rate_out = samp_rate_out = samp_rate_in
##################################################
# Blocks
##################################################
self.ppm_in = None;self.message_port_register_hier_out("ppm_in")
self.gsm_controlled_rotator_cc_0 = grgsm.controlled_rotator_cc(0,samp_rate_out)
self.gsm_controlled_const_source_f_0 = grgsm.controlled_const_source_f(ppm)
self.fractional_resampler_xx_0 = filter.fractional_resampler_cc(0, samp_rate_in/samp_rate_out)
self.blocks_multiply_const_vxx_0_0 = blocks.multiply_const_vff((1.0e-6*samp_rate_in/samp_rate_out, ))
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((fc/samp_rate_out*(2*math.pi)/1e6, ))
self.blocks_add_const_vxx_0 = blocks.add_const_vff((samp_rate_in/samp_rate_out, ))
##################################################
# Connections
##################################################
self.connect((self, 0), (self.fractional_resampler_xx_0, 0))
self.connect((self.fractional_resampler_xx_0, 0), (self.gsm_controlled_rotator_cc_0, 0))
self.connect((self.blocks_add_const_vxx_0, 0), (self.fractional_resampler_xx_0, 1))
self.connect((self.blocks_multiply_const_vxx_0_0, 0), (self.blocks_add_const_vxx_0, 0))
self.connect((self.blocks_multiply_const_vxx_0, 0), (self.gsm_controlled_rotator_cc_0, 1))
self.connect((self.gsm_controlled_rotator_cc_0, 0), (self, 0))
self.connect((self.gsm_controlled_const_source_f_0, 0), (self.blocks_multiply_const_vxx_0_0, 0))
self.connect((self.gsm_controlled_const_source_f_0, 0), (self.blocks_multiply_const_vxx_0, 0))
##################################################
# Asynch Message Connections
##################################################
self.msg_connect(self, "ppm_in", self.gsm_controlled_const_source_f_0, "constant_msg")
def get_fc(self):
return self.fc
def set_fc(self, fc):
self.fc = fc
self.blocks_multiply_const_vxx_0.set_k((self.fc/self.samp_rate_out*(2*math.pi)/1e6, ))
def get_ppm(self):
return self.ppm
def set_ppm(self, ppm):
self.ppm = ppm
self.gsm_controlled_const_source_f_0.set_constant(self.ppm)
def get_samp_rate_in(self):
return self.samp_rate_in
def set_samp_rate_in(self, samp_rate_in):
self.samp_rate_in = samp_rate_in
self.set_samp_rate_out(self.samp_rate_in)
self.fractional_resampler_xx_0.set_resamp_ratio(self.samp_rate_in/self.samp_rate_out)
self.blocks_multiply_const_vxx_0_0.set_k((1.0e-6*self.samp_rate_in/self.samp_rate_out, ))
self.blocks_add_const_vxx_0.set_k((self.samp_rate_in/self.samp_rate_out, ))
def get_samp_rate_out(self):
return self.samp_rate_out
def set_samp_rate_out(self, samp_rate_out):
self.samp_rate_out = samp_rate_out
self.blocks_multiply_const_vxx_0.set_k((self.fc/self.samp_rate_out*(2*math.pi)/1e6, ))
self.fractional_resampler_xx_0.set_resamp_ratio(self.samp_rate_in/self.samp_rate_out)
self.blocks_multiply_const_vxx_0_0.set_k((1.0e-6*self.samp_rate_in/self.samp_rate_out, ))
self.gsm_controlled_rotator_cc_0.set_samp_rate(self.samp_rate_out)
self.blocks_add_const_vxx_0.set_k((self.samp_rate_in/self.samp_rate_out, ))
| martinjlowm/gr-gsm | python/misc_utils/clock_offset_corrector.py | Python | gpl-3.0 | 4,498 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
4372,
2615,
18750,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#=======================================================================
#
# Python Lexical Analyser
#
# Exception classes
#
#=======================================================================
import exceptions
class PlexError(exceptions.Exception):
message = ""
class PlexTypeError(PlexError, TypeError):
pass
class PlexValueError(PlexError, ValueError):
pass
class InvalidRegex(PlexError):
pass
class InvalidToken(PlexError):
def __init__(self, token_number, message):
PlexError.__init__(self, "Token number %d: %s" % (token_number, message))
class InvalidScanner(PlexError):
pass
class AmbiguousAction(PlexError):
message = "Two tokens with different actions can match the same string"
def __init__(self):
pass
class UnrecognizedInput(PlexError):
scanner = None
position = None
state_name = None
def __init__(self, scanner, state_name):
self.scanner = scanner
self.position = scanner.position()
self.state_name = state_name
def __str__(self):
return ("'%s', line %d, char %d: Token not recognised in state %s"
% (self.position + (repr(self.state_name),)))
| onoga/wm | src/gnue/common/external/plex/Errors.py | Python | gpl-2.0 | 1,109 | [
30522,
1001,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for DSA-3545-1
#
# Security announcement date: 2016-04-07 00:00:00 UTC
# Script generation date: 2017-01-01 21:07:59 UTC
#
# Operating System: Debian 8 (Jessie)
# Architecture: x86_64
#
# Vulnerable packages fix on version:
# - cgit:0.10.2.git2.0.1-3+deb8u1
#
# Last versions recommanded by security team:
# - cgit:0.10.2.git2.0.1-3+deb8u1
#
# CVE List:
# - CVE-2016-1899
# - CVE-2016-1900
# - CVE-2016-1901
#
# More details:
# - https://www.cyberwatch.fr/vulnerabilites
#
# Licence: Released under The MIT License (MIT), See LICENSE FILE
sudo apt-get install --only-upgrade cgit=0.10.2.git2.0.1-3+deb8u1 -y
| Cyberwatch/cbw-security-fixes | Debian_8_(Jessie)/x86_64/2016/DSA-3545-1.sh | Shell | mit | 675 | [
30522,
1001,
999,
1013,
8026,
1013,
14021,
1001,
16941,
18866,
21871,
1011,
2418,
1001,
1001,
3036,
8081,
2005,
16233,
2050,
1011,
27878,
2629,
1011,
1015,
1001,
1001,
3036,
8874,
3058,
1024,
2355,
1011,
5840,
1011,
5718,
4002,
1024,
4002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
export const MAIN = {
APP: {
BRAND: 'My Job Glasses'
}
};
| vibesharing/MJG-Angular2 | src/app/shared/constant/main.ts | TypeScript | mit | 74 | [
30522,
9167,
9530,
3367,
2364,
1027,
1063,
10439,
1024,
1063,
4435,
1024,
1005,
2026,
3105,
7877,
1005,
1065,
1065,
1025,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>0.9.6: type_vec3.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">0.9.6
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_153b03dd71a7bff437c38ec53cb2e014.html">Source</a></li><li class="navelem"><a class="el" href="dir_0c6652232a835be54bedd6cfd7502504.html">G-Truc</a></li><li class="navelem"><a class="el" href="dir_e2c7faa62a52820b5be8795affd6e495.html">glm</a></li><li class="navelem"><a class="el" href="dir_5cf96241cdcf6779b80e104875f9716f.html">glm</a></li><li class="navelem"><a class="el" href="dir_9b22c367036d391e575f56d067c9855b.html">detail</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">type_vec3.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00134.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">//#include "../fwd.hpp"</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "<a class="code" href="a00131.html">type_vec.hpp</a>"</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#ifdef GLM_SWIZZLE</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor"># if GLM_HAS_ANONYMOUS_UNION</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor"># include "<a class="code" href="a00004.html">_swizzle.hpp</a>"</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor"># else</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor"># include "<a class="code" href="a00005.html">_swizzle_func.hpp</a>"</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="preprocessor">#endif //GLM_SWIZZLE</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#include <cstddef></span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">namespace </span><a class="code" href="a00145.html">glm</a></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P = defaultp></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">struct </span>tvec3</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  { </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">// Implementation detail</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keyword">typedef</span> tvec3<T, P> type;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keyword">typedef</span> tvec3<bool, P> bool_type;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keyword">typedef</span> T value_type;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="comment">// Data</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor"># if GLM_HAS_ANONYMOUS_UNION</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keyword">union</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  {</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keyword">struct</span>{ T x, y, z; };</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keyword">struct</span>{ T r, g, b; };</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keyword">struct</span>{ T s, t, p; };</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor"># ifdef GLM_SWIZZLE</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, x, y, z)</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, r, g, b)</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  _GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, s, t, p)</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, x, y, z)</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, r, g, b)</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  _GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, s, t, p)</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, x, y, z)</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, r, g, b)</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  _GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, s, t, p)</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="preprocessor"># endif//GLM_SWIZZLE</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  };</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor"># else</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keyword">union </span>{ T x, r, s; };</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keyword">union </span>{ T y, g, t; };</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keyword">union </span>{ T z, b, p; };</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="preprocessor"># ifdef GLM_SWIZZLE</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, tvec3, tvec2, tvec3, tvec4)</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="preprocessor"># endif//GLM_SWIZZLE</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="preprocessor"># endif//GLM_LANG</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="comment">// Component accesses</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="preprocessor"># ifdef GLM_FORCE_SIZE_FUNC</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keyword">typedef</span> <span class="keywordtype">size_t</span> size_type;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  GLM_FUNC_DECL GLM_CONSTEXPR size_type size() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  GLM_FUNC_DECL T & operator[](size_type i);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  GLM_FUNC_DECL T <span class="keyword">const</span> & operator[](size_type i) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="preprocessor"># else</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keyword">typedef</span> length_t length_type;</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  GLM_FUNC_DECL GLM_CONSTEXPR length_type <a class="code" href="a00151.html#ga18d45e3d4c7705e67ccfabd99e521604">length</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  GLM_FUNC_DECL T & operator[](length_type i);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  GLM_FUNC_DECL T <span class="keyword">const</span> & operator[](length_type i) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="preprocessor"># endif//GLM_FORCE_SIZE_FUNC</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="comment">// Implicit basic constructors</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  GLM_FUNC_DECL tvec3();</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">template</span> <precision Q></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  GLM_FUNC_DECL tvec3(tvec3<T, Q> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment">// Explicit basic constructors</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(ctor);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  GLM_FUNC_DECL tvec3(T <span class="keyword">const</span> & a, T <span class="keyword">const</span> & b, T <span class="keyword">const</span> & c);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="comment">// Conversion scalar constructors</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> A, <span class="keyword">typename</span> B, <span class="keyword">typename</span> C></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  GLM_FUNC_DECL tvec3(A <span class="keyword">const</span> & a, B <span class="keyword">const</span> & b, C <span class="keyword">const</span> & c);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> A, <span class="keyword">typename</span> B, <span class="keyword">typename</span> C></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  GLM_FUNC_DECL tvec3(tvec1<A, P> <span class="keyword">const</span> & a, tvec1<B, P> <span class="keyword">const</span> & b, tvec1<C, P> <span class="keyword">const</span> & c);</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="comment">// Conversion vector constructors</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> A, <span class="keyword">typename</span> B, precision Q></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(tvec2<A, Q> <span class="keyword">const</span> & a, B <span class="keyword">const</span> & b);</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> A, <span class="keyword">typename</span> B, precision Q></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(tvec2<A, Q> <span class="keyword">const</span> & a, tvec1<B, Q> <span class="keyword">const</span> & b);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> A, <span class="keyword">typename</span> B, precision Q></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(A <span class="keyword">const</span> & a, tvec2<B, Q> <span class="keyword">const</span> & b);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> A, <span class="keyword">typename</span> B, precision Q></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(tvec1<A, Q> <span class="keyword">const</span> & a, tvec2<B, Q> <span class="keyword">const</span> & b);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U, precision Q></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(tvec4<U, Q> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span> </div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="preprocessor"># ifdef GLM_FORCE_EXPLICIT_CTOR</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U, precision Q></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  GLM_FUNC_DECL <span class="keyword">explicit</span> tvec3(tvec3<U, Q> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="preprocessor"># else</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U, precision Q></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  GLM_FUNC_DECL tvec3(tvec3<U, Q> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> </div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="comment">// Swizzle constructors</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> </div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="preprocessor"># if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keyword">template</span> <<span class="keywordtype">int</span> E0, <span class="keywordtype">int</span> E1, <span class="keywordtype">int</span> E2></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  GLM_FUNC_DECL tvec3(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> <span class="keyword">const</span> & that)</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  {</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  *<span class="keyword">this</span> = that();</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  }</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> </div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keyword">template</span> <<span class="keywordtype">int</span> E0, <span class="keywordtype">int</span> E1></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s)</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  {</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  *<span class="keyword">this</span> = tvec3<T, P>(v(), s);</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  }</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span> </div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keyword">template</span> <<span class="keywordtype">int</span> E0, <span class="keywordtype">int</span> E1></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  GLM_FUNC_DECL tvec3(T <span class="keyword">const</span> & s, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> <span class="keyword">const</span> & v)</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  {</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  *<span class="keyword">this</span> = tvec3<T, P>(s, v());</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  }</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> <span class="preprocessor"># endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="comment">// Unary arithmetic operators</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  GLM_FUNC_DECL tvec3<T, P> & operator+=(U s);</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  GLM_FUNC_DECL tvec3<T, P> & operator-=(U s);</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  GLM_FUNC_DECL tvec3<T, P> & operator*=(U s);</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  GLM_FUNC_DECL tvec3<T, P> & operator/=(U s);</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span> </div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment">// Increment and decrement operators</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span> </div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  GLM_FUNC_DECL tvec3<T, P> & operator++();</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  GLM_FUNC_DECL tvec3<T, P> & operator--();</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  GLM_FUNC_DECL tvec3<T, P> operator++(<span class="keywordtype">int</span>);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  GLM_FUNC_DECL tvec3<T, P> operator--(<span class="keywordtype">int</span>);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span> </div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="comment">// Unary bit operators</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span> </div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  GLM_FUNC_DECL tvec3<T, P> & operator%=(U s);</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  GLM_FUNC_DECL tvec3<T, P> & operator&=(U s);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  GLM_FUNC_DECL tvec3<T, P> & operator|=(U s);</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  GLM_FUNC_DECL tvec3<T, P> & operator^=(U s);</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  GLM_FUNC_DECL tvec3<T, P> & operator<<=(U s);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  GLM_FUNC_DECL tvec3<T, P> & operator>>=(U s);</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec1<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  };</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span> </div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> </div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span> </div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  GLM_FUNC_DECL tvec3<T, P> operator+(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span> </div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span> </div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span> </div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span> </div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  GLM_FUNC_DECL tvec3<T, P> operator-(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span> </div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span> </div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span> </div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span> </div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  GLM_FUNC_DECL tvec3<T, P> operator*(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span> </div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span> </div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span> </div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span> </div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  GLM_FUNC_DECL tvec3<T, P> operator/(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span> </div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span> </div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> </div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span> </div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span> </div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span> </div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  GLM_FUNC_DECL tvec3<T, P> operator%(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> </div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span> </div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span> </div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span> </div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  GLM_FUNC_DECL tvec3<T, P> operator&(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span> </div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span> </div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span> </div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> </div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span> </div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  GLM_FUNC_DECL tvec3<T, P> operator|(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span> </div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span> </div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span> </div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span> </div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span> </div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  GLM_FUNC_DECL tvec3<T, P> operator^(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span> </div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span> </div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span> </div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span> </div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span> </div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span> </div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span> </div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span> </div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> <span class="keyword">const</span> & v, T <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span> </div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> <span class="keyword">const</span> & v, tvec1<T, P> <span class="keyword">const</span> & s);</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span> </div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(T <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span> </div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec1<T, P> <span class="keyword">const</span> & s, tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span> </div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P></div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> <span class="keyword">const</span> & v1, tvec3<T, P> <span class="keyword">const</span> & v2);</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span> </div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T, precision P> </div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P> <span class="keyword">const</span> & v);</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span> }<span class="comment">//namespace glm</span></div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span> </div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span> <span class="preprocessor">#ifndef GLM_EXTERNAL_TEMPLATE</span></div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span> <span class="preprocessor">#include "type_vec3.inl"</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span> <span class="preprocessor">#endif//GLM_EXTERNAL_TEMPLATE</span></div>
<div class="ttc" id="a00005_html"><div class="ttname"><a href="a00005.html">_swizzle_func.hpp</a></div><div class="ttdoc">OpenGL Mathematics (glm.g-truc.net) </div></div>
<div class="ttc" id="a00151_html_ga18d45e3d4c7705e67ccfabd99e521604"><div class="ttname"><a href="a00151.html#ga18d45e3d4c7705e67ccfabd99e521604">glm::length</a></div><div class="ttdeci">GLM_FUNC_DECL T length(vecType< T, P > const &x)</div><div class="ttdoc">Returns the length of x, i.e., sqrt(x * x). </div></div>
<div class="ttc" id="a00145_html"><div class="ttname"><a href="a00145.html">glm</a></div><div class="ttdef"><b>Definition:</b> <a href="a00003_source.html#l00039">_noise.hpp:39</a></div></div>
<div class="ttc" id="a00131_html"><div class="ttname"><a href="a00131.html">type_vec.hpp</a></div><div class="ttdoc">OpenGL Mathematics (glm.g-truc.net) </div></div>
<div class="ttc" id="a00004_html"><div class="ttname"><a href="a00004.html">_swizzle.hpp</a></div><div class="ttdoc">OpenGL Mathematics (glm.g-truc.net) </div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
| ronsaldo/loden | thirdparty/glm/doc/api/a00134_source.html | HTML | mit | 67,346 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for RNN cell wrapper v2 implementation."""
from absl.testing import parameterized
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.keras import combinations
from tensorflow.python.keras import layers
from tensorflow.python.keras.layers import rnn_cell_wrapper_v2
from tensorflow.python.keras.layers.legacy_rnn import rnn_cell_impl
from tensorflow.python.keras.legacy_tf_layers import base as legacy_base_layer
from tensorflow.python.keras.utils import generic_utils
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import variables as variables_lib
from tensorflow.python.platform import test
@combinations.generate(combinations.combine(mode=["graph", "eager"]))
class RNNCellWrapperTest(test.TestCase, parameterized.TestCase):
def testResidualWrapper(self):
wrapper_type = rnn_cell_wrapper_v2.ResidualWrapper
x = ops.convert_to_tensor_v2_with_dispatch(
np.array([[1., 1., 1.]]), dtype="float32")
m = ops.convert_to_tensor_v2_with_dispatch(
np.array([[0.1, 0.1, 0.1]]), dtype="float32")
base_cell = rnn_cell_impl.GRUCell(
3, kernel_initializer=init_ops.constant_initializer(0.5),
bias_initializer=init_ops.constant_initializer(0.5))
g, m_new = base_cell(x, m)
wrapper_object = wrapper_type(base_cell)
children = wrapper_object._trackable_children()
wrapper_object.get_config() # Should not throw an error
self.assertIn("cell", children)
self.assertIs(children["cell"], base_cell)
g_res, m_new_res = wrapper_object(x, m)
self.evaluate([variables_lib.global_variables_initializer()])
res = self.evaluate([g, g_res, m_new, m_new_res])
# Residual connections
self.assertAllClose(res[1], res[0] + [1., 1., 1.])
# States are left untouched
self.assertAllClose(res[2], res[3])
def testResidualWrapperWithSlice(self):
wrapper_type = rnn_cell_wrapper_v2.ResidualWrapper
x = ops.convert_to_tensor_v2_with_dispatch(
np.array([[1., 1., 1., 1., 1.]]), dtype="float32")
m = ops.convert_to_tensor_v2_with_dispatch(
np.array([[0.1, 0.1, 0.1]]), dtype="float32")
base_cell = rnn_cell_impl.GRUCell(
3, kernel_initializer=init_ops.constant_initializer(0.5),
bias_initializer=init_ops.constant_initializer(0.5))
g, m_new = base_cell(x, m)
def residual_with_slice_fn(inp, out):
inp_sliced = array_ops.slice(inp, [0, 0], [-1, 3])
return inp_sliced + out
g_res, m_new_res = wrapper_type(
base_cell, residual_with_slice_fn)(x, m)
self.evaluate([variables_lib.global_variables_initializer()])
res_g, res_g_res, res_m_new, res_m_new_res = self.evaluate(
[g, g_res, m_new, m_new_res])
# Residual connections
self.assertAllClose(res_g_res, res_g + [1., 1., 1.])
# States are left untouched
self.assertAllClose(res_m_new, res_m_new_res)
def testDeviceWrapper(self):
wrapper_type = rnn_cell_wrapper_v2.DeviceWrapper
x = array_ops.zeros([1, 3])
m = array_ops.zeros([1, 3])
cell = rnn_cell_impl.GRUCell(3)
wrapped_cell = wrapper_type(cell, "/cpu:0")
children = wrapped_cell._trackable_children()
wrapped_cell.get_config() # Should not throw an error
self.assertIn("cell", children)
self.assertIs(children["cell"], cell)
outputs, _ = wrapped_cell(x, m)
self.assertIn("cpu:0", outputs.device.lower())
@parameterized.parameters(
[[rnn_cell_impl.DropoutWrapper, rnn_cell_wrapper_v2.DropoutWrapper],
[rnn_cell_impl.ResidualWrapper, rnn_cell_wrapper_v2.ResidualWrapper]])
def testWrapperKerasStyle(self, wrapper, wrapper_v2):
"""Tests if wrapper cell is instantiated in keras style scope."""
wrapped_cell_v2 = wrapper_v2(rnn_cell_impl.BasicRNNCell(1))
self.assertIsNone(getattr(wrapped_cell_v2, "_keras_style", None))
wrapped_cell = wrapper(rnn_cell_impl.BasicRNNCell(1))
self.assertFalse(wrapped_cell._keras_style)
@parameterized.parameters(
[rnn_cell_wrapper_v2.DropoutWrapper, rnn_cell_wrapper_v2.ResidualWrapper])
def testWrapperWeights(self, wrapper):
"""Tests that wrapper weights contain wrapped cells weights."""
base_cell = layers.SimpleRNNCell(1, name="basic_rnn_cell")
rnn_cell = wrapper(base_cell)
rnn_layer = layers.RNN(rnn_cell)
inputs = ops.convert_to_tensor_v2_with_dispatch([[[1]]],
dtype=dtypes.float32)
rnn_layer(inputs)
wrapper_name = generic_utils.to_snake_case(wrapper.__name__)
expected_weights = ["rnn/" + wrapper_name + "/" + var for var in
("kernel:0", "recurrent_kernel:0", "bias:0")]
self.assertLen(rnn_cell.weights, 3)
self.assertCountEqual([v.name for v in rnn_cell.weights], expected_weights)
self.assertCountEqual([v.name for v in rnn_cell.trainable_variables],
expected_weights)
self.assertCountEqual([v.name for v in rnn_cell.non_trainable_variables],
[])
self.assertCountEqual([v.name for v in rnn_cell.cell.weights],
expected_weights)
@parameterized.parameters(
[rnn_cell_wrapper_v2.DropoutWrapper, rnn_cell_wrapper_v2.ResidualWrapper])
def testWrapperV2Caller(self, wrapper):
"""Tests that wrapper V2 is using the LayerRNNCell's caller."""
with legacy_base_layer.keras_style_scope():
base_cell = rnn_cell_impl.MultiRNNCell(
[rnn_cell_impl.BasicRNNCell(1) for _ in range(2)])
rnn_cell = wrapper(base_cell)
inputs = ops.convert_to_tensor_v2_with_dispatch([[1]], dtype=dtypes.float32)
state = ops.convert_to_tensor_v2_with_dispatch([[1]], dtype=dtypes.float32)
_ = rnn_cell(inputs, [state, state])
weights = base_cell._cells[0].weights
self.assertLen(weights, expected_len=2)
self.assertTrue(all("_wrapper" in v.name for v in weights))
@parameterized.parameters(
[rnn_cell_wrapper_v2.DropoutWrapper, rnn_cell_wrapper_v2.ResidualWrapper])
def testWrapperV2Build(self, wrapper):
cell = rnn_cell_impl.LSTMCell(10)
wrapper = wrapper(cell)
wrapper.build((1,))
self.assertTrue(cell.built)
def testDeviceWrapperSerialization(self):
wrapper_cls = rnn_cell_wrapper_v2.DeviceWrapper
cell = layers.LSTMCell(10)
wrapper = wrapper_cls(cell, "/cpu:0")
config = wrapper.get_config()
reconstructed_wrapper = wrapper_cls.from_config(config)
self.assertDictEqual(config, reconstructed_wrapper.get_config())
self.assertIsInstance(reconstructed_wrapper, wrapper_cls)
def testResidualWrapperSerialization(self):
wrapper_cls = rnn_cell_wrapper_v2.ResidualWrapper
cell = layers.LSTMCell(10)
wrapper = wrapper_cls(cell)
config = wrapper.get_config()
reconstructed_wrapper = wrapper_cls.from_config(config)
self.assertDictEqual(config, reconstructed_wrapper.get_config())
self.assertIsInstance(reconstructed_wrapper, wrapper_cls)
wrapper = wrapper_cls(cell, residual_fn=lambda i, o: i + i + o)
config = wrapper.get_config()
reconstructed_wrapper = wrapper_cls.from_config(config)
# Assert the reconstructed function will perform the math correctly.
self.assertEqual(reconstructed_wrapper._residual_fn(1, 2), 4)
def residual_fn(inputs, outputs):
return inputs * 3 + outputs
wrapper = wrapper_cls(cell, residual_fn=residual_fn)
config = wrapper.get_config()
reconstructed_wrapper = wrapper_cls.from_config(config)
# Assert the reconstructed function will perform the math correctly.
self.assertEqual(reconstructed_wrapper._residual_fn(1, 2), 5)
def testDropoutWrapperSerialization(self):
wrapper_cls = rnn_cell_wrapper_v2.DropoutWrapper
cell = layers.GRUCell(10)
wrapper = wrapper_cls(cell)
config = wrapper.get_config()
reconstructed_wrapper = wrapper_cls.from_config(config)
self.assertDictEqual(config, reconstructed_wrapper.get_config())
self.assertIsInstance(reconstructed_wrapper, wrapper_cls)
wrapper = wrapper_cls(cell, dropout_state_filter_visitor=lambda s: True)
config = wrapper.get_config()
reconstructed_wrapper = wrapper_cls.from_config(config)
self.assertTrue(reconstructed_wrapper._dropout_state_filter(None))
def dropout_state_filter_visitor(unused_state):
return False
wrapper = wrapper_cls(
cell, dropout_state_filter_visitor=dropout_state_filter_visitor)
config = wrapper.get_config()
reconstructed_wrapper = wrapper_cls.from_config(config)
self.assertFalse(reconstructed_wrapper._dropout_state_filter(None))
def testDropoutWrapperWithKerasLSTMCell(self):
wrapper_cls = rnn_cell_wrapper_v2.DropoutWrapper
cell = layers.LSTMCell(10)
with self.assertRaisesRegex(ValueError, "does not work with "):
wrapper_cls(cell)
cell = layers.LSTMCellV2(10)
with self.assertRaisesRegex(ValueError, "does not work with "):
wrapper_cls(cell)
if __name__ == "__main__":
test.main()
| tensorflow/tensorflow | tensorflow/python/keras/layers/rnn_cell_wrapper_v2_test.py | Python | apache-2.0 | 9,770 | [
30522,
1001,
9385,
10476,
1996,
23435,
12314,
6048,
1012,
2035,
2916,
9235,
1012,
1001,
1001,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
1001,
2017,
2089,
2025,
2224,
2023,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="Description" content="Basic Gray">
<meta name="author" content="CoffeeCup Software, Inc.">
<meta name="Copyright" content="Copyright (c) 2010 CoffeeCup, all rights reserved.">
<meta name="Customized" content="Chad Anderson and James Laprevote">
<title>Basic Gray Theme - About</title>
<link rel="stylesheet" href="stylesheets/default.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="javascripts/behavior.js"></script>
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<header id="mast">
<p align="right" > <a> login </a> <a> signup </a> </p>
<h1>Yardsale Addicts</h1>
</header>
<nav id="global">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="profile.html">Profile</a></li>
<li><a href="services.html">Yardsale Mapper</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a class="selected" href="about.html">About</a></li>
</ul>
</nav>
<section id="intro">
<header>
<h2>Do you love yardsales as much as we do?</h2>
</header>
<p>The number of garage sales that occur in the Provo and Salt Lake areas is large. Garage sale hoping has become a Saturday activity for some, especially newlyweds looking to furnish their first apartment. While these individuals wish to furnish their apartment many lack the funds to just buy the items outright and the time to search KSL continuously for deals.
<br><br>Garage Sale Addict Solutions aims to help solve the headache of planning a route to garage sales in the local area. It will offer the ability to choose from a selection of yard sales and find a fast, convenient route between them. </p>
<div id="photo">
<div>
<h3>Photo of us?</h3>
</div>
</div>
</section>
<div id="main" class="clear">
</div>
<footer>
<div class="clear">
<section id="about">
<header>
<h3>About</h3>
</header>
<p>The number of garage sales that occur in the Provo and Salt Lake areas is large. Garage sale hoping has become a Saturday activity for some, especially newlyweds looking to furnish their first apartment. While these individuals wish to furnish their apartment many lack the funds to just buy the items outright and the time to search KSL continuously for deals.
<br>
Garage Sale Addict Solutions aims to help solve the headache of planning a route to garage sales in the local area. It will offer the ability to choose from a selection of yard sales and find a fast, convenient route between them.</p>
</section>
<section>
<header>
<h3>Recent Yardsales</h3>
</header>
<nav id="blogRoll">
<ul>
<li><a href="/">Page Link</a></li>
<li><a href="/">Page Link</a></li>
<li><a href="/">Page Link</a></li>
<li><a href="/">Page Link</a></li>
<li><a href="/">Page Link</a></li>
<li><a href="/">Page Link</a></li>
</ul>
</nav>
</section>
<section>
<header>
<h3>Site Map</h3>
</header>
<nav id="siteMap">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="profile.html">Profile</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="about.html">About</a></li>
</ul>
</nav>
</section>
</div>
</footer>
</body>
</html>
| vorquel/yard-sale-mapper | webdesign/about.html | HTML | mit | 4,064 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
18804,
2171,
1027,
1000,
6412,
1000,
4180,
1027,
1000,
3937,
3897,
1000,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
// Dependencies
var UFirst = require("ucfirst");
/**
* CrossStyle
* Returns an array of cross-browser CSS properties for given input.
*
* @name CrossStyle
* @function
* @param {String} input The CSS property (e.g. `"transform"` or `"transformOrigin"`).
* @return {Array} An array of strings representing the cross-browser CSS properties for the given input.
*/
function CrossStyle(input) {
var uInput = UFirst(input);
return [
"webkit" + uInput
, "moz" + uInput
, "ms" + uInput
, "o" + uInput
, input
]
}
module.exports = CrossStyle;
| IonicaBizau/cross-style.js | lib/index.js | JavaScript | mit | 588 | [
30522,
1013,
1013,
12530,
15266,
13075,
1057,
8873,
12096,
1027,
5478,
1006,
1000,
15384,
8873,
12096,
1000,
1007,
1025,
1013,
1008,
1008,
1008,
2892,
21756,
2571,
1008,
5651,
2019,
9140,
1997,
2892,
1011,
16602,
20116,
2015,
5144,
2005,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.collection.spi;
import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.loader.CollectionAliases;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.type.Type;
/**
* Persistent collections are treated as value objects by Hibernate.
* ie. they have no independent existence beyond the object holding
* a reference to them. Unlike instances of entity classes, they are
* automatically deleted when unreferenced and automatically become
* persistent when held by a persistent object. Collections can be
* passed between different objects (change "roles") and this might
* cause their elements to move from one database table to another.<br>
* <br>
* Hibernate "wraps" a java collection in an instance of
* PersistentCollection. This mechanism is designed to support
* tracking of changes to the collection's persistent state and
* lazy instantiation of collection elements. The downside is that
* only certain abstract collection types are supported and any
* extra semantics are lost<br>
* <br>
* Applications should <em>never</em> use classes in this package
* directly, unless extending the "framework" here.<br>
* <br>
* Changes to <em>structure</em> of the collection are recorded by the
* collection calling back to the session. Changes to mutable
* elements (ie. composite elements) are discovered by cloning their
* state when the collection is initialized and comparing at flush
* time.
*
* @author Gavin King
*/
public interface PersistentCollection {
/**
* Get the owning entity. Note that the owner is only
* set during the flush cycle, and when a new collection
* wrapper is created while loading an entity.
*
* @return The owner
*/
public Object getOwner();
/**
* Set the reference to the owning entity
*
* @param entity The owner
*/
public void setOwner(Object entity);
/**
* Is the collection empty? (don't try to initialize the collection)
*
* @return {@code false} if the collection is non-empty; {@code true} otherwise.
*/
public boolean empty();
/**
* After flushing, re-init snapshot state.
*
* @param key The collection instance key (fk value).
* @param role The collection role
* @param snapshot The snapshot state
*/
public void setSnapshot(Serializable key, String role, Serializable snapshot);
/**
* After flushing, clear any "queued" additions, since the
* database state is now synchronized with the memory state.
*/
public void postAction();
/**
* Return the user-visible collection (or array) instance
*
* @return The underlying collection/array
*/
public Object getValue();
/**
* Called just before reading any rows from the JDBC result set
*/
public void beginRead();
/**
* Called after reading all rows from the JDBC result set
*
* @return Whether to end the read.
*/
public boolean endRead();
/**
* Called after initializing from cache
*
* @return ??
*/
public boolean afterInitialize();
/**
* Could the application possibly have a direct reference to
* the underlying collection implementation?
*
* @return {@code true} indicates that the application might have access to the underlying collection/array.
*/
public boolean isDirectlyAccessible();
/**
* Disassociate this collection from the given session.
*
* @param currentSession The session we are disassociating from. Used for validations.
*
* @return true if this was currently associated with the given session
*/
public boolean unsetSession(SessionImplementor currentSession);
/**
* Associate the collection with the given session.
*
* @param session The session to associate with
*
* @return false if the collection was already associated with the session
*
* @throws HibernateException if the collection was already associated
* with another open session
*/
public boolean setCurrentSession(SessionImplementor session) throws HibernateException;
/**
* Read the state of the collection from a disassembled cached value
*
* @param persister The collection persister
* @param disassembled The disassembled cached state
* @param owner The collection owner
*/
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner);
/**
* Iterate all collection entries, during update of the database
*
* @param persister The collection persister.
*
* @return The iterator
*/
public Iterator entries(CollectionPersister persister);
/**
* Read a row from the JDBC result set
*
* @param rs The JDBC ResultSet
* @param role The collection role
* @param descriptor The aliases used for the columns making up the collection
* @param owner The collection owner
*
* @return The read object
*
* @throws HibernateException Generally indicates a problem resolving data read from the ResultSet
* @throws SQLException Indicates a problem accessing the ResultSet
*/
public Object readFrom(ResultSet rs, CollectionPersister role, CollectionAliases descriptor, Object owner)
throws HibernateException, SQLException;
/**
* Get the identifier of the given collection entry. This refers to the collection identifier, not the
* identifier of the (possibly) entity elements. This is only valid for invocation on the
* {@code idbag} collection.
*
* @param entry The collection entry/element
* @param i The assumed identifier (?)
*
* @return The identifier value
*/
public Object getIdentifier(Object entry, int i);
/**
* Get the index of the given collection entry
*
* @param entry The collection entry/element
* @param i The assumed index
* @param persister it was more elegant before we added this...
*
* @return The index value
*/
public Object getIndex(Object entry, int i, CollectionPersister persister);
/**
* Get the value of the given collection entry. Generally the given entry parameter value will just be returned.
* Might get a different value for a duplicate entries in a Set.
*
* @param entry The object instance for which to get the collection element instance.
*
* @return The corresponding object that is part of the collection elements.
*/
public Object getElement(Object entry);
/**
* Get the snapshot value of the given collection entry
*
* @param entry The entry
* @param i The index
*
* @return The snapshot state for that element
*/
public Object getSnapshotElement(Object entry, int i);
/**
* Called before any elements are read into the collection,
* allowing appropriate initializations to occur.
*
* @param persister The underlying collection persister.
* @param anticipatedSize The anticipated size of the collection after initialization is complete.
*/
public void beforeInitialize(CollectionPersister persister, int anticipatedSize);
/**
* Does the current state exactly match the snapshot?
*
* @param persister The collection persister
*
* @return {@code true} if the current state and the snapshot state match.
*
*/
public boolean equalsSnapshot(CollectionPersister persister);
/**
* Is the snapshot empty?
*
* @param snapshot The snapshot to check
*
* @return {@code true} if the given snapshot is empty
*/
public boolean isSnapshotEmpty(Serializable snapshot);
/**
* Disassemble the collection to get it ready for the cache
*
* @param persister The collection persister
*
* @return The disassembled state
*/
public Serializable disassemble(CollectionPersister persister) ;
/**
* Do we need to completely recreate this collection when it changes?
*
* @param persister The collection persister
*
* @return {@code true} if a change requires a recreate.
*/
public boolean needsRecreate(CollectionPersister persister);
/**
* Return a new snapshot of the current state of the collection
*
* @param persister The collection persister
*
* @return The snapshot
*/
public Serializable getSnapshot(CollectionPersister persister);
/**
* To be called internally by the session, forcing immediate initialization.
*/
public void forceInitialization();
/**
* Does the given element/entry exist in the collection?
*
* @param entry The object to check if it exists as a collection element
* @param i Unused
*
* @return {@code true} if the given entry is a collection element
*/
public boolean entryExists(Object entry, int i);
/**
* Do we need to insert this element?
*
* @param entry The collection element to check
* @param i The index (for indexed collections)
* @param elemType The type for the element
*
* @return {@code true} if the element needs inserting
*/
public boolean needsInserting(Object entry, int i, Type elemType);
/**
* Do we need to update this element?
*
* @param entry The collection element to check
* @param i The index (for indexed collections)
* @param elemType The type for the element
*
* @return {@code true} if the element needs updating
*/
public boolean needsUpdating(Object entry, int i, Type elemType);
/**
* Can each element in the collection be mapped unequivocally to a single row in the database? Generally
* bags and sets are the only collections that cannot be.
*
* @return {@code true} if the row for each element is known
*/
public boolean isRowUpdatePossible();
/**
* Get all the elements that need deleting
*
* @param persister The collection persister
* @param indexIsFormula For indexed collections, tells whether the index is a formula (calculated value) mapping
*
* @return An iterator over the elements to delete
*/
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula);
/**
* Is this the wrapper for the given collection instance?
*
* @param collection The collection to check whether this is wrapping it
*
* @return {@code true} if this is a wrapper around that given collection instance.
*/
public boolean isWrapper(Object collection);
/**
* Is this instance initialized?
*
* @return Was this collection initialized? Or is its data still not (fully) loaded?
*/
public boolean wasInitialized();
/**
* Does this instance have any "queued" operations?
*
* @return {@code true} indicates there are pending, queued, delayed operations
*/
public boolean hasQueuedOperations();
/**
* Iterator over the "queued" additions
*
* @return The iterator
*/
public Iterator queuedAdditionIterator();
/**
* Get the "queued" orphans
*
* @param entityName The name of the entity that makes up the elements
*
* @return The orphaned elements
*/
public Collection getQueuedOrphans(String entityName);
/**
* Get the current collection key value
*
* @return the current collection key value
*/
public Serializable getKey();
/**
* Get the current role name
*
* @return the collection role name
*/
public String getRole();
/**
* Is the collection unreferenced?
*
* @return {@code true} if the collection is no longer referenced by an owner
*/
public boolean isUnreferenced();
/**
* Is the collection dirty? Note that this is only
* reliable during the flush cycle, after the
* collection elements are dirty checked against
* the snapshot.
*
* @return {@code true} if the collection is dirty
*/
public boolean isDirty();
/**
* Clear the dirty flag, after flushing changes
* to the database.
*/
public void clearDirty();
/**
* Get the snapshot cached by the collection instance
*
* @return The internally stored snapshot state
*/
public Serializable getStoredSnapshot();
/**
* Mark the collection as dirty
*/
public void dirty();
/**
* Called before inserting rows, to ensure that any surrogate keys
* are fully generated
*
* @param persister The collection persister
*/
public void preInsert(CollectionPersister persister);
/**
* Called after inserting a row, to fetch the natively generated id
*
* @param persister The collection persister
* @param entry The collection element just inserted
* @param i The element position/index
*/
public void afterRowInsert(CollectionPersister persister, Object entry, int i);
/**
* get all "orphaned" elements
*
* @param snapshot The snapshot state
* @param entityName The name of the entity that are the elements of the collection
*
* @return The orphans
*/
public Collection getOrphans(Serializable snapshot, String entityName);
}
| kevin-chen-hw/LDAE | com.huawei.soa.ldae/src/main/java/org/hibernate/collection/spi/PersistentCollection.java | Java | lgpl-2.1 | 13,745 | [
30522,
1013,
1008,
1008,
7632,
5677,
12556,
1010,
28771,
28297,
2005,
8909,
18994,
12070,
9262,
1008,
1008,
9385,
1006,
1039,
1007,
2263,
1011,
2249,
1010,
2417,
6045,
4297,
1012,
2030,
2353,
1011,
2283,
16884,
2004,
1008,
5393,
2011,
1996,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* File : listctrl.h
* This file is part of RTGUI in RT-Thread RTOS
* COPYRIGHT (C) 2010, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2010-12-06 Bernard first version
*/
#ifndef __RTGUI_LISTCTRL_H__
#define __RTGUI_LISTCTRL_H__
#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/widget.h>
/** Gets the type of a list ctrl */
#define RTGUI_LISTCTRL_TYPE (rtgui_listctrl_type_get())
/** Casts the object to a filelist */
#define RTGUI_LISTCTRL(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LISTCTRL_TYPE, rtgui_listctrl_t))
/** Checks if the object is a filelist ctrl */
#define RTGUI_IS_LISTCTRL(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LISTCTRL_TYPE))
struct rtgui_listctrl
{
struct rtgui_widget parent;
/* widget private data */
/* listctrl items */
rt_uint32_t items;
/* total number of items */
rt_uint16_t items_count;
/* the number of item in a page */
rt_uint16_t page_items;
/* current item */
rt_uint16_t current_item;
/* item event handler */
void (*on_item)(rtgui_widget_t *widget, struct rtgui_event* event);
void (*on_item_draw)(struct rtgui_listctrl *list, struct rtgui_dc* dc, rtgui_rect_t* rect, rt_uint16_t index);
};
typedef struct rtgui_listctrl rtgui_listctrl_t;
typedef void (*rtgui_onitem_func_t)(struct rtgui_widget* widget, rtgui_event_t *event);
typedef void (*rtgui_onitem_draw_t)(struct rtgui_listctrl *list, struct rtgui_dc* dc, rtgui_rect_t* rect, rt_uint16_t index);
rtgui_type_t *rtgui_listctrl_type_get(void);
rtgui_listctrl_t* rtgui_listctrl_create(rt_uint32_t items, rt_uint16_t count,
rtgui_rect_t *rect, rtgui_onitem_draw_t ondraw);
void rtgui_listctrl_destroy(rtgui_listctrl_t* ctrl);
rt_bool_t rtgui_listctrl_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
void rtgui_listctrl_set_onitem(rtgui_listctrl_t* ctrl, rtgui_onitem_func_t func);
void rtgui_listctrl_set_items(rtgui_listctrl_t* ctrl, rt_uint32_t items, rt_uint16_t count);
rt_bool_t rtgui_listctrl_get_item_rect(rtgui_listctrl_t* ctrl, rt_uint16_t item, rtgui_rect_t* item_rect);
#endif
| JasonCC/stm32radio | rt-thread/components/rtgui/include/rtgui/widgets/listctrl.h | C | gpl-2.0 | 2,324 | [
30522,
1013,
1008,
1008,
5371,
1024,
2862,
6593,
12190,
1012,
1044,
1008,
2023,
5371,
2003,
2112,
1997,
19387,
25698,
1999,
19387,
1011,
11689,
19387,
2891,
1008,
9385,
1006,
1039,
1007,
2230,
1010,
19387,
1011,
11689,
2458,
2136,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en" xmlns="http://www.w3.org/1999/html"> <!--<![endif]-->
<head>
<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8" />
<title>icon-linux: Font Awesome Icons</title>
<meta name="description" content="Font Awesome, the iconic font designed for Bootstrap">
<meta name="author" content="Dave Gandy">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--<meta name="viewport" content="initial-scale=1; maximum-scale=1">-->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- CSS
================================================== -->
<link rel="stylesheet" href="../../assets/css/site.css">
<link rel="stylesheet" href="../../assets/css/pygments.css">
<link rel="stylesheet" href="../../assets/font-awesome/css/font-awesome.css">
<!--[if IE 7]>
<link rel="stylesheet" href="../../assets/font-awesome/css/font-awesome-ie7.css">
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="../../assets/ico/favicon.ico">
<script type="text/javascript" src="//use.typekit.net/wnc7ioh.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30136587-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body data-spy="scroll" data-target=".navbar">
<div class="wrapper"> <!-- necessary for sticky footer. wrap all content except footer -->
<div class="navbar navbar-inverse navbar-static-top hidden-print">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="../../"><i class="icon-flag"></i> Font Awesome</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="hidden-tablet "><a href="../../">Home</a></li>
<li><a href="../../get-started/">Get Started</a></li>
<li class="dropdown-split-left"><a href="../../icons/">Icons</a></li>
<li class="dropdown dropdown-split-right hidden-phone">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-caret-down"></i>
</a>
<ul class="dropdown-menu pull-right">
<li><a href="../../icons/"><i class="icon-flag icon-fixed-width"></i> Icons</a></li>
<li class="divider"></li>
<li><a href="../../icons/#new"><i class="icon-shield icon-fixed-width"></i> New Icons in 3.2.1</a></li>
<li><a href="../../icons/#web-application"><i class="icon-camera-retro icon-fixed-width"></i> Web Application Icons</a></li>
<li><a href="../../icons/#currency"><i class="icon-won icon-fixed-width"></i> Currency Icons</a></li>
<li><a href="../../icons/#text-editor"><i class="icon-file-text-alt icon-fixed-width"></i> Text Editor Icons</a></li>
<li><a href="../../icons/#directional"><i class="icon-hand-right icon-fixed-width"></i> Directional Icons</a></li>
<li><a href="../../icons/#video-player"><i class="icon-play-sign icon-fixed-width"></i> Video Player Icons</a></li>
<li><a href="../../icons/#brand"><i class="icon-github icon-fixed-width"></i> Brand Icons</a></li>
<li><a href="../../icons/#medical"><i class="icon-medkit icon-fixed-width"></i> Medical Icons</a></li>
</ul>
</li>
<li class="dropdown-split-left"><a href="../../examples/">Examples</a></li>
<li class="dropdown dropdown-split-right hidden-phone">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-caret-down"></i>
</a>
<ul class="dropdown-menu pull-right">
<li><a href="../../examples/">Examples</a></li>
<li class="divider"></li>
<li><a href="../../examples/#new-styles">New Styles</a></li>
<li><a href="../../examples/#inline-icons">Inline Icons</a></li>
<li><a href="../../examples/#larger-icons">Larger Icons</a></li>
<li><a href="../../examples/#bordered-pulled">Bordered & Pulled</a></li>
<li><a href="../../examples/#buttons">Buttons</a></li>
<li><a href="../../examples/#button-groups">Button Groups</a></li>
<li><a href="../../examples/#button-dropdowns">Button Dropdowns</a></li>
<li><a href="../../examples/#bulleted-lists">Bulleted Lists</a></li>
<li><a href="../../examples/#navigation">Navigation</a></li>
<li><a href="../../examples/#form-inputs">Form Inputs</a></li>
<li><a href="../../examples/#animated-spinner">Animated Spinner</a></li>
<li><a href="../../examples/#rotated-flipped">Rotated & Flipped</a></li>
<li><a href="../../examples/#stacked">Stacked</a></li>
<li><a href="../../examples/#custom">Custom CSS</a></li>
</ul>
</li>
<li><a href="../../whats-new/">
<span class="hidden-tablet">What's </span>New</a>
</li>
<li><a href="../../community/">Community</a></li>
<li><a href="../../license/">License</a></li>
</ul>
<ul class="nav pull-right">
<li><a href="http://blog.fontawesome.io">Blog</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="jumbotron jumbotron-icon">
<div class="container">
<div class="info-icons">
<i class="icon-linux icon-6"></i>
<span class="hidden-phone">
<i class="icon-linux icon-5"></i>
<span class="hidden-tablet"><i class="icon-linux icon-4"></i> </span>
<i class="icon-linux icon-3"></i>
<i class="icon-linux icon-2"></i>
</span>
<i class="icon-linux icon-1"></i>
</div>
<h1 class="info-class">
icon-linux
<small>
<i class="icon-linux"></i> ·
Unicode: <span class="upper">f17c</span> ·
Created: v3.2 ·
Categories:
Brand Icons
</small>
</h1>
</div>
</div>
<div class="container">
<section>
<div class="row-fluid">
<div class="span9">
<p>After you get <a href="../../integration/">up and running</a>, you can place Font Awesome icons just about anywhere with the <code><i></code> tag:</p>
<div class="well well-transparent">
<div style="font-size: 24px; line-height: 1.5em;">
<i class="icon-linux"></i> icon-linux
</div>
</div>
<div class="highlight"><pre><code class="html"><span class="nt"><i</span> <span class="na">class=</span><span class="s">"icon-linux"</span><span class="nt">></i></span> icon-linux
</code></pre></div>
<br>
<div class="lead"><i class="icon-info-sign"></i> Looking for more? Check out the <a href="../../examples/">examples</a>.</div>
</div>
<div class="span3">
<div class="info-ad"><div id="carbonads-container"><div class="carbonad"><div id="azcarbon"></div><script type="text/javascript">var z = document.createElement("script"); z.type = "text/javascript"; z.async = true; z.src = "http://engine.carbonads.com/z/32291/azcarbon_2_1_0_VERT"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(z, s);</script></div></div>
</div>
</div>
</div>
</section>
</div>
<div class="push"><!-- necessary for sticky footer --></div>
</div>
<footer class="footer hidden-print">
<div class="container text-center">
<div>
<i class="icon-flag"></i> Font Awesome 3.2.1
<span class="hidden-phone">·</span><br class="visible-phone">
Created and Maintained by <a href="http://twitter.com/davegandy">Dave Gandy</a>
</div>
<div>
Font Awesome licensed under <a href="http://scripts.sil.org/OFL">SIL OFL 1.1</a>
<span class="hidden-phone">·</span><br class="visible-phone">
Code licensed under <a href="http://opensource.org/licenses/mit-license.html">MIT License</a>
<span class="hidden-phone hidden-tablet">·</span><br class="visible-phone visible-tablet">
Documentation licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>
</div>
<div>
Thanks to <a href="http://maxcdn.com"><i class="icon-maxcdn"></i> MaxCDN</a> for providing the excellent <a href="http://www.bootstrapcdn.com/#tab_fontawesome">BootstrapCDN for Font Awesome</a>
</div>
<div class="project">
<a href="https://github.com/FortAwesome/Font-Awesome">GitHub Project</a> ·
<a href="https://github.com/FortAwesome/Font-Awesome/issues">Issues</a>
</div>
</div>
</footer>
<script src="http://platform.twitter.com/widgets.js"></script>
<script src="../../assets/js/jquery-1.7.1.min.js"></script>
<script src="../../assets/js/ZeroClipboard-1.1.7.min.js"></script>
<script src="../../assets/js/bootstrap-2.3.1.min.js"></script>
<script src="../../assets/js/site.js"></script>
</body>
</html>
| vinnylinck/TodoSyncPoc | www/lib/font-awesome/src/3.2.1/icon/linux/index.html | HTML | mit | 10,033 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
999,
1011,
1011,
1031,
2065,
8318,
29464,
1021,
1033,
1028,
1026,
16129,
2465,
1027,
1000,
29464,
29464,
2575,
1000,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
999,
1031,
2203,
10128,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* Licensed to Apereo under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Apereo licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a
* copy of the License at the following location:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jasig.portlet.proxy.service.web;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.verify;
import javax.portlet.PortletPreferences;
import javax.portlet.PortletRequest;
import javax.portlet.PortletSession;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
public class MultiRequestHttpClientServiceImplTest {
private static final String HTTP_CLIENT_CONNECTION_TIMEOUT = "httpClientConnectionTimeout";
private static final String HTTP_CLIENT_SOCKET_TIMEOUT = "httpClientSocketTimeout";
private static final int DEFAULT_HTTP_CLIENT_CONNECTION_TIMEOUT = 10000;
private static final int DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT = 10000;
@Mock PortletRequest request;
@Mock PortletPreferences preferences;
@Mock PortletSession session;
@Mock DefaultHttpClient client;
MultiRequestHttpClientServiceImpl service;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
service = new MultiRequestHttpClientServiceImpl();
when(request.getPreferences()).thenReturn(preferences);
when(request.getPortletSession()).thenReturn(session);
when(preferences.getValue(HTTP_CLIENT_CONNECTION_TIMEOUT, String.valueOf(DEFAULT_HTTP_CLIENT_CONNECTION_TIMEOUT))).thenReturn(String.valueOf(DEFAULT_HTTP_CLIENT_CONNECTION_TIMEOUT));
when(preferences.getValue(HTTP_CLIENT_SOCKET_TIMEOUT, String.valueOf(DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT))).thenReturn(String.valueOf(DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT));
}
@Test
public void testGetSharedClient() {
when(preferences.getValue(MultiRequestHttpClientServiceImpl.SHARED_SESSION_KEY, null)).thenReturn("sharedSession");
when(session.getAttribute("sharedSession", PortletSession.APPLICATION_SCOPE)).thenReturn(client);
HttpClient response = service.getHttpClient(request);
assertSame(client, response);
}
@Test
public void testGetUnsharedClient() {
when(session.getAttribute(MultiRequestHttpClientServiceImpl.CLIENT_SESSION_KEY, PortletSession.PORTLET_SCOPE)).thenReturn(client);
HttpClient response = service.getHttpClient(request);
assertSame(client, response);
}
@Test
public void testCreateSharedClient() {
when(preferences.getValue(MultiRequestHttpClientServiceImpl.SHARED_SESSION_KEY, null)).thenReturn("sharedSession");
HttpClient response = service.getHttpClient(request);
assertNotNull(response);
verify(session).setAttribute("sharedSession", response, PortletSession.APPLICATION_SCOPE);
}
@Test
public void testCreateUnsharedClient() {
HttpClient response = service.getHttpClient(request);
assertNotNull(response);
verify(session).setAttribute(MultiRequestHttpClientServiceImpl.CLIENT_SESSION_KEY, response, PortletSession.PORTLET_SCOPE);
}
}
| mgillian/WebproxyPortlet | src/test/java/org/jasig/portlet/proxy/service/web/MultiRequestHttpClientServiceImplTest.java | Java | apache-2.0 | 3,763 | [
30522,
1013,
1008,
1008,
1008,
7000,
2000,
23957,
2890,
2080,
2104,
2028,
2030,
2062,
12130,
6105,
1008,
10540,
1012,
2156,
30524,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1007,
1025,
2017,
2089,
2025,
2224,
2023,
5371,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
package org.openoffice.xmerge.merger.diff;
import java.util.ArrayList;
import org.openoffice.xmerge.merger.Difference;
/**
* <p>This is an implementations of <code>DiffAlgorithm</code> interface
* which will difference char arrays.</p>
*
* <p>It also use Longest Common Subsequence (LCS). The algorithm is based
* on the book "Introduction to Algorithms" by Thomas H.Cormen,
* Charles E.Leiserson, and Ronald L.Riverst (MIT Press 1990) page 314.</p>
*/
public class CharArrayLCSAlgorithm {
/**
* Return an <code>Difference</code> array. This method finds out
* the difference between two sequences.
*
* @param orgSeq The original sequence.
* @param modSeq The modified (or changed) sequence to
* compare against the origial.
*
* @return A <code>Difference</code> array.
*/
public Difference[] computeDiffs(char[] orgSeq, char[] modSeq) {
int orgSeqlen = orgSeq.length;
int modSeqlen = modSeq.length;
int[][] diffTable;
// Diff table is used to keep track which element is the same or not
// in those 2 sequences
diffTable = createDiffTable(orgSeq, modSeq);
ArrayList<Difference> diffResult = new ArrayList<Difference>();
generateResult(diffTable, orgSeqlen, modSeqlen, diffResult);
Difference[] diffArray = new Difference[0];
// convert the vector to array, it has to do in here as
// generateResult is called recursively
if (diffResult.size() > 0) {
diffArray = new Difference[diffResult.size()];
diffResult.toArray(diffArray);
}
diffTable = null;
diffResult = null;
return diffArray;
}
/**
* Create the difference table.
* The difference table is used internal to keep track what
* elements are common or different in the two sequences.
*
* @param orgSeq The original sequence to be used as a base.
* @param modSeq The modified sequence to compare.
*
* @return A difference table as a two-dimensional array of
* integers.
*/
private int[][] createDiffTable(char[] orgSeq, char[] modSeq) {
int orgSeqlen = orgSeq.length + 1;
int modSeqlen = modSeq.length + 1;
int[][] diffTable;
// initialize the diffTable (it need to be 1 row/col bigger
// than the original str)
diffTable = new int[orgSeqlen][];
for (int i = 0; i < orgSeqlen; i++) {
diffTable[i] = new int[modSeqlen];
}
// compute the diff Table using LCS algorithm, refer to the book
// mentioned at the top of the program
for (int i = 1; i < orgSeqlen; i++) {
for (int j = 1; j < modSeqlen; j++) {
if (orgSeq[i-1] == modSeq[j-1]) {
diffTable[i][j] = diffTable[i-1][j-1]+1;
} else {
if (diffTable[i-1][j] >= diffTable[i][j-1]) {
diffTable[i][j] = diffTable[i-1][j];
} else {
diffTable[i][j] = diffTable[i][j-1];
}
}
}
}
return diffTable;
}
/**
* Generate the <code>Difference</code> result vector.
* This method will be called recursively to backtrack the difference
* table to get the difference result (and also the LCS).
*
* @param diffTable The difference table containing the
* <code>Difference</code> result.
* @param i The nth element in original sequence to
* compare. This method is called recursively
* with i and j decreased until 0.
* @param j The nth element in modified sequence to
* compare.
* @param diffVector A vector to output the <code>Difference</code>
* result. Can not use a return variable as it
* is a recursive method. The vector will contain
* <code>Difference</code> objects with operation
* and positions filled in.
*/
private void generateResult(int[][] diffTable,
int i, int j, ArrayList<Difference> diffVector) {
// handle the first element
if (i == 0 || j == 0) {
if (i == 0 && j == 0) {
// return
} else if (j == 0) {
for (int cnt = 0; cnt < i; cnt++) {
Difference diff =
new Difference(Difference.DELETE, cnt, j);
diffVector.add(diff);
}
} else {
for (int cnt = 0; cnt < j; cnt++) {
Difference diff =
new Difference(Difference.ADD, i, cnt);
diffVector.add(diff);
}
}
return;
}
// for the detail of this algorithm, refer to the book mentioned on
// the top and page 317 and 318.
if ((diffTable[i-1][j-1] == diffTable[i][j] -1) &&
(diffTable[i-1][j-1] == diffTable[i-1][j]) &&
(diffTable[i-1][j-1] == diffTable[i][j-1])) {
// the element of ith and jth in org and mod sequence is the same
generateResult(diffTable, i-1, j-1, diffVector);
} else {
if (diffTable[i-1][j] > diffTable[i][j-1]) {
// recursively call first, then add the result so that
// the beginning of the diffs will be stored first
generateResult(diffTable, i-1, j, diffVector);
Difference diff =
new Difference(Difference.DELETE, i-1, j);
diffVector.add(diff);
} else if (diffTable[i-1][j] < diffTable[i][j-1]) {
// recursively call first, then add the result so that
// the beginning of the diffs will be stored first
generateResult(diffTable, i, j-1, diffVector);
Difference diff =
new Difference(Difference.ADD, i, j-1);
diffVector.add(diff);
} else { // diffTable[i-1][j] == diffTable[i][j-1]
// recursively call first, then add the result so that
// the beginning of the diffs will be stored first
generateResult(diffTable, i-1, j-1, diffVector);
Difference diff =
new Difference(Difference.CHANGE, i-1, j-1);
diffVector.add(diff);
}
}
}
}
| qt-haiku/LibreOffice | xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java | Java | gpl-3.0 | 7,570 | [
30522,
1013,
1008,
1008,
2023,
5371,
2003,
2112,
1997,
1996,
21091,
7245,
6610,
2622,
1012,
1008,
1008,
2023,
3120,
3642,
2433,
2003,
3395,
2000,
1996,
3408,
1997,
1996,
9587,
5831,
4571,
2270,
1008,
6105,
1010,
1058,
1012,
1016,
1012,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.logs.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.logs.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* DescribeLogStreamsResult JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeLogStreamsResultJsonUnmarshaller implements Unmarshaller<DescribeLogStreamsResult, JsonUnmarshallerContext> {
public DescribeLogStreamsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
DescribeLogStreamsResult describeLogStreamsResult = new DescribeLogStreamsResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return describeLogStreamsResult;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("logStreams", targetDepth)) {
context.nextToken();
describeLogStreamsResult.setLogStreams(new ListUnmarshaller<LogStream>(LogStreamJsonUnmarshaller.getInstance()).unmarshall(context));
}
if (context.testExpression("nextToken", targetDepth)) {
context.nextToken();
describeLogStreamsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return describeLogStreamsResult;
}
private static DescribeLogStreamsResultJsonUnmarshaller instance;
public static DescribeLogStreamsResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new DescribeLogStreamsResultJsonUnmarshaller();
return instance;
}
}
| dagnir/aws-sdk-java | aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/transform/DescribeLogStreamsResultJsonUnmarshaller.java | Java | apache-2.0 | 3,146 | [
30522,
1013,
1008,
1008,
9385,
2262,
1011,
2418,
9733,
1012,
4012,
1010,
4297,
1012,
2030,
2049,
18460,
1012,
2035,
2916,
9235,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1000,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4714257
* @summary Test to make sure that the title attribute shows up in links.
* @author jamieh
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
* @build JavadocTester
* @run main TestTitleInHref
*/
public class TestTitleInHref extends JavadocTester {
public static void main(String... args) throws Exception {
TestTitleInHref tester = new TestTitleInHref();
tester.runTests();
}
@Test
void test() {
String uri = "http://java.sun.com/j2se/1.4/docs/api";
javadoc("-d", "out",
"-sourcepath", testSrc,
"-linkoffline", uri, testSrc,
"pkg");
checkExit(Exit.OK);
checkOutput("pkg/Links.html", true,
//Test to make sure that the title shows up in a class link.
"<a href=\"../pkg/Class.html\" title=\"class in pkg\">",
//Test to make sure that the title shows up in an interface link.
"<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">",
//Test to make sure that the title shows up in cross link shows up
"<a href=\"" + uri + "/java/io/File.html?is-external=true\" "
+ "title=\"class or interface in java.io\">"
+ "<code>This is a cross link to class File</code></a>");
}
}
| FauxFaux/jdk9-langtools | test/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java | Java | gpl-2.0 | 2,431 | [
30522,
1013,
1008,
1008,
9385,
1006,
1039,
1007,
2526,
1010,
2355,
1010,
14721,
1998,
1013,
2030,
2049,
18460,
1012,
2035,
2916,
9235,
1012,
1008,
2079,
2025,
11477,
2030,
6366,
9385,
14444,
2030,
2023,
5371,
20346,
1012,
1008,
1008,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* v4l2-fh.h
*
* V4L2 file handle. Store per file handle data for the V4L2
* framework. Using file handles is optional for the drivers.
*
* Copyright (C) 2009--2010 Nokia Corporation.
*
* Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef V4L2_FH_H
#define V4L2_FH_H
#include <linux/list.h>
struct video_device;
struct v4l2_ctrl_handler;
struct v4l2_fh {
struct list_head list;
struct video_device *vdev;
struct v4l2_ctrl_handler *ctrl_handler;
enum v4l2_priority prio;
wait_queue_head_t wait;
struct list_head subscribed;
struct list_head available;
unsigned int navailable;
u32 sequence;
};
void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev);
void v4l2_fh_add(struct v4l2_fh *fh);
int v4l2_fh_open(struct file *filp);
void v4l2_fh_del(struct v4l2_fh *fh);
void v4l2_fh_exit(struct v4l2_fh *fh);
int v4l2_fh_release(struct file *filp);
int v4l2_fh_is_singular(struct v4l2_fh *fh);
static inline int v4l2_fh_is_singular_file(struct file *filp)
{
return v4l2_fh_is_singular(filp->private_data);
}
#endif
| mlachwani/Android-4.4.3-HTC-M8-Kernel-ATT | include/media/v4l2-fh.h | C | gpl-2.0 | 1,730 | [
30522,
1013,
1008,
1008,
1058,
2549,
2140,
2475,
1011,
1042,
2232,
1012,
1044,
1008,
1008,
1058,
2549,
2140,
2475,
5371,
5047,
1012,
3573,
2566,
5371,
5047,
2951,
2005,
1996,
1058,
2549,
2140,
2475,
1008,
7705,
1012,
2478,
5371,
16024,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `ColorP4uiv` mod in crate `servo`.">
<meta name="keywords" content="rust, rustlang, rust-lang, ColorP4uiv">
<title>servo::gl::ColorP4uiv - Rust</title>
<link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../../index.html'>servo</a>::<wbr><a href='../index.html'>gl</a></p><script>window.sidebarCurrent = {name: 'ColorP4uiv', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>Module <a href='../../index.html'>servo</a>::<wbr><a href='../index.html'>gl</a>::<wbr><a class='mod' href=''>ColorP4uiv</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-5231' class='srclink' href='../../../gleam/ffi/ColorP4uiv/index.html?gotosrc=5231' title='goto source code'>[src]</a></span></h1>
<h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class='fn' href='fn.is_loaded.html'
title='servo::gl::ColorP4uiv::is_loaded'>is_loaded</a></td>
<td class='docblock short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class='fn' href='fn.load_with.html'
title='servo::gl::ColorP4uiv::load_with'>load_with</a></td>
<td class='docblock short'>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../../";
window.currentCrate = "servo";
window.playgroundUrl = "";
</script>
<script src="../../../jquery.js"></script>
<script src="../../../main.js"></script>
<script defer src="../../../search-index.js"></script>
</body>
</html> | servo/doc.servo.org | servo/gl/ColorP4uiv/index.html | HTML | mpl-2.0 | 4,883 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
18804,
2171,
1027,
1000,
3193,
6442,
1000,
418... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*
* e-additives.server RESTful API
* Copyright (C) 2013 VEXELON.NET Services
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Eadditives;
use \Eadditives\Models\LocalesModel;
/**
* MyRequest
*
* Reads input HTTP request header and parameters and prepares data fetch criteria.
*
* @package Eadditives
* @author p.petrov
*/
class MyRequest {
const X_AUTH_HEADER = "X-Authorization";
const X_AUTH_HEADER_MASHAPE = "X-Mashape-Proxy-Secret";
const X_AUTH_SCHEME = "EAD-TOKENS";
const PARAM_CATEGORY = 'category';
const PARAM_SORT = 'sort';
const PARAM_ORDER = 'order';
const PARAM_LOCALE = 'locale';
/**
* @var array
*/
protected $validParams = array(
self::PARAM_CATEGORY => array(),
self::PARAM_SORT => array(),
self::PARAM_ORDER => array(),
self::PARAM_LOCALE => array()
);
/**
* Slim app instance
* @var mixed
*/
protected $app;
/**
* Slim app request
* @var mixed
*/
protected $request;
function __construct($app) {
$this->app = $app;
$this->request = $app->request;
}
public function isParam($name) {
return !is_null($this->request->params($name));
}
public function getParam($name) {
return $this->request->params($name);
}
protected function getFilteredParams() {
$result = array_intersect_key($this->request->params(), $this->validParams);
if ($this->app->log->getEnabled() && !empty($result))
$this->app->log->debug('Request params: ' . print_r($result, true));
return $result;
}
/**
* Resolve and validate criteria parameters
* @param array $criteria category id
* @return array
*/
public function getCriteria() {
$criteria = $this->getFilteredParams();
$locale = $criteria[MyRequest::PARAM_LOCALE];
if (is_null($locale)) {
// default locale is EN
$criteria[MyRequest::PARAM_LOCALE] = LocalesModel::LOCALE_EN;
} else if ($locale !== LocalesModel::LOCALE_EN
&& $locale !== LocalesModel::LOCALE_BG) {
$this->app->log->error("Invalid locale - [$locale]!");
throw new RequestException('Not Found', MyResponse::HTTP_STATUS_NOT_FOUND);
}
$sort = $criteria[MyRequest::PARAM_SORT];
if (!is_null($sort)) {
$order = $criteria[MyRequest::PARAM_ORDER];
if (is_null($order)) {
$criteria[MyRequest::PARAM_ORDER] = 'DESC';
} else if ($order !== 'asc' && $order !== 'desc') {
$this->app->log->error("Invalid order - [$order]!");
throw new RequestException('Not Found', MyResponse::HTTP_STATUS_NOT_FOUND);
}
}
return $criteria;
}
/**
* Validate required headers.
*
* Expects:
* User-Agent: <any string>
* X-Authorization: EAD-TOKENS apiKey="quoted-string"
*
* @throws RequestException If authorization header was not passed or wrong formatted.
*/
public function authorize() {
// header: User-Agent
$userAgent = trim($this->request->headers('User-Agent'));
if (empty($userAgent)) {
throw new RequestException('Forbidden', MyResponse::HTTP_STATUS_FORBIDDEN);
}
$apiKeys = unserialize(X_AUTH_KEY);
$tokens = array();
try {
// header: X-Mashape-Proxy
$authorizationMashape = $this->request->headers(self::X_AUTH_HEADER_MASHAPE);
if (!is_null($authorizationMashape)) {
$tokenMashape = trim(str_replace(self::X_AUTH_HEADER_MASHAPE . ':', '', $authorizationMashape));
$tokens['apiKey'] = $tokenMashape;
} else {
// header: X-Authorization
$authorization = $this->request->headers(self::X_AUTH_HEADER);
$tokens = $this->parseXAuthorization($authorization);
}
// verify keys
if (!isset($tokens['apiKey']) || !in_array($tokens['apiKey'], $apiKeys)) {
throw new \Exception('Invalid API key!');
}
// save API key info in app
$this->app->container->singleton('apiKey', function() use ($tokens) {
return $tokens['apiKey'];
});
} catch (\Exception $e) {
throw new RequestException('Authorization required', MyResponse::HTTP_STATUS_UNAUTHORIZED, $e);
}
}
/**
* Parses X-Authorization header components.
* @param $header
* @throws Exception If one or more components of X-Authorization could not be parsed.
* @return array
*/
private function parseXAuthorization($header) {
if (is_null($header)) {
throw new \Exception('X-Authorization header is empty!');
}
$headerNoScheme = strstr($header, self::X_AUTH_SCHEME);
if ($headerNoScheme === FALSE) {
throw new \Exception('X-Authorization header scheme is invalid!');
}
$headerNoScheme = trim(str_replace(self::X_AUTH_SCHEME, "", $headerNoScheme));
// expects to get no more than 10 items!
$items = explode(",", $headerNoScheme, 10);
$results = array();
// parse key/value for each item
foreach ($items as $item) {
$pair = explode("=", $item);
$key = trim(strval($pair[0]));
$value = trim(str_replace('"', "", $pair[1]));
$results[$key] = $value;
}
if (DEBUG) {
$this->app->log->debug(self::X_AUTH_HEADER . ' values: ' . print_r($results, true));
}
return $results;
}
}
?> | vexelon-dot-net/e-additives.server | src/Eadditives/MyRequest.php | PHP | agpl-3.0 | 6,416 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1041,
1011,
29167,
2015,
1012,
8241,
2717,
3993,
17928,
1008,
9385,
1006,
1039,
1007,
2286,
2310,
2595,
18349,
2078,
1012,
5658,
2578,
1008,
1008,
2023,
2565,
2003,
2489,
4007,
1024,
2017,
2064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
package me.tomkent.chemcraft.Blocks;
import me.tomkent.chemcraft.ChemCraft;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class oreBarium extends Block{
private static String blockName = "Barium Ore";
private static String blockTexture = "missing";
private static String blockNameSafe = "oreBarium";
public oreBarium()
{
super(Material.rock);
setBlockName(ChemCraft.MODID + "_" + blockNameSafe);
setCreativeTab(ChemCraft.tabChemcraft);
setBlockTextureName("chemcraft:" + blockTexture);
setHarvestLevel("pickaxe", 1);
setHardness(5F);
}
}
| tommykent1210/ChemCraft | Development/src/main/java/me/tomkent/chemcraft/Blocks/oreBarium.java | Java | gpl-2.0 | 655 | [
30522,
7427,
2033,
1012,
3419,
7520,
2102,
1012,
18178,
12458,
27528,
2102,
1012,
5991,
1025,
12324,
2033,
1012,
3419,
7520,
2102,
1012,
18178,
12458,
27528,
2102,
1012,
18178,
12458,
27528,
2102,
1025,
12324,
5658,
1012,
3067,
10419,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2010-2016 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bx#license-bsd-2-clause
*/
#ifndef BX_FLOAT4X4_H_HEADER_GUARD
#define BX_FLOAT4X4_H_HEADER_GUARD
#include "simd_t.h"
namespace bx
{
BX_ALIGN_DECL_16(struct) float4x4_t
{
simd128_t col[4];
};
BX_SIMD_FORCE_INLINE simd128_t simd_mul_xyz1(simd128_t _a, const float4x4_t* _b)
{
const simd128_t xxxx = simd_swiz_xxxx(_a);
const simd128_t yyyy = simd_swiz_yyyy(_a);
const simd128_t zzzz = simd_swiz_zzzz(_a);
const simd128_t col0 = simd_mul(_b->col[0], xxxx);
const simd128_t col1 = simd_mul(_b->col[1], yyyy);
const simd128_t col2 = simd_madd(_b->col[2], zzzz, col0);
const simd128_t col3 = simd_add(_b->col[3], col1);
const simd128_t result = simd_add(col2, col3);
return result;
}
BX_SIMD_FORCE_INLINE simd128_t simd_mul(simd128_t _a, const float4x4_t* _b)
{
const simd128_t xxxx = simd_swiz_xxxx(_a);
const simd128_t yyyy = simd_swiz_yyyy(_a);
const simd128_t zzzz = simd_swiz_zzzz(_a);
const simd128_t wwww = simd_swiz_wwww(_a);
const simd128_t col0 = simd_mul(_b->col[0], xxxx);
const simd128_t col1 = simd_mul(_b->col[1], yyyy);
const simd128_t col2 = simd_madd(_b->col[2], zzzz, col0);
const simd128_t col3 = simd_madd(_b->col[3], wwww, col1);
const simd128_t result = simd_add(col2, col3);
return result;
}
BX_SIMD_INLINE void float4x4_mul(float4x4_t* __restrict _result, const float4x4_t* __restrict _a, const float4x4_t* __restrict _b)
{
_result->col[0] = simd_mul(_a->col[0], _b);
_result->col[1] = simd_mul(_a->col[1], _b);
_result->col[2] = simd_mul(_a->col[2], _b);
_result->col[3] = simd_mul(_a->col[3], _b);
}
BX_SIMD_FORCE_INLINE void float4x4_transpose(float4x4_t* __restrict _result, const float4x4_t* __restrict _mtx)
{
const simd128_t aibj = simd_shuf_xAyB(_mtx->col[0], _mtx->col[2]); // aibj
const simd128_t emfn = simd_shuf_xAyB(_mtx->col[1], _mtx->col[3]); // emfn
const simd128_t ckdl = simd_shuf_zCwD(_mtx->col[0], _mtx->col[2]); // ckdl
const simd128_t gohp = simd_shuf_zCwD(_mtx->col[1], _mtx->col[3]); // gohp
_result->col[0] = simd_shuf_xAyB(aibj, emfn); // aeim
_result->col[1] = simd_shuf_zCwD(aibj, emfn); // bfjn
_result->col[2] = simd_shuf_xAyB(ckdl, gohp); // cgko
_result->col[3] = simd_shuf_zCwD(ckdl, gohp); // dhlp
}
BX_SIMD_INLINE void float4x4_inverse(float4x4_t* __restrict _result, const float4x4_t* __restrict _a)
{
const simd128_t tmp0 = simd_shuf_xAzC(_a->col[0], _a->col[1]);
const simd128_t tmp1 = simd_shuf_xAzC(_a->col[2], _a->col[3]);
const simd128_t tmp2 = simd_shuf_yBwD(_a->col[0], _a->col[1]);
const simd128_t tmp3 = simd_shuf_yBwD(_a->col[2], _a->col[3]);
const simd128_t t0 = simd_shuf_xyAB(tmp0, tmp1);
const simd128_t t1 = simd_shuf_xyAB(tmp3, tmp2);
const simd128_t t2 = simd_shuf_zwCD(tmp0, tmp1);
const simd128_t t3 = simd_shuf_zwCD(tmp3, tmp2);
const simd128_t t23 = simd_mul(t2, t3);
const simd128_t t23_yxwz = simd_swiz_yxwz(t23);
const simd128_t t23_wzyx = simd_swiz_wzyx(t23);
simd128_t cof0, cof1, cof2, cof3;
const simd128_t zero = simd_zero();
cof0 = simd_nmsub(t1, t23_yxwz, zero);
cof0 = simd_madd(t1, t23_wzyx, cof0);
cof1 = simd_nmsub(t0, t23_yxwz, zero);
cof1 = simd_madd(t0, t23_wzyx, cof1);
cof1 = simd_swiz_zwxy(cof1);
const simd128_t t12 = simd_mul(t1, t2);
const simd128_t t12_yxwz = simd_swiz_yxwz(t12);
const simd128_t t12_wzyx = simd_swiz_wzyx(t12);
cof0 = simd_madd(t3, t12_yxwz, cof0);
cof0 = simd_nmsub(t3, t12_wzyx, cof0);
cof3 = simd_mul(t0, t12_yxwz);
cof3 = simd_nmsub(t0, t12_wzyx, cof3);
cof3 = simd_swiz_zwxy(cof3);
const simd128_t t1_zwxy = simd_swiz_zwxy(t1);
const simd128_t t2_zwxy = simd_swiz_zwxy(t2);
const simd128_t t13 = simd_mul(t1_zwxy, t3);
const simd128_t t13_yxwz = simd_swiz_yxwz(t13);
const simd128_t t13_wzyx = simd_swiz_wzyx(t13);
cof0 = simd_madd(t2_zwxy, t13_yxwz, cof0);
cof0 = simd_nmsub(t2_zwxy, t13_wzyx, cof0);
cof2 = simd_mul(t0, t13_yxwz);
cof2 = simd_nmsub(t0, t13_wzyx, cof2);
cof2 = simd_swiz_zwxy(cof2);
const simd128_t t01 = simd_mul(t0, t1);
const simd128_t t01_yxwz = simd_swiz_yxwz(t01);
const simd128_t t01_wzyx = simd_swiz_wzyx(t01);
cof2 = simd_nmsub(t3, t01_yxwz, cof2);
cof2 = simd_madd(t3, t01_wzyx, cof2);
cof3 = simd_madd(t2_zwxy, t01_yxwz, cof3);
cof3 = simd_nmsub(t2_zwxy, t01_wzyx, cof3);
const simd128_t t03 = simd_mul(t0, t3);
const simd128_t t03_yxwz = simd_swiz_yxwz(t03);
const simd128_t t03_wzyx = simd_swiz_wzyx(t03);
cof1 = simd_nmsub(t2_zwxy, t03_yxwz, cof1);
cof1 = simd_madd(t2_zwxy, t03_wzyx, cof1);
cof2 = simd_madd(t1, t03_yxwz, cof2);
cof2 = simd_nmsub(t1, t03_wzyx, cof2);
const simd128_t t02 = simd_mul(t0, t2_zwxy);
const simd128_t t02_yxwz = simd_swiz_yxwz(t02);
const simd128_t t02_wzyx = simd_swiz_wzyx(t02);
cof1 = simd_madd(t3, t02_yxwz, cof1);
cof1 = simd_nmsub(t3, t02_wzyx, cof1);
cof3 = simd_nmsub(t1, t02_yxwz, cof3);
cof3 = simd_madd(t1, t02_wzyx, cof3);
const simd128_t det = simd_dot(t0, cof0);
const simd128_t invdet = simd_rcp(det);
_result->col[0] = simd_mul(cof0, invdet);
_result->col[1] = simd_mul(cof1, invdet);
_result->col[2] = simd_mul(cof2, invdet);
_result->col[3] = simd_mul(cof3, invdet);
}
} // namespace bx
#endif // BX_FLOAT4X4_H_HEADER_GUARD
| dariomanesku/bx | include/bx/float4x4_t.h | C | bsd-2-clause | 5,418 | [
30522,
1013,
1008,
1008,
9385,
2230,
1011,
2355,
24905,
27605,
2099,
13173,
2094,
27586,
1012,
2035,
2916,
9235,
1012,
1008,
6105,
1024,
16770,
1024,
1013,
1013,
21025,
2705,
12083,
1012,
4012,
1013,
23923,
5400,
2094,
27586,
1013,
1038,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
<p>The requested URL /html/wedlock/images/apple-touch-icon-114x114.png was not found on this server.</p>
<hr>
<address>Apache Server at demo.t2themes.com Port 80</address>
</body></html>
| sunpj2007/sunpj2007.github.io | images/apple-touch-icon-114x114.html | HTML | apache-2.0 | 316 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
29464,
24475,
1013,
1013,
26718,
2094,
16129,
1016,
1012,
1014,
1013,
1013,
4372,
1000,
1028,
1026,
16129,
1028,
1026,
2132,
1028,
1026,
2516,
1028,
24837,
2025,
2179,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.dynamodbv2.model;
import java.io.Serializable;
/**
* <p>
* Represents a condition to be compared with an attribute value. This condition
* can be used with <i>DeleteItem</i>, <i>PutItem</i> or <i>UpdateItem</i>
* operations; if the comparison evaluates to true, the operation succeeds; if
* not, the operation fails. You can use <i>ExpectedAttributeValue</i> in one of
* two different ways:
* </p>
* <ul>
* <li>
* <p>
* Use <i>AttributeValueList</i> to specify one or more values to compare
* against an attribute. Use <i>ComparisonOperator</i> to specify how you want
* to perform the comparison. If the comparison evaluates to true, then the
* conditional operation succeeds.
* </p>
* </li>
* <li>
* <p>
* Use <i>Value</i> to specify a value that DynamoDB will compare against an
* attribute. If the values match, then <i>ExpectedAttributeValue</i> evaluates
* to true and the conditional operation succeeds. Optionally, you can also set
* <i>Exists</i> to false, indicating that you <i>do not</i> expect to find the
* attribute value in the table. In this case, the conditional operation
* succeeds only if the comparison evaluates to false.
* </p>
* </li>
* </ul>
* <p>
* <i>Value</i> and <i>Exists</i> are incompatible with
* <i>AttributeValueList</i> and <i>ComparisonOperator</i>. Note that if you use
* both sets of parameters at once, DynamoDB will return a
* <i>ValidationException</i> exception.
* </p>
*/
public class ExpectedAttributeValue implements Serializable, Cloneable {
private AttributeValue value;
/**
* <p>
* Causes DynamoDB to evaluate the value before attempting a conditional
* operation:
* </p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see if that
* attribute value already exists in the table. If it is found, then the
* operation succeeds. If it is not found, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value does
* not exist, then the assumption is valid and the operation succeeds. If
* the value is found, despite the assumption that it does not exist, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you supply
* a <i>Value</i> all by itself, DynamoDB assumes the attribute exists: You
* don't have to set <i>Exists</i> to <code>true</code>, because it is
* implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to check.
* (You expect a value to exist, but don't specify what that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a <i>Value</i>.
* (You cannot expect an attribute to have a value, while also expecting it
* not to exist.)
* </p>
* </li>
* </ul>
*/
private Boolean exists;
/**
* <p>
* A comparator for evaluating attributes in the <i>AttributeValueList</i>.
* For example, equals, greater than, less than, etc.
* </p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all datatypes,
* including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, Binary, String Set, Number Set, or Binary
* Set. If an item contains an <i>AttributeValue</i> element of a different
* type than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, Binary, String Set, Number Set, or Binary Set. If an
* item contains an <i>AttributeValue</i> of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not equal <code>{"NS":["6", "2", "1"]}</code>
* .
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, or Binary (not a set type). If an item contains an
* <i>AttributeValue</i> element of a different type than the one provided
* in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists. <code>NOT_NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its data type.
* If the data type of attribute "<code>a</code>" is null, and you evaluate
* it using <code>NOT_NULL</code>, the result is a Boolean <i>true</i>. This
* result is because the attribute "<code>a</code>" exists; its data type is
* not relevant to the <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist. <code>NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its data
* type. If the data type of attribute "<code>a</code>" is null, and you
* evaluate it using <code>NULL</code>, the result is a Boolean
* <i>false</i>. This is because the attribute "<code>a</code>" exists; its
* data type is not relevant to the <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is of type String, then the operator checks
* for a substring match. If the target attribute of the comparison is of
* type Binary, then the operator looks for a subsequence of the target that
* matches the input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then the
* operator evaluates to true if it finds an exact match with any member of
* the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>" can be a list; however, "
* <code>b</code>" cannot be a set, a map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence, or
* absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is a String, then the operator checks for the
* absence of a substring match. If the target attribute of the comparison
* is Binary, then the operator checks for the absence of a subsequence of
* the target that matches the input. If the target attribute of the
* comparison is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it <i>does
* not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map, or a
* list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String or Binary (not a Number or a set type). The target attribute
* of the comparison must be of type String or Binary (not a Number or a set
* type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more <i>AttributeValue</i>
* elements of type String, Number, or Binary (not a set type). These
* attributes are compared against an existing set type attribute of an
* item. If any elements of the input set are present in the item attribute,
* the expression evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value, and less
* than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i> elements
* of the same type, either String, Number, or Binary (not a set type). A
* target attribute matches if the target value is greater than, or equal
* to, the first element and less than, or equal to, the second element. If
* an item contains an <i>AttributeValue</i> element of a different type
* than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not compare to
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* </ul>
*/
private String comparisonOperator;
/**
* <p>
* One or more values to evaluate against the supplied attribute. The number
* of values in the list depends on the <i>ComparisonOperator</i> being
* used.
* </p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than are based
* on ASCII character code values. For example, <code>a</code> is greater
* than <code>A</code>, and <code>a</code> is greater than <code>B</code>.
* For a list of code values, see <a
* href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as unsigned when
* it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
*/
private java.util.List<AttributeValue> attributeValueList;
/**
* Default constructor for ExpectedAttributeValue object. Callers should use
* the setter or fluent setter (with...) methods to initialize the object
* after creating it.
*/
public ExpectedAttributeValue() {
}
/**
* Constructs a new ExpectedAttributeValue object. Callers should use the
* setter or fluent setter (with...) methods to initialize any additional
* object members.
*
* @param value
*/
public ExpectedAttributeValue(AttributeValue value) {
setValue(value);
}
/**
* Constructs a new ExpectedAttributeValue object. Callers should use the
* setter or fluent setter (with...) methods to initialize any additional
* object members.
*
* @param exists
* Causes DynamoDB to evaluate the value before attempting a
* conditional operation:</p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see
* if that attribute value already exists in the table. If it is
* found, then the operation succeeds. If it is not found, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value
* does not exist, then the assumption is valid and the operation
* succeeds. If the value is found, despite the assumption that it
* does not exist, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you
* supply a <i>Value</i> all by itself, DynamoDB assumes the
* attribute exists: You don't have to set <i>Exists</i> to
* <code>true</code>, because it is implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to
* check. (You expect a value to exist, but don't specify what
* that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a
* <i>Value</i>. (You cannot expect an attribute to have a value,
* while also expecting it not to exist.)
* </p>
* </li>
*/
public ExpectedAttributeValue(Boolean exists) {
setExists(exists);
}
/**
* @param value
*/
public void setValue(AttributeValue value) {
this.value = value;
}
/**
* @return
*/
public AttributeValue getValue() {
return this.value;
}
/**
* @param value
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ExpectedAttributeValue withValue(AttributeValue value) {
setValue(value);
return this;
}
/**
* <p>
* Causes DynamoDB to evaluate the value before attempting a conditional
* operation:
* </p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see if that
* attribute value already exists in the table. If it is found, then the
* operation succeeds. If it is not found, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value does
* not exist, then the assumption is valid and the operation succeeds. If
* the value is found, despite the assumption that it does not exist, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you supply
* a <i>Value</i> all by itself, DynamoDB assumes the attribute exists: You
* don't have to set <i>Exists</i> to <code>true</code>, because it is
* implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to check.
* (You expect a value to exist, but don't specify what that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a <i>Value</i>.
* (You cannot expect an attribute to have a value, while also expecting it
* not to exist.)
* </p>
* </li>
* </ul>
*
* @param exists
* Causes DynamoDB to evaluate the value before attempting a
* conditional operation:</p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see
* if that attribute value already exists in the table. If it is
* found, then the operation succeeds. If it is not found, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value
* does not exist, then the assumption is valid and the operation
* succeeds. If the value is found, despite the assumption that it
* does not exist, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you
* supply a <i>Value</i> all by itself, DynamoDB assumes the
* attribute exists: You don't have to set <i>Exists</i> to
* <code>true</code>, because it is implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to
* check. (You expect a value to exist, but don't specify what
* that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a
* <i>Value</i>. (You cannot expect an attribute to have a value,
* while also expecting it not to exist.)
* </p>
* </li>
*/
public void setExists(Boolean exists) {
this.exists = exists;
}
/**
* <p>
* Causes DynamoDB to evaluate the value before attempting a conditional
* operation:
* </p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see if that
* attribute value already exists in the table. If it is found, then the
* operation succeeds. If it is not found, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value does
* not exist, then the assumption is valid and the operation succeeds. If
* the value is found, despite the assumption that it does not exist, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you supply
* a <i>Value</i> all by itself, DynamoDB assumes the attribute exists: You
* don't have to set <i>Exists</i> to <code>true</code>, because it is
* implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to check.
* (You expect a value to exist, but don't specify what that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a <i>Value</i>.
* (You cannot expect an attribute to have a value, while also expecting it
* not to exist.)
* </p>
* </li>
* </ul>
*
* @return Causes DynamoDB to evaluate the value before attempting a
* conditional operation:</p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see
* if that attribute value already exists in the table. If it is
* found, then the operation succeeds. If it is not found, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value
* does not exist, then the assumption is valid and the operation
* succeeds. If the value is found, despite the assumption that it
* does not exist, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If
* you supply a <i>Value</i> all by itself, DynamoDB assumes the
* attribute exists: You don't have to set <i>Exists</i> to
* <code>true</code>, because it is implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i>
* to check. (You expect a value to exist, but don't specify
* what that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a
* <i>Value</i>. (You cannot expect an attribute to have a value,
* while also expecting it not to exist.)
* </p>
* </li>
*/
public Boolean getExists() {
return this.exists;
}
/**
* <p>
* Causes DynamoDB to evaluate the value before attempting a conditional
* operation:
* </p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see if that
* attribute value already exists in the table. If it is found, then the
* operation succeeds. If it is not found, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value does
* not exist, then the assumption is valid and the operation succeeds. If
* the value is found, despite the assumption that it does not exist, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you supply
* a <i>Value</i> all by itself, DynamoDB assumes the attribute exists: You
* don't have to set <i>Exists</i> to <code>true</code>, because it is
* implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to check.
* (You expect a value to exist, but don't specify what that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a <i>Value</i>.
* (You cannot expect an attribute to have a value, while also expecting it
* not to exist.)
* </p>
* </li>
* </ul>
*
* @param exists
* Causes DynamoDB to evaluate the value before attempting a
* conditional operation:</p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see
* if that attribute value already exists in the table. If it is
* found, then the operation succeeds. If it is not found, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value
* does not exist, then the assumption is valid and the operation
* succeeds. If the value is found, despite the assumption that it
* does not exist, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you
* supply a <i>Value</i> all by itself, DynamoDB assumes the
* attribute exists: You don't have to set <i>Exists</i> to
* <code>true</code>, because it is implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to
* check. (You expect a value to exist, but don't specify what
* that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a
* <i>Value</i>. (You cannot expect an attribute to have a value,
* while also expecting it not to exist.)
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ExpectedAttributeValue withExists(Boolean exists) {
setExists(exists);
return this;
}
/**
* <p>
* Causes DynamoDB to evaluate the value before attempting a conditional
* operation:
* </p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see if that
* attribute value already exists in the table. If it is found, then the
* operation succeeds. If it is not found, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value does
* not exist, then the assumption is valid and the operation succeeds. If
* the value is found, despite the assumption that it does not exist, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If you supply
* a <i>Value</i> all by itself, DynamoDB assumes the attribute exists: You
* don't have to set <i>Exists</i> to <code>true</code>, because it is
* implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i> to check.
* (You expect a value to exist, but don't specify what that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a <i>Value</i>.
* (You cannot expect an attribute to have a value, while also expecting it
* not to exist.)
* </p>
* </li>
* </ul>
*
* @return Causes DynamoDB to evaluate the value before attempting a
* conditional operation:</p>
* <ul>
* <li>
* <p>
* If <i>Exists</i> is <code>true</code>, DynamoDB will check to see
* if that attribute value already exists in the table. If it is
* found, then the operation succeeds. If it is not found, the
* operation fails with a <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* <li>
* <p>
* If <i>Exists</i> is <code>false</code>, DynamoDB assumes that the
* attribute value does not exist in the table. If in fact the value
* does not exist, then the assumption is valid and the operation
* succeeds. If the value is found, despite the assumption that it
* does not exist, the operation fails with a
* <i>ConditionalCheckFailedException</i>.
* </p>
* </li>
* </ul>
* <p>
* The default setting for <i>Exists</i> is <code>true</code>. If
* you supply a <i>Value</i> all by itself, DynamoDB assumes the
* attribute exists: You don't have to set <i>Exists</i> to
* <code>true</code>, because it is implied.
* </p>
* <p>
* DynamoDB returns a <i>ValidationException</i> if:
* </p>
* <ul>
* <li>
* <p>
* <i>Exists</i> is <code>true</code> but there is no <i>Value</i>
* to check. (You expect a value to exist, but don't specify
* what that value is.)
* </p>
* </li>
* <li>
* <p>
* <i>Exists</i> is <code>false</code> but you also provide a
* <i>Value</i>. (You cannot expect an attribute to have a value,
* while also expecting it not to exist.)
* </p>
* </li>
*/
public Boolean isExists() {
return this.exists;
}
/**
* <p>
* A comparator for evaluating attributes in the <i>AttributeValueList</i>.
* For example, equals, greater than, less than, etc.
* </p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all datatypes,
* including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, Binary, String Set, Number Set, or Binary
* Set. If an item contains an <i>AttributeValue</i> element of a different
* type than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, Binary, String Set, Number Set, or Binary Set. If an
* item contains an <i>AttributeValue</i> of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not equal <code>{"NS":["6", "2", "1"]}</code>
* .
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, or Binary (not a set type). If an item contains an
* <i>AttributeValue</i> element of a different type than the one provided
* in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists. <code>NOT_NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its data type.
* If the data type of attribute "<code>a</code>" is null, and you evaluate
* it using <code>NOT_NULL</code>, the result is a Boolean <i>true</i>. This
* result is because the attribute "<code>a</code>" exists; its data type is
* not relevant to the <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist. <code>NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its data
* type. If the data type of attribute "<code>a</code>" is null, and you
* evaluate it using <code>NULL</code>, the result is a Boolean
* <i>false</i>. This is because the attribute "<code>a</code>" exists; its
* data type is not relevant to the <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is of type String, then the operator checks
* for a substring match. If the target attribute of the comparison is of
* type Binary, then the operator looks for a subsequence of the target that
* matches the input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then the
* operator evaluates to true if it finds an exact match with any member of
* the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>" can be a list; however, "
* <code>b</code>" cannot be a set, a map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence, or
* absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is a String, then the operator checks for the
* absence of a substring match. If the target attribute of the comparison
* is Binary, then the operator checks for the absence of a subsequence of
* the target that matches the input. If the target attribute of the
* comparison is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it <i>does
* not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map, or a
* list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String or Binary (not a Number or a set type). The target attribute
* of the comparison must be of type String or Binary (not a Number or a set
* type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more <i>AttributeValue</i>
* elements of type String, Number, or Binary (not a set type). These
* attributes are compared against an existing set type attribute of an
* item. If any elements of the input set are present in the item attribute,
* the expression evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value, and less
* than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i> elements
* of the same type, either String, Number, or Binary (not a set type). A
* target attribute matches if the target value is greater than, or equal
* to, the first element and less than, or equal to, the second element. If
* an item contains an <i>AttributeValue</i> element of a different type
* than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not compare to
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* </ul>
*
* @param comparisonOperator
* A comparator for evaluating attributes in the
* <i>AttributeValueList</i>. For example, equals, greater than, less
* than, etc.</p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, Binary,
* String Set, Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, Binary, String Set,
* Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> of a different type than the one provided in
* the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, or Binary (not a set
* type). If an item contains an <i>AttributeValue</i> element of a
* different type than the one provided in the request, the value
* does not match. For example, <code>{"S":"6"}</code> does not equal
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not
* compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists.
* <code>NOT_NULL</code> is supported for all datatypes, including
* lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NOT_NULL</code>, the result is a
* Boolean <i>true</i>. This result is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist.
* <code>NULL</code> is supported for all datatypes, including lists
* and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NULL</code>, the result is a
* Boolean <i>false</i>. This is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a
* set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is of
* type String, then the operator checks for a substring match. If
* the target attribute of the comparison is of type Binary, then the
* operator looks for a subsequence of the target that matches the
* input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then
* the operator evaluates to true if it finds an exact match with any
* member of the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence,
* or absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is a
* String, then the operator checks for the absence of a substring
* match. If the target attribute of the comparison is Binary, then
* the operator checks for the absence of a subsequence of the target
* that matches the input. If the target attribute of the comparison
* is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it
* <i>does not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String or Binary (not a Number or a
* set type). The target attribute of the comparison must be of type
* String or Binary (not a Number or a set type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more
* <i>AttributeValue</i> elements of type String, Number, or Binary
* (not a set type). These attributes are compared against an
* existing set type attribute of an item. If any elements of the
* input set are present in the item attribute, the expression
* evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value,
* and less than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i>
* elements of the same type, either String, Number, or Binary (not a
* set type). A target attribute matches if the target value is
* greater than, or equal to, the first element and less than, or
* equal to, the second element. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not compare to <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* @see ComparisonOperator
*/
public void setComparisonOperator(String comparisonOperator) {
this.comparisonOperator = comparisonOperator;
}
/**
* <p>
* A comparator for evaluating attributes in the <i>AttributeValueList</i>.
* For example, equals, greater than, less than, etc.
* </p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all datatypes,
* including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, Binary, String Set, Number Set, or Binary
* Set. If an item contains an <i>AttributeValue</i> element of a different
* type than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, Binary, String Set, Number Set, or Binary Set. If an
* item contains an <i>AttributeValue</i> of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not equal <code>{"NS":["6", "2", "1"]}</code>
* .
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, or Binary (not a set type). If an item contains an
* <i>AttributeValue</i> element of a different type than the one provided
* in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists. <code>NOT_NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its data type.
* If the data type of attribute "<code>a</code>" is null, and you evaluate
* it using <code>NOT_NULL</code>, the result is a Boolean <i>true</i>. This
* result is because the attribute "<code>a</code>" exists; its data type is
* not relevant to the <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist. <code>NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its data
* type. If the data type of attribute "<code>a</code>" is null, and you
* evaluate it using <code>NULL</code>, the result is a Boolean
* <i>false</i>. This is because the attribute "<code>a</code>" exists; its
* data type is not relevant to the <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is of type String, then the operator checks
* for a substring match. If the target attribute of the comparison is of
* type Binary, then the operator looks for a subsequence of the target that
* matches the input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then the
* operator evaluates to true if it finds an exact match with any member of
* the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>" can be a list; however, "
* <code>b</code>" cannot be a set, a map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence, or
* absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is a String, then the operator checks for the
* absence of a substring match. If the target attribute of the comparison
* is Binary, then the operator checks for the absence of a subsequence of
* the target that matches the input. If the target attribute of the
* comparison is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it <i>does
* not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map, or a
* list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String or Binary (not a Number or a set type). The target attribute
* of the comparison must be of type String or Binary (not a Number or a set
* type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more <i>AttributeValue</i>
* elements of type String, Number, or Binary (not a set type). These
* attributes are compared against an existing set type attribute of an
* item. If any elements of the input set are present in the item attribute,
* the expression evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value, and less
* than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i> elements
* of the same type, either String, Number, or Binary (not a set type). A
* target attribute matches if the target value is greater than, or equal
* to, the first element and less than, or equal to, the second element. If
* an item contains an <i>AttributeValue</i> element of a different type
* than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not compare to
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* </ul>
*
* @return A comparator for evaluating attributes in the
* <i>AttributeValueList</i>. For example, equals, greater than,
* less than, etc.</p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, Binary,
* String Set, Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, Binary, String Set,
* Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> of a different type than the one provided
* in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code>
* does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, or Binary (not a
* set type). If an item contains an <i>AttributeValue</i> element
* of a different type than the one provided in the request, the
* value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code>
* does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code>
* does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists.
* <code>NOT_NULL</code> is supported for all datatypes, including
* lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is
* null, and you evaluate it using <code>NOT_NULL</code>, the result
* is a Boolean <i>true</i>. This result is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist.
* <code>NULL</code> is supported for all datatypes, including lists
* and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is
* null, and you evaluate it using <code>NULL</code>, the result is
* a Boolean <i>false</i>. This is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a
* set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is of
* type String, then the operator checks for a substring match. If
* the target attribute of the comparison is of type Binary, then
* the operator looks for a subsequence of the target that matches
* the input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then
* the operator evaluates to true if it finds an exact match with
* any member of the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a
* map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence,
* or absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is a
* String, then the operator checks for the absence of a substring
* match. If the target attribute of the comparison is Binary, then
* the operator checks for the absence of a subsequence of the
* target that matches the input. If the target attribute of the
* comparison is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it
* <i>does not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a
* map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String or Binary (not a Number or a
* set type). The target attribute of the comparison must be of type
* String or Binary (not a Number or a set type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more
* <i>AttributeValue</i> elements of type String, Number, or Binary
* (not a set type). These attributes are compared against an
* existing set type attribute of an item. If any elements of the
* input set are present in the item attribute, the expression
* evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value,
* and less than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i>
* elements of the same type, either String, Number, or Binary (not
* a set type). A target attribute matches if the target value is
* greater than, or equal to, the first element and less than, or
* equal to, the second element. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not compare to <code>{"N":"6"}</code>
* . Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* @see ComparisonOperator
*/
public String getComparisonOperator() {
return this.comparisonOperator;
}
/**
* <p>
* A comparator for evaluating attributes in the <i>AttributeValueList</i>.
* For example, equals, greater than, less than, etc.
* </p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all datatypes,
* including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, Binary, String Set, Number Set, or Binary
* Set. If an item contains an <i>AttributeValue</i> element of a different
* type than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, Binary, String Set, Number Set, or Binary Set. If an
* item contains an <i>AttributeValue</i> of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not equal <code>{"NS":["6", "2", "1"]}</code>
* .
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, or Binary (not a set type). If an item contains an
* <i>AttributeValue</i> element of a different type than the one provided
* in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists. <code>NOT_NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its data type.
* If the data type of attribute "<code>a</code>" is null, and you evaluate
* it using <code>NOT_NULL</code>, the result is a Boolean <i>true</i>. This
* result is because the attribute "<code>a</code>" exists; its data type is
* not relevant to the <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist. <code>NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its data
* type. If the data type of attribute "<code>a</code>" is null, and you
* evaluate it using <code>NULL</code>, the result is a Boolean
* <i>false</i>. This is because the attribute "<code>a</code>" exists; its
* data type is not relevant to the <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is of type String, then the operator checks
* for a substring match. If the target attribute of the comparison is of
* type Binary, then the operator looks for a subsequence of the target that
* matches the input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then the
* operator evaluates to true if it finds an exact match with any member of
* the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>" can be a list; however, "
* <code>b</code>" cannot be a set, a map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence, or
* absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is a String, then the operator checks for the
* absence of a substring match. If the target attribute of the comparison
* is Binary, then the operator checks for the absence of a subsequence of
* the target that matches the input. If the target attribute of the
* comparison is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it <i>does
* not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map, or a
* list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String or Binary (not a Number or a set type). The target attribute
* of the comparison must be of type String or Binary (not a Number or a set
* type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more <i>AttributeValue</i>
* elements of type String, Number, or Binary (not a set type). These
* attributes are compared against an existing set type attribute of an
* item. If any elements of the input set are present in the item attribute,
* the expression evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value, and less
* than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i> elements
* of the same type, either String, Number, or Binary (not a set type). A
* target attribute matches if the target value is greater than, or equal
* to, the first element and less than, or equal to, the second element. If
* an item contains an <i>AttributeValue</i> element of a different type
* than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not compare to
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* </ul>
*
* @param comparisonOperator
* A comparator for evaluating attributes in the
* <i>AttributeValueList</i>. For example, equals, greater than, less
* than, etc.</p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, Binary,
* String Set, Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, Binary, String Set,
* Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> of a different type than the one provided in
* the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, or Binary (not a set
* type). If an item contains an <i>AttributeValue</i> element of a
* different type than the one provided in the request, the value
* does not match. For example, <code>{"S":"6"}</code> does not equal
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not
* compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists.
* <code>NOT_NULL</code> is supported for all datatypes, including
* lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NOT_NULL</code>, the result is a
* Boolean <i>true</i>. This result is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist.
* <code>NULL</code> is supported for all datatypes, including lists
* and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NULL</code>, the result is a
* Boolean <i>false</i>. This is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a
* set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is of
* type String, then the operator checks for a substring match. If
* the target attribute of the comparison is of type Binary, then the
* operator looks for a subsequence of the target that matches the
* input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then
* the operator evaluates to true if it finds an exact match with any
* member of the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence,
* or absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is a
* String, then the operator checks for the absence of a substring
* match. If the target attribute of the comparison is Binary, then
* the operator checks for the absence of a subsequence of the target
* that matches the input. If the target attribute of the comparison
* is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it
* <i>does not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String or Binary (not a Number or a
* set type). The target attribute of the comparison must be of type
* String or Binary (not a Number or a set type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more
* <i>AttributeValue</i> elements of type String, Number, or Binary
* (not a set type). These attributes are compared against an
* existing set type attribute of an item. If any elements of the
* input set are present in the item attribute, the expression
* evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value,
* and less than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i>
* elements of the same type, either String, Number, or Binary (not a
* set type). A target attribute matches if the target value is
* greater than, or equal to, the first element and less than, or
* equal to, the second element. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not compare to <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see ComparisonOperator
*/
public ExpectedAttributeValue withComparisonOperator(
String comparisonOperator) {
setComparisonOperator(comparisonOperator);
return this;
}
/**
* <p>
* A comparator for evaluating attributes in the <i>AttributeValueList</i>.
* For example, equals, greater than, less than, etc.
* </p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all datatypes,
* including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, Binary, String Set, Number Set, or Binary
* Set. If an item contains an <i>AttributeValue</i> element of a different
* type than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, Binary, String Set, Number Set, or Binary Set. If an
* item contains an <i>AttributeValue</i> of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not equal <code>{"NS":["6", "2", "1"]}</code>
* .
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, or Binary (not a set type). If an item contains an
* <i>AttributeValue</i> element of a different type than the one provided
* in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists. <code>NOT_NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its data type.
* If the data type of attribute "<code>a</code>" is null, and you evaluate
* it using <code>NOT_NULL</code>, the result is a Boolean <i>true</i>. This
* result is because the attribute "<code>a</code>" exists; its data type is
* not relevant to the <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist. <code>NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its data
* type. If the data type of attribute "<code>a</code>" is null, and you
* evaluate it using <code>NULL</code>, the result is a Boolean
* <i>false</i>. This is because the attribute "<code>a</code>" exists; its
* data type is not relevant to the <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is of type String, then the operator checks
* for a substring match. If the target attribute of the comparison is of
* type Binary, then the operator looks for a subsequence of the target that
* matches the input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then the
* operator evaluates to true if it finds an exact match with any member of
* the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>" can be a list; however, "
* <code>b</code>" cannot be a set, a map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence, or
* absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is a String, then the operator checks for the
* absence of a substring match. If the target attribute of the comparison
* is Binary, then the operator checks for the absence of a subsequence of
* the target that matches the input. If the target attribute of the
* comparison is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it <i>does
* not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map, or a
* list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String or Binary (not a Number or a set type). The target attribute
* of the comparison must be of type String or Binary (not a Number or a set
* type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more <i>AttributeValue</i>
* elements of type String, Number, or Binary (not a set type). These
* attributes are compared against an existing set type attribute of an
* item. If any elements of the input set are present in the item attribute,
* the expression evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value, and less
* than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i> elements
* of the same type, either String, Number, or Binary (not a set type). A
* target attribute matches if the target value is greater than, or equal
* to, the first element and less than, or equal to, the second element. If
* an item contains an <i>AttributeValue</i> element of a different type
* than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not compare to
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* </ul>
*
* @param comparisonOperator
* A comparator for evaluating attributes in the
* <i>AttributeValueList</i>. For example, equals, greater than, less
* than, etc.</p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, Binary,
* String Set, Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, Binary, String Set,
* Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> of a different type than the one provided in
* the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, or Binary (not a set
* type). If an item contains an <i>AttributeValue</i> element of a
* different type than the one provided in the request, the value
* does not match. For example, <code>{"S":"6"}</code> does not equal
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not
* compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists.
* <code>NOT_NULL</code> is supported for all datatypes, including
* lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NOT_NULL</code>, the result is a
* Boolean <i>true</i>. This result is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist.
* <code>NULL</code> is supported for all datatypes, including lists
* and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NULL</code>, the result is a
* Boolean <i>false</i>. This is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a
* set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is of
* type String, then the operator checks for a substring match. If
* the target attribute of the comparison is of type Binary, then the
* operator looks for a subsequence of the target that matches the
* input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then
* the operator evaluates to true if it finds an exact match with any
* member of the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence,
* or absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is a
* String, then the operator checks for the absence of a substring
* match. If the target attribute of the comparison is Binary, then
* the operator checks for the absence of a subsequence of the target
* that matches the input. If the target attribute of the comparison
* is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it
* <i>does not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String or Binary (not a Number or a
* set type). The target attribute of the comparison must be of type
* String or Binary (not a Number or a set type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more
* <i>AttributeValue</i> elements of type String, Number, or Binary
* (not a set type). These attributes are compared against an
* existing set type attribute of an item. If any elements of the
* input set are present in the item attribute, the expression
* evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value,
* and less than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i>
* elements of the same type, either String, Number, or Binary (not a
* set type). A target attribute matches if the target value is
* greater than, or equal to, the first element and less than, or
* equal to, the second element. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not compare to <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* @see ComparisonOperator
*/
public void setComparisonOperator(ComparisonOperator comparisonOperator) {
this.comparisonOperator = comparisonOperator.toString();
}
/**
* <p>
* A comparator for evaluating attributes in the <i>AttributeValueList</i>.
* For example, equals, greater than, less than, etc.
* </p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all datatypes,
* including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, Binary, String Set, Number Set, or Binary
* Set. If an item contains an <i>AttributeValue</i> element of a different
* type than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, Binary, String Set, Number Set, or Binary Set. If an
* item contains an <i>AttributeValue</i> of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not equal <code>{"NS":["6", "2", "1"]}</code>
* .
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String, Number, or Binary (not a set type). If an item contains an
* <i>AttributeValue</i> element of a different type than the one provided
* in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If an item
* contains an <i>AttributeValue</i> element of a different type than the
* one provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>. Also,
* <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists. <code>NOT_NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its data type.
* If the data type of attribute "<code>a</code>" is null, and you evaluate
* it using <code>NOT_NULL</code>, the result is a Boolean <i>true</i>. This
* result is because the attribute "<code>a</code>" exists; its data type is
* not relevant to the <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist. <code>NULL</code> is
* supported for all datatypes, including lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its data
* type. If the data type of attribute "<code>a</code>" is null, and you
* evaluate it using <code>NULL</code>, the result is a Boolean
* <i>false</i>. This is because the attribute "<code>a</code>" exists; its
* data type is not relevant to the <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is of type String, then the operator checks
* for a substring match. If the target attribute of the comparison is of
* type Binary, then the operator looks for a subsequence of the target that
* matches the input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then the
* operator evaluates to true if it finds an exact match with any member of
* the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>" can be a list; however, "
* <code>b</code>" cannot be a set, a map, or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence, or
* absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i>
* element of type String, Number, or Binary (not a set type). If the target
* attribute of the comparison is a String, then the operator checks for the
* absence of a substring match. If the target attribute of the comparison
* is Binary, then the operator checks for the absence of a subsequence of
* the target that matches the input. If the target attribute of the
* comparison is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it <i>does
* not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map, or a
* list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one <i>AttributeValue</i> of
* type String or Binary (not a Number or a set type). The target attribute
* of the comparison must be of type String or Binary (not a Number or a set
* type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more <i>AttributeValue</i>
* elements of type String, Number, or Binary (not a set type). These
* attributes are compared against an existing set type attribute of an
* item. If any elements of the input set are present in the item attribute,
* the expression evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value, and less
* than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i> elements
* of the same type, either String, Number, or Binary (not a set type). A
* target attribute matches if the target value is greater than, or equal
* to, the first element and less than, or equal to, the second element. If
* an item contains an <i>AttributeValue</i> element of a different type
* than the one provided in the request, the value does not match. For
* example, <code>{"S":"6"}</code> does not compare to
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* </ul>
*
* @param comparisonOperator
* A comparator for evaluating attributes in the
* <i>AttributeValueList</i>. For example, equals, greater than, less
* than, etc.</p>
* <p>
* The following comparison operators are available:
* </p>
* <p>
* <code>EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN</code>
* </p>
* <p>
* The following are descriptions of each comparison operator.
* </p>
* <ul>
* <li>
* <p>
* <code>EQ</code> : Equal. <code>EQ</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, Binary,
* String Set, Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NE</code> : Not equal. <code>NE</code> is supported for all
* datatypes, including lists and maps.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, Binary, String Set,
* Number Set, or Binary Set. If an item contains an
* <i>AttributeValue</i> of a different type than the one provided in
* the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not equal <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not equal
* <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LE</code> : Less than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>LT</code> : Less than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String, Number, or Binary (not a set
* type). If an item contains an <i>AttributeValue</i> element of a
* different type than the one provided in the request, the value
* does not match. For example, <code>{"S":"6"}</code> does not equal
* <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code> does not
* compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GE</code> : Greater than or equal.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>GT</code> : Greater than.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If an item contains an <i>AttributeValue</i>
* element of a different type than the one provided in the request,
* the value does not match. For example, <code>{"S":"6"}</code> does
* not equal <code>{"N":"6"}</code>. Also, <code>{"N":"6"}</code>
* does not compare to <code>{"NS":["6", "2", "1"]}</code>.
* </p>
* <p/></li>
* <li>
* <p>
* <code>NOT_NULL</code> : The attribute exists.
* <code>NOT_NULL</code> is supported for all datatypes, including
* lists and maps.
* </p>
* <note>
* <p>
* This operator tests for the existence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NOT_NULL</code>, the result is a
* Boolean <i>true</i>. This result is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NOT_NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>NULL</code> : The attribute does not exist.
* <code>NULL</code> is supported for all datatypes, including lists
* and maps.
* </p>
* <note>
* <p>
* This operator tests for the nonexistence of an attribute, not its
* data type. If the data type of attribute "<code>a</code>" is null,
* and you evaluate it using <code>NULL</code>, the result is a
* Boolean <i>false</i>. This is because the attribute "
* <code>a</code>" exists; its data type is not relevant to the
* <code>NULL</code> comparison operator.
* </p>
* </note></li>
* <li>
* <p>
* <code>CONTAINS</code> : Checks for a subsequence, or value in a
* set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is of
* type String, then the operator checks for a substring match. If
* the target attribute of the comparison is of type Binary, then the
* operator looks for a subsequence of the target that matches the
* input. If the target attribute of the comparison is a set ("
* <code>SS</code>", "<code>NS</code>", or "<code>BS</code>"), then
* the operator evaluates to true if it finds an exact match with any
* member of the set.
* </p>
* <p>
* CONTAINS is supported for lists: When evaluating "
* <code>a CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>NOT_CONTAINS</code> : Checks for absence of a subsequence,
* or absence of a value in a set.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> element of type String, Number, or Binary
* (not a set type). If the target attribute of the comparison is a
* String, then the operator checks for the absence of a substring
* match. If the target attribute of the comparison is Binary, then
* the operator checks for the absence of a subsequence of the target
* that matches the input. If the target attribute of the comparison
* is a set ("<code>SS</code>", "<code>NS</code>", or "
* <code>BS</code>"), then the operator evaluates to true if it
* <i>does not</i> find an exact match with any member of the set.
* </p>
* <p>
* NOT_CONTAINS is supported for lists: When evaluating "
* <code>a NOT CONTAINS b</code>", "<code>a</code>
* " can be a list; however, "<code>b</code>" cannot be a set, a map,
* or a list.
* </p>
* </li>
* <li>
* <p>
* <code>BEGINS_WITH</code> : Checks for a prefix.
* </p>
* <p>
* <i>AttributeValueList</i> can contain only one
* <i>AttributeValue</i> of type String or Binary (not a Number or a
* set type). The target attribute of the comparison must be of type
* String or Binary (not a Number or a set type).
* </p>
* <p/></li>
* <li>
* <p>
* <code>IN</code> : Checks for matching elements within two sets.
* </p>
* <p>
* <i>AttributeValueList</i> can contain one or more
* <i>AttributeValue</i> elements of type String, Number, or Binary
* (not a set type). These attributes are compared against an
* existing set type attribute of an item. If any elements of the
* input set are present in the item attribute, the expression
* evaluates to true.
* </p>
* </li>
* <li>
* <p>
* <code>BETWEEN</code> : Greater than or equal to the first value,
* and less than or equal to the second value.
* </p>
* <p>
* <i>AttributeValueList</i> must contain two <i>AttributeValue</i>
* elements of the same type, either String, Number, or Binary (not a
* set type). A target attribute matches if the target value is
* greater than, or equal to, the first element and less than, or
* equal to, the second element. If an item contains an
* <i>AttributeValue</i> element of a different type than the one
* provided in the request, the value does not match. For example,
* <code>{"S":"6"}</code> does not compare to <code>{"N":"6"}</code>.
* Also, <code>{"N":"6"}</code> does not compare to
* <code>{"NS":["6", "2", "1"]}</code>
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see ComparisonOperator
*/
public ExpectedAttributeValue withComparisonOperator(
ComparisonOperator comparisonOperator) {
setComparisonOperator(comparisonOperator);
return this;
}
/**
* <p>
* One or more values to evaluate against the supplied attribute. The number
* of values in the list depends on the <i>ComparisonOperator</i> being
* used.
* </p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than are based
* on ASCII character code values. For example, <code>a</code> is greater
* than <code>A</code>, and <code>a</code> is greater than <code>B</code>.
* For a list of code values, see <a
* href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as unsigned when
* it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
*
* @return One or more values to evaluate against the supplied attribute.
* The number of values in the list depends on the
* <i>ComparisonOperator</i> being used.</p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than
* are based on ASCII character code values. For example,
* <code>a</code> is greater than <code>A</code>, and <code>a</code>
* is greater than <code>B</code>. For a list of code values, see <a
* href
* ="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http
* ://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as
* unsigned when it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer
* Guide</i>.
*/
public java.util.List<AttributeValue> getAttributeValueList() {
return attributeValueList;
}
/**
* <p>
* One or more values to evaluate against the supplied attribute. The number
* of values in the list depends on the <i>ComparisonOperator</i> being
* used.
* </p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than are based
* on ASCII character code values. For example, <code>a</code> is greater
* than <code>A</code>, and <code>a</code> is greater than <code>B</code>.
* For a list of code values, see <a
* href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as unsigned when
* it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
*
* @param attributeValueList
* One or more values to evaluate against the supplied attribute. The
* number of values in the list depends on the
* <i>ComparisonOperator</i> being used.</p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than
* are based on ASCII character code values. For example,
* <code>a</code> is greater than <code>A</code>, and <code>a</code>
* is greater than <code>B</code>. For a list of code values, see <a
* href
* ="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http
* ://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as
* unsigned when it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer
* Guide</i>.
*/
public void setAttributeValueList(
java.util.Collection<AttributeValue> attributeValueList) {
if (attributeValueList == null) {
this.attributeValueList = null;
return;
}
this.attributeValueList = new java.util.ArrayList<AttributeValue>(
attributeValueList);
}
/**
* <p>
* One or more values to evaluate against the supplied attribute. The number
* of values in the list depends on the <i>ComparisonOperator</i> being
* used.
* </p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than are based
* on ASCII character code values. For example, <code>a</code> is greater
* than <code>A</code>, and <code>a</code> is greater than <code>B</code>.
* For a list of code values, see <a
* href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as unsigned when
* it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if
* any). Use {@link #setAttributeValueList(java.util.Collection)} or
* {@link #withAttributeValueList(java.util.Collection)} if you want to
* override the existing values.
* </p>
*
* @param attributeValueList
* One or more values to evaluate against the supplied attribute. The
* number of values in the list depends on the
* <i>ComparisonOperator</i> being used.</p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than
* are based on ASCII character code values. For example,
* <code>a</code> is greater than <code>A</code>, and <code>a</code>
* is greater than <code>B</code>. For a list of code values, see <a
* href
* ="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http
* ://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as
* unsigned when it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer
* Guide</i>.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ExpectedAttributeValue withAttributeValueList(
AttributeValue... attributeValueList) {
if (this.attributeValueList == null) {
setAttributeValueList(new java.util.ArrayList<AttributeValue>(
attributeValueList.length));
}
for (AttributeValue ele : attributeValueList) {
this.attributeValueList.add(ele);
}
return this;
}
/**
* <p>
* One or more values to evaluate against the supplied attribute. The number
* of values in the list depends on the <i>ComparisonOperator</i> being
* used.
* </p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than are based
* on ASCII character code values. For example, <code>a</code> is greater
* than <code>A</code>, and <code>a</code> is greater than <code>B</code>.
* For a list of code values, see <a
* href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as unsigned when
* it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer Guide</i>.
* </p>
*
* @param attributeValueList
* One or more values to evaluate against the supplied attribute. The
* number of values in the list depends on the
* <i>ComparisonOperator</i> being used.</p>
* <p>
* For type Number, value comparisons are numeric.
* </p>
* <p>
* String value comparisons for greater than, equals, or less than
* are based on ASCII character code values. For example,
* <code>a</code> is greater than <code>A</code>, and <code>a</code>
* is greater than <code>B</code>. For a list of code values, see <a
* href
* ="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters"
* >http
* ://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters</a>.
* </p>
* <p>
* For Binary, DynamoDB treats each byte of the binary data as
* unsigned when it compares binary values.
* </p>
* <p>
* For information on specifying data types in JSON, see <a href=
* "http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html"
* >JSON Data Format</a> in the <i>Amazon DynamoDB Developer
* Guide</i>.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ExpectedAttributeValue withAttributeValueList(
java.util.Collection<AttributeValue> attributeValueList) {
setAttributeValueList(attributeValueList);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getValue() != null)
sb.append("Value: " + getValue() + ",");
if (getExists() != null)
sb.append("Exists: " + getExists() + ",");
if (getComparisonOperator() != null)
sb.append("ComparisonOperator: " + getComparisonOperator() + ",");
if (getAttributeValueList() != null)
sb.append("AttributeValueList: " + getAttributeValueList());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ExpectedAttributeValue == false)
return false;
ExpectedAttributeValue other = (ExpectedAttributeValue) obj;
if (other.getValue() == null ^ this.getValue() == null)
return false;
if (other.getValue() != null
&& other.getValue().equals(this.getValue()) == false)
return false;
if (other.getExists() == null ^ this.getExists() == null)
return false;
if (other.getExists() != null
&& other.getExists().equals(this.getExists()) == false)
return false;
if (other.getComparisonOperator() == null
^ this.getComparisonOperator() == null)
return false;
if (other.getComparisonOperator() != null
&& other.getComparisonOperator().equals(
this.getComparisonOperator()) == false)
return false;
if (other.getAttributeValueList() == null
^ this.getAttributeValueList() == null)
return false;
if (other.getAttributeValueList() != null
&& other.getAttributeValueList().equals(
this.getAttributeValueList()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getValue() == null) ? 0 : getValue().hashCode());
hashCode = prime * hashCode
+ ((getExists() == null) ? 0 : getExists().hashCode());
hashCode = prime
* hashCode
+ ((getComparisonOperator() == null) ? 0
: getComparisonOperator().hashCode());
hashCode = prime
* hashCode
+ ((getAttributeValueList() == null) ? 0
: getAttributeValueList().hashCode());
return hashCode;
}
@Override
public ExpectedAttributeValue clone() {
try {
return (ExpectedAttributeValue) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}
| mhurne/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ExpectedAttributeValue.java | Java | apache-2.0 | 150,773 | [
30522,
1013,
1008,
1008,
9385,
2230,
1011,
2355,
9733,
1012,
4012,
1010,
4297,
1012,
2030,
2049,
18460,
1012,
2035,
2916,
1008,
9235,
1012,
1008,
1008,
7000,
2104,
1996,
15895,
6105,
1010,
2544,
1016,
1012,
1014,
1006,
1996,
1000,
6105,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#!/usr/bin/env python
"""
LeBLEU - Letter-edit / Levenshtein BLEU
"""
import logging
#__all__ = []
__version__ = '0.0.1'
__author__ = 'Stig-Arne Gronroos'
__author_email__ = "stig-arne.gronroos@aalto.fi"
_logger = logging.getLogger(__name__)
def get_version():
return __version__
# The public api imports need to be at the end of the file,
# so that the package global names are available to the modules
# when they are imported.
from .lebleu import LeBLEU
# Convenience functions
def eval_single(*args, **kwargs):
lb = LeBLEU(**kwargs)
return lb.eval_single(*args)
def eval(*args, **kwargs):
lb = LeBLEU(**kwargs)
return lb.eval(*args)
| Waino/LeBLEU | lebleu/__init__.py | Python | bsd-2-clause | 670 | [
30522,
1001,
999,
1013,
2149,
2099,
1013,
8026,
1013,
4372,
2615,
18750,
1000,
1000,
1000,
3393,
3468,
2226,
1011,
3661,
1011,
10086,
1013,
23310,
6132,
11039,
12377,
1038,
2571,
2226,
1000,
1000,
1000,
12324,
15899,
1001,
1035,
1035,
2035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<h3>mediaelement</h3>
<div class='row' ng-controller='DemoMediaelementCtrl'>
<div class='col-sm-6'>
<video
ng-src='{{ mp4Video }}'
height='240'
width='100%'
preload='auto'
controls='controls'
poster='https://pbs.twimg.com/profile_images/2149314222/square.png'
mediaelement>
<source type='video/mp4' ng-src='{{ mp4Video }}' />
</video>
</div>
<div class='col-sm-6'>
<pre>{{ codeExample }}</pre>
</div>
</div> | VHAINNOVATIONS/Mental-Health-eScreening | escreening/src/main/webapp/resources/editors/js/directives/modules/mediaelement/demo/index.html | HTML | apache-2.0 | 545 | [
30522,
1026,
1044,
2509,
1028,
2865,
12260,
3672,
1026,
1013,
1044,
2509,
1028,
1026,
4487,
2615,
2465,
1027,
1005,
5216,
1005,
12835,
1011,
11486,
1027,
1005,
9703,
16969,
12260,
3672,
6593,
12190,
1005,
1028,
1026,
4487,
2615,
2465,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
var request = require('request');
module.exports = function(args) {
var opts = {
API_URL:'http://en.wikipedia.org/w/api.php',
RATE_LIMIT:false,
RATE_LIMIT_MIN_WAIT:false,
RATE_LIMIT_LAST_CALL:false,
USER_AGENT:'wikipedia (https://github.com/meadowstream/wikipedia.js/)'
};
for (var i in args) {
opts[i] = args[i];
}
return {
// variables
'cache':new Cache(),
// Functions
'opts':opts,
'search':search,
'set_caching':set_caching,
'suggest':suggest,
'page':page,
'geosearch':geosearch,
'languages':languages,
'set_lang':set_lang,
'set_rate_limiting':set_rate_limiting,
'random':random,
// Classes
'WikipediaPage':WikipediaPage
};
}; | lengstrom/wikipedia.js | js/core.js | JavaScript | mit | 682 | [
30522,
13075,
5227,
1027,
5478,
1006,
1005,
5227,
1005,
1007,
1025,
11336,
1012,
14338,
1027,
3853,
1006,
12098,
5620,
1007,
1063,
13075,
23569,
2015,
1027,
1063,
17928,
1035,
24471,
2140,
1024,
1005,
8299,
1024,
1013,
1013,
4372,
1012,
169... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#include <errno.h>
#include <vdr/tools.h>
#include <vdr/thread.h>
#include "extpipe.h"
cExtPipe::cExtPipe(void)
{
pid = -1;
f_stderr = -1;
f_stdout= -1;
}
cExtPipe::~cExtPipe()
{
int status;
Close(status);
}
bool cExtPipe::Open(const char *Command)
{
int fd_stdout[2];
int fd_stderr[2];
if (pipe(fd_stdout) < 0)
{
LOG_ERROR;
return false;
}
if (pipe(fd_stderr) < 0)
{
close(fd_stdout[0]);
close(fd_stdout[1]);
LOG_ERROR;
return false;
}
if ((pid = fork()) < 0) // fork failed
{
LOG_ERROR;
close(fd_stdout[0]);
close(fd_stdout[1]);
close(fd_stderr[0]);
close(fd_stderr[1]);
return false;
}
if (pid > 0) // parent process
{
close(fd_stdout[1]); // close write fd, we need only read fd
close(fd_stderr[1]); // close write fd, we need only read fd
f_stdout = fd_stdout[0];
f_stderr = fd_stderr[0];
return true;
}
else // child process
{
close(fd_stdout[0]); // close read fd, we need only write fd
close(fd_stderr[0]); // close read fd, we need only write fd
if (dup2(fd_stdout[1], STDOUT_FILENO) == -1) // now redirect
{
LOG_ERROR;
close(fd_stderr[1]);
close(fd_stdout[1]);
_exit(-1);
}
if (dup2(fd_stderr[1], STDERR_FILENO) == -1) // now redirect
{
LOG_ERROR;
close(fd_stderr[1]);
close(fd_stdout[1]);
_exit(-1);
}
int MaxPossibleFileDescriptors = getdtablesize();
for (int i = STDERR_FILENO + 1; i < MaxPossibleFileDescriptors; i++)
close(i); //close all dup'ed filedescriptors
if (execl("/bin/sh", "sh", "-c", Command, NULL) == -1)
{
LOG_ERROR_STR(Command);
close(fd_stderr[1]);
close(fd_stdout[1]);
_exit(-1);
}
_exit(0);
}
}
int cExtPipe::Close(int &status)
{
int ret = -1;
if (f_stderr!=-1)
{
close(f_stderr);
f_stderr = -1;
}
if (f_stdout!=-1)
{
close(f_stdout);
f_stdout=-1;
}
if (pid > 0)
{
int i = 5;
while (i > 0)
{
ret = waitpid(pid, &status, WNOHANG);
if (ret < 0)
{
if (errno != EINTR && errno != ECHILD)
{
LOG_ERROR;
break;
}
else if (errno == ECHILD)
{
ret = pid;
break;
}
}
else if (ret == pid)
break;
i--;
cCondWait::SleepMs(100);
}
if (!i)
{
kill(pid, SIGKILL);
ret = -1;
}
else if (ret == -1 || !WIFEXITED(status))
ret = -1;
pid = -1;
}
return ret;
}
| kersten/vdr-plugin-xmltv2vdr | extpipe.cpp | C++ | gpl-2.0 | 3,129 | [
30522,
1001,
2421,
1026,
4895,
2923,
2094,
1012,
1044,
1028,
1001,
2421,
1026,
5164,
1012,
1044,
1028,
1001,
2421,
1026,
4742,
1012,
1044,
1028,
1001,
2421,
1026,
25353,
2015,
1013,
3524,
1012,
1044,
1028,
1001,
2421,
1026,
9413,
19139,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/*-----------------------------------------------------------------------------------
Plugin Name: BYT Company Address
-----------------------------------------------------------------------------------*/
// Add function to widgets_init that'll load our widget.
add_action( 'widgets_init', 'byt_address_widgets' );
// Register widget.
function byt_address_widgets() {
register_widget( 'byt_Address_Widget' );
}
// Widget class.
class byt_address_widget extends WP_Widget {
/*-----------------------------------------------------------------------------------*/
/* Widget Setup
/*-----------------------------------------------------------------------------------*/
function byt_Address_Widget() {
/* Widget settings. */
$widget_ops = array( 'classname' => 'byt_address_widget', 'description' => __('BookYourTravel: Address Widget', 'bookyourtravel') );
/* Widget control settings. */
$control_ops = array( 'width' => 300, 'height' => 550, 'id_base' => 'byt_address_widget' );
/* Create the widget. */
$this->WP_Widget( 'byt_address_widget', __('BookYourTravel: Address Widget', 'bookyourtravel'), $widget_ops, $control_ops );
}
/*-----------------------------------------------------------------------------------*/
/* Display Widget
/*-----------------------------------------------------------------------------------*/
function widget( $args, $instance ) {
extract( $args );
/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title'] );
$company_name = $instance['company_name'];
$company_address = $instance['company_address'];
$company_phone = $instance['company_phone'];
$company_email = $instance['company_email'];
/* Before widget (defined by themes). */
echo $before_widget;
/* Display Widget */
/* Display the widget title if one was input (before and after defined by themes). */
if ( $title )
echo $before_title . $title . $after_title;
?>
<article class="byt_address_widget one-fourth">
<h3><?php echo $company_name; ?></h3>
<p><?php echo $company_address; ?></p>
<p><em>P:</em> <?php _e('24/7 customer support', 'bookyourtravel'); ?>: <?php echo $company_phone; ?></p>
<p><em>E:</em> <a href="#" title="<?php echo esc_attr( $company_email ); ?>"><?php echo $company_email; ?></a></p>
</article>
<?php
/* After widget (defined by themes). */
echo $after_widget;
}
/*-----------------------------------------------------------------------------------*/
/* Update Widget
/*-----------------------------------------------------------------------------------*/
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
/* Strip tags to remove HTML (important for text inputs). */
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['company_name'] = strip_tags( $new_instance['company_name'] );
$instance['company_address'] = strip_tags( $new_instance['company_address'] );
$instance['company_phone'] = strip_tags( $new_instance['company_phone'] );
$instance['company_email'] = strip_tags( $new_instance['company_email'] );
return $instance;
}
/*-----------------------------------------------------------------------------------*/
/* Widget Settings
/*-----------------------------------------------------------------------------------*/
function form( $instance ) {
/* Set up some default widget settings. */
$defaults = array(
'title' => '',
'company_name' => 'Book Your Travel LLC',
'company_address' => '1400 Pennsylvania Ave. Washington, DC',
'company_phone' => '1-555-555-5555',
'company_email' => 'info@bookyourtravel.com'
);
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
<!-- Widget Title: Text Input -->
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e('Title:', 'bookyourtravel') ?></label>
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'company_name' ) ); ?>"><?php _e('Company name:', 'bookyourtravel') ?></label>
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'company_name' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'company_name' ) ); ?>" value="<?php echo esc_attr( $instance['company_name']); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'company_address' ) ); ?>"><?php _e('Company address:', 'bookyourtravel') ?></label>
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'company_address' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'company_address' ) ); ?>" value="<?php echo esc_attr( $instance['company_address'] ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'company_phone' ) ); ?>"><?php _e('Company phone:', 'bookyourtravel') ?></label>
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'company_phone' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'company_phone' ) ); ?>" value="<?php echo esc_attr( $instance['company_phone'] ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'company_email' ) ); ?>"><?php _e('Company email:', 'bookyourtravel') ?></label>
<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'company_email' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'company_email' ) ); ?>" value="<?php echo esc_attr( $instance['company_email'] ); ?>" />
</p>
<?php
}
}
?> | maskcodex/xecuatoi | wp-content/themes/BookYourTravel/includes/plugins/widgets/widget-address.php | PHP | gpl-2.0 | 5,774 | [
30522,
1026,
1029,
25718,
1013,
1008,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<p><?php echo $this->message ?></p>
| stuartwakefield/templating | test/templates/test.php | PHP | mit | 36 | [
30522,
1026,
1052,
1028,
1026,
1029,
25718,
9052,
1002,
2023,
1011,
1028,
4471,
1029,
1028,
1026,
1013,
1052,
1028,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace BackendBundle\Controller;
use Symfony\Component\Form\Extension\Core\Type;
use CentraleReferencementBundle\Entity\Contact;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
/**
* Article controller.
*
* @Route("/contact")
*/
class ContactController extends Controller
{
/**
* Lists all contact entities.
*
* @Route("/")
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$contacts = $em->getRepository('CentraleReferencementBundle:Contact')->findBackendContact();
$deleteForms = array();
foreach ($contacts as $contact) {
$deleteForms[$contact->getId()] = $this->createDeleteForm($contact)->createView();
}
return $this->render('@Backend/contact/show.html.twig', array(
'contacts' => $contacts,
'delete_forms' => $deleteForms,
));
}
/**
* Creates a form to delete a contact entity.
*
* @param Contact $contact The contact entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm(Contact $contact)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('backend_contact_delete', array('id' => $contact->getId())))
->setMethod('DELETE')
->getForm();
}
/**
* @Route("/new")
* @Method({"GET", "POST"})
*/
public function newAction(Request $request)
{
$contact = new Contact();
$form = $this->createForm('CentraleReferencementBundle\Form\ContactType', $contact);
$form
->add('nom')
->add('prenom')
->add('email', Type\EmailType::class)
->add('telephone')
->add('message', Type\HiddenType::class)
->add('envoyer', Type\SubmitType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$contact->setTypeContact('contactBack');
$nom = $contact->getNom();
$prenom = $contact->getPrenom();
$em->persist($contact);
$em->flush();
$request->getSession()->getFlashBag()
->add('notice_contact', "Le contact $nom $prenom a bien été créé !");
return $this->render('@Backend/contact/new.html.twig', array(
'form' => $form->createView(),
));
}
return $this->render('@Backend/contact/new.html.twig', array(
'contact' => $contact,
'form' => $form->createView(),
));
}
/**
* Displays a form to edit an existing contact entity.
*
* @Route("{id}/edit")
* @Method({"GET", "POST"})
*/
public function editAction(Request $request, Contact $contact)
{
$editForm = $this->createForm('CentraleReferencementBundle\Form\ContactType', $contact);
$editForm
->add('nom')
->add('prenom')
->add('email', Type\EmailType::class)
->add('telephone')
->add('message', Type\HiddenType::class)
->add('envoyer', Type\SubmitType::class);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {
$this->getDoctrine()->getManager()->flush();
return $this->redirectToRoute('backend_contact_index');
}
return $this->render('@Backend/contact/edit.html.twig', array(
'contact' => $contact,
'form' => $editForm->createView()
));
}
/**
* Deletes a contact entity.
*
* @Route("/{id}")
* @Method("DELETE")
*/
public function deleteAction(Request $request, Contact $contact)
{
$form = $this->createDeleteForm($contact);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->remove($contact);
$em->flush($contact);
}
return $this->redirectToRoute('backend_contact_index');
}
}
| ViraxDev/centrale_referencement | src/BackendBundle/Controller/ContactController.php | PHP | mit | 4,389 | [
30522,
1026,
1029,
25718,
3415,
15327,
2067,
10497,
27265,
2571,
1032,
11486,
1025,
2224,
25353,
2213,
14876,
4890,
1032,
6922,
1032,
2433,
1032,
5331,
1032,
4563,
1032,
2828,
1025,
2224,
2430,
7869,
25523,
3672,
27265,
2571,
1032,
9178,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/**
* @namespace http
*
* The C<http> namespace groups functions and classes used while making
* HTTP Requests.
*
*/
ECMAScript.Extend('http', function (ecma) {
// Intentionally private
var _documentLocation = null
function _getDocumentLocation () {
if (!_documentLocation) _documentLocation = new ecma.http.Location();
return _documentLocation;
}
/**
* @constant HTTP_STATUS_NAMES
* HTTP/1.1 Status Code Definitions
*
* Taken from, RFC 2616 Section 10:
* L<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>
*
* These names are used in conjuction with L<ecma.http.Request> for
* indicating callback functions. The name is prepended with C<on> such
* that
* onMethodNotAllowed
* corresponds to the callback triggered when a 405 status is received.
*
# Names
*
* 100 Continue
* 101 SwitchingProtocols
* 200 Ok
* 201 Created
* 202 Accepted
* 203 NonAuthoritativeInformation
* 204 NoContent
* 205 ResetContent
* 206 PartialContent
* 300 MultipleChoices
* 301 MovedPermanently
* 302 Found
* 303 SeeOther
* 304 NotModified
* 305 UseProxy
* 306 Unused
* 307 TemporaryRedirect
* 400 BadRequest
* 401 Unauthorized
* 402 PaymentRequired
* 403 Forbidden
* 404 NotFound
* 405 MethodNotAllowed
* 406 NotAcceptable
* 407 ProxyAuthenticationRequired
* 408 RequestTimeout
* 409 Conflict
* 410 Gone
* 411 LengthRequired
* 412 PreconditionFailed
* 413 RequestEntityTooLarge
* 414 RequestURITooLong
* 415 UnsupportedMediaType
* 416 RequestedRangeNotSatisfiable
* 417 ExpectationFailed
* 500 InternalServerError
* 501 NotImplemented
* 502 BadGateway
* 503 ServiceUnavailable
* 504 GatewayTimeout
* 505 HTTPVersionNotSupported
*/
this.HTTP_STATUS_NAMES = {
100: 'Continue',
101: 'SwitchingProtocols',
200: 'Ok',
201: 'Created',
202: 'Accepted',
203: 'NonAuthoritativeInformation',
204: 'NoContent',
205: 'ResetContent',
206: 'PartialContent',
300: 'MultipleChoices',
301: 'MovedPermanently',
302: 'Found',
303: 'SeeOther',
304: 'NotModified',
305: 'UseProxy',
306: 'Unused',
307: 'TemporaryRedirect',
400: 'BadRequest',
401: 'Unauthorized',
402: 'PaymentRequired',
403: 'Forbidden',
404: 'NotFound',
405: 'MethodNotAllowed',
406: 'NotAcceptable',
407: 'ProxyAuthenticationRequired',
408: 'RequestTimeout',
409: 'Conflict',
410: 'Gone',
411: 'LengthRequired',
412: 'PreconditionFailed',
413: 'RequestEntityTooLarge',
414: 'RequestURITooLong',
415: 'UnsupportedMediaType',
416: 'RequestedRangeNotSatisfiable',
417: 'ExpectationFailed',
500: 'InternalServerError',
501: 'NotImplemented',
502: 'BadGateway',
503: 'ServiceUnavailable',
504: 'GatewayTimeout',
505: 'HTTPVersionNotSupported'
};
/**
* @function isSameOrigin
*
* Compare originating servers.
*
* var bool = ecma.http.isSameOrigin(uri);
* var bool = ecma.http.isSameOrigin(uri, uri);
*
* Is the resource located on the server at the port using the same protocol
* which served the document.
*
* var bool = ecma.http.isSameOrigin('http://www.example.com');
*
* Are the two URI's served from the same origin
*
* var bool = ecma.http.isSameOrigin('http://www.example.com', 'https://www.example.com');
*
*/
this.isSameOrigin = function(uri1, uri2) {
if (!(uri1)) return false;
var loc1 = uri1 instanceof ecma.http.Location
? uri1 : new ecma.http.Location(uri1);
var loc2 = uri2 || _getDocumentLocation();
return loc1.isSameOrigin(loc2);
};
});
| ryangies/lsn-javascript | src/lib/ecma/http/http.js | JavaScript | mit | 3,860 | [
30522,
1013,
1008,
1008,
1008,
1030,
3415,
15327,
8299,
1008,
1008,
1996,
1039,
1026,
8299,
1028,
3415,
15327,
2967,
4972,
1998,
4280,
2109,
2096,
2437,
1008,
8299,
11186,
1012,
1008,
1008,
1013,
14925,
9335,
23235,
1012,
7949,
1006,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
### import ####################################################################
import pycmds.project.classes as pc
import pycmds.hardware.hardware as hw
import pathlib
import appdirs
import toml
import yaqc
### driver ####################################################################
class Driver(hw.Driver):
def __init__(self, *args, **kwargs):
self._yaqd_port = kwargs.pop("yaqd_port")
super().__init__(*args, **kwargs)
self.grating_index = pc.Combo(
name="Grating",
allowed_values=[1, 2],
section=self.name,
option="grating_index",
display=True,
set_method="set_turret",
)
self.exposed.append(self.grating_index)
def get_position(self):
native_position = self.ctrl.get_position()
self.position.write(native_position, self.native_units)
return self.position.read()
def initialize(self, *args, **kwargs):
# open control
self.ctrl = yaqc.Client(self._yaqd_port)
# import some information from control
id_dict = self.ctrl.id()
self.serial_number = id_dict["serial"]
self.position.write(self.ctrl.get_position())
# recorded
self.recorded[self.name] = [self.position, self.native_units, 1.0, "m", False]
self.wait_until_still()
# finish
self.initialized.write(True)
self.initialized_signal.emit()
def is_busy(self):
return self.ctrl.busy()
def set_position(self, destination):
self.ctrl.set_position(float(destination))
self.wait_until_still()
def set_turret(self, destination_index):
if type(destination_index) == list:
destination_index = destination_index[0]
# turret index on ActiveX call starts from zero
destination_index_zero_based = int(destination_index) - 1
self.ctrl.set_turret(destination_index_zero_based)
self.grating_index.write(destination_index)
self.wait_until_still()
self.limits.write(*self.ctrl.get_limits(), self.native_units)
### gui #######################################################################
class GUI(hw.GUI):
pass
### hardware ##################################################################
class Hardware(hw.Hardware):
def __init__(self, *args, **kwargs):
self.kind = "spectrometer"
hw.Hardware.__init__(self, *args, **kwargs)
### import ####################################################################
conf = pathlib.Path(appdirs.user_config_dir("pycmds", "pycmds")) / "config.toml"
conf = toml.load(conf)
hardwares, gui, advanced_gui = hw.import_hardwares(
conf.get("hardware", {}).get("spectrometers", {}),
name="Spectrometers",
Driver=Driver,
GUI=GUI,
Hardware=Hardware,
)
| wright-group/PyCMDS | pycmds/hardware/spectrometers.py | Python | mit | 2,840 | [
30522,
1001,
1001,
1001,
12324,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
1001,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
import * as fs from "fs";
import * as path from "path";
import * as commander from "commander";
import { ConsoleLogger } from "@akashic/akashic-cli-commons";
import { promiseExportHTML } from "./exportHTML";
import { promiseExportAtsumaru } from "./exportAtsumaru";
interface CommandParameterObject {
cwd?: string;
source?: string;
force?: boolean;
quiet?: boolean;
output?: string;
exclude?: string[];
strip?: boolean;
hashFilename?: number | boolean;
minify?: boolean;
bundle?: boolean;
magnify?: boolean;
injects?: string[];
atsumaru?: boolean;
}
function cli(param: CommandParameterObject): void {
const logger = new ConsoleLogger({ quiet: param.quiet });
const exportParam = {
cwd: !param.cwd ? process.cwd() : path.resolve(param.cwd),
source: param.source,
force: param.force,
quiet: param.quiet,
output: param.output,
exclude: param.exclude,
logger: logger,
strip: (param.strip != null) ? param.strip : true,
hashLength: !param.hashFilename && !param.atsumaru ? 0 :
(param.hashFilename === true || param.hashFilename === undefined) ? 20 : Number(param.hashFilename),
minify: param.minify,
bundle: param.bundle || param.atsumaru,
magnify: param.magnify || param.atsumaru,
injects: param.injects,
unbundleText: !param.bundle || param.atsumaru,
lint: !param.atsumaru
};
Promise.resolve()
.then(() => {
if (param.output === undefined) {
throw new Error("--output option must be specified.");
}
if (param.atsumaru) {
return promiseExportAtsumaru(exportParam);
} else {
return promiseExportHTML(exportParam);
}
})
.then(() => logger.info("Done!"))
.catch((err: any) => {
logger.error(err);
process.exit(1);
});
}
const ver = JSON.parse(fs.readFileSync(path.resolve(__dirname, "..", "package.json"), "utf8")).version;
commander
.version(ver);
commander
.description("convert your Akashic game runnable standalone.")
.option("-C, --cwd <dir>", "The directory to export from")
.option("-s, --source <dir>", "Source directory to export from cwd/current directory")
.option("-f, --force", "Overwrites existing files")
.option("-q, --quiet", "Suppress output")
.option("-o, --output <fileName>", "Name of output file or directory")
.option("-S, --no-strip", "output fileset without strip")
.option("-H, --hash-filename [length]", "Rename asset files with their hash values")
.option("-M, --minify", "minify JavaScript files")
.option("-b, --bundle", "bundle assets and scripts in index.html (to reduce the number of files)")
.option("-m, --magnify", "fit game area to outer element size")
.option("-i, --inject [fileName]", "specify injected file content into index.html", inject, [])
.option("-a, --atsumaru", "generate files that can be posted to RPG-atsumaru");
export function run(argv: string[]): void {
// Commander の制約により --strip と --no-strip 引数を両立できないため、暫定対応として Commander 前に argv を処理する
const argvCopy = dropDeprecatedArgs(argv);
commander.parse(argvCopy);
cli({
cwd: commander["cwd"],
force: commander["force"],
quiet: commander["quiet"],
output: commander["output"],
source: commander["source"],
strip: commander["strip"],
minify: commander["minify"],
bundle: commander["bundle"],
magnify: commander["magnify"],
hashFilename: commander["hashFilename"],
injects: commander["inject"],
atsumaru: commander["atsumaru"]
});
}
function dropDeprecatedArgs(argv: string[]): string[] {
const filteredArgv = argv.filter(v => !/^(-s|--strip)$/.test(v));
if (argv.length !== filteredArgv.length) {
console.log("WARN: --strip option is deprecated. strip is applied by default.");
console.log("WARN: If you do not need to apply it, use --no-strip option.");
}
return filteredArgv;
}
function inject(val: string, injects: string[]): string[] {
injects.push(val);
return injects;
}
| akashic-games/akashic-cli-export-html | src/app/cli.ts | TypeScript | mit | 3,890 | [
30522,
12324,
1008,
2004,
1042,
2015,
2013,
1000,
1042,
2015,
1000,
1025,
12324,
1008,
2004,
4130,
2013,
1000,
4130,
1000,
1025,
12324,
1008,
2004,
3474,
2013,
1000,
3474,
1000,
1025,
12324,
1063,
10122,
21197,
4590,
1065,
2013,
1000,
1030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/* FOSUserBundle:Resetting:request_content.html.twig */
class __TwigTemplate_16fccc8b4081822ba4c49543c44f48b24850d6b4ad9846152c39968be5b4e7c7 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 2
echo "
<form action=\"";
// line 3
echo $this->env->getExtension('routing')->getPath("fos_user_resetting_send_email");
echo "\" method=\"POST\" class=\"fos_user_resetting_request\">
<div>
";
// line 5
if (array_key_exists("invalid_username", $context)) {
// line 6
echo " <p>";
echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("resetting.request.invalid_username", array("%username%" => (isset($context["invalid_username"]) ? $context["invalid_username"] : $this->getContext($context, "invalid_username"))), "FOSUserBundle"), "html", null, true);
echo "</p>
";
}
// line 8
echo " <label for=\"username\">";
echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("resetting.request.username", array(), "FOSUserBundle"), "html", null, true);
echo "</label>
<input type=\"text\" id=\"username\" name=\"username\" required=\"required\" />
</div>
<div>
<input type=\"submit\" value=\"";
// line 12
echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("resetting.request.submit", array(), "FOSUserBundle"), "html", null, true);
echo "\" />
</div>
</form>
";
}
public function getTemplateName()
{
return "FOSUserBundle:Resetting:request_content.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 43 => 12, 35 => 8, 29 => 6, 27 => 5, 22 => 3, 19 => 2,);
}
}
| thecoons/thecoontube | app/cache/dev/twig/16/fc/cc8b4081822ba4c49543c44f48b24850d6b4ad9846152c39968be5b4e7c7.php | PHP | mit | 2,146 | [
30522,
1026,
1029,
25718,
1013,
1008,
1042,
2891,
20330,
27265,
2571,
1024,
25141,
3436,
1024,
5227,
1035,
4180,
1012,
16129,
1012,
1056,
16279,
1008,
1013,
2465,
1035,
1035,
1056,
16279,
18532,
15725,
1035,
2385,
11329,
9468,
2620,
2497,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html>
<!--
Copyright 2010 The Closure Library Authors. All Rights Reserved.
Use of this source code is governed by an Apache 2.0 License.
See the COPYING file for details.
-->
<head>
<title>goog.ui.AdvancedTooltip</title>
<meta charset="utf-8">
<script src="../base.js"></script>
<script>
goog.require('goog.ui.AdvancedTooltip');
</script>
<link rel="stylesheet" href="css/demo.css">
<style>
.goog-tooltip {
background: lightyellow;
color: black;
border: 1px solid black;
padding: 1px;
font: menu;
}
.tooltip {
background: lightyellow;
color: black;
border: 1px solid black;
padding: 5px;
font: menu;
width: 400px;
}
</style>
</head>
<body>
<h1>goog.ui.AdvancedTooltip</h1>
<fieldset class="goog-debug-panel" style="display:none">
<legend>Event Log</legend>
<div id="log"></div>
</fieldset>
<p>
<button id="btn">Hover me</button>
</p>
<script>
var tooltip = new goog.ui.AdvancedTooltip('btn');
tooltip.className = 'tooltip';
tooltip.setHtml(
"<h2>AdvancedTooltip</h2>" +
"<ul><li>Move cursor towards the tooltip (<em>that's me!</em>) " +
"and see that it remains open.</li>" +
"<li>Before reaching it start moving the cursor in another " +
"direction...</li>" +
"<li>Once the cursor reaches the tooltip the cursor tracking is turned " +
"off and a 10px 'padding' around it gets added. As long as the cursor " +
"stays inside the box formed by the tooltip and the padding it remains " +
"open.</li></ul><hr/><div style=\"text-align: center;\">" +
"<button id=\"btn-nest\">Hover me</button> " +
"<button id=\"btn-close\">Close</button></div>", true);
tooltip.setHotSpotPadding(new goog.math.Box(5, 5, 5, 5));
tooltip.setCursorTracking(true);
tooltip.setMargin(new goog.math.Box(100, 0, 0, 100));
tooltip.setHideDelayMs(250);
new goog.ui.AdvancedTooltip('btn-nest').setHtml(
'Clicking<br> this<br> button<br> has no effect.');
new goog.ui.Tooltip('btn-close', 'Closes tooltip');
goog.events.listen(document.getElementById('btn-close'),
goog.events.EventType.CLICK, function(e) {
tooltip.setVisible(false);
}
);
</script>
</body>
</html>
| xs2ranjeet/mdv | third_party/closure/closure/goog/demos/advancedtooltip.html | HTML | apache-2.0 | 2,336 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
1028,
1026,
999,
1011,
1011,
9385,
2230,
1996,
8503,
3075,
6048,
1012,
2035,
2916,
9235,
1012,
2224,
1997,
2023,
3120,
3642,
2003,
9950,
2011,
2019,
15895,
1016,
1012,
1014,
6105,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
namespace Conejo
{
partial class Asociado
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Asociado));
this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
this.label12 = new System.Windows.Forms.Label();
this.bttTelModificar = new System.Windows.Forms.Button();
this.bttDesasociar = new System.Windows.Forms.Button();
this.lbTeléfonos = new System.Windows.Forms.ListBox();
this.bttModificar = new System.Windows.Forms.Button();
this.bttEliminar = new System.Windows.Forms.Button();
this.bttAceptar = new System.Windows.Forms.Button();
this.txtTeléfono = new System.Windows.Forms.TextBox();
this.bttTelefono = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.txtNombre = new System.Windows.Forms.TextBox();
this.txtTipoAsociación = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.cbLugarTrabajo = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.dateBirth = new System.Windows.Forms.DateTimePicker();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.txtDUI = new System.Windows.Forms.TextBox();
this.txtApellidos = new System.Windows.Forms.TextBox();
this.txtNIT = new System.Windows.Forms.TextBox();
this.dateDesasociación = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label();
this.dateAsociación = new System.Windows.Forms.DateTimePicker();
this.labelDesasociacion = new System.Windows.Forms.Label();
this.txtCódigoAsociado = new System.Windows.Forms.TextBox();
this.txtDirección = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// errorProvider1
//
this.errorProvider1.ContainerControl = this;
//
// label12
//
this.label12.AutoSize = true;
this.label12.BackColor = System.Drawing.Color.Transparent;
this.label12.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label12.ForeColor = System.Drawing.Color.Navy;
this.label12.Location = new System.Drawing.Point(43, 280);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(58, 32);
this.label12.TabIndex = 57;
this.label12.Text = "Lugar de\r\nTrabajo:";
//
// bttTelModificar
//
this.bttTelModificar.Enabled = false;
this.bttTelModificar.Font = new System.Drawing.Font("Linotte-Regular", 9F, System.Drawing.FontStyle.Bold);
this.bttTelModificar.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.bttTelModificar.Location = new System.Drawing.Point(389, 379);
this.bttTelModificar.Name = "bttTelModificar";
this.bttTelModificar.Size = new System.Drawing.Size(75, 25);
this.bttTelModificar.TabIndex = 67;
this.bttTelModificar.TabStop = false;
this.bttTelModificar.Text = "Modificar";
this.bttTelModificar.UseVisualStyleBackColor = true;
this.bttTelModificar.Click += new System.EventHandler(this.bttTelModificar_Click);
//
// bttDesasociar
//
this.bttDesasociar.Font = new System.Drawing.Font("Linotte-Regular", 11.25F, System.Drawing.FontStyle.Bold);
this.bttDesasociar.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.bttDesasociar.Location = new System.Drawing.Point(548, 451);
this.bttDesasociar.Name = "bttDesasociar";
this.bttDesasociar.Size = new System.Drawing.Size(187, 49);
this.bttDesasociar.TabIndex = 58;
this.bttDesasociar.TabStop = false;
this.bttDesasociar.Text = "Desasociar";
this.bttDesasociar.UseVisualStyleBackColor = true;
this.bttDesasociar.Click += new System.EventHandler(this.bttDesasociar_Click_1);
//
// lbTeléfonos
//
this.lbTeléfonos.BackColor = System.Drawing.Color.White;
this.lbTeléfonos.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.lbTeléfonos.FormattingEnabled = true;
this.lbTeléfonos.ItemHeight = 16;
this.lbTeléfonos.Items.AddRange(new object[] {
"Añadir"});
this.lbTeléfonos.Location = new System.Drawing.Point(136, 331);
this.lbTeléfonos.Name = "lbTeléfonos";
this.lbTeléfonos.Size = new System.Drawing.Size(120, 112);
this.lbTeléfonos.TabIndex = 66;
this.lbTeléfonos.SelectedIndexChanged += new System.EventHandler(this.lbTeléfonos_SelectedIndexChanged);
//
// bttModificar
//
this.bttModificar.Font = new System.Drawing.Font("Linotte-Regular", 11.25F, System.Drawing.FontStyle.Bold);
this.bttModificar.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.bttModificar.Location = new System.Drawing.Point(548, 129);
this.bttModificar.Name = "bttModificar";
this.bttModificar.Size = new System.Drawing.Size(187, 49);
this.bttModificar.TabIndex = 38;
this.bttModificar.Text = "Guardar y Salir";
this.bttModificar.UseVisualStyleBackColor = true;
this.bttModificar.Click += new System.EventHandler(this.bttModificar_Click_1);
//
// bttEliminar
//
this.bttEliminar.Enabled = false;
this.bttEliminar.Font = new System.Drawing.Font("Linotte-Regular", 9F, System.Drawing.FontStyle.Bold);
this.bttEliminar.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.bttEliminar.Location = new System.Drawing.Point(346, 405);
this.bttEliminar.Name = "bttEliminar";
this.bttEliminar.Size = new System.Drawing.Size(75, 25);
this.bttEliminar.TabIndex = 65;
this.bttEliminar.TabStop = false;
this.bttEliminar.Text = "Eliminar";
this.bttEliminar.UseVisualStyleBackColor = true;
this.bttEliminar.Click += new System.EventHandler(this.bttEliminar_Click);
//
// bttAceptar
//
this.bttAceptar.Font = new System.Drawing.Font("Linotte-Regular", 11.25F, System.Drawing.FontStyle.Bold);
this.bttAceptar.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.bttAceptar.Location = new System.Drawing.Point(548, 192);
this.bttAceptar.Name = "bttAceptar";
this.bttAceptar.Size = new System.Drawing.Size(187, 49);
this.bttAceptar.TabIndex = 39;
this.bttAceptar.Text = "Salir";
this.bttAceptar.UseVisualStyleBackColor = true;
this.bttAceptar.Click += new System.EventHandler(this.bttAceptar_Click_1);
//
// txtTeléfono
//
this.txtTeléfono.BackColor = System.Drawing.Color.White;
this.txtTeléfono.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtTeléfono.Location = new System.Drawing.Point(338, 353);
this.txtTeléfono.MaxLength = 9;
this.txtTeléfono.Multiline = true;
this.txtTeléfono.Name = "txtTeléfono";
this.txtTeléfono.Size = new System.Drawing.Size(100, 23);
this.txtTeléfono.TabIndex = 64;
//
// bttTelefono
//
this.bttTelefono.Font = new System.Drawing.Font("Linotte-Regular", 9F, System.Drawing.FontStyle.Bold);
this.bttTelefono.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
this.bttTelefono.Location = new System.Drawing.Point(308, 379);
this.bttTelefono.Name = "bttTelefono";
this.bttTelefono.Size = new System.Drawing.Size(75, 25);
this.bttTelefono.TabIndex = 63;
this.bttTelefono.TabStop = false;
this.bttTelefono.Text = "Ingresar";
this.bttTelefono.UseVisualStyleBackColor = true;
this.bttTelefono.Click += new System.EventHandler(this.bttTelefono_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label1.ForeColor = System.Drawing.Color.Navy;
this.label1.Location = new System.Drawing.Point(43, 112);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 16);
this.label1.TabIndex = 37;
this.label1.Text = "Nombres:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label8.ForeColor = System.Drawing.Color.Navy;
this.label8.Location = new System.Drawing.Point(43, 386);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(66, 16);
this.label8.TabIndex = 62;
this.label8.Text = "Teléfonos:";
//
// txtNombre
//
this.txtNombre.BackColor = System.Drawing.Color.White;
this.txtNombre.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtNombre.Location = new System.Drawing.Point(136, 113);
this.txtNombre.MaxLength = 50;
this.txtNombre.Multiline = true;
this.txtNombre.Name = "txtNombre";
this.txtNombre.Size = new System.Drawing.Size(229, 23);
this.txtNombre.TabIndex = 41;
//
// txtTipoAsociación
//
this.txtTipoAsociación.BackColor = System.Drawing.Color.White;
this.txtTipoAsociación.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtTipoAsociación.Enabled = false;
this.txtTipoAsociación.Location = new System.Drawing.Point(136, 450);
this.txtTipoAsociación.Multiline = true;
this.txtTipoAsociación.Name = "txtTipoAsociación";
this.txtTipoAsociación.Size = new System.Drawing.Size(119, 23);
this.txtTipoAsociación.TabIndex = 51;
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label2.ForeColor = System.Drawing.Color.Navy;
this.label2.Location = new System.Drawing.Point(43, 149);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(63, 16);
this.label2.TabIndex = 40;
this.label2.Text = "Apellidos:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label3.ForeColor = System.Drawing.Color.Navy;
this.label3.Location = new System.Drawing.Point(43, 444);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(71, 32);
this.label3.TabIndex = 61;
this.label3.Text = "Tipo de\r\nAsociación:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label4.ForeColor = System.Drawing.Color.Navy;
this.label4.Location = new System.Drawing.Point(43, 252);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(64, 16);
this.label4.TabIndex = 45;
this.label4.Text = "Dirección:";
//
// cbLugarTrabajo
//
this.cbLugarTrabajo.BackColor = System.Drawing.Color.White;
this.cbLugarTrabajo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbLugarTrabajo.FormattingEnabled = true;
this.cbLugarTrabajo.Location = new System.Drawing.Point(136, 304);
this.cbLugarTrabajo.Name = "cbLugarTrabajo";
this.cbLugarTrabajo.Size = new System.Drawing.Size(229, 24);
this.cbLugarTrabajo.TabIndex = 50;
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label5.ForeColor = System.Drawing.Color.Navy;
this.label5.Location = new System.Drawing.Point(264, 219);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(31, 16);
this.label5.TabIndex = 46;
this.label5.Text = "NIT:";
//
// dateBirth
//
this.dateBirth.Location = new System.Drawing.Point(136, 183);
this.dateBirth.Name = "dateBirth";
this.dateBirth.Size = new System.Drawing.Size(229, 23);
this.dateBirth.TabIndex = 43;
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label6.ForeColor = System.Drawing.Color.Navy;
this.label6.Location = new System.Drawing.Point(43, 223);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(33, 16);
this.label6.TabIndex = 49;
this.label6.Text = "DUI:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label7.ForeColor = System.Drawing.Color.Navy;
this.label7.Location = new System.Drawing.Point(43, 177);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(76, 32);
this.label7.TabIndex = 60;
this.label7.Text = "Fecha de\r\nNacimiento:";
//
// txtDUI
//
this.txtDUI.BackColor = System.Drawing.Color.White;
this.txtDUI.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtDUI.Location = new System.Drawing.Point(136, 216);
this.txtDUI.MaxLength = 10;
this.txtDUI.Multiline = true;
this.txtDUI.Name = "txtDUI";
this.txtDUI.Size = new System.Drawing.Size(119, 23);
this.txtDUI.TabIndex = 44;
//
// txtApellidos
//
this.txtApellidos.BackColor = System.Drawing.Color.White;
this.txtApellidos.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtApellidos.Location = new System.Drawing.Point(136, 145);
this.txtApellidos.MaxLength = 50;
this.txtApellidos.Multiline = true;
this.txtApellidos.Name = "txtApellidos";
this.txtApellidos.Size = new System.Drawing.Size(229, 23);
this.txtApellidos.TabIndex = 42;
//
// txtNIT
//
this.txtNIT.BackColor = System.Drawing.Color.White;
this.txtNIT.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtNIT.Location = new System.Drawing.Point(308, 216);
this.txtNIT.MaxLength = 17;
this.txtNIT.Multiline = true;
this.txtNIT.Name = "txtNIT";
this.txtNIT.Size = new System.Drawing.Size(176, 23);
this.txtNIT.TabIndex = 47;
//
// dateDesasociación
//
this.dateDesasociación.Enabled = false;
this.dateDesasociación.Location = new System.Drawing.Point(136, 534);
this.dateDesasociación.Name = "dateDesasociación";
this.dateDesasociación.Size = new System.Drawing.Size(229, 23);
this.dateDesasociación.TabIndex = 53;
this.dateDesasociación.Visible = false;
//
// label10
//
this.label10.AutoSize = true;
this.label10.BackColor = System.Drawing.Color.Transparent;
this.label10.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label10.ForeColor = System.Drawing.Color.Navy;
this.label10.Location = new System.Drawing.Point(43, 479);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(71, 32);
this.label10.TabIndex = 54;
this.label10.Text = "Fecha de\r\nAsociación:";
//
// dateAsociación
//
this.dateAsociación.Enabled = false;
this.dateAsociación.Location = new System.Drawing.Point(136, 487);
this.dateAsociación.Name = "dateAsociación";
this.dateAsociación.Size = new System.Drawing.Size(229, 23);
this.dateAsociación.TabIndex = 52;
//
// labelDesasociacion
//
this.labelDesasociacion.AutoSize = true;
this.labelDesasociacion.BackColor = System.Drawing.Color.Transparent;
this.labelDesasociacion.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.labelDesasociacion.ForeColor = System.Drawing.Color.Navy;
this.labelDesasociacion.Location = new System.Drawing.Point(43, 526);
this.labelDesasociacion.Name = "labelDesasociacion";
this.labelDesasociacion.Size = new System.Drawing.Size(92, 32);
this.labelDesasociacion.TabIndex = 56;
this.labelDesasociacion.Text = "Fecha de\r\nDesasociación:";
this.labelDesasociacion.Visible = false;
//
// txtCódigoAsociado
//
this.txtCódigoAsociado.BackColor = System.Drawing.Color.White;
this.txtCódigoAsociado.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtCódigoAsociado.Enabled = false;
this.txtCódigoAsociado.Location = new System.Drawing.Point(136, 580);
this.txtCódigoAsociado.Multiline = true;
this.txtCódigoAsociado.Name = "txtCódigoAsociado";
this.txtCódigoAsociado.Size = new System.Drawing.Size(86, 23);
this.txtCódigoAsociado.TabIndex = 55;
//
// txtDirección
//
this.txtDirección.BackColor = System.Drawing.Color.White;
this.txtDirección.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtDirección.Location = new System.Drawing.Point(136, 249);
this.txtDirección.Multiline = true;
this.txtDirección.Name = "txtDirección";
this.txtDirección.Size = new System.Drawing.Size(348, 46);
this.txtDirección.TabIndex = 48;
//
// label13
//
this.label13.AutoSize = true;
this.label13.BackColor = System.Drawing.Color.Transparent;
this.label13.Font = new System.Drawing.Font("Linotte-SemiBold", 9.749999F);
this.label13.ForeColor = System.Drawing.Color.Navy;
this.label13.Location = new System.Drawing.Point(43, 574);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(71, 32);
this.label13.TabIndex = 59;
this.label13.Text = "Código de\r\nAsociación:";
//
// label9
//
this.label9.AutoSize = true;
this.label9.BackColor = System.Drawing.Color.Transparent;
this.label9.Font = new System.Drawing.Font("Gotham Narrow Medium", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(17)))), ((int)(((byte)(2)))));
this.label9.Location = new System.Drawing.Point(133, 36);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(513, 38);
this.label9.TabIndex = 69;
this.label9.Text = "Asociación Cooperativa De Ahorro, Crédito Y Consumo Del\r\nPersonal De La Procuradu" +
"ría Para La Defensa De Los Derechos Humanos";
this.label9.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBox1.Location = new System.Drawing.Point(36, 15);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(80, 80);
this.pictureBox1.TabIndex = 68;
this.pictureBox1.TabStop = false;
//
// Asociado
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(783, 651);
this.Controls.Add(this.label9);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label12);
this.Controls.Add(this.bttTelModificar);
this.Controls.Add(this.bttDesasociar);
this.Controls.Add(this.lbTeléfonos);
this.Controls.Add(this.bttModificar);
this.Controls.Add(this.bttEliminar);
this.Controls.Add(this.bttAceptar);
this.Controls.Add(this.txtTeléfono);
this.Controls.Add(this.bttTelefono);
this.Controls.Add(this.label1);
this.Controls.Add(this.label8);
this.Controls.Add(this.txtNombre);
this.Controls.Add(this.txtTipoAsociación);
this.Controls.Add(this.label2);
this.Controls.Add(this.label3);
this.Controls.Add(this.label4);
this.Controls.Add(this.cbLugarTrabajo);
this.Controls.Add(this.label5);
this.Controls.Add(this.dateBirth);
this.Controls.Add(this.label6);
this.Controls.Add(this.label7);
this.Controls.Add(this.txtDUI);
this.Controls.Add(this.txtApellidos);
this.Controls.Add(this.txtNIT);
this.Controls.Add(this.dateDesasociación);
this.Controls.Add(this.label10);
this.Controls.Add(this.dateAsociación);
this.Controls.Add(this.labelDesasociacion);
this.Controls.Add(this.txtCódigoAsociado);
this.Controls.Add(this.txtDirección);
this.Controls.Add(this.label13);
this.DoubleBuffered = true;
this.Font = new System.Drawing.Font("Linotte-Light", 9.75F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Asociado";
this.Text = "Usuario";
this.Load += new System.EventHandler(this.Usuario_Load);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ErrorProvider errorProvider1;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Button bttTelModificar;
private System.Windows.Forms.Button bttDesasociar;
private System.Windows.Forms.ListBox lbTeléfonos;
private System.Windows.Forms.Button bttModificar;
private System.Windows.Forms.Button bttEliminar;
private System.Windows.Forms.Button bttAceptar;
private System.Windows.Forms.TextBox txtTeléfono;
private System.Windows.Forms.Button bttTelefono;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtNombre;
private System.Windows.Forms.TextBox txtTipoAsociación;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox cbLugarTrabajo;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.DateTimePicker dateBirth;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtDUI;
private System.Windows.Forms.TextBox txtApellidos;
private System.Windows.Forms.TextBox txtNIT;
private System.Windows.Forms.DateTimePicker dateDesasociación;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.DateTimePicker dateAsociación;
private System.Windows.Forms.Label labelDesasociacion;
private System.Windows.Forms.TextBox txtCódigoAsociado;
private System.Windows.Forms.TextBox txtDirección;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.PictureBox pictureBox1;
}
} | EduardAl/Proyectos-Visual-Studio | Editando/Conejo/Conejo/Asociado.Designer.cs | C# | mit | 28,967 | [
30522,
3415,
15327,
13171,
5558,
1063,
7704,
2465,
2004,
10085,
28665,
2080,
1063,
1013,
1013,
1013,
1026,
12654,
1028,
1013,
1013,
1013,
3223,
5859,
8023,
1012,
1013,
1013,
1013,
1026,
1013,
12654,
1028,
2797,
2291,
1012,
6922,
5302,
9247,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Copyright 2014 CyberVision, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "kaa/http/IHttpClient.hpp"
#include "kaa/common/AvroByteArrayConverter.hpp"
#include "kaa/common/EndpointObjectHash.hpp"
#include "kaa/http/IHttpRequest.hpp"
#include "kaa/http/HttpResponse.hpp"
namespace kaa {
const std::string HttpResponseStart = "HTTP/1.1\t200\r\nX-SIGNATURE: \r\n";
template <typename T>
class HttpClientStub : public IHttpClient {
public:
HttpClientStub() : shift(0) {}
std::shared_ptr<IHttpResponse> sendRequest(const IHttpRequest& request) {
AvroByteArrayConverter<T> converter;
SharedDataBuffer buffer = converter.toByteArray(element);
std::stringstream ss;
ss << HttpResponseStart;
ss << "Content-Length: " << buffer.second + shift << "\r\n\r\n";
for (size_t i = 0; i < buffer.second; ++i) {
ss << (unsigned char) buffer.first[i];
}
ss << "\r\n\r\n";
std::shared_ptr<IHttpResponse> response(new HttpResponse(ss.str()));
return response;
}
void closeConnection() { }
T element;
int shift;
};
} // namespace kaa
| vzhukovskyi/kaa | client/client-multi/client-cpp/test/headers/http/HttpClientStub.hpp | C++ | apache-2.0 | 1,676 | [
30522,
1013,
1008,
1008,
9385,
2297,
16941,
17084,
1010,
4297,
1012,
1008,
1008,
30524,
1996,
1000,
6105,
1000,
1007,
1025,
1008,
2017,
2089,
2025,
2224,
2023,
5371,
3272,
1999,
12646,
2007,
1996,
6105,
1012,
1008,
2017,
2089,
6855,
1037,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Summer 2011 -- African Uhambo</title>
<link href="https://africanuhambo.co.uk/categories/summer-2011/index.xml" rel="alternate" type="application/rss+xml" title="African Uhambo" />
<link href="https://africanuhambo.co.uk/categories/summer-2011/index.xml" rel="feed" type="application/rss+xml" title="African Uhambo" />
<link href="https://africanuhambo.co.uk//css/bootstrap.min.css" rel="stylesheet">
<link href="https://africanuhambo.co.uk//css/clean-blog.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
</head>
<body>
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://africanuhambo.co.uk/">African Uhambo</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://africanuhambo.co.uk/">home</a>
</li>
<li>
<a href="https://africanuhambo.co.uk/post/">Archives</a>
</li>
<li>
<a href="https://africanuhambo.co.uk/about/">About Us</a>
</li>
<li>
<a href="https://africanuhambo.co.uk/tusky/">Tusky</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="intro-header" style="background-image: url('https://africanuhambo.co.uk//img/home-bg.jpg')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1>Summer 2011</h1>
<hr class="small">
<span class="subheading"></span>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2012/07/01/serbia-unexpected-off-road/">Serbia, Unexpected off road</a> on Sun, Jul 1, 2012
<br />
In <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/defender">defender</a>, <a href="https://africanuhambo.co.uk/tags/garmin">garmin</a>, <a href="https://africanuhambo.co.uk/tags/serbia">serbia</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2012/04/28/durmitor-national-park-montenegro-maps/">Durmitor National Park, Montenegro - Garmin Maps</a> on Sat, Apr 28, 2012
<br />
In <a href="https://africanuhambo.co.uk/categories/garmin">Garmin</a>, <a href="https://africanuhambo.co.uk/categories/maps">Maps</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>, <a href="https://africanuhambo.co.uk/categories/walking">Walking</a>
Tags <a href="https://africanuhambo.co.uk/tags/garmin">garmin</a>, <a href="https://africanuhambo.co.uk/tags/maps">maps</a>, <a href="https://africanuhambo.co.uk/tags/walking">walking</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/27/day-27-thursday-25-august-2011-villey-le-sec-france-hove-england/">DAY 27: THURSDAY 25 AUGUST 2011 Villey le Sec (France) – Hove (England)</a> on Sat, Aug 27, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/france">France</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/france">france</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/25/day-2526-2324-august-2011-altkirch-france-villey-le-sec-france/">DAY 25/26: 23/24 AUGUST 2011 Altkirch (France) – Villey le Sec (France)</a> on Thu, Aug 25, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/france">France</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/france">france</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/23/day-2324-2122-august-2011-forno-di-zaldo-italy-altkirch-france/">DAY 23/24: 21/22 AUGUST 2011 Forno di Zaldo (Italy) – Altkirch (France)</a> on Tue, Aug 23, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/italy">Italy</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/france">france</a>, <a href="https://africanuhambo.co.uk/tags/italy">italy</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/22/day-19-21-17-21-august-2011-trogir-croatia-plitvicka-jezera-nationalni-park-croatia/">DAY 19 - 21: 17 - 21 AUGUST 2011 Trogir (Croatia) – Plitvička Jezera Nationalni Park (Croatia)</a> on Mon, Aug 22, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/croatia">Croatia</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/croatia">croatia</a>, <a href="https://africanuhambo.co.uk/tags/national-park">national park</a>, <a href="https://africanuhambo.co.uk/tags/plitvice">plitvice</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/21/day-22-saturday-20-august-2011-plitvicka-jezera-croatia-forno-di-zaldo-italy/">DAY 22: SATURDAY 20 AUGUST 2011 Plitvička Jezera (Croatia) – Forno di Zaldo (Italy)</a> on Sun, Aug 21, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/croatia">Croatia</a>, <a href="https://africanuhambo.co.uk/categories/italy">Italy</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/croatia">croatia</a>, <a href="https://africanuhambo.co.uk/tags/italy">italy</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/17/day-18-tuesday-16-august-2011-lumbarda-korcula-croatia-trogir-croatia/">DAY 18: TUESDAY 16 AUGUST 2011 Lumbarda, Korčula (Croatia) – Trogir (Croatia)</a> on Wed, Aug 17, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/croatia">Croatia</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/croatia">croatia</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/16/day-1617-1415-august-2011-mostar-bosnia-lumbarda-korcula-croatia/">DAY 16/17: 14/15 AUGUST 2011, Mostar (Bosnia) – Lumbarda, Korčula (Croatia)</a> on Tue, Aug 16, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/croatia">Croatia</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/blagaj">blagaj</a>, <a href="https://africanuhambo.co.uk/tags/croatia">croatia</a>
</p>
</div>
<div class="post-preview">
<p class="post-meta"><a href="https://africanuhambo.co.uk/2011/08/14/day-15-saturday-13-august-2011-donji-morinj-montenegro-mostar-bosnia/">DAY 15: SATURDAY 13 AUGUST 2011 Donji Morinj (Montenegro) – Mostar (Bosnia)</a> on Sun, Aug 14, 2011
<br />
In <a href="https://africanuhambo.co.uk/categories/bosnia-and-herzegovina">Bosnia And Herzegovina</a>, <a href="https://africanuhambo.co.uk/categories/summer-2011">Summer 2011</a>
Tags <a href="https://africanuhambo.co.uk/tags/bosnia-and-herzegovina">bosnia and herzegovina</a>, <a href="https://africanuhambo.co.uk/tags/mostar">mostar</a>
</p>
</div>
<ul class="pagination">
<li>
<a href="https://africanuhambo.co.uk/categories/summer-2011/" aria-label="First"><span aria-hidden="true">««</span></a>
</li>
<li
class="disabled">
<a href="" aria-label="Previous"><span aria-hidden="true">«</span></a>
</li>
<li
class="active"><a href="https://africanuhambo.co.uk/categories/summer-2011/">1</a></li>
<li
><a href="https://africanuhambo.co.uk/categories/summer-2011/page/2/">2</a></li>
<li
><a href="https://africanuhambo.co.uk/categories/summer-2011/page/3/">3</a></li>
<li
>
<a href="https://africanuhambo.co.uk/categories/summer-2011/page/2/" aria-label="Next"><span aria-hidden="true">»</span></a>
</li>
<li>
<a href="https://africanuhambo.co.uk/categories/summer-2011/page/3/" aria-label="Last"><span aria-hidden="true">»»</span></a>
</li>
</ul>
</div>
</div>
</div>
<hr>
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center">
<li>
<a href="https://www.twitter.com/danward79">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://www.linkedin.com/in/danward79">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="copyright text-muted">Code released under the MIT license.</p>
</div>
</div>
</div>
</footer>
<script src="https://africanuhambo.co.uk//js/jquery.min.js"></script>
<script src="https://africanuhambo.co.uk//js/bootstrap.min.js"></script>
<script src="https://africanuhambo.co.uk//js/clean-blog.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40336336-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| AfricanUhambo/AfricanUhambo.github.io | categories/summer-2011/index.html | HTML | mit | 13,761 | [
30522,
1026,
999,
9986,
13874,
16129,
1028,
1026,
16129,
11374,
1027,
1000,
4372,
1011,
2149,
1000,
1028,
1026,
2132,
1028,
1026,
18804,
25869,
13462,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1028,
1026,
18804,
8299,
1011,
1041,
15549,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace CMissionLib.Actions
{
[DataContract]
public class CancelCountdownAction : Action
{
string countdown;
public CancelCountdownAction(string countdown)
{
this.Countdown = countdown;
}
[DataMember]
public string Countdown
{
get { return countdown; }
set
{
countdown = value;
RaisePropertyChanged("Countdown");
}
}
public override LuaTable GetLuaTable(Mission mission)
{
var map = new Dictionary<object, object>
{
{"countdown", Countdown??string.Empty},
};
return new LuaTable(map);
}
public override string GetDefaultName()
{
return "Cancel Countdown";
}
}
} | ZeroK-RTS/Zero-K-Infrastructure | MissionEditor/CMissionLib/Actions/Logic/CancelCountdownAction.cs | C# | gpl-3.0 | 732 | [
30522,
2478,
2291,
1025,
2478,
2291,
1012,
6407,
1012,
12391,
1025,
2478,
2291,
1012,
2448,
7292,
1012,
7642,
3989,
1025,
3415,
15327,
4642,
14643,
3258,
29521,
1012,
4506,
1063,
1031,
2951,
8663,
6494,
6593,
1033,
2270,
2465,
17542,
3597,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#ifndef BRACKETEDKEYWORDINCONTEXTDELEGATE_HH
#define BRACKETEDKEYWORDINCONTEXTDELEGATE_HH
#include <vector>
#include <AlpinoCorpus/LexItem.hh>
#include "BracketedDelegate.hh"
class BracketedKeywordInContextDelegate : public BracketedDelegate
{
Q_OBJECT
public:
BracketedKeywordInContextDelegate(CorpusReaderPtr);
virtual ~BracketedKeywordInContextDelegate() {}
void paint(QPainter *painter, QStyleOptionViewItem const &option, QModelIndex const &index) const;
QSize sizeHint(QStyleOptionViewItem const &option, QModelIndex const &index) const;
private:
void loadColorSettings();
QString extractFragment(std::vector<alpinocorpus::LexItem> const &items, size_t first, size_t last) const;
mutable QColor d_highlightColor;
};
#endif
| evdmade01/dact | include/BracketedKeywordInContextDelegate.hh | C++ | lgpl-2.1 | 770 | [
30522,
1001,
2065,
13629,
2546,
21605,
2098,
14839,
18351,
2378,
8663,
18209,
9247,
29107,
2618,
1035,
1044,
2232,
1001,
9375,
21605,
2098,
14839,
18351,
2378,
8663,
18209,
9247,
29107,
2618,
1035,
1044,
2232,
1001,
2421,
1026,
9207,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
/**
* Search entry layout
*
* @package Total WordPress theme
* @subpackage Partials
* @version 3.3.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?>
<article id="search-no-results" class="clr">
<?php esc_html_e( 'Sorry, no results were found for this query.', 'total' ); ?>
</article><!-- #search-no-results --> | iq007/MadScape | wp-content/themes/Total/partials/search/search-no-results.php | PHP | gpl-2.0 | 354 | [
30522,
1026,
1029,
25718,
1013,
1008,
1008,
1008,
3945,
4443,
9621,
1008,
1008,
1030,
7427,
2561,
2773,
20110,
4323,
1008,
1030,
4942,
23947,
4270,
7704,
2015,
1008,
1030,
2544,
1017,
1012,
1017,
1012,
1014,
1008,
1013,
1013,
1013,
6164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_91) on Mon Jun 06 14:51:16 EDT 2016 -->
<title>CounterCells (apache-cassandra API)</title>
<meta name="date" content="2016-06-06">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CounterCells (apache-cassandra API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CounterCells.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/cassandra/db/rows/ComplexColumnData.Builder.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/db/rows/CounterCells.html" target="_top">Frames</a></li>
<li><a href="CounterCells.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.db.rows</div>
<h2 title="Class CounterCells" class="title">Class CounterCells</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.db.rows.CounterCells</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">CounterCells</span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/cassandra/db/rows/CounterCells.html#hasLegacyShards-org.apache.cassandra.db.rows.Cell-">hasLegacyShards</a></span>(<a href="../../../../../org/apache/cassandra/db/rows/Cell.html" title="class in org.apache.cassandra.db.rows">Cell</a> cell)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="hasLegacyShards-org.apache.cassandra.db.rows.Cell-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>hasLegacyShards</h4>
<pre>public static boolean hasLegacyShards(<a href="../../../../../org/apache/cassandra/db/rows/Cell.html" title="class in org.apache.cassandra.db.rows">Cell</a> cell)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CounterCells.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/cassandra/db/rows/ComplexColumnData.Builder.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/cassandra/db/rows/EncodingStats.html" title="class in org.apache.cassandra.db.rows"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/cassandra/db/rows/CounterCells.html" target="_top">Frames</a></li>
<li><a href="CounterCells.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2016 The Apache Software Foundation</small></p>
</body>
</html>
| jasonwee/videoOnCloud | lib/cassandra/apache-cassandra-3.7/javadoc/org/apache/cassandra/db/rows/CounterCells.html | HTML | apache-2.0 | 8,562 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
16129,
1018,
1012,
5890,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
8917,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace spec\Money\Provider;
use Money\Provider;
use Money\Currency;
use Money\Exception\UnsupportedCurrency;
use PhpSpec\ObjectBehavior;
class BatchSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Money\Provider\Batch');
$this->shouldHaveType('Money\Provider');
}
function it_should_have_providers(Provider $provider)
{
$this->hasProvider($provider)->shouldReturn(false);
$this->addProvider($provider);
$this->hasProvider($provider)->shouldReturn(true);
}
function it_should_be_able_to_get_a_rate(Provider $provider1, Provider $provider2)
{
$rate = 1.25;
$baseCurrency = new Currency('EUR');
$counterCurrency = new Currency('USD');
$e = new UnsupportedCurrency($baseCurrency);
$provider1->getRate($baseCurrency, $counterCurrency)->willThrow($e);
$provider2->getRate($baseCurrency, $counterCurrency)->willReturn($rate);
$this->addProvider($provider1);
$this->addProvider($provider2);
$this->getRate($baseCurrency, $counterCurrency)->shouldReturn($rate);
}
function it_should_throw_an_exception_when_called_without_providers()
{
$baseCurrency = new Currency('EUR');
$counterCurrency = new Currency('USD');
$this->shouldThrow('RuntimeException')->duringGetRate($baseCurrency, $counterCurrency);
}
function it_should_throw_an_exception_when_all_provider_fails(Provider $provider1, Provider $provider2)
{
$rate = 1.25;
$baseCurrency = new Currency('EUR');
$counterCurrency = new Currency('USD');
$e = new UnsupportedCurrency($baseCurrency);
$provider1->getRate($baseCurrency, $counterCurrency)->willThrow($e);
$provider2->getRate($baseCurrency, $counterCurrency)->willThrow($e);
$this->addProvider($provider1);
$this->addProvider($provider2);
$this->shouldThrow($e)->duringGetRate($baseCurrency, $counterCurrency);
}
function it_should_throw_an_exception_when_rate_cannot_be_determined(Provider $provider)
{
$rate = 1.25;
$baseCurrency = new Currency('EUR');
$counterCurrency = new Currency('USD');
$provider->getRate($baseCurrency, $counterCurrency)->willReturn(null);
$this->addProvider($provider);
$this->shouldThrow('RuntimeException')->duringGetRate($baseCurrency, $counterCurrency);
}
}
| indigophp/money | spec/Money/Provider/BatchSpec.php | PHP | mit | 2,484 | [
30522,
1026,
1029,
25718,
3415,
15327,
28699,
1032,
2769,
1032,
10802,
1025,
2224,
2769,
1032,
10802,
1025,
2224,
2769,
1032,
9598,
1025,
2224,
2769,
1032,
6453,
1032,
4895,
6342,
9397,
15613,
10841,
14343,
9407,
1025,
2224,
25718,
13102,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "private/qpacketprotocol_p.h"
#include <QBuffer>
#include <QElapsedTimer>
QT_BEGIN_NAMESPACE
#define MAX_PACKET_SIZE 0x7FFFFFFF
/*!
\class QPacketProtocol
\internal
\brief The QPacketProtocol class encapsulates communicating discrete packets
across fragmented IO channels, such as TCP sockets.
QPacketProtocol makes it simple to send arbitrary sized data "packets" across
fragmented transports such as TCP and UDP.
As transmission boundaries are not respected, sending packets over protocols
like TCP frequently involves "stitching" them back together at the receiver.
QPacketProtocol makes this easier by performing this task for you. Packet
data sent using QPacketProtocol is prepended with a 4-byte size header
allowing the receiving QPacketProtocol to buffer the packet internally until
it has all been received. QPacketProtocol does not perform any sanity
checking on the size or on the data, so this class should only be used in
prototyping or trusted situations where DOS attacks are unlikely.
QPacketProtocol does not perform any communications itself. Instead it can
operate on any QIODevice that supports the QIODevice::readyRead() signal. A
logical "packet" is encapsulated by the companion QPacket class. The
following example shows two ways to send data using QPacketProtocol. The
transmitted data is equivalent in both.
\code
QTcpSocket socket;
// ... connect socket ...
QPacketProtocol protocol(&socket);
// Send packet the quick way
protocol.send() << "Hello world" << 123;
// Send packet the longer way
QPacket packet;
packet << "Hello world" << 123;
protocol.send(packet);
\endcode
Likewise, the following shows how to read data from QPacketProtocol, assuming
that the QPacketProtocol::readyRead() signal has been emitted.
\code
// ... QPacketProtocol::readyRead() is emitted ...
int a;
QByteArray b;
// Receive packet the quick way
protocol.read() >> a >> b;
// Receive packet the longer way
QPacket packet = protocol.read();
p >> a >> b;
\endcode
\ingroup io
\sa QPacket
*/
class QPacketProtocolPrivate : public QObject
{
Q_OBJECT
public:
QPacketProtocolPrivate(QPacketProtocol * parent, QIODevice * _dev)
: QObject(parent), inProgressSize(-1), maxPacketSize(MAX_PACKET_SIZE),
waitingForPacket(false), dev(_dev)
{
Q_ASSERT(4 == sizeof(qint32));
QObject::connect(this, SIGNAL(readyRead()),
parent, SIGNAL(readyRead()));
QObject::connect(this, SIGNAL(packetWritten()),
parent, SIGNAL(packetWritten()));
QObject::connect(this, SIGNAL(invalidPacket()),
parent, SIGNAL(invalidPacket()));
QObject::connect(dev, SIGNAL(readyRead()),
this, SLOT(readyToRead()));
QObject::connect(dev, SIGNAL(aboutToClose()),
this, SLOT(aboutToClose()));
QObject::connect(dev, SIGNAL(bytesWritten(qint64)),
this, SLOT(bytesWritten(qint64)));
}
Q_SIGNALS:
void readyRead();
void packetWritten();
void invalidPacket();
public Q_SLOTS:
void aboutToClose()
{
inProgress.clear();
sendingPackets.clear();
inProgressSize = -1;
}
void bytesWritten(qint64 bytes)
{
Q_ASSERT(!sendingPackets.isEmpty());
while(bytes) {
if(sendingPackets.at(0) > bytes) {
sendingPackets[0] -= bytes;
bytes = 0;
} else {
bytes -= sendingPackets.at(0);
sendingPackets.removeFirst();
emit packetWritten();
}
}
}
void readyToRead()
{
bool gotPackets = false;
while (true) {
// Get size header (if not in progress)
if (-1 == inProgressSize) {
// We need a size header of sizeof(qint32)
if (sizeof(qint32) > (uint)dev->bytesAvailable()) {
if (gotPackets)
emit readyRead();
return; // no more data available
}
// Read size header
int read = dev->read((char *)&inProgressSize, sizeof(qint32));
Q_ASSERT(read == sizeof(qint32));
Q_UNUSED(read);
// Check sizing constraints
if (inProgressSize > maxPacketSize) {
QObject::disconnect(dev, SIGNAL(readyRead()),
this, SLOT(readyToRead()));
QObject::disconnect(dev, SIGNAL(aboutToClose()),
this, SLOT(aboutToClose()));
QObject::disconnect(dev, SIGNAL(bytesWritten(qint64)),
this, SLOT(bytesWritten(qint64)));
dev = 0;
emit invalidPacket();
return;
}
inProgressSize -= sizeof(qint32);
} else {
inProgress.append(dev->read(inProgressSize - inProgress.size()));
if (inProgressSize == inProgress.size()) {
// Packet has arrived!
packets.append(inProgress);
inProgressSize = -1;
inProgress.clear();
waitingForPacket = false;
gotPackets = true;
} else {
if (gotPackets)
emit readyRead();
return; // packet in progress is not yet complete
}
}
}
}
public:
QList<qint64> sendingPackets;
QList<QByteArray> packets;
QByteArray inProgress;
qint32 inProgressSize;
qint32 maxPacketSize;
bool waitingForPacket;
QIODevice * dev;
};
/*!
Construct a QPacketProtocol instance that works on \a dev with the
specified \a parent.
*/
QPacketProtocol::QPacketProtocol(QIODevice * dev, QObject * parent)
: QObject(parent), d(new QPacketProtocolPrivate(this, dev))
{
Q_ASSERT(dev);
}
/*!
Destroys the QPacketProtocol instance.
*/
QPacketProtocol::~QPacketProtocol()
{
}
/*!
Returns the maximum packet size allowed. By default this is
2,147,483,647 bytes.
If a packet claiming to be larger than the maximum packet size is received,
the QPacketProtocol::invalidPacket() signal is emitted.
\sa QPacketProtocol::setMaximumPacketSize()
*/
qint32 QPacketProtocol::maximumPacketSize() const
{
return d->maxPacketSize;
}
/*!
Sets the maximum allowable packet size to \a max.
\sa QPacketProtocol::maximumPacketSize()
*/
qint32 QPacketProtocol::setMaximumPacketSize(qint32 max)
{
if(max > (signed)sizeof(qint32))
d->maxPacketSize = max;
return d->maxPacketSize;
}
/*!
Returns a streamable object that is transmitted on destruction. For example
\code
protocol.send() << "Hello world" << 123;
\endcode
will send a packet containing "Hello world" and 123. To construct more
complex packets, explicitly construct a QPacket instance.
*/
QPacketAutoSend QPacketProtocol::send()
{
return QPacketAutoSend(this);
}
/*!
\fn void QPacketProtocol::send(const QPacket & packet)
Transmit the \a packet.
*/
void QPacketProtocol::send(const QPacket & p)
{
if(p.b.isEmpty())
return; // We don't send empty packets
qint64 sendSize = p.b.size() + sizeof(qint32);
d->sendingPackets.append(sendSize);
qint32 sendSize32 = sendSize;
qint64 writeBytes = d->dev->write((char *)&sendSize32, sizeof(qint32));
Q_ASSERT(writeBytes == sizeof(qint32));
writeBytes = d->dev->write(p.b);
Q_ASSERT(writeBytes == p.b.size());
Q_UNUSED(writeBytes);
}
/*!
Returns the number of received packets yet to be read.
*/
qint64 QPacketProtocol::packetsAvailable() const
{
return d->packets.count();
}
/*!
Discard any unread packets.
*/
void QPacketProtocol::clear()
{
d->packets.clear();
}
/*!
Return the next unread packet, or an invalid QPacket instance if no packets
are available. This method does NOT block.
*/
QPacket QPacketProtocol::read()
{
if(0 == d->packets.count())
return QPacket();
QPacket rv(d->packets.at(0));
d->packets.removeFirst();
return rv;
}
/*
Returns the difference between msecs and elapsed. If msecs is -1,
however, -1 is returned.
*/
static int qt_timeout_value(int msecs, int elapsed)
{
if (msecs == -1)
return -1;
int timeout = msecs - elapsed;
return timeout < 0 ? 0 : timeout;
}
/*!
This function locks until a new packet is available for reading and the
\l{QIODevice::}{readyRead()} signal has been emitted. The function
will timeout after \a msecs milliseconds; the default timeout is
30000 milliseconds.
The function returns true if the readyRead() signal is emitted and
there is new data available for reading; otherwise it returns false
(if an error occurred or the operation timed out).
*/
bool QPacketProtocol::waitForReadyRead(int msecs)
{
if (!d->packets.isEmpty())
return true;
QElapsedTimer stopWatch;
stopWatch.start();
d->waitingForPacket = true;
do {
if (!d->dev->waitForReadyRead(msecs))
return false;
if (!d->waitingForPacket)
return true;
msecs = qt_timeout_value(msecs, stopWatch.elapsed());
} while (true);
}
/*!
Return the QIODevice passed to the QPacketProtocol constructor.
*/
QIODevice * QPacketProtocol::device()
{
return d->dev;
}
/*!
\fn void QPacketProtocol::readyRead()
Emitted whenever a new packet is received. Applications may use
QPacketProtocol::read() to retrieve this packet.
*/
/*!
\fn void QPacketProtocol::invalidPacket()
A packet larger than the maximum allowable packet size was received. The
packet will be discarded and, as it indicates corruption in the protocol, no
further packets will be received.
*/
/*!
\fn void QPacketProtocol::packetWritten()
Emitted each time a packet is completing written to the device. This signal
may be used for communications flow control.
*/
/*!
\class QPacket
\internal
\brief The QPacket class encapsulates an unfragmentable packet of data to be
transmitted by QPacketProtocol.
The QPacket class works together with QPacketProtocol to make it simple to
send arbitrary sized data "packets" across fragmented transports such as TCP
and UDP.
QPacket provides a QDataStream interface to an unfragmentable packet.
Applications should construct a QPacket, propagate it with data and then
transmit it over a QPacketProtocol instance. For example:
\code
QPacketProtocol protocol(...);
QPacket myPacket;
myPacket << "Hello world!" << 123;
protocol.send(myPacket);
\endcode
As long as both ends of the connection are using the QPacketProtocol class,
the data within this packet will be delivered unfragmented at the other end,
ready for extraction.
\code
QByteArray greeting;
int count;
QPacket myPacket = protocol.read();
myPacket >> greeting >> count;
\endcode
Only packets returned from QPacketProtocol::read() may be read from. QPacket
instances constructed by directly by applications are for transmission only
and are considered "write only". Attempting to read data from them will
result in undefined behavior.
\ingroup io
\sa QPacketProtocol
*/
/*!
Constructs an empty write-only packet.
*/
QPacket::QPacket()
: QDataStream(), buf(0)
{
buf = new QBuffer(&b);
buf->open(QIODevice::WriteOnly);
setDevice(buf);
setVersion(QDataStream::Qt_4_7);
}
/*!
Destroys the QPacket instance.
*/
QPacket::~QPacket()
{
if(buf) {
delete buf;
buf = 0;
}
}
/*!
Creates a copy of \a other. The initial stream positions are shared, but the
two packets are otherwise independent.
*/
QPacket::QPacket(const QPacket & other)
: QDataStream(), b(other.b), buf(0)
{
buf = new QBuffer(&b);
buf->open(other.buf->openMode());
setDevice(buf);
}
/*!
\internal
*/
QPacket::QPacket(const QByteArray & ba)
: QDataStream(), b(ba), buf(0)
{
buf = new QBuffer(&b);
buf->open(QIODevice::ReadOnly);
setDevice(buf);
}
/*!
Returns true if this packet is empty - that is, contains no data.
*/
bool QPacket::isEmpty() const
{
return b.isEmpty();
}
/*!
Returns raw packet data.
*/
QByteArray QPacket::data() const
{
return b;
}
/*!
Clears data in the packet. This is useful for reusing one writable packet.
For example
\code
QPacketProtocol protocol(...);
QPacket packet;
packet << "Hello world!" << 123;
protocol.send(packet);
packet.clear();
packet << "Goodbyte world!" << 789;
protocol.send(packet);
\endcode
*/
void QPacket::clear()
{
QBuffer::OpenMode oldMode = buf->openMode();
buf->close();
b.clear();
buf->setBuffer(&b); // reset QBuffer internals with new size of b.
buf->open(oldMode);
}
/*!
\class QPacketAutoSend
\internal
\internal
*/
QPacketAutoSend::QPacketAutoSend(QPacketProtocol * _p)
: QPacket(), p(_p)
{
}
QPacketAutoSend::~QPacketAutoSend()
{
if(!b.isEmpty())
p->send(*this);
}
QT_END_NAMESPACE
#include <qpacketprotocol.moc>
| kobolabs/qtquick1 | src/declarative/debugger/qpacketprotocol.cpp | C++ | lgpl-2.1 | 15,319 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace Mawi\Bundle\FrostlogBundle\Controller;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Exception\ParseException;
class FrontController extends Controller
{
/**
* @Route("/", name="front")
* @Template("MawiFrostlogBundle::layout.html.twig")
*/
public function frontAction()
{
return array();
}
/**
* @Route("/check", name="ajax_login_check")
*/
public function indexAction()
{
if (false === $this->get('security.context')->isGranted(
'IS_AUTHENTICATED_FULLY'
)) {
return new Response('NOT AUTHENTICATED');
}
$token = $this->get('security.context')->getToken();
if ($token) {
$user = $token->getUser();
if ($user) {
return new Response('OK');
} else {
return new Response('NO USER');
}
}
return new Response('NO TOKEN');
}
public function loginPageAction()
{
$request = $this->getRequest();
$session = $request->getSession();
// get the login error if there is one
if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
$error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
} else {
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
}
return $this->render('MawiFrostlogBundle:Front:login.html.twig', array(
// last username entered by the user
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
'error' => $error,
));
}
/**
* @Route("/login", name="login")
*/
public function loginAction()
{
return $this->render('MawiFrostlogBundle::layout.html.twig', array(
// last username entered by the user
'content' => 'MawiFrostlogBundle:Front:loginPage',
));
}
/**
* @Route("/login/done", name="login_done")
*/
public function loginDoneAction()
{
return new Response('DONE');
}
/**
* @Route("/login/fail", name="login_fail")
*/
public function loginFailAction()
{
return new Response('FAIL');
}
/**
* @Route("/login_check", name="login_check")
*/
public function loginCheckAction()
{
}
/**
* @Route("/logout", name="logout")
*/
public function logoutAction()
{
}
}
| mawi12345/frostlog | src/Mawi/Bundle/FrostlogBundle/Controller/FrontController.php | PHP | mit | 2,772 | [
30522,
1026,
1029,
25718,
3415,
15327,
5003,
9148,
1032,
14012,
1032,
10097,
21197,
27265,
2571,
1032,
30524,
2571,
1032,
11486,
1032,
11486,
1025,
2224,
12411,
20763,
1032,
14012,
1032,
7705,
10288,
6494,
27265,
2571,
1032,
9563,
1032,
2799,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
* Generic process-grouping system.
*
* Based originally on the cpuset system, extracted by Paul Menage
* Copyright (C) 2006 Google, Inc
*
* Notifications support
* Copyright (C) 2009 Nokia Corporation
* Author: Kirill A. Shutemov
*
* Copyright notices from the original cpuset code:
* --------------------------------------------------
* Copyright (C) 2003 BULL SA.
* Copyright (C) 2004-2006 Silicon Graphics, Inc.
*
* Portions derived from Patrick Mochel's sysfs code.
* sysfs is Copyright (c) 2001-3 Patrick Mochel
*
* 2003-10-10 Written by Simon Derr.
* 2003-10-22 Updates by Stephen Hemminger.
* 2004 May-July Rework by Paul Jackson.
* ---------------------------------------------------
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of the Linux
* distribution for more details.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/cgroup.h>
#include <linux/cred.h>
#include <linux/ctype.h>
#include <linux/errno.h>
#include <linux/init_task.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/magic.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/mount.h>
#include <linux/pagemap.h>
#include <linux/proc_fs.h>
#include <linux/rcupdate.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/rwsem.h>
#include <linux/string.h>
#include <linux/sort.h>
#include <linux/kmod.h>
#include <linux/delayacct.h>
#include <linux/cgroupstats.h>
#include <linux/hashtable.h>
#include <linux/pid_namespace.h>
#include <linux/idr.h>
#include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/atomic.h>
/*
* pidlists linger the following amount before being destroyed. The goal
* is avoiding frequent destruction in the middle of consecutive read calls
* Expiring in the middle is a performance problem not a correctness one.
* 1 sec should be enough.
*/
#define CGROUP_PIDLIST_DESTROY_DELAY HZ
#define CGROUP_FILE_NAME_MAX (MAX_CGROUP_TYPE_NAMELEN + \
MAX_CFTYPE_NAME + 2)
/*
* cgroup_mutex is the master lock. Any modification to cgroup or its
* hierarchy must be performed while holding it.
*
* css_set_rwsem protects task->cgroups pointer, the list of css_set
* objects, and the chain of tasks off each css_set.
*
* These locks are exported if CONFIG_PROVE_RCU so that accessors in
* cgroup.h can use them for lockdep annotations.
*/
#ifdef CONFIG_PROVE_RCU
DEFINE_MUTEX(cgroup_mutex);
DECLARE_RWSEM(css_set_rwsem);
EXPORT_SYMBOL_GPL(cgroup_mutex);
EXPORT_SYMBOL_GPL(css_set_rwsem);
#else
static DEFINE_MUTEX(cgroup_mutex);
static DECLARE_RWSEM(css_set_rwsem);
#endif
/*
* Protects cgroup_idr and css_idr so that IDs can be released without
* grabbing cgroup_mutex.
*/
static DEFINE_SPINLOCK(cgroup_idr_lock);
/*
* Protects cgroup_subsys->release_agent_path. Modifying it also requires
* cgroup_mutex. Reading requires either cgroup_mutex or this spinlock.
*/
static DEFINE_SPINLOCK(release_agent_path_lock);
#define cgroup_assert_mutex_or_rcu_locked() \
rcu_lockdep_assert(rcu_read_lock_held() || \
lockdep_is_held(&cgroup_mutex), \
"cgroup_mutex or RCU read lock required");
/*
* cgroup destruction makes heavy use of work items and there can be a lot
* of concurrent destructions. Use a separate workqueue so that cgroup
* destruction work items don't end up filling up max_active of system_wq
* which may lead to deadlock.
*/
static struct workqueue_struct *cgroup_destroy_wq;
/*
* pidlist destructions need to be flushed on cgroup destruction. Use a
* separate workqueue as flush domain.
*/
static struct workqueue_struct *cgroup_pidlist_destroy_wq;
/* generate an array of cgroup subsystem pointers */
#define SUBSYS(_x) [_x ## _cgrp_id] = &_x ## _cgrp_subsys,
static struct cgroup_subsys *cgroup_subsys[] = {
#include <linux/cgroup_subsys.h>
};
#undef SUBSYS
/* array of cgroup subsystem names */
#define SUBSYS(_x) [_x ## _cgrp_id] = #_x,
static const char *cgroup_subsys_name[] = {
#include <linux/cgroup_subsys.h>
};
#undef SUBSYS
/*
* The default hierarchy, reserved for the subsystems that are otherwise
* unattached - it never has more than a single cgroup, and all tasks are
* part of that cgroup.
*/
struct cgroup_root cgrp_dfl_root;
/*
* The default hierarchy always exists but is hidden until mounted for the
* first time. This is for backward compatibility.
*/
static bool cgrp_dfl_root_visible;
/*
* Set by the boot param of the same name and makes subsystems with NULL
* ->dfl_files to use ->legacy_files on the default hierarchy.
*/
static bool cgroup_legacy_files_on_dfl;
/* some controllers are not supported in the default hierarchy */
static unsigned int cgrp_dfl_root_inhibit_ss_mask;
/* The list of hierarchy roots */
static LIST_HEAD(cgroup_roots);
static int cgroup_root_count;
/* hierarchy ID allocation and mapping, protected by cgroup_mutex */
static DEFINE_IDR(cgroup_hierarchy_idr);
/*
* Assign a monotonically increasing serial number to csses. It guarantees
* cgroups with bigger numbers are newer than those with smaller numbers.
* Also, as csses are always appended to the parent's ->children list, it
* guarantees that sibling csses are always sorted in the ascending serial
* number order on the list. Protected by cgroup_mutex.
*/
static u64 css_serial_nr_next = 1;
/* This flag indicates whether tasks in the fork and exit paths should
* check for fork/exit handlers to call. This avoids us having to do
* extra work in the fork/exit path if none of the subsystems need to
* be called.
*/
static int need_forkexit_callback __read_mostly;
static struct cftype cgroup_dfl_base_files[];
static struct cftype cgroup_legacy_base_files[];
static void cgroup_put(struct cgroup *cgrp);
static int rebind_subsystems(struct cgroup_root *dst_root,
unsigned int ss_mask);
static int cgroup_destroy_locked(struct cgroup *cgrp);
static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss,
bool visible);
static void css_release(struct percpu_ref *ref);
static void kill_css(struct cgroup_subsys_state *css);
static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[],
bool is_add);
static void cgroup_pidlist_destroy_all(struct cgroup *cgrp);
/* IDR wrappers which synchronize using cgroup_idr_lock */
static int cgroup_idr_alloc(struct idr *idr, void *ptr, int start, int end,
gfp_t gfp_mask)
{
int ret;
idr_preload(gfp_mask);
spin_lock_bh(&cgroup_idr_lock);
ret = idr_alloc(idr, ptr, start, end, gfp_mask);
spin_unlock_bh(&cgroup_idr_lock);
idr_preload_end();
return ret;
}
static void *cgroup_idr_replace(struct idr *idr, void *ptr, int id)
{
void *ret;
spin_lock_bh(&cgroup_idr_lock);
ret = idr_replace(idr, ptr, id);
spin_unlock_bh(&cgroup_idr_lock);
return ret;
}
static void cgroup_idr_remove(struct idr *idr, int id)
{
spin_lock_bh(&cgroup_idr_lock);
idr_remove(idr, id);
spin_unlock_bh(&cgroup_idr_lock);
}
static struct cgroup *cgroup_parent(struct cgroup *cgrp)
{
struct cgroup_subsys_state *parent_css = cgrp->self.parent;
if (parent_css)
return container_of(parent_css, struct cgroup, self);
return NULL;
}
/**
* cgroup_css - obtain a cgroup's css for the specified subsystem
* @cgrp: the cgroup of interest
* @ss: the subsystem of interest (%NULL returns @cgrp->self)
*
* Return @cgrp's css (cgroup_subsys_state) associated with @ss. This
* function must be called either under cgroup_mutex or rcu_read_lock() and
* the caller is responsible for pinning the returned css if it wants to
* keep accessing it outside the said locks. This function may return
* %NULL if @cgrp doesn't have @subsys_id enabled.
*/
static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
struct cgroup_subsys *ss)
{
if (ss)
return rcu_dereference_check(cgrp->subsys[ss->id],
lockdep_is_held(&cgroup_mutex));
else
return &cgrp->self;
}
/**
* cgroup_e_css - obtain a cgroup's effective css for the specified subsystem
* @cgrp: the cgroup of interest
* @ss: the subsystem of interest (%NULL returns @cgrp->self)
*
* Similar to cgroup_css() but returns the effctive css, which is defined
* as the matching css of the nearest ancestor including self which has @ss
* enabled. If @ss is associated with the hierarchy @cgrp is on, this
* function is guaranteed to return non-NULL css.
*/
static struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp,
struct cgroup_subsys *ss)
{
lockdep_assert_held(&cgroup_mutex);
if (!ss)
return &cgrp->self;
if (!(cgrp->root->subsys_mask & (1 << ss->id)))
return NULL;
while (cgroup_parent(cgrp) &&
!(cgroup_parent(cgrp)->child_subsys_mask & (1 << ss->id)))
cgrp = cgroup_parent(cgrp);
return cgroup_css(cgrp, ss);
}
/* convenient tests for these bits */
static inline bool cgroup_is_dead(const struct cgroup *cgrp)
{
return !(cgrp->self.flags & CSS_ONLINE);
}
struct cgroup_subsys_state *of_css(struct kernfs_open_file *of)
{
struct cgroup *cgrp = of->kn->parent->priv;
struct cftype *cft = of_cft(of);
/*
* This is open and unprotected implementation of cgroup_css().
* seq_css() is only called from a kernfs file operation which has
* an active reference on the file. Because all the subsystem
* files are drained before a css is disassociated with a cgroup,
* the matching css from the cgroup's subsys table is guaranteed to
* be and stay valid until the enclosing operation is complete.
*/
if (cft->ss)
return rcu_dereference_raw(cgrp->subsys[cft->ss->id]);
else
return &cgrp->self;
}
EXPORT_SYMBOL_GPL(of_css);
/**
* cgroup_is_descendant - test ancestry
* @cgrp: the cgroup to be tested
* @ancestor: possible ancestor of @cgrp
*
* Test whether @cgrp is a descendant of @ancestor. It also returns %true
* if @cgrp == @ancestor. This function is safe to call as long as @cgrp
* and @ancestor are accessible.
*/
bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor)
{
while (cgrp) {
if (cgrp == ancestor)
return true;
cgrp = cgroup_parent(cgrp);
}
return false;
}
static int cgroup_is_releasable(const struct cgroup *cgrp)
{
const int bits =
(1 << CGRP_RELEASABLE) |
(1 << CGRP_NOTIFY_ON_RELEASE);
return (cgrp->flags & bits) == bits;
}
static int notify_on_release(const struct cgroup *cgrp)
{
return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
}
/**
* for_each_css - iterate all css's of a cgroup
* @css: the iteration cursor
* @ssid: the index of the subsystem, CGROUP_SUBSYS_COUNT after reaching the end
* @cgrp: the target cgroup to iterate css's of
*
* Should be called under cgroup_[tree_]mutex.
*/
#define for_each_css(css, ssid, cgrp) \
for ((ssid) = 0; (ssid) < CGROUP_SUBSYS_COUNT; (ssid)++) \
if (!((css) = rcu_dereference_check( \
(cgrp)->subsys[(ssid)], \
lockdep_is_held(&cgroup_mutex)))) { } \
else
/**
* for_each_e_css - iterate all effective css's of a cgroup
* @css: the iteration cursor
* @ssid: the index of the subsystem, CGROUP_SUBSYS_COUNT after reaching the end
* @cgrp: the target cgroup to iterate css's of
*
* Should be called under cgroup_[tree_]mutex.
*/
#define for_each_e_css(css, ssid, cgrp) \
for ((ssid) = 0; (ssid) < CGROUP_SUBSYS_COUNT; (ssid)++) \
if (!((css) = cgroup_e_css(cgrp, cgroup_subsys[(ssid)]))) \
; \
else
/**
* for_each_subsys - iterate all enabled cgroup subsystems
* @ss: the iteration cursor
* @ssid: the index of @ss, CGROUP_SUBSYS_COUNT after reaching the end
*/
#define for_each_subsys(ss, ssid) \
for ((ssid) = 0; (ssid) < CGROUP_SUBSYS_COUNT && \
(((ss) = cgroup_subsys[ssid]) || true); (ssid)++)
/* iterate across the hierarchies */
#define for_each_root(root) \
list_for_each_entry((root), &cgroup_roots, root_list)
/* iterate over child cgrps, lock should be held throughout iteration */
#define cgroup_for_each_live_child(child, cgrp) \
list_for_each_entry((child), &(cgrp)->self.children, self.sibling) \
if (({ lockdep_assert_held(&cgroup_mutex); \
cgroup_is_dead(child); })) \
; \
else
/* the list of cgroups eligible for automatic release. Protected by
* release_list_lock */
static LIST_HEAD(release_list);
static DEFINE_RAW_SPINLOCK(release_list_lock);
static void cgroup_release_agent(struct work_struct *work);
static DECLARE_WORK(release_agent_work, cgroup_release_agent);
static void check_for_release(struct cgroup *cgrp);
/*
* A cgroup can be associated with multiple css_sets as different tasks may
* belong to different cgroups on different hierarchies. In the other
* direction, a css_set is naturally associated with multiple cgroups.
* This M:N relationship is represented by the following link structure
* which exists for each association and allows traversing the associations
* from both sides.
*/
struct cgrp_cset_link {
/* the cgroup and css_set this link associates */
struct cgroup *cgrp;
struct css_set *cset;
/* list of cgrp_cset_links anchored at cgrp->cset_links */
struct list_head cset_link;
/* list of cgrp_cset_links anchored at css_set->cgrp_links */
struct list_head cgrp_link;
};
/*
* The default css_set - used by init and its children prior to any
* hierarchies being mounted. It contains a pointer to the root state
* for each subsystem. Also used to anchor the list of css_sets. Not
* reference-counted, to improve performance when child cgroups
* haven't been created.
*/
struct css_set init_css_set = {
.refcount = ATOMIC_INIT(1),
.cgrp_links = LIST_HEAD_INIT(init_css_set.cgrp_links),
.tasks = LIST_HEAD_INIT(init_css_set.tasks),
.mg_tasks = LIST_HEAD_INIT(init_css_set.mg_tasks),
.mg_preload_node = LIST_HEAD_INIT(init_css_set.mg_preload_node),
.mg_node = LIST_HEAD_INIT(init_css_set.mg_node),
};
static int css_set_count = 1; /* 1 for init_css_set */
/**
* cgroup_update_populated - updated populated count of a cgroup
* @cgrp: the target cgroup
* @populated: inc or dec populated count
*
* @cgrp is either getting the first task (css_set) or losing the last.
* Update @cgrp->populated_cnt accordingly. The count is propagated
* towards root so that a given cgroup's populated_cnt is zero iff the
* cgroup and all its descendants are empty.
*
* @cgrp's interface file "cgroup.populated" is zero if
* @cgrp->populated_cnt is zero and 1 otherwise. When @cgrp->populated_cnt
* changes from or to zero, userland is notified that the content of the
* interface file has changed. This can be used to detect when @cgrp and
* its descendants become populated or empty.
*/
static void cgroup_update_populated(struct cgroup *cgrp, bool populated)
{
lockdep_assert_held(&css_set_rwsem);
do {
bool trigger;
if (populated)
trigger = !cgrp->populated_cnt++;
else
trigger = !--cgrp->populated_cnt;
if (!trigger)
break;
if (cgrp->populated_kn)
kernfs_notify(cgrp->populated_kn);
cgrp = cgroup_parent(cgrp);
} while (cgrp);
}
/*
* hash table for cgroup groups. This improves the performance to find
* an existing css_set. This hash doesn't (currently) take into
* account cgroups in empty hierarchies.
*/
#define CSS_SET_HASH_BITS 7
static DEFINE_HASHTABLE(css_set_table, CSS_SET_HASH_BITS);
static unsigned long css_set_hash(struct cgroup_subsys_state *css[])
{
unsigned long key = 0UL;
struct cgroup_subsys *ss;
int i;
for_each_subsys(ss, i)
key += (unsigned long)css[i];
key = (key >> 16) ^ key;
return key;
}
static void put_css_set_locked(struct css_set *cset, bool taskexit)
{
struct cgrp_cset_link *link, *tmp_link;
struct cgroup_subsys *ss;
int ssid;
lockdep_assert_held(&css_set_rwsem);
if (!atomic_dec_and_test(&cset->refcount))
return;
/* This css_set is dead. unlink it and release cgroup refcounts */
for_each_subsys(ss, ssid)
list_del(&cset->e_cset_node[ssid]);
hash_del(&cset->hlist);
css_set_count--;
list_for_each_entry_safe(link, tmp_link, &cset->cgrp_links, cgrp_link) {
struct cgroup *cgrp = link->cgrp;
list_del(&link->cset_link);
list_del(&link->cgrp_link);
/* @cgrp can't go away while we're holding css_set_rwsem */
if (list_empty(&cgrp->cset_links)) {
cgroup_update_populated(cgrp, false);
if (notify_on_release(cgrp)) {
if (taskexit)
set_bit(CGRP_RELEASABLE, &cgrp->flags);
check_for_release(cgrp);
}
}
kfree(link);
}
kfree_rcu(cset, rcu_head);
}
static void put_css_set(struct css_set *cset, bool taskexit)
{
/*
* Ensure that the refcount doesn't hit zero while any readers
* can see it. Similar to atomic_dec_and_lock(), but for an
* rwlock
*/
if (atomic_add_unless(&cset->refcount, -1, 1))
return;
down_write(&css_set_rwsem);
put_css_set_locked(cset, taskexit);
up_write(&css_set_rwsem);
}
/*
* refcounted get/put for css_set objects
*/
static inline void get_css_set(struct css_set *cset)
{
atomic_inc(&cset->refcount);
}
/**
* compare_css_sets - helper function for find_existing_css_set().
* @cset: candidate css_set being tested
* @old_cset: existing css_set for a task
* @new_cgrp: cgroup that's being entered by the task
* @template: desired set of css pointers in css_set (pre-calculated)
*
* Returns true if "cset" matches "old_cset" except for the hierarchy
* which "new_cgrp" belongs to, for which it should match "new_cgrp".
*/
static bool compare_css_sets(struct css_set *cset,
struct css_set *old_cset,
struct cgroup *new_cgrp,
struct cgroup_subsys_state *template[])
{
struct list_head *l1, *l2;
/*
* On the default hierarchy, there can be csets which are
* associated with the same set of cgroups but different csses.
* Let's first ensure that csses match.
*/
if (memcmp(template, cset->subsys, sizeof(cset->subsys)))
return false;
/*
* Compare cgroup pointers in order to distinguish between
* different cgroups in hierarchies. As different cgroups may
* share the same effective css, this comparison is always
* necessary.
*/
l1 = &cset->cgrp_links;
l2 = &old_cset->cgrp_links;
while (1) {
struct cgrp_cset_link *link1, *link2;
struct cgroup *cgrp1, *cgrp2;
l1 = l1->next;
l2 = l2->next;
/* See if we reached the end - both lists are equal length. */
if (l1 == &cset->cgrp_links) {
BUG_ON(l2 != &old_cset->cgrp_links);
break;
} else {
BUG_ON(l2 == &old_cset->cgrp_links);
}
/* Locate the cgroups associated with these links. */
link1 = list_entry(l1, struct cgrp_cset_link, cgrp_link);
link2 = list_entry(l2, struct cgrp_cset_link, cgrp_link);
cgrp1 = link1->cgrp;
cgrp2 = link2->cgrp;
/* Hierarchies should be linked in the same order. */
BUG_ON(cgrp1->root != cgrp2->root);
/*
* If this hierarchy is the hierarchy of the cgroup
* that's changing, then we need to check that this
* css_set points to the new cgroup; if it's any other
* hierarchy, then this css_set should point to the
* same cgroup as the old css_set.
*/
if (cgrp1->root == new_cgrp->root) {
if (cgrp1 != new_cgrp)
return false;
} else {
if (cgrp1 != cgrp2)
return false;
}
}
return true;
}
/**
* find_existing_css_set - init css array and find the matching css_set
* @old_cset: the css_set that we're using before the cgroup transition
* @cgrp: the cgroup that we're moving into
* @template: out param for the new set of csses, should be clear on entry
*/
static struct css_set *find_existing_css_set(struct css_set *old_cset,
struct cgroup *cgrp,
struct cgroup_subsys_state *template[])
{
struct cgroup_root *root = cgrp->root;
struct cgroup_subsys *ss;
struct css_set *cset;
unsigned long key;
int i;
/*
* Build the set of subsystem state objects that we want to see in the
* new css_set. while subsystems can change globally, the entries here
* won't change, so no need for locking.
*/
for_each_subsys(ss, i) {
if (root->subsys_mask & (1UL << i)) {
/*
* @ss is in this hierarchy, so we want the
* effective css from @cgrp.
*/
template[i] = cgroup_e_css(cgrp, ss);
} else {
/*
* @ss is not in this hierarchy, so we don't want
* to change the css.
*/
template[i] = old_cset->subsys[i];
}
}
key = css_set_hash(template);
hash_for_each_possible(css_set_table, cset, hlist, key) {
if (!compare_css_sets(cset, old_cset, cgrp, template))
continue;
/* This css_set matches what we need */
return cset;
}
/* No existing cgroup group matched */
return NULL;
}
static void free_cgrp_cset_links(struct list_head *links_to_free)
{
struct cgrp_cset_link *link, *tmp_link;
list_for_each_entry_safe(link, tmp_link, links_to_free, cset_link) {
list_del(&link->cset_link);
kfree(link);
}
}
/**
* allocate_cgrp_cset_links - allocate cgrp_cset_links
* @count: the number of links to allocate
* @tmp_links: list_head the allocated links are put on
*
* Allocate @count cgrp_cset_link structures and chain them on @tmp_links
* through ->cset_link. Returns 0 on success or -errno.
*/
static int allocate_cgrp_cset_links(int count, struct list_head *tmp_links)
{
struct cgrp_cset_link *link;
int i;
INIT_LIST_HEAD(tmp_links);
for (i = 0; i < count; i++) {
link = kzalloc(sizeof(*link), GFP_KERNEL);
if (!link) {
free_cgrp_cset_links(tmp_links);
return -ENOMEM;
}
list_add(&link->cset_link, tmp_links);
}
return 0;
}
/**
* link_css_set - a helper function to link a css_set to a cgroup
* @tmp_links: cgrp_cset_link objects allocated by allocate_cgrp_cset_links()
* @cset: the css_set to be linked
* @cgrp: the destination cgroup
*/
static void link_css_set(struct list_head *tmp_links, struct css_set *cset,
struct cgroup *cgrp)
{
struct cgrp_cset_link *link;
BUG_ON(list_empty(tmp_links));
if (cgroup_on_dfl(cgrp))
cset->dfl_cgrp = cgrp;
link = list_first_entry(tmp_links, struct cgrp_cset_link, cset_link);
link->cset = cset;
link->cgrp = cgrp;
if (list_empty(&cgrp->cset_links))
cgroup_update_populated(cgrp, true);
list_move(&link->cset_link, &cgrp->cset_links);
/*
* Always add links to the tail of the list so that the list
* is sorted by order of hierarchy creation
*/
list_add_tail(&link->cgrp_link, &cset->cgrp_links);
}
/**
* find_css_set - return a new css_set with one cgroup updated
* @old_cset: the baseline css_set
* @cgrp: the cgroup to be updated
*
* Return a new css_set that's equivalent to @old_cset, but with @cgrp
* substituted into the appropriate hierarchy.
*/
static struct css_set *find_css_set(struct css_set *old_cset,
struct cgroup *cgrp)
{
struct cgroup_subsys_state *template[CGROUP_SUBSYS_COUNT] = { };
struct css_set *cset;
struct list_head tmp_links;
struct cgrp_cset_link *link;
struct cgroup_subsys *ss;
unsigned long key;
int ssid;
lockdep_assert_held(&cgroup_mutex);
/* First see if we already have a cgroup group that matches
* the desired set */
down_read(&css_set_rwsem);
cset = find_existing_css_set(old_cset, cgrp, template);
if (cset)
get_css_set(cset);
up_read(&css_set_rwsem);
if (cset)
return cset;
cset = kzalloc(sizeof(*cset), GFP_KERNEL);
if (!cset)
return NULL;
/* Allocate all the cgrp_cset_link objects that we'll need */
if (allocate_cgrp_cset_links(cgroup_root_count, &tmp_links) < 0) {
kfree(cset);
return NULL;
}
atomic_set(&cset->refcount, 1);
INIT_LIST_HEAD(&cset->cgrp_links);
INIT_LIST_HEAD(&cset->tasks);
INIT_LIST_HEAD(&cset->mg_tasks);
INIT_LIST_HEAD(&cset->mg_preload_node);
INIT_LIST_HEAD(&cset->mg_node);
INIT_HLIST_NODE(&cset->hlist);
/* Copy the set of subsystem state objects generated in
* find_existing_css_set() */
memcpy(cset->subsys, template, sizeof(cset->subsys));
down_write(&css_set_rwsem);
/* Add reference counts and links from the new css_set. */
list_for_each_entry(link, &old_cset->cgrp_links, cgrp_link) {
struct cgroup *c = link->cgrp;
if (c->root == cgrp->root)
c = cgrp;
link_css_set(&tmp_links, cset, c);
}
BUG_ON(!list_empty(&tmp_links));
css_set_count++;
/* Add @cset to the hash table */
key = css_set_hash(cset->subsys);
hash_add(css_set_table, &cset->hlist, key);
for_each_subsys(ss, ssid)
list_add_tail(&cset->e_cset_node[ssid],
&cset->subsys[ssid]->cgroup->e_csets[ssid]);
up_write(&css_set_rwsem);
return cset;
}
static struct cgroup_root *cgroup_root_from_kf(struct kernfs_root *kf_root)
{
struct cgroup *root_cgrp = kf_root->kn->priv;
return root_cgrp->root;
}
static int cgroup_init_root_id(struct cgroup_root *root)
{
int id;
lockdep_assert_held(&cgroup_mutex);
id = idr_alloc_cyclic(&cgroup_hierarchy_idr, root, 0, 0, GFP_KERNEL);
if (id < 0)
return id;
root->hierarchy_id = id;
return 0;
}
static void cgroup_exit_root_id(struct cgroup_root *root)
{
lockdep_assert_held(&cgroup_mutex);
if (root->hierarchy_id) {
idr_remove(&cgroup_hierarchy_idr, root->hierarchy_id);
root->hierarchy_id = 0;
}
}
static void cgroup_free_root(struct cgroup_root *root)
{
if (root) {
/* hierarhcy ID shoulid already have been released */
WARN_ON_ONCE(root->hierarchy_id);
idr_destroy(&root->cgroup_idr);
kfree(root);
}
}
static void cgroup_destroy_root(struct cgroup_root *root)
{
struct cgroup *cgrp = &root->cgrp;
struct cgrp_cset_link *link, *tmp_link;
mutex_lock(&cgroup_mutex);
BUG_ON(atomic_read(&root->nr_cgrps));
BUG_ON(!list_empty(&cgrp->self.children));
/* Rebind all subsystems back to the default hierarchy */
rebind_subsystems(&cgrp_dfl_root, root->subsys_mask);
/*
* Release all the links from cset_links to this hierarchy's
* root cgroup
*/
down_write(&css_set_rwsem);
list_for_each_entry_safe(link, tmp_link, &cgrp->cset_links, cset_link) {
list_del(&link->cset_link);
list_del(&link->cgrp_link);
kfree(link);
}
up_write(&css_set_rwsem);
if (!list_empty(&root->root_list)) {
list_del(&root->root_list);
cgroup_root_count--;
}
cgroup_exit_root_id(root);
mutex_unlock(&cgroup_mutex);
kernfs_destroy_root(root->kf_root);
cgroup_free_root(root);
}
/* look up cgroup associated with given css_set on the specified hierarchy */
static struct cgroup *cset_cgroup_from_root(struct css_set *cset,
struct cgroup_root *root)
{
struct cgroup *res = NULL;
lockdep_assert_held(&cgroup_mutex);
lockdep_assert_held(&css_set_rwsem);
if (cset == &init_css_set) {
res = &root->cgrp;
} else {
struct cgrp_cset_link *link;
list_for_each_entry(link, &cset->cgrp_links, cgrp_link) {
struct cgroup *c = link->cgrp;
if (c->root == root) {
res = c;
break;
}
}
}
BUG_ON(!res);
return res;
}
/*
* Return the cgroup for "task" from the given hierarchy. Must be
* called with cgroup_mutex and css_set_rwsem held.
*/
static struct cgroup *task_cgroup_from_root(struct task_struct *task,
struct cgroup_root *root)
{
/*
* No need to lock the task - since we hold cgroup_mutex the
* task can't change groups, so the only thing that can happen
* is that it exits and its css is set back to init_css_set.
*/
return cset_cgroup_from_root(task_css_set(task), root);
}
/*
* A task must hold cgroup_mutex to modify cgroups.
*
* Any task can increment and decrement the count field without lock.
* So in general, code holding cgroup_mutex can't rely on the count
* field not changing. However, if the count goes to zero, then only
* cgroup_attach_task() can increment it again. Because a count of zero
* means that no tasks are currently attached, therefore there is no
* way a task attached to that cgroup can fork (the other way to
* increment the count). So code holding cgroup_mutex can safely
* assume that if the count is zero, it will stay zero. Similarly, if
* a task holds cgroup_mutex on a cgroup with zero count, it
* knows that the cgroup won't be removed, as cgroup_rmdir()
* needs that mutex.
*
* The fork and exit callbacks cgroup_fork() and cgroup_exit(), don't
* (usually) take cgroup_mutex. These are the two most performance
* critical pieces of code here. The exception occurs on cgroup_exit(),
* when a task in a notify_on_release cgroup exits. Then cgroup_mutex
* is taken, and if the cgroup count is zero, a usermode call made
* to the release agent with the name of the cgroup (path relative to
* the root of cgroup file system) as the argument.
*
* A cgroup can only be deleted if both its 'count' of using tasks
* is zero, and its list of 'children' cgroups is empty. Since all
* tasks in the system use _some_ cgroup, and since there is always at
* least one task in the system (init, pid == 1), therefore, root cgroup
* always has either children cgroups and/or using tasks. So we don't
* need a special hack to ensure that root cgroup cannot be deleted.
*
* P.S. One more locking exception. RCU is used to guard the
* update of a tasks cgroup pointer by cgroup_attach_task()
*/
static int cgroup_populate_dir(struct cgroup *cgrp, unsigned int subsys_mask);
static struct kernfs_syscall_ops cgroup_kf_syscall_ops;
static const struct file_operations proc_cgroupstats_operations;
static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
char *buf)
{
if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) &&
!(cgrp->root->flags & CGRP_ROOT_NOPREFIX))
snprintf(buf, CGROUP_FILE_NAME_MAX, "%s.%s",
cft->ss->name, cft->name);
else
strncpy(buf, cft->name, CGROUP_FILE_NAME_MAX);
return buf;
}
/**
* cgroup_file_mode - deduce file mode of a control file
* @cft: the control file in question
*
* returns cft->mode if ->mode is not 0
* returns S_IRUGO|S_IWUSR if it has both a read and a write handler
* returns S_IRUGO if it has only a read handler
* returns S_IWUSR if it has only a write hander
*/
static umode_t cgroup_file_mode(const struct cftype *cft)
{
umode_t mode = 0;
if (cft->mode)
return cft->mode;
if (cft->read_u64 || cft->read_s64 || cft->seq_show)
mode |= S_IRUGO;
if (cft->write_u64 || cft->write_s64 || cft->write)
mode |= S_IWUSR;
return mode;
}
static void cgroup_get(struct cgroup *cgrp)
{
WARN_ON_ONCE(cgroup_is_dead(cgrp));
css_get(&cgrp->self);
}
static bool cgroup_tryget(struct cgroup *cgrp)
{
return css_tryget(&cgrp->self);
}
static void cgroup_put(struct cgroup *cgrp)
{
css_put(&cgrp->self);
}
/**
* cgroup_refresh_child_subsys_mask - update child_subsys_mask
* @cgrp: the target cgroup
*
* On the default hierarchy, a subsystem may request other subsystems to be
* enabled together through its ->depends_on mask. In such cases, more
* subsystems than specified in "cgroup.subtree_control" may be enabled.
*
* This function determines which subsystems need to be enabled given the
* current @cgrp->subtree_control and records it in
* @cgrp->child_subsys_mask. The resulting mask is always a superset of
* @cgrp->subtree_control and follows the usual hierarchy rules.
*/
static void cgroup_refresh_child_subsys_mask(struct cgroup *cgrp)
{
struct cgroup *parent = cgroup_parent(cgrp);
unsigned int cur_ss_mask = cgrp->subtree_control;
struct cgroup_subsys *ss;
int ssid;
lockdep_assert_held(&cgroup_mutex);
if (!cgroup_on_dfl(cgrp)) {
cgrp->child_subsys_mask = cur_ss_mask;
return;
}
while (true) {
unsigned int new_ss_mask = cur_ss_mask;
for_each_subsys(ss, ssid)
if (cur_ss_mask & (1 << ssid))
new_ss_mask |= ss->depends_on;
/*
* Mask out subsystems which aren't available. This can
* happen only if some depended-upon subsystems were bound
* to non-default hierarchies.
*/
if (parent)
new_ss_mask &= parent->child_subsys_mask;
else
new_ss_mask &= cgrp->root->subsys_mask;
if (new_ss_mask == cur_ss_mask)
break;
cur_ss_mask = new_ss_mask;
}
cgrp->child_subsys_mask = cur_ss_mask;
}
/**
* cgroup_kn_unlock - unlocking helper for cgroup kernfs methods
* @kn: the kernfs_node being serviced
*
* This helper undoes cgroup_kn_lock_live() and should be invoked before
* the method finishes if locking succeeded. Note that once this function
* returns the cgroup returned by cgroup_kn_lock_live() may become
* inaccessible any time. If the caller intends to continue to access the
* cgroup, it should pin it before invoking this function.
*/
static void cgroup_kn_unlock(struct kernfs_node *kn)
{
struct cgroup *cgrp;
if (kernfs_type(kn) == KERNFS_DIR)
cgrp = kn->priv;
else
cgrp = kn->parent->priv;
mutex_unlock(&cgroup_mutex);
kernfs_unbreak_active_protection(kn);
cgroup_put(cgrp);
}
/**
* cgroup_kn_lock_live - locking helper for cgroup kernfs methods
* @kn: the kernfs_node being serviced
*
* This helper is to be used by a cgroup kernfs method currently servicing
* @kn. It breaks the active protection, performs cgroup locking and
* verifies that the associated cgroup is alive. Returns the cgroup if
* alive; otherwise, %NULL. A successful return should be undone by a
* matching cgroup_kn_unlock() invocation.
*
* Any cgroup kernfs method implementation which requires locking the
* associated cgroup should use this helper. It avoids nesting cgroup
* locking under kernfs active protection and allows all kernfs operations
* including self-removal.
*/
static struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn)
{
struct cgroup *cgrp;
if (kernfs_type(kn) == KERNFS_DIR)
cgrp = kn->priv;
else
cgrp = kn->parent->priv;
/*
* We're gonna grab cgroup_mutex which nests outside kernfs
* active_ref. cgroup liveliness check alone provides enough
* protection against removal. Ensure @cgrp stays accessible and
* break the active_ref protection.
*/
if (!cgroup_tryget(cgrp))
return NULL;
kernfs_break_active_protection(kn);
mutex_lock(&cgroup_mutex);
if (!cgroup_is_dead(cgrp))
return cgrp;
cgroup_kn_unlock(kn);
return NULL;
}
static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft)
{
char name[CGROUP_FILE_NAME_MAX];
lockdep_assert_held(&cgroup_mutex);
kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name));
}
/**
* cgroup_clear_dir - remove subsys files in a cgroup directory
* @cgrp: target cgroup
* @subsys_mask: mask of the subsystem ids whose files should be removed
*/
static void cgroup_clear_dir(struct cgroup *cgrp, unsigned int subsys_mask)
{
struct cgroup_subsys *ss;
int i;
for_each_subsys(ss, i) {
struct cftype *cfts;
if (!(subsys_mask & (1 << i)))
continue;
list_for_each_entry(cfts, &ss->cfts, node)
cgroup_addrm_files(cgrp, cfts, false);
}
}
static int rebind_subsystems(struct cgroup_root *dst_root, unsigned int ss_mask)
{
struct cgroup_subsys *ss;
unsigned int tmp_ss_mask;
int ssid, i, ret;
lockdep_assert_held(&cgroup_mutex);
for_each_subsys(ss, ssid) {
if (!(ss_mask & (1 << ssid)))
continue;
/* if @ss has non-root csses attached to it, can't move */
if (css_next_child(NULL, cgroup_css(&ss->root->cgrp, ss)))
return -EBUSY;
/* can't move between two non-dummy roots either */
if (ss->root != &cgrp_dfl_root && dst_root != &cgrp_dfl_root)
return -EBUSY;
}
/* skip creating root files on dfl_root for inhibited subsystems */
tmp_ss_mask = ss_mask;
if (dst_root == &cgrp_dfl_root)
tmp_ss_mask &= ~cgrp_dfl_root_inhibit_ss_mask;
ret = cgroup_populate_dir(&dst_root->cgrp, tmp_ss_mask);
if (ret) {
if (dst_root != &cgrp_dfl_root)
return ret;
/*
* Rebinding back to the default root is not allowed to
* fail. Using both default and non-default roots should
* be rare. Moving subsystems back and forth even more so.
* Just warn about it and continue.
*/
if (cgrp_dfl_root_visible) {
pr_warn("failed to create files (%d) while rebinding 0x%x to default root\n",
ret, ss_mask);
pr_warn("you may retry by moving them to a different hierarchy and unbinding\n");
}
}
/*
* Nothing can fail from this point on. Remove files for the
* removed subsystems and rebind each subsystem.
*/
for_each_subsys(ss, ssid)
if (ss_mask & (1 << ssid))
cgroup_clear_dir(&ss->root->cgrp, 1 << ssid);
for_each_subsys(ss, ssid) {
struct cgroup_root *src_root;
struct cgroup_subsys_state *css;
struct css_set *cset;
if (!(ss_mask & (1 << ssid)))
continue;
src_root = ss->root;
css = cgroup_css(&src_root->cgrp, ss);
WARN_ON(!css || cgroup_css(&dst_root->cgrp, ss));
RCU_INIT_POINTER(src_root->cgrp.subsys[ssid], NULL);
rcu_assign_pointer(dst_root->cgrp.subsys[ssid], css);
ss->root = dst_root;
css->cgroup = &dst_root->cgrp;
down_write(&css_set_rwsem);
hash_for_each(css_set_table, i, cset, hlist)
list_move_tail(&cset->e_cset_node[ss->id],
&dst_root->cgrp.e_csets[ss->id]);
up_write(&css_set_rwsem);
src_root->subsys_mask &= ~(1 << ssid);
src_root->cgrp.subtree_control &= ~(1 << ssid);
cgroup_refresh_child_subsys_mask(&src_root->cgrp);
/* default hierarchy doesn't enable controllers by default */
dst_root->subsys_mask |= 1 << ssid;
if (dst_root != &cgrp_dfl_root) {
dst_root->cgrp.subtree_control |= 1 << ssid;
cgroup_refresh_child_subsys_mask(&dst_root->cgrp);
}
if (ss->bind)
ss->bind(css);
}
kernfs_activate(dst_root->cgrp.kn);
return 0;
}
static int cgroup_show_options(struct seq_file *seq,
struct kernfs_root *kf_root)
{
struct cgroup_root *root = cgroup_root_from_kf(kf_root);
struct cgroup_subsys *ss;
int ssid;
for_each_subsys(ss, ssid)
if (root->subsys_mask & (1 << ssid))
seq_printf(seq, ",%s", ss->name);
if (root->flags & CGRP_ROOT_NOPREFIX)
seq_puts(seq, ",noprefix");
if (root->flags & CGRP_ROOT_XATTR)
seq_puts(seq, ",xattr");
spin_lock(&release_agent_path_lock);
if (strlen(root->release_agent_path))
seq_printf(seq, ",release_agent=%s", root->release_agent_path);
spin_unlock(&release_agent_path_lock);
if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags))
seq_puts(seq, ",clone_children");
if (strlen(root->name))
seq_printf(seq, ",name=%s", root->name);
return 0;
}
struct cgroup_sb_opts {
unsigned int subsys_mask;
unsigned int flags;
char *release_agent;
bool cpuset_clone_children;
char *name;
/* User explicitly requested empty subsystem */
bool none;
};
static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
{
char *token, *o = data;
bool all_ss = false, one_ss = false;
unsigned int mask = -1U;
struct cgroup_subsys *ss;
int nr_opts = 0;
int i;
#ifdef CONFIG_CPUSETS
mask = ~(1U << cpuset_cgrp_id);
#endif
memset(opts, 0, sizeof(*opts));
while ((token = strsep(&o, ",")) != NULL) {
nr_opts++;
if (!*token)
return -EINVAL;
if (!strcmp(token, "none")) {
/* Explicitly have no subsystems */
opts->none = true;
continue;
}
if (!strcmp(token, "all")) {
/* Mutually exclusive option 'all' + subsystem name */
if (one_ss)
return -EINVAL;
all_ss = true;
continue;
}
if (!strcmp(token, "__DEVEL__sane_behavior")) {
opts->flags |= CGRP_ROOT_SANE_BEHAVIOR;
continue;
}
if (!strcmp(token, "noprefix")) {
opts->flags |= CGRP_ROOT_NOPREFIX;
continue;
}
if (!strcmp(token, "clone_children")) {
opts->cpuset_clone_children = true;
continue;
}
if (!strcmp(token, "xattr")) {
opts->flags |= CGRP_ROOT_XATTR;
continue;
}
if (!strncmp(token, "release_agent=", 14)) {
/* Specifying two release agents is forbidden */
if (opts->release_agent)
return -EINVAL;
opts->release_agent =
kstrndup(token + 14, PATH_MAX - 1, GFP_KERNEL);
if (!opts->release_agent)
return -ENOMEM;
continue;
}
if (!strncmp(token, "name=", 5)) {
const char *name = token + 5;
/* Can't specify an empty name */
if (!strlen(name))
return -EINVAL;
/* Must match [\w.-]+ */
for (i = 0; i < strlen(name); i++) {
char c = name[i];
if (isalnum(c))
continue;
if ((c == '.') || (c == '-') || (c == '_'))
continue;
return -EINVAL;
}
/* Specifying two names is forbidden */
if (opts->name)
return -EINVAL;
opts->name = kstrndup(name,
MAX_CGROUP_ROOT_NAMELEN - 1,
GFP_KERNEL);
if (!opts->name)
return -ENOMEM;
continue;
}
for_each_subsys(ss, i) {
if (strcmp(token, ss->name))
continue;
if (ss->disabled)
continue;
/* Mutually exclusive option 'all' + subsystem name */
if (all_ss)
return -EINVAL;
opts->subsys_mask |= (1 << i);
one_ss = true;
break;
}
if (i == CGROUP_SUBSYS_COUNT)
return -ENOENT;
}
if (opts->flags & CGRP_ROOT_SANE_BEHAVIOR) {
pr_warn("sane_behavior: this is still under development and its behaviors will change, proceed at your own risk\n");
if (nr_opts != 1) {
pr_err("sane_behavior: no other mount options allowed\n");
return -EINVAL;
}
return 0;
}
/*
* If the 'all' option was specified select all the subsystems,
* otherwise if 'none', 'name=' and a subsystem name options were
* not specified, let's default to 'all'
*/
if (all_ss || (!one_ss && !opts->none && !opts->name))
for_each_subsys(ss, i)
if (!ss->disabled)
opts->subsys_mask |= (1 << i);
/*
* We either have to specify by name or by subsystems. (So all
* empty hierarchies must have a name).
*/
if (!opts->subsys_mask && !opts->name)
return -EINVAL;
/*
* Option noprefix was introduced just for backward compatibility
* with the old cpuset, so we allow noprefix only if mounting just
* the cpuset subsystem.
*/
if ((opts->flags & CGRP_ROOT_NOPREFIX) && (opts->subsys_mask & mask))
return -EINVAL;
/* Can't specify "none" and some subsystems */
if (opts->subsys_mask && opts->none)
return -EINVAL;
return 0;
}
static int cgroup_remount(struct kernfs_root *kf_root, int *flags, char *data)
{
int ret = 0;
struct cgroup_root *root = cgroup_root_from_kf(kf_root);
struct cgroup_sb_opts opts;
unsigned int added_mask, removed_mask;
if (root == &cgrp_dfl_root) {
pr_err("remount is not allowed\n");
return -EINVAL;
}
mutex_lock(&cgroup_mutex);
/* See what subsystems are wanted */
ret = parse_cgroupfs_options(data, &opts);
if (ret)
goto out_unlock;
if (opts.subsys_mask != root->subsys_mask || opts.release_agent)
pr_warn("option changes via remount are deprecated (pid=%d comm=%s)\n",
task_tgid_nr(current), current->comm);
added_mask = opts.subsys_mask & ~root->subsys_mask;
removed_mask = root->subsys_mask & ~opts.subsys_mask;
/* Don't allow flags or name to change at remount */
if ((opts.flags ^ root->flags) ||
(opts.name && strcmp(opts.name, root->name))) {
pr_err("option or name mismatch, new: 0x%x \"%s\", old: 0x%x \"%s\"\n",
opts.flags, opts.name ?: "", root->flags, root->name);
ret = -EINVAL;
goto out_unlock;
}
/* remounting is not allowed for populated hierarchies */
if (!list_empty(&root->cgrp.self.children)) {
ret = -EBUSY;
goto out_unlock;
}
ret = rebind_subsystems(root, added_mask);
if (ret)
goto out_unlock;
rebind_subsystems(&cgrp_dfl_root, removed_mask);
if (opts.release_agent) {
spin_lock(&release_agent_path_lock);
strcpy(root->release_agent_path, opts.release_agent);
spin_unlock(&release_agent_path_lock);
}
out_unlock:
kfree(opts.release_agent);
kfree(opts.name);
mutex_unlock(&cgroup_mutex);
return ret;
}
/*
* To reduce the fork() overhead for systems that are not actually using
* their cgroups capability, we don't maintain the lists running through
* each css_set to its tasks until we see the list actually used - in other
* words after the first mount.
*/
static bool use_task_css_set_links __read_mostly;
static void cgroup_enable_task_cg_lists(void)
{
struct task_struct *p, *g;
down_write(&css_set_rwsem);
if (use_task_css_set_links)
goto out_unlock;
use_task_css_set_links = true;
/*
* We need tasklist_lock because RCU is not safe against
* while_each_thread(). Besides, a forking task that has passed
* cgroup_post_fork() without seeing use_task_css_set_links = 1
* is not guaranteed to have its child immediately visible in the
* tasklist if we walk through it with RCU.
*/
read_lock(&tasklist_lock);
do_each_thread(g, p) {
WARN_ON_ONCE(!list_empty(&p->cg_list) ||
task_css_set(p) != &init_css_set);
/*
* We should check if the process is exiting, otherwise
* it will race with cgroup_exit() in that the list
* entry won't be deleted though the process has exited.
* Do it while holding siglock so that we don't end up
* racing against cgroup_exit().
*/
spin_lock_irq(&p->sighand->siglock);
if (!(p->flags & PF_EXITING)) {
struct css_set *cset = task_css_set(p);
list_add(&p->cg_list, &cset->tasks);
get_css_set(cset);
}
spin_unlock_irq(&p->sighand->siglock);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
out_unlock:
up_write(&css_set_rwsem);
}
static void init_cgroup_housekeeping(struct cgroup *cgrp)
{
struct cgroup_subsys *ss;
int ssid;
INIT_LIST_HEAD(&cgrp->self.sibling);
INIT_LIST_HEAD(&cgrp->self.children);
INIT_LIST_HEAD(&cgrp->cset_links);
INIT_LIST_HEAD(&cgrp->release_list);
INIT_LIST_HEAD(&cgrp->pidlists);
mutex_init(&cgrp->pidlist_mutex);
cgrp->self.cgroup = cgrp;
cgrp->self.flags |= CSS_ONLINE;
for_each_subsys(ss, ssid)
INIT_LIST_HEAD(&cgrp->e_csets[ssid]);
init_waitqueue_head(&cgrp->offline_waitq);
}
static void init_cgroup_root(struct cgroup_root *root,
struct cgroup_sb_opts *opts)
{
struct cgroup *cgrp = &root->cgrp;
INIT_LIST_HEAD(&root->root_list);
atomic_set(&root->nr_cgrps, 1);
cgrp->root = root;
init_cgroup_housekeeping(cgrp);
idr_init(&root->cgroup_idr);
root->flags = opts->flags;
if (opts->release_agent)
strcpy(root->release_agent_path, opts->release_agent);
if (opts->name)
strcpy(root->name, opts->name);
if (opts->cpuset_clone_children)
set_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags);
}
static int cgroup_setup_root(struct cgroup_root *root, unsigned int ss_mask)
{
LIST_HEAD(tmp_links);
struct cgroup *root_cgrp = &root->cgrp;
struct cftype *base_files;
struct css_set *cset;
int i, ret;
lockdep_assert_held(&cgroup_mutex);
ret = cgroup_idr_alloc(&root->cgroup_idr, root_cgrp, 1, 2, GFP_NOWAIT);
if (ret < 0)
goto out;
root_cgrp->id = ret;
ret = percpu_ref_init(&root_cgrp->self.refcnt, css_release);
if (ret)
goto out;
/*
* We're accessing css_set_count without locking css_set_rwsem here,
* but that's OK - it can only be increased by someone holding
* cgroup_lock, and that's us. The worst that can happen is that we
* have some link structures left over
*/
ret = allocate_cgrp_cset_links(css_set_count, &tmp_links);
if (ret)
goto cancel_ref;
ret = cgroup_init_root_id(root);
if (ret)
goto cancel_ref;
root->kf_root = kernfs_create_root(&cgroup_kf_syscall_ops,
KERNFS_ROOT_CREATE_DEACTIVATED,
root_cgrp);
if (IS_ERR(root->kf_root)) {
ret = PTR_ERR(root->kf_root);
goto exit_root_id;
}
root_cgrp->kn = root->kf_root->kn;
if (root == &cgrp_dfl_root)
base_files = cgroup_dfl_base_files;
else
base_files = cgroup_legacy_base_files;
ret = cgroup_addrm_files(root_cgrp, base_files, true);
if (ret)
goto destroy_root;
ret = rebind_subsystems(root, ss_mask);
if (ret)
goto destroy_root;
/*
* There must be no failure case after here, since rebinding takes
* care of subsystems' refcounts, which are explicitly dropped in
* the failure exit path.
*/
list_add(&root->root_list, &cgroup_roots);
cgroup_root_count++;
/*
* Link the root cgroup in this hierarchy into all the css_set
* objects.
*/
down_write(&css_set_rwsem);
hash_for_each(css_set_table, i, cset, hlist)
link_css_set(&tmp_links, cset, root_cgrp);
up_write(&css_set_rwsem);
BUG_ON(!list_empty(&root_cgrp->self.children));
BUG_ON(atomic_read(&root->nr_cgrps) != 1);
kernfs_activate(root_cgrp->kn);
ret = 0;
goto out;
destroy_root:
kernfs_destroy_root(root->kf_root);
root->kf_root = NULL;
exit_root_id:
cgroup_exit_root_id(root);
cancel_ref:
percpu_ref_exit(&root_cgrp->self.refcnt);
out:
free_cgrp_cset_links(&tmp_links);
return ret;
}
static struct dentry *cgroup_mount(struct file_system_type *fs_type,
int flags, const char *unused_dev_name,
void *data)
{
struct super_block *pinned_sb = NULL;
struct cgroup_subsys *ss;
struct cgroup_root *root;
struct cgroup_sb_opts opts;
struct dentry *dentry;
int ret;
int i;
bool new_sb;
/*
* The first time anyone tries to mount a cgroup, enable the list
* linking each css_set to its tasks and fix up all existing tasks.
*/
if (!use_task_css_set_links)
cgroup_enable_task_cg_lists();
mutex_lock(&cgroup_mutex);
/* First find the desired set of subsystems */
ret = parse_cgroupfs_options(data, &opts);
if (ret)
goto out_unlock;
/* look for a matching existing root */
if (opts.flags & CGRP_ROOT_SANE_BEHAVIOR) {
cgrp_dfl_root_visible = true;
root = &cgrp_dfl_root;
cgroup_get(&root->cgrp);
ret = 0;
goto out_unlock;
}
/*
* Destruction of cgroup root is asynchronous, so subsystems may
* still be dying after the previous unmount. Let's drain the
* dying subsystems. We just need to ensure that the ones
* unmounted previously finish dying and don't care about new ones
* starting. Testing ref liveliness is good enough.
*/
for_each_subsys(ss, i) {
if (!(opts.subsys_mask & (1 << i)) ||
ss->root == &cgrp_dfl_root)
continue;
if (!percpu_ref_tryget_live(&ss->root->cgrp.self.refcnt)) {
mutex_unlock(&cgroup_mutex);
msleep(10);
ret = restart_syscall();
goto out_free;
}
cgroup_put(&ss->root->cgrp);
}
for_each_root(root) {
bool name_match = false;
if (root == &cgrp_dfl_root)
continue;
/*
* If we asked for a name then it must match. Also, if
* name matches but sybsys_mask doesn't, we should fail.
* Remember whether name matched.
*/
if (opts.name) {
if (strcmp(opts.name, root->name))
continue;
name_match = true;
}
/*
* If we asked for subsystems (or explicitly for no
* subsystems) then they must match.
*/
if ((opts.subsys_mask || opts.none) &&
(opts.subsys_mask != root->subsys_mask)) {
if (!name_match)
continue;
ret = -EBUSY;
goto out_unlock;
}
if (root->flags ^ opts.flags)
pr_warn("new mount options do not match the existing superblock, will be ignored\n");
/*
* We want to reuse @root whose lifetime is governed by its
* ->cgrp. Let's check whether @root is alive and keep it
* that way. As cgroup_kill_sb() can happen anytime, we
* want to block it by pinning the sb so that @root doesn't
* get killed before mount is complete.
*
* With the sb pinned, tryget_live can reliably indicate
* whether @root can be reused. If it's being killed,
* drain it. We can use wait_queue for the wait but this
* path is super cold. Let's just sleep a bit and retry.
*/
pinned_sb = kernfs_pin_sb(root->kf_root, NULL);
if (IS_ERR(pinned_sb) ||
!percpu_ref_tryget_live(&root->cgrp.self.refcnt)) {
mutex_unlock(&cgroup_mutex);
if (!IS_ERR_OR_NULL(pinned_sb))
deactivate_super(pinned_sb);
msleep(10);
ret = restart_syscall();
goto out_free;
}
ret = 0;
goto out_unlock;
}
/*
* No such thing, create a new one. name= matching without subsys
* specification is allowed for already existing hierarchies but we
* can't create new one without subsys specification.
*/
if (!opts.subsys_mask && !opts.none) {
ret = -EINVAL;
goto out_unlock;
}
root = kzalloc(sizeof(*root), GFP_KERNEL);
if (!root) {
ret = -ENOMEM;
goto out_unlock;
}
init_cgroup_root(root, &opts);
ret = cgroup_setup_root(root, opts.subsys_mask);
if (ret)
cgroup_free_root(root);
out_unlock:
mutex_unlock(&cgroup_mutex);
out_free:
kfree(opts.release_agent);
kfree(opts.name);
if (ret)
return ERR_PTR(ret);
dentry = kernfs_mount(fs_type, flags, root->kf_root,
CGROUP_SUPER_MAGIC, &new_sb);
if (IS_ERR(dentry) || !new_sb)
cgroup_put(&root->cgrp);
/*
* If @pinned_sb, we're reusing an existing root and holding an
* extra ref on its sb. Mount is complete. Put the extra ref.
*/
if (pinned_sb) {
WARN_ON(new_sb);
deactivate_super(pinned_sb);
}
return dentry;
}
static void cgroup_kill_sb(struct super_block *sb)
{
struct kernfs_root *kf_root = kernfs_root_from_sb(sb);
struct cgroup_root *root = cgroup_root_from_kf(kf_root);
/*
* If @root doesn't have any mounts or children, start killing it.
* This prevents new mounts by disabling percpu_ref_tryget_live().
* cgroup_mount() may wait for @root's release.
*
* And don't kill the default root.
*/
if (css_has_online_children(&root->cgrp.self) ||
root == &cgrp_dfl_root)
cgroup_put(&root->cgrp);
else
percpu_ref_kill(&root->cgrp.self.refcnt);
kernfs_kill_sb(sb);
}
static struct file_system_type cgroup_fs_type = {
.name = "cgroup",
.mount = cgroup_mount,
.kill_sb = cgroup_kill_sb,
};
static struct kobject *cgroup_kobj;
/**
* task_cgroup_path - cgroup path of a task in the first cgroup hierarchy
* @task: target task
* @buf: the buffer to write the path into
* @buflen: the length of the buffer
*
* Determine @task's cgroup on the first (the one with the lowest non-zero
* hierarchy_id) cgroup hierarchy and copy its path into @buf. This
* function grabs cgroup_mutex and shouldn't be used inside locks used by
* cgroup controller callbacks.
*
* Return value is the same as kernfs_path().
*/
char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen)
{
struct cgroup_root *root;
struct cgroup *cgrp;
int hierarchy_id = 1;
char *path = NULL;
mutex_lock(&cgroup_mutex);
down_read(&css_set_rwsem);
root = idr_get_next(&cgroup_hierarchy_idr, &hierarchy_id);
if (root) {
cgrp = task_cgroup_from_root(task, root);
path = cgroup_path(cgrp, buf, buflen);
} else {
/* if no hierarchy exists, everyone is in "/" */
if (strlcpy(buf, "/", buflen) < buflen)
path = buf;
}
up_read(&css_set_rwsem);
mutex_unlock(&cgroup_mutex);
return path;
}
EXPORT_SYMBOL_GPL(task_cgroup_path);
/* used to track tasks and other necessary states during migration */
struct cgroup_taskset {
/* the src and dst cset list running through cset->mg_node */
struct list_head src_csets;
struct list_head dst_csets;
/*
* Fields for cgroup_taskset_*() iteration.
*
* Before migration is committed, the target migration tasks are on
* ->mg_tasks of the csets on ->src_csets. After, on ->mg_tasks of
* the csets on ->dst_csets. ->csets point to either ->src_csets
* or ->dst_csets depending on whether migration is committed.
*
* ->cur_csets and ->cur_task point to the current task position
* during iteration.
*/
struct list_head *csets;
struct css_set *cur_cset;
struct task_struct *cur_task;
};
/**
* cgroup_taskset_first - reset taskset and return the first task
* @tset: taskset of interest
*
* @tset iteration is initialized and the first task is returned.
*/
struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset)
{
tset->cur_cset = list_first_entry(tset->csets, struct css_set, mg_node);
tset->cur_task = NULL;
return cgroup_taskset_next(tset);
}
/**
* cgroup_taskset_next - iterate to the next task in taskset
* @tset: taskset of interest
*
* Return the next task in @tset. Iteration must have been initialized
* with cgroup_taskset_first().
*/
struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset)
{
struct css_set *cset = tset->cur_cset;
struct task_struct *task = tset->cur_task;
while (&cset->mg_node != tset->csets) {
if (!task)
task = list_first_entry(&cset->mg_tasks,
struct task_struct, cg_list);
else
task = list_next_entry(task, cg_list);
if (&task->cg_list != &cset->mg_tasks) {
tset->cur_cset = cset;
tset->cur_task = task;
return task;
}
cset = list_next_entry(cset, mg_node);
task = NULL;
}
return NULL;
}
/**
* cgroup_task_migrate - move a task from one cgroup to another.
* @old_cgrp: the cgroup @tsk is being migrated from
* @tsk: the task being migrated
* @new_cset: the new css_set @tsk is being attached to
*
* Must be called with cgroup_mutex, threadgroup and css_set_rwsem locked.
*/
static void cgroup_task_migrate(struct cgroup *old_cgrp,
struct task_struct *tsk,
struct css_set *new_cset)
{
struct css_set *old_cset;
lockdep_assert_held(&cgroup_mutex);
lockdep_assert_held(&css_set_rwsem);
/*
* We are synchronized through threadgroup_lock() against PF_EXITING
* setting such that we can't race against cgroup_exit() changing the
* css_set to init_css_set and dropping the old one.
*/
WARN_ON_ONCE(tsk->flags & PF_EXITING);
old_cset = task_css_set(tsk);
get_css_set(new_cset);
rcu_assign_pointer(tsk->cgroups, new_cset);
/*
* Use move_tail so that cgroup_taskset_first() still returns the
* leader after migration. This works because cgroup_migrate()
* ensures that the dst_cset of the leader is the first on the
* tset's dst_csets list.
*/
list_move_tail(&tsk->cg_list, &new_cset->mg_tasks);
/*
* We just gained a reference on old_cset by taking it from the
* task. As trading it for new_cset is protected by cgroup_mutex,
* we're safe to drop it here; it will be freed under RCU.
*/
set_bit(CGRP_RELEASABLE, &old_cgrp->flags);
put_css_set_locked(old_cset, false);
}
/**
* cgroup_migrate_finish - cleanup after attach
* @preloaded_csets: list of preloaded css_sets
*
* Undo cgroup_migrate_add_src() and cgroup_migrate_prepare_dst(). See
* those functions for details.
*/
static void cgroup_migrate_finish(struct list_head *preloaded_csets)
{
struct css_set *cset, *tmp_cset;
lockdep_assert_held(&cgroup_mutex);
down_write(&css_set_rwsem);
list_for_each_entry_safe(cset, tmp_cset, preloaded_csets, mg_preload_node) {
cset->mg_src_cgrp = NULL;
cset->mg_dst_cset = NULL;
list_del_init(&cset->mg_preload_node);
put_css_set_locked(cset, false);
}
up_write(&css_set_rwsem);
}
/**
* cgroup_migrate_add_src - add a migration source css_set
* @src_cset: the source css_set to add
* @dst_cgrp: the destination cgroup
* @preloaded_csets: list of preloaded css_sets
*
* Tasks belonging to @src_cset are about to be migrated to @dst_cgrp. Pin
* @src_cset and add it to @preloaded_csets, which should later be cleaned
* up by cgroup_migrate_finish().
*
* This function may be called without holding threadgroup_lock even if the
* target is a process. Threads may be created and destroyed but as long
* as cgroup_mutex is not dropped, no new css_set can be put into play and
* the preloaded css_sets are guaranteed to cover all migrations.
*/
static void cgroup_migrate_add_src(struct css_set *src_cset,
struct cgroup *dst_cgrp,
struct list_head *preloaded_csets)
{
struct cgroup *src_cgrp;
lockdep_assert_held(&cgroup_mutex);
lockdep_assert_held(&css_set_rwsem);
src_cgrp = cset_cgroup_from_root(src_cset, dst_cgrp->root);
if (!list_empty(&src_cset->mg_preload_node))
return;
WARN_ON(src_cset->mg_src_cgrp);
WARN_ON(!list_empty(&src_cset->mg_tasks));
WARN_ON(!list_empty(&src_cset->mg_node));
src_cset->mg_src_cgrp = src_cgrp;
get_css_set(src_cset);
list_add(&src_cset->mg_preload_node, preloaded_csets);
}
/**
* cgroup_migrate_prepare_dst - prepare destination css_sets for migration
* @dst_cgrp: the destination cgroup (may be %NULL)
* @preloaded_csets: list of preloaded source css_sets
*
* Tasks are about to be moved to @dst_cgrp and all the source css_sets
* have been preloaded to @preloaded_csets. This function looks up and
* pins all destination css_sets, links each to its source, and append them
* to @preloaded_csets. If @dst_cgrp is %NULL, the destination of each
* source css_set is assumed to be its cgroup on the default hierarchy.
*
* This function must be called after cgroup_migrate_add_src() has been
* called on each migration source css_set. After migration is performed
* using cgroup_migrate(), cgroup_migrate_finish() must be called on
* @preloaded_csets.
*/
static int cgroup_migrate_prepare_dst(struct cgroup *dst_cgrp,
struct list_head *preloaded_csets)
{
LIST_HEAD(csets);
struct css_set *src_cset, *tmp_cset;
lockdep_assert_held(&cgroup_mutex);
/*
* Except for the root, child_subsys_mask must be zero for a cgroup
* with tasks so that child cgroups don't compete against tasks.
*/
if (dst_cgrp && cgroup_on_dfl(dst_cgrp) && cgroup_parent(dst_cgrp) &&
dst_cgrp->child_subsys_mask)
return -EBUSY;
/* look up the dst cset for each src cset and link it to src */
list_for_each_entry_safe(src_cset, tmp_cset, preloaded_csets, mg_preload_node) {
struct css_set *dst_cset;
dst_cset = find_css_set(src_cset,
dst_cgrp ?: src_cset->dfl_cgrp);
if (!dst_cset)
goto err;
WARN_ON_ONCE(src_cset->mg_dst_cset || dst_cset->mg_dst_cset);
/*
* If src cset equals dst, it's noop. Drop the src.
* cgroup_migrate() will skip the cset too. Note that we
* can't handle src == dst as some nodes are used by both.
*/
if (src_cset == dst_cset) {
src_cset->mg_src_cgrp = NULL;
list_del_init(&src_cset->mg_preload_node);
put_css_set(src_cset, false);
put_css_set(dst_cset, false);
continue;
}
src_cset->mg_dst_cset = dst_cset;
if (list_empty(&dst_cset->mg_preload_node))
list_add(&dst_cset->mg_preload_node, &csets);
else
put_css_set(dst_cset, false);
}
list_splice_tail(&csets, preloaded_csets);
return 0;
err:
cgroup_migrate_finish(&csets);
return -ENOMEM;
}
/**
* cgroup_migrate - migrate a process or task to a cgroup
* @cgrp: the destination cgroup
* @leader: the leader of the process or the task to migrate
* @threadgroup: whether @leader points to the whole process or a single task
*
* Migrate a process or task denoted by @leader to @cgrp. If migrating a
* process, the caller must be holding threadgroup_lock of @leader. The
* caller is also responsible for invoking cgroup_migrate_add_src() and
* cgroup_migrate_prepare_dst() on the targets before invoking this
* function and following up with cgroup_migrate_finish().
*
* As long as a controller's ->can_attach() doesn't fail, this function is
* guaranteed to succeed. This means that, excluding ->can_attach()
* failure, when migrating multiple targets, the success or failure can be
* decided for all targets by invoking group_migrate_prepare_dst() before
* actually starting migrating.
*/
static int cgroup_migrate(struct cgroup *cgrp, struct task_struct *leader,
bool threadgroup)
{
struct cgroup_taskset tset = {
.src_csets = LIST_HEAD_INIT(tset.src_csets),
.dst_csets = LIST_HEAD_INIT(tset.dst_csets),
.csets = &tset.src_csets,
};
struct cgroup_subsys_state *css, *failed_css = NULL;
struct css_set *cset, *tmp_cset;
struct task_struct *task, *tmp_task;
int i, ret;
/*
* Prevent freeing of tasks while we take a snapshot. Tasks that are
* already PF_EXITING could be freed from underneath us unless we
* take an rcu_read_lock.
*/
down_write(&css_set_rwsem);
rcu_read_lock();
task = leader;
do {
/* @task either already exited or can't exit until the end */
if (task->flags & PF_EXITING)
goto next;
/* leave @task alone if post_fork() hasn't linked it yet */
if (list_empty(&task->cg_list))
goto next;
cset = task_css_set(task);
if (!cset->mg_src_cgrp)
goto next;
/*
* cgroup_taskset_first() must always return the leader.
* Take care to avoid disturbing the ordering.
*/
list_move_tail(&task->cg_list, &cset->mg_tasks);
if (list_empty(&cset->mg_node))
list_add_tail(&cset->mg_node, &tset.src_csets);
if (list_empty(&cset->mg_dst_cset->mg_node))
list_move_tail(&cset->mg_dst_cset->mg_node,
&tset.dst_csets);
next:
if (!threadgroup)
break;
} while_each_thread(leader, task);
rcu_read_unlock();
up_write(&css_set_rwsem);
/* methods shouldn't be called if no task is actually migrating */
if (list_empty(&tset.src_csets))
return 0;
/* check that we can legitimately attach to the cgroup */
for_each_e_css(css, i, cgrp) {
if (css->ss->can_attach) {
ret = css->ss->can_attach(css, &tset);
if (ret) {
failed_css = css;
goto out_cancel_attach;
}
}
}
/*
* Now that we're guaranteed success, proceed to move all tasks to
* the new cgroup. There are no failure cases after here, so this
* is the commit point.
*/
down_write(&css_set_rwsem);
list_for_each_entry(cset, &tset.src_csets, mg_node) {
list_for_each_entry_safe(task, tmp_task, &cset->mg_tasks, cg_list)
cgroup_task_migrate(cset->mg_src_cgrp, task,
cset->mg_dst_cset);
}
up_write(&css_set_rwsem);
/*
* Migration is committed, all target tasks are now on dst_csets.
* Nothing is sensitive to fork() after this point. Notify
* controllers that migration is complete.
*/
tset.csets = &tset.dst_csets;
for_each_e_css(css, i, cgrp)
if (css->ss->attach)
css->ss->attach(css, &tset);
ret = 0;
goto out_release_tset;
out_cancel_attach:
for_each_e_css(css, i, cgrp) {
if (css == failed_css)
break;
if (css->ss->cancel_attach)
css->ss->cancel_attach(css, &tset);
}
out_release_tset:
down_write(&css_set_rwsem);
list_splice_init(&tset.dst_csets, &tset.src_csets);
list_for_each_entry_safe(cset, tmp_cset, &tset.src_csets, mg_node) {
list_splice_tail_init(&cset->mg_tasks, &cset->tasks);
list_del_init(&cset->mg_node);
}
up_write(&css_set_rwsem);
return ret;
}
/**
* cgroup_attach_task - attach a task or a whole threadgroup to a cgroup
* @dst_cgrp: the cgroup to attach to
* @leader: the task or the leader of the threadgroup to be attached
* @threadgroup: attach the whole threadgroup?
*
* Call holding cgroup_mutex and threadgroup_lock of @leader.
*/
static int cgroup_attach_task(struct cgroup *dst_cgrp,
struct task_struct *leader, bool threadgroup)
{
LIST_HEAD(preloaded_csets);
struct task_struct *task;
int ret;
/* look up all src csets */
down_read(&css_set_rwsem);
rcu_read_lock();
task = leader;
do {
cgroup_migrate_add_src(task_css_set(task), dst_cgrp,
&preloaded_csets);
if (!threadgroup)
break;
} while_each_thread(leader, task);
rcu_read_unlock();
up_read(&css_set_rwsem);
/* prepare dst csets and commit */
ret = cgroup_migrate_prepare_dst(dst_cgrp, &preloaded_csets);
if (!ret)
ret = cgroup_migrate(dst_cgrp, leader, threadgroup);
cgroup_migrate_finish(&preloaded_csets);
return ret;
}
/*
* Find the task_struct of the task to attach by vpid and pass it along to the
* function to attach either it or all tasks in its threadgroup. Will lock
* cgroup_mutex and threadgroup.
*/
static ssize_t __cgroup_procs_write(struct kernfs_open_file *of, char *buf,
size_t nbytes, loff_t off, bool threadgroup)
{
struct task_struct *tsk;
const struct cred *cred = current_cred(), *tcred;
struct cgroup *cgrp;
pid_t pid;
int ret;
if (kstrtoint(strstrip(buf), 0, &pid) || pid < 0)
return -EINVAL;
cgrp = cgroup_kn_lock_live(of->kn);
if (!cgrp)
return -ENODEV;
retry_find_task:
rcu_read_lock();
if (pid) {
tsk = find_task_by_vpid(pid);
if (!tsk) {
rcu_read_unlock();
ret = -ESRCH;
goto out_unlock_cgroup;
}
/*
* even if we're attaching all tasks in the thread group, we
* only need to check permissions on one of them.
*/
tcred = __task_cred(tsk);
if (!uid_eq(cred->euid, GLOBAL_ROOT_UID) &&
!uid_eq(cred->euid, tcred->uid) &&
!uid_eq(cred->euid, tcred->suid)) {
rcu_read_unlock();
ret = -EACCES;
goto out_unlock_cgroup;
}
} else
tsk = current;
if (threadgroup)
tsk = tsk->group_leader;
/*
* Workqueue threads may acquire PF_NO_SETAFFINITY and become
* trapped in a cpuset, or RT worker may be born in a cgroup
* with no rt_runtime allocated. Just say no.
*/
if (tsk == kthreadd_task || (tsk->flags & PF_NO_SETAFFINITY)) {
ret = -EINVAL;
rcu_read_unlock();
goto out_unlock_cgroup;
}
get_task_struct(tsk);
rcu_read_unlock();
threadgroup_lock(tsk);
if (threadgroup) {
if (!thread_group_leader(tsk)) {
/*
* a race with de_thread from another thread's exec()
* may strip us of our leadership, if this happens,
* there is no choice but to throw this task away and
* try again; this is
* "double-double-toil-and-trouble-check locking".
*/
threadgroup_unlock(tsk);
put_task_struct(tsk);
goto retry_find_task;
}
}
ret = cgroup_attach_task(cgrp, tsk, threadgroup);
threadgroup_unlock(tsk);
put_task_struct(tsk);
out_unlock_cgroup:
cgroup_kn_unlock(of->kn);
return ret ?: nbytes;
}
/**
* cgroup_attach_task_all - attach task 'tsk' to all cgroups of task 'from'
* @from: attach to all cgroups of a given task
* @tsk: the task to be attached
*/
int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)
{
struct cgroup_root *root;
int retval = 0;
mutex_lock(&cgroup_mutex);
for_each_root(root) {
struct cgroup *from_cgrp;
if (root == &cgrp_dfl_root)
continue;
down_read(&css_set_rwsem);
from_cgrp = task_cgroup_from_root(from, root);
up_read(&css_set_rwsem);
retval = cgroup_attach_task(from_cgrp, tsk, false);
if (retval)
break;
}
mutex_unlock(&cgroup_mutex);
return retval;
}
EXPORT_SYMBOL_GPL(cgroup_attach_task_all);
static ssize_t cgroup_tasks_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{
return __cgroup_procs_write(of, buf, nbytes, off, false);
}
static ssize_t cgroup_procs_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{
return __cgroup_procs_write(of, buf, nbytes, off, true);
}
static ssize_t cgroup_release_agent_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{
struct cgroup *cgrp;
BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
cgrp = cgroup_kn_lock_live(of->kn);
if (!cgrp)
return -ENODEV;
spin_lock(&release_agent_path_lock);
strlcpy(cgrp->root->release_agent_path, strstrip(buf),
sizeof(cgrp->root->release_agent_path));
spin_unlock(&release_agent_path_lock);
cgroup_kn_unlock(of->kn);
return nbytes;
}
static int cgroup_release_agent_show(struct seq_file *seq, void *v)
{
struct cgroup *cgrp = seq_css(seq)->cgroup;
spin_lock(&release_agent_path_lock);
seq_puts(seq, cgrp->root->release_agent_path);
spin_unlock(&release_agent_path_lock);
seq_putc(seq, '\n');
return 0;
}
static int cgroup_sane_behavior_show(struct seq_file *seq, void *v)
{
seq_puts(seq, "0\n");
return 0;
}
static void cgroup_print_ss_mask(struct seq_file *seq, unsigned int ss_mask)
{
struct cgroup_subsys *ss;
bool printed = false;
int ssid;
for_each_subsys(ss, ssid) {
if (ss_mask & (1 << ssid)) {
if (printed)
seq_putc(seq, ' ');
seq_printf(seq, "%s", ss->name);
printed = true;
}
}
if (printed)
seq_putc(seq, '\n');
}
/* show controllers which are currently attached to the default hierarchy */
static int cgroup_root_controllers_show(struct seq_file *seq, void *v)
{
struct cgroup *cgrp = seq_css(seq)->cgroup;
cgroup_print_ss_mask(seq, cgrp->root->subsys_mask &
~cgrp_dfl_root_inhibit_ss_mask);
return 0;
}
/* show controllers which are enabled from the parent */
static int cgroup_controllers_show(struct seq_file *seq, void *v)
{
struct cgroup *cgrp = seq_css(seq)->cgroup;
cgroup_print_ss_mask(seq, cgroup_parent(cgrp)->subtree_control);
return 0;
}
/* show controllers which are enabled for a given cgroup's children */
static int cgroup_subtree_control_show(struct seq_file *seq, void *v)
{
struct cgroup *cgrp = seq_css(seq)->cgroup;
cgroup_print_ss_mask(seq, cgrp->subtree_control);
return 0;
}
/**
* cgroup_update_dfl_csses - update css assoc of a subtree in default hierarchy
* @cgrp: root of the subtree to update csses for
*
* @cgrp's child_subsys_mask has changed and its subtree's (self excluded)
* css associations need to be updated accordingly. This function looks up
* all css_sets which are attached to the subtree, creates the matching
* updated css_sets and migrates the tasks to the new ones.
*/
static int cgroup_update_dfl_csses(struct cgroup *cgrp)
{
LIST_HEAD(preloaded_csets);
struct cgroup_subsys_state *css;
struct css_set *src_cset;
int ret;
lockdep_assert_held(&cgroup_mutex);
/* look up all csses currently attached to @cgrp's subtree */
down_read(&css_set_rwsem);
css_for_each_descendant_pre(css, cgroup_css(cgrp, NULL)) {
struct cgrp_cset_link *link;
/* self is not affected by child_subsys_mask change */
if (css->cgroup == cgrp)
continue;
list_for_each_entry(link, &css->cgroup->cset_links, cset_link)
cgroup_migrate_add_src(link->cset, cgrp,
&preloaded_csets);
}
up_read(&css_set_rwsem);
/* NULL dst indicates self on default hierarchy */
ret = cgroup_migrate_prepare_dst(NULL, &preloaded_csets);
if (ret)
goto out_finish;
list_for_each_entry(src_cset, &preloaded_csets, mg_preload_node) {
struct task_struct *last_task = NULL, *task;
/* src_csets precede dst_csets, break on the first dst_cset */
if (!src_cset->mg_src_cgrp)
break;
/*
* All tasks in src_cset need to be migrated to the
* matching dst_cset. Empty it process by process. We
* walk tasks but migrate processes. The leader might even
* belong to a different cset but such src_cset would also
* be among the target src_csets because the default
* hierarchy enforces per-process membership.
*/
while (true) {
down_read(&css_set_rwsem);
task = list_first_entry_or_null(&src_cset->tasks,
struct task_struct, cg_list);
if (task) {
task = task->group_leader;
WARN_ON_ONCE(!task_css_set(task)->mg_src_cgrp);
get_task_struct(task);
}
up_read(&css_set_rwsem);
if (!task)
break;
/* guard against possible infinite loop */
if (WARN(last_task == task,
"cgroup: update_dfl_csses failed to make progress, aborting in inconsistent state\n"))
goto out_finish;
last_task = task;
threadgroup_lock(task);
/* raced against de_thread() from another thread? */
if (!thread_group_leader(task)) {
threadgroup_unlock(task);
put_task_struct(task);
continue;
}
ret = cgroup_migrate(src_cset->dfl_cgrp, task, true);
threadgroup_unlock(task);
put_task_struct(task);
if (WARN(ret, "cgroup: failed to update controllers for the default hierarchy (%d), further operations may crash or hang\n", ret))
goto out_finish;
}
}
out_finish:
cgroup_migrate_finish(&preloaded_csets);
return ret;
}
/* change the enabled child controllers for a cgroup in the default hierarchy */
static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
char *buf, size_t nbytes,
loff_t off)
{
unsigned int enable = 0, disable = 0;
unsigned int css_enable, css_disable, old_ctrl, new_ctrl;
struct cgroup *cgrp, *child;
struct cgroup_subsys *ss;
char *tok;
int ssid, ret;
/*
* Parse input - space separated list of subsystem names prefixed
* with either + or -.
*/
buf = strstrip(buf);
while ((tok = strsep(&buf, " "))) {
if (tok[0] == '\0')
continue;
for_each_subsys(ss, ssid) {
if (ss->disabled || strcmp(tok + 1, ss->name) ||
((1 << ss->id) & cgrp_dfl_root_inhibit_ss_mask))
continue;
if (*tok == '+') {
enable |= 1 << ssid;
disable &= ~(1 << ssid);
} else if (*tok == '-') {
disable |= 1 << ssid;
enable &= ~(1 << ssid);
} else {
return -EINVAL;
}
break;
}
if (ssid == CGROUP_SUBSYS_COUNT)
return -EINVAL;
}
cgrp = cgroup_kn_lock_live(of->kn);
if (!cgrp)
return -ENODEV;
for_each_subsys(ss, ssid) {
if (enable & (1 << ssid)) {
if (cgrp->subtree_control & (1 << ssid)) {
enable &= ~(1 << ssid);
continue;
}
/* unavailable or not enabled on the parent? */
if (!(cgrp_dfl_root.subsys_mask & (1 << ssid)) ||
(cgroup_parent(cgrp) &&
!(cgroup_parent(cgrp)->subtree_control & (1 << ssid)))) {
ret = -ENOENT;
goto out_unlock;
}
/*
* @ss is already enabled through dependency and
* we'll just make it visible. Skip draining.
*/
if (cgrp->child_subsys_mask & (1 << ssid))
continue;
/*
* Because css offlining is asynchronous, userland
* might try to re-enable the same controller while
* the previous instance is still around. In such
* cases, wait till it's gone using offline_waitq.
*/
cgroup_for_each_live_child(child, cgrp) {
DEFINE_WAIT(wait);
if (!cgroup_css(child, ss))
continue;
cgroup_get(child);
prepare_to_wait(&child->offline_waitq, &wait,
TASK_UNINTERRUPTIBLE);
cgroup_kn_unlock(of->kn);
schedule();
finish_wait(&child->offline_waitq, &wait);
cgroup_put(child);
return restart_syscall();
}
} else if (disable & (1 << ssid)) {
if (!(cgrp->subtree_control & (1 << ssid))) {
disable &= ~(1 << ssid);
continue;
}
/* a child has it enabled? */
cgroup_for_each_live_child(child, cgrp) {
if (child->subtree_control & (1 << ssid)) {
ret = -EBUSY;
goto out_unlock;
}
}
}
}
if (!enable && !disable) {
ret = 0;
goto out_unlock;
}
/*
* Except for the root, subtree_control must be zero for a cgroup
* with tasks so that child cgroups don't compete against tasks.
*/
if (enable && cgroup_parent(cgrp) && !list_empty(&cgrp->cset_links)) {
ret = -EBUSY;
goto out_unlock;
}
/*
* Update subsys masks and calculate what needs to be done. More
* subsystems than specified may need to be enabled or disabled
* depending on subsystem dependencies.
*/
cgrp->subtree_control |= enable;
cgrp->subtree_control &= ~disable;
old_ctrl = cgrp->child_subsys_mask;
cgroup_refresh_child_subsys_mask(cgrp);
new_ctrl = cgrp->child_subsys_mask;
css_enable = ~old_ctrl & new_ctrl;
css_disable = old_ctrl & ~new_ctrl;
enable |= css_enable;
disable |= css_disable;
/*
* Create new csses or make the existing ones visible. A css is
* created invisible if it's being implicitly enabled through
* dependency. An invisible css is made visible when the userland
* explicitly enables it.
*/
for_each_subsys(ss, ssid) {
if (!(enable & (1 << ssid)))
continue;
cgroup_for_each_live_child(child, cgrp) {
if (css_enable & (1 << ssid))
ret = create_css(child, ss,
cgrp->subtree_control & (1 << ssid));
else
ret = cgroup_populate_dir(child, 1 << ssid);
if (ret)
goto err_undo_css;
}
}
/*
* At this point, cgroup_e_css() results reflect the new csses
* making the following cgroup_update_dfl_csses() properly update
* css associations of all tasks in the subtree.
*/
ret = cgroup_update_dfl_csses(cgrp);
if (ret)
goto err_undo_css;
/*
* All tasks are migrated out of disabled csses. Kill or hide
* them. A css is hidden when the userland requests it to be
* disabled while other subsystems are still depending on it. The
* css must not actively control resources and be in the vanilla
* state if it's made visible again later. Controllers which may
* be depended upon should provide ->css_reset() for this purpose.
*/
for_each_subsys(ss, ssid) {
if (!(disable & (1 << ssid)))
continue;
cgroup_for_each_live_child(child, cgrp) {
struct cgroup_subsys_state *css = cgroup_css(child, ss);
if (css_disable & (1 << ssid)) {
kill_css(css);
} else {
cgroup_clear_dir(child, 1 << ssid);
if (ss->css_reset)
ss->css_reset(css);
}
}
}
kernfs_activate(cgrp->kn);
ret = 0;
out_unlock:
cgroup_kn_unlock(of->kn);
return ret ?: nbytes;
err_undo_css:
cgrp->subtree_control &= ~enable;
cgrp->subtree_control |= disable;
cgroup_refresh_child_subsys_mask(cgrp);
for_each_subsys(ss, ssid) {
if (!(enable & (1 << ssid)))
continue;
cgroup_for_each_live_child(child, cgrp) {
struct cgroup_subsys_state *css = cgroup_css(child, ss);
if (!css)
continue;
if (css_enable & (1 << ssid))
kill_css(css);
else
cgroup_clear_dir(child, 1 << ssid);
}
}
goto out_unlock;
}
static int cgroup_populated_show(struct seq_file *seq, void *v)
{
seq_printf(seq, "%d\n", (bool)seq_css(seq)->cgroup->populated_cnt);
return 0;
}
static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
size_t nbytes, loff_t off)
{
struct cgroup *cgrp = of->kn->parent->priv;
struct cftype *cft = of->kn->priv;
struct cgroup_subsys_state *css;
int ret;
if (cft->write)
return cft->write(of, buf, nbytes, off);
/*
* kernfs guarantees that a file isn't deleted with operations in
* flight, which means that the matching css is and stays alive and
* doesn't need to be pinned. The RCU locking is not necessary
* either. It's just for the convenience of using cgroup_css().
*/
rcu_read_lock();
css = cgroup_css(cgrp, cft->ss);
rcu_read_unlock();
if (cft->write_u64) {
unsigned long long v;
ret = kstrtoull(buf, 0, &v);
if (!ret)
ret = cft->write_u64(css, cft, v);
} else if (cft->write_s64) {
long long v;
ret = kstrtoll(buf, 0, &v);
if (!ret)
ret = cft->write_s64(css, cft, v);
} else {
ret = -EINVAL;
}
return ret ?: nbytes;
}
static void *cgroup_seqfile_start(struct seq_file *seq, loff_t *ppos)
{
return seq_cft(seq)->seq_start(seq, ppos);
}
static void *cgroup_seqfile_next(struct seq_file *seq, void *v, loff_t *ppos)
{
return seq_cft(seq)->seq_next(seq, v, ppos);
}
static void cgroup_seqfile_stop(struct seq_file *seq, void *v)
{
seq_cft(seq)->seq_stop(seq, v);
}
static int cgroup_seqfile_show(struct seq_file *m, void *arg)
{
struct cftype *cft = seq_cft(m);
struct cgroup_subsys_state *css = seq_css(m);
if (cft->seq_show)
return cft->seq_show(m, arg);
if (cft->read_u64)
seq_printf(m, "%llu\n", cft->read_u64(css, cft));
else if (cft->read_s64)
seq_printf(m, "%lld\n", cft->read_s64(css, cft));
else
return -EINVAL;
return 0;
}
static struct kernfs_ops cgroup_kf_single_ops = {
.atomic_write_len = PAGE_SIZE,
.write = cgroup_file_write,
.seq_show = cgroup_seqfile_show,
};
static struct kernfs_ops cgroup_kf_ops = {
.atomic_write_len = PAGE_SIZE,
.write = cgroup_file_write,
.seq_start = cgroup_seqfile_start,
.seq_next = cgroup_seqfile_next,
.seq_stop = cgroup_seqfile_stop,
.seq_show = cgroup_seqfile_show,
};
/*
* cgroup_rename - Only allow simple rename of directories in place.
*/
static int cgroup_rename(struct kernfs_node *kn, struct kernfs_node *new_parent,
const char *new_name_str)
{
struct cgroup *cgrp = kn->priv;
int ret;
if (kernfs_type(kn) != KERNFS_DIR)
return -ENOTDIR;
if (kn->parent != new_parent)
return -EIO;
/*
* This isn't a proper migration and its usefulness is very
* limited. Disallow on the default hierarchy.
*/
if (cgroup_on_dfl(cgrp))
return -EPERM;
/*
* We're gonna grab cgroup_mutex which nests outside kernfs
* active_ref. kernfs_rename() doesn't require active_ref
* protection. Break them before grabbing cgroup_mutex.
*/
kernfs_break_active_protection(new_parent);
kernfs_break_active_protection(kn);
mutex_lock(&cgroup_mutex);
ret = kernfs_rename(kn, new_parent, new_name_str);
mutex_unlock(&cgroup_mutex);
kernfs_unbreak_active_protection(kn);
kernfs_unbreak_active_protection(new_parent);
return ret;
}
/* set uid and gid of cgroup dirs and files to that of the creator */
static int cgroup_kn_set_ugid(struct kernfs_node *kn)
{
struct iattr iattr = { .ia_valid = ATTR_UID | ATTR_GID,
.ia_uid = current_fsuid(),
.ia_gid = current_fsgid(), };
if (uid_eq(iattr.ia_uid, GLOBAL_ROOT_UID) &&
gid_eq(iattr.ia_gid, GLOBAL_ROOT_GID))
return 0;
return kernfs_setattr(kn, &iattr);
}
static int cgroup_add_file(struct cgroup *cgrp, struct cftype *cft)
{
char name[CGROUP_FILE_NAME_MAX];
struct kernfs_node *kn;
struct lock_class_key *key = NULL;
int ret;
#ifdef CONFIG_DEBUG_LOCK_ALLOC
key = &cft->lockdep_key;
#endif
kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name),
cgroup_file_mode(cft), 0, cft->kf_ops, cft,
NULL, false, key);
if (IS_ERR(kn))
return PTR_ERR(kn);
ret = cgroup_kn_set_ugid(kn);
if (ret) {
kernfs_remove(kn);
return ret;
}
if (cft->seq_show == cgroup_populated_show)
cgrp->populated_kn = kn;
return 0;
}
/**
* cgroup_addrm_files - add or remove files to a cgroup directory
* @cgrp: the target cgroup
* @cfts: array of cftypes to be added
* @is_add: whether to add or remove
*
* Depending on @is_add, add or remove files defined by @cfts on @cgrp.
* For removals, this function never fails. If addition fails, this
* function doesn't remove files already added. The caller is responsible
* for cleaning up.
*/
static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[],
bool is_add)
{
struct cftype *cft;
int ret;
lockdep_assert_held(&cgroup_mutex);
for (cft = cfts; cft->name[0] != '\0'; cft++) {
/* does cft->flags tell us to skip this file on @cgrp? */
if ((cft->flags & __CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp))
continue;
if ((cft->flags & __CFTYPE_NOT_ON_DFL) && cgroup_on_dfl(cgrp))
continue;
if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgroup_parent(cgrp))
continue;
if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgroup_parent(cgrp))
continue;
if (is_add) {
ret = cgroup_add_file(cgrp, cft);
if (ret) {
pr_warn("%s: failed to add %s, err=%d\n",
__func__, cft->name, ret);
return ret;
}
} else {
cgroup_rm_file(cgrp, cft);
}
}
return 0;
}
static int cgroup_apply_cftypes(struct cftype *cfts, bool is_add)
{
LIST_HEAD(pending);
struct cgroup_subsys *ss = cfts[0].ss;
struct cgroup *root = &ss->root->cgrp;
struct cgroup_subsys_state *css;
int ret = 0;
lockdep_assert_held(&cgroup_mutex);
/* add/rm files for all cgroups created before */
css_for_each_descendant_pre(css, cgroup_css(root, ss)) {
struct cgroup *cgrp = css->cgroup;
if (cgroup_is_dead(cgrp))
continue;
ret = cgroup_addrm_files(cgrp, cfts, is_add);
if (ret)
break;
}
if (is_add && !ret)
kernfs_activate(root->kn);
return ret;
}
static void cgroup_exit_cftypes(struct cftype *cfts)
{
struct cftype *cft;
for (cft = cfts; cft->name[0] != '\0'; cft++) {
/* free copy for custom atomic_write_len, see init_cftypes() */
if (cft->max_write_len && cft->max_write_len != PAGE_SIZE)
kfree(cft->kf_ops);
cft->kf_ops = NULL;
cft->ss = NULL;
/* revert flags set by cgroup core while adding @cfts */
cft->flags &= ~(__CFTYPE_ONLY_ON_DFL | __CFTYPE_NOT_ON_DFL);
}
}
static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
{
struct cftype *cft;
for (cft = cfts; cft->name[0] != '\0'; cft++) {
struct kernfs_ops *kf_ops;
WARN_ON(cft->ss || cft->kf_ops);
if (cft->seq_start)
kf_ops = &cgroup_kf_ops;
else
kf_ops = &cgroup_kf_single_ops;
/*
* Ugh... if @cft wants a custom max_write_len, we need to
* make a copy of kf_ops to set its atomic_write_len.
*/
if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) {
kf_ops = kmemdup(kf_ops, sizeof(*kf_ops), GFP_KERNEL);
if (!kf_ops) {
cgroup_exit_cftypes(cfts);
return -ENOMEM;
}
kf_ops->atomic_write_len = cft->max_write_len;
}
cft->kf_ops = kf_ops;
cft->ss = ss;
}
return 0;
}
static int cgroup_rm_cftypes_locked(struct cftype *cfts)
{
lockdep_assert_held(&cgroup_mutex);
if (!cfts || !cfts[0].ss)
return -ENOENT;
list_del(&cfts->node);
cgroup_apply_cftypes(cfts, false);
cgroup_exit_cftypes(cfts);
return 0;
}
/**
* cgroup_rm_cftypes - remove an array of cftypes from a subsystem
* @cfts: zero-length name terminated array of cftypes
*
* Unregister @cfts. Files described by @cfts are removed from all
* existing cgroups and all future cgroups won't have them either. This
* function can be called anytime whether @cfts' subsys is attached or not.
*
* Returns 0 on successful unregistration, -ENOENT if @cfts is not
* registered.
*/
int cgroup_rm_cftypes(struct cftype *cfts)
{
int ret;
mutex_lock(&cgroup_mutex);
ret = cgroup_rm_cftypes_locked(cfts);
mutex_unlock(&cgroup_mutex);
return ret;
}
/**
* cgroup_add_cftypes - add an array of cftypes to a subsystem
* @ss: target cgroup subsystem
* @cfts: zero-length name terminated array of cftypes
*
* Register @cfts to @ss. Files described by @cfts are created for all
* existing cgroups to which @ss is attached and all future cgroups will
* have them too. This function can be called anytime whether @ss is
* attached or not.
*
* Returns 0 on successful registration, -errno on failure. Note that this
* function currently returns 0 as long as @cfts registration is successful
* even if some file creation attempts on existing cgroups fail.
*/
static int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
{
int ret;
if (ss->disabled)
return 0;
if (!cfts || cfts[0].name[0] == '\0')
return 0;
ret = cgroup_init_cftypes(ss, cfts);
if (ret)
return ret;
mutex_lock(&cgroup_mutex);
list_add_tail(&cfts->node, &ss->cfts);
ret = cgroup_apply_cftypes(cfts, true);
if (ret)
cgroup_rm_cftypes_locked(cfts);
mutex_unlock(&cgroup_mutex);
return ret;
}
/**
* cgroup_add_dfl_cftypes - add an array of cftypes for default hierarchy
* @ss: target cgroup subsystem
* @cfts: zero-length name terminated array of cftypes
*
* Similar to cgroup_add_cftypes() but the added files are only used for
* the default hierarchy.
*/
int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
{
struct cftype *cft;
for (cft = cfts; cft && cft->name[0] != '\0'; cft++)
cft->flags |= __CFTYPE_ONLY_ON_DFL;
return cgroup_add_cftypes(ss, cfts);
}
/**
* cgroup_add_legacy_cftypes - add an array of cftypes for legacy hierarchies
* @ss: target cgroup subsystem
* @cfts: zero-length name terminated array of cftypes
*
* Similar to cgroup_add_cftypes() but the added files are only used for
* the legacy hierarchies.
*/
int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
{
struct cftype *cft;
/*
* If legacy_flies_on_dfl, we want to show the legacy files on the
* dfl hierarchy but iff the target subsystem hasn't been updated
* for the dfl hierarchy yet.
*/
if (!cgroup_legacy_files_on_dfl ||
ss->dfl_cftypes != ss->legacy_cftypes) {
for (cft = cfts; cft && cft->name[0] != '\0'; cft++)
cft->flags |= __CFTYPE_NOT_ON_DFL;
}
return cgroup_add_cftypes(ss, cfts);
}
/**
* cgroup_task_count - count the number of tasks in a cgroup.
* @cgrp: the cgroup in question
*
* Return the number of tasks in the cgroup.
*/
static int cgroup_task_count(const struct cgroup *cgrp)
{
int count = 0;
struct cgrp_cset_link *link;
down_read(&css_set_rwsem);
list_for_each_entry(link, &cgrp->cset_links, cset_link)
count += atomic_read(&link->cset->refcount);
up_read(&css_set_rwsem);
return count;
}
/**
* css_next_child - find the next child of a given css
* @pos: the current position (%NULL to initiate traversal)
* @parent: css whose children to walk
*
* This function returns the next child of @parent and should be called
* under either cgroup_mutex or RCU read lock. The only requirement is
* that @parent and @pos are accessible. The next sibling is guaranteed to
* be returned regardless of their states.
*
* If a subsystem synchronizes ->css_online() and the start of iteration, a
* css which finished ->css_online() is guaranteed to be visible in the
* future iterations and will stay visible until the last reference is put.
* A css which hasn't finished ->css_online() or already finished
* ->css_offline() may show up during traversal. It's each subsystem's
* responsibility to synchronize against on/offlining.
*/
struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
struct cgroup_subsys_state *parent)
{
struct cgroup_subsys_state *next;
cgroup_assert_mutex_or_rcu_locked();
/*
* @pos could already have been unlinked from the sibling list.
* Once a cgroup is removed, its ->sibling.next is no longer
* updated when its next sibling changes. CSS_RELEASED is set when
* @pos is taken off list, at which time its next pointer is valid,
* and, as releases are serialized, the one pointed to by the next
* pointer is guaranteed to not have started release yet. This
* implies that if we observe !CSS_RELEASED on @pos in this RCU
* critical section, the one pointed to by its next pointer is
* guaranteed to not have finished its RCU grace period even if we
* have dropped rcu_read_lock() inbetween iterations.
*
* If @pos has CSS_RELEASED set, its next pointer can't be
* dereferenced; however, as each css is given a monotonically
* increasing unique serial number and always appended to the
* sibling list, the next one can be found by walking the parent's
* children until the first css with higher serial number than
* @pos's. While this path can be slower, it happens iff iteration
* races against release and the race window is very small.
*/
if (!pos) {
next = list_entry_rcu(parent->children.next, struct cgroup_subsys_state, sibling);
} else if (likely(!(pos->flags & CSS_RELEASED))) {
next = list_entry_rcu(pos->sibling.next, struct cgroup_subsys_state, sibling);
} else {
list_for_each_entry_rcu(next, &parent->children, sibling)
if (next->serial_nr > pos->serial_nr)
break;
}
/*
* @next, if not pointing to the head, can be dereferenced and is
* the next sibling.
*/
if (&next->sibling != &parent->children)
return next;
return NULL;
}
/**
* css_next_descendant_pre - find the next descendant for pre-order walk
* @pos: the current position (%NULL to initiate traversal)
* @root: css whose descendants to walk
*
* To be used by css_for_each_descendant_pre(). Find the next descendant
* to visit for pre-order traversal of @root's descendants. @root is
* included in the iteration and the first node to be visited.
*
* While this function requires cgroup_mutex or RCU read locking, it
* doesn't require the whole traversal to be contained in a single critical
* section. This function will return the correct next descendant as long
* as both @pos and @root are accessible and @pos is a descendant of @root.
*
* If a subsystem synchronizes ->css_online() and the start of iteration, a
* css which finished ->css_online() is guaranteed to be visible in the
* future iterations and will stay visible until the last reference is put.
* A css which hasn't finished ->css_online() or already finished
* ->css_offline() may show up during traversal. It's each subsystem's
* responsibility to synchronize against on/offlining.
*/
struct cgroup_subsys_state *
css_next_descendant_pre(struct cgroup_subsys_state *pos,
struct cgroup_subsys_state *root)
{
struct cgroup_subsys_state *next;
cgroup_assert_mutex_or_rcu_locked();
/* if first iteration, visit @root */
if (!pos)
return root;
/* visit the first child if exists */
next = css_next_child(NULL, pos);
if (next)
return next;
/* no child, visit my or the closest ancestor's next sibling */
while (pos != root) {
next = css_next_child(pos, pos->parent);
if (next)
return next;
pos = pos->parent;
}
return NULL;
}
/**
* css_rightmost_descendant - return the rightmost descendant of a css
* @pos: css of interest
*
* Return the rightmost descendant of @pos. If there's no descendant, @pos
* is returned. This can be used during pre-order traversal to skip
* subtree of @pos.
*
* While this function requires cgroup_mutex or RCU read locking, it
* doesn't require the whole traversal to be contained in a single critical
* section. This function will return the correct rightmost descendant as
* long as @pos is accessible.
*/
struct cgroup_subsys_state *
css_rightmost_descendant(struct cgroup_subsys_state *pos)
{
struct cgroup_subsys_state *last, *tmp;
cgroup_assert_mutex_or_rcu_locked();
do {
last = pos;
/* ->prev isn't RCU safe, walk ->next till the end */
pos = NULL;
css_for_each_child(tmp, last)
pos = tmp;
} while (pos);
return last;
}
static struct cgroup_subsys_state *
css_leftmost_descendant(struct cgroup_subsys_state *pos)
{
struct cgroup_subsys_state *last;
do {
last = pos;
pos = css_next_child(NULL, pos);
} while (pos);
return last;
}
/**
* css_next_descendant_post - find the next descendant for post-order walk
* @pos: the current position (%NULL to initiate traversal)
* @root: css whose descendants to walk
*
* To be used by css_for_each_descendant_post(). Find the next descendant
* to visit for post-order traversal of @root's descendants. @root is
* included in the iteration and the last node to be visited.
*
* While this function requires cgroup_mutex or RCU read locking, it
* doesn't require the whole traversal to be contained in a single critical
* section. This function will return the correct next descendant as long
* as both @pos and @cgroup are accessible and @pos is a descendant of
* @cgroup.
*
* If a subsystem synchronizes ->css_online() and the start of iteration, a
* css which finished ->css_online() is guaranteed to be visible in the
* future iterations and will stay visible until the last reference is put.
* A css which hasn't finished ->css_online() or already finished
* ->css_offline() may show up during traversal. It's each subsystem's
* responsibility to synchronize against on/offlining.
*/
struct cgroup_subsys_state *
css_next_descendant_post(struct cgroup_subsys_state *pos,
struct cgroup_subsys_state *root)
{
struct cgroup_subsys_state *next;
cgroup_assert_mutex_or_rcu_locked();
/* if first iteration, visit leftmost descendant which may be @root */
if (!pos)
return css_leftmost_descendant(root);
/* if we visited @root, we're done */
if (pos == root)
return NULL;
/* if there's an unvisited sibling, visit its leftmost descendant */
next = css_next_child(pos, pos->parent);
if (next)
return css_leftmost_descendant(next);
/* no sibling left, visit parent */
return pos->parent;
}
/**
* css_has_online_children - does a css have online children
* @css: the target css
*
* Returns %true if @css has any online children; otherwise, %false. This
* function can be called from any context but the caller is responsible
* for synchronizing against on/offlining as necessary.
*/
bool css_has_online_children(struct cgroup_subsys_state *css)
{
struct cgroup_subsys_state *child;
bool ret = false;
rcu_read_lock();
css_for_each_child(child, css) {
if (child->flags & CSS_ONLINE) {
ret = true;
break;
}
}
rcu_read_unlock();
return ret;
}
/**
* css_advance_task_iter - advance a task itererator to the next css_set
* @it: the iterator to advance
*
* Advance @it to the next css_set to walk.
*/
static void css_advance_task_iter(struct css_task_iter *it)
{
struct list_head *l = it->cset_pos;
struct cgrp_cset_link *link;
struct css_set *cset;
/* Advance to the next non-empty css_set */
do {
l = l->next;
if (l == it->cset_head) {
it->cset_pos = NULL;
return;
}
if (it->ss) {
cset = container_of(l, struct css_set,
e_cset_node[it->ss->id]);
} else {
link = list_entry(l, struct cgrp_cset_link, cset_link);
cset = link->cset;
}
} while (list_empty(&cset->tasks) && list_empty(&cset->mg_tasks));
it->cset_pos = l;
if (!list_empty(&cset->tasks))
it->task_pos = cset->tasks.next;
else
it->task_pos = cset->mg_tasks.next;
it->tasks_head = &cset->tasks;
it->mg_tasks_head = &cset->mg_tasks;
}
/**
* css_task_iter_start - initiate task iteration
* @css: the css to walk tasks of
* @it: the task iterator to use
*
* Initiate iteration through the tasks of @css. The caller can call
* css_task_iter_next() to walk through the tasks until the function
* returns NULL. On completion of iteration, css_task_iter_end() must be
* called.
*
* Note that this function acquires a lock which is released when the
* iteration finishes. The caller can't sleep while iteration is in
* progress.
*/
void css_task_iter_start(struct cgroup_subsys_state *css,
struct css_task_iter *it)
__acquires(css_set_rwsem)
{
/* no one should try to iterate before mounting cgroups */
WARN_ON_ONCE(!use_task_css_set_links);
down_read(&css_set_rwsem);
it->ss = css->ss;
if (it->ss)
it->cset_pos = &css->cgroup->e_csets[css->ss->id];
else
it->cset_pos = &css->cgroup->cset_links;
it->cset_head = it->cset_pos;
css_advance_task_iter(it);
}
/**
* css_task_iter_next - return the next task for the iterator
* @it: the task iterator being iterated
*
* The "next" function for task iteration. @it should have been
* initialized via css_task_iter_start(). Returns NULL when the iteration
* reaches the end.
*/
struct task_struct *css_task_iter_next(struct css_task_iter *it)
{
struct task_struct *res;
struct list_head *l = it->task_pos;
/* If the iterator cg is NULL, we have no tasks */
if (!it->cset_pos)
return NULL;
res = list_entry(l, struct task_struct, cg_list);
/*
* Advance iterator to find next entry. cset->tasks is consumed
* first and then ->mg_tasks. After ->mg_tasks, we move onto the
* next cset.
*/
l = l->next;
if (l == it->tasks_head)
l = it->mg_tasks_head->next;
if (l == it->mg_tasks_head)
css_advance_task_iter(it);
else
it->task_pos = l;
return res;
}
/**
* css_task_iter_end - finish task iteration
* @it: the task iterator to finish
*
* Finish task iteration started by css_task_iter_start().
*/
void css_task_iter_end(struct css_task_iter *it)
__releases(css_set_rwsem)
{
up_read(&css_set_rwsem);
}
/**
* cgroup_trasnsfer_tasks - move tasks from one cgroup to another
* @to: cgroup to which the tasks will be moved
* @from: cgroup in which the tasks currently reside
*
* Locking rules between cgroup_post_fork() and the migration path
* guarantee that, if a task is forking while being migrated, the new child
* is guaranteed to be either visible in the source cgroup after the
* parent's migration is complete or put into the target cgroup. No task
* can slip out of migration through forking.
*/
int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from)
{
LIST_HEAD(preloaded_csets);
struct cgrp_cset_link *link;
struct css_task_iter it;
struct task_struct *task;
int ret;
mutex_lock(&cgroup_mutex);
/* all tasks in @from are being moved, all csets are source */
down_read(&css_set_rwsem);
list_for_each_entry(link, &from->cset_links, cset_link)
cgroup_migrate_add_src(link->cset, to, &preloaded_csets);
up_read(&css_set_rwsem);
ret = cgroup_migrate_prepare_dst(to, &preloaded_csets);
if (ret)
goto out_err;
/*
* Migrate tasks one-by-one until @form is empty. This fails iff
* ->can_attach() fails.
*/
do {
css_task_iter_start(&from->self, &it);
task = css_task_iter_next(&it);
if (task)
get_task_struct(task);
css_task_iter_end(&it);
if (task) {
ret = cgroup_migrate(to, task, false);
put_task_struct(task);
}
} while (task && !ret);
out_err:
cgroup_migrate_finish(&preloaded_csets);
mutex_unlock(&cgroup_mutex);
return ret;
}
/*
* Stuff for reading the 'tasks'/'procs' files.
*
* Reading this file can return large amounts of data if a cgroup has
* *lots* of attached tasks. So it may need several calls to read(),
* but we cannot guarantee that the information we produce is correct
* unless we produce it entirely atomically.
*
*/
/* which pidlist file are we talking about? */
enum cgroup_filetype {
CGROUP_FILE_PROCS,
CGROUP_FILE_TASKS,
};
/*
* A pidlist is a list of pids that virtually represents the contents of one
* of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists,
* a pair (one each for procs, tasks) for each pid namespace that's relevant
* to the cgroup.
*/
struct cgroup_pidlist {
/*
* used to find which pidlist is wanted. doesn't change as long as
* this particular list stays in the list.
*/
struct { enum cgroup_filetype type; struct pid_namespace *ns; } key;
/* array of xids */
pid_t *list;
/* how many elements the above list has */
int length;
/* each of these stored in a list by its cgroup */
struct list_head links;
/* pointer to the cgroup we belong to, for list removal purposes */
struct cgroup *owner;
/* for delayed destruction */
struct delayed_work destroy_dwork;
};
/*
* The following two functions "fix" the issue where there are more pids
* than kmalloc will give memory for; in such cases, we use vmalloc/vfree.
* TODO: replace with a kernel-wide solution to this problem
*/
#define PIDLIST_TOO_LARGE(c) ((c) * sizeof(pid_t) > (PAGE_SIZE * 2))
static void *pidlist_allocate(int count)
{
if (PIDLIST_TOO_LARGE(count))
return vmalloc(count * sizeof(pid_t));
else
return kmalloc(count * sizeof(pid_t), GFP_KERNEL);
}
static void pidlist_free(void *p)
{
if (is_vmalloc_addr(p))
vfree(p);
else
kfree(p);
}
/*
* Used to destroy all pidlists lingering waiting for destroy timer. None
* should be left afterwards.
*/
static void cgroup_pidlist_destroy_all(struct cgroup *cgrp)
{
struct cgroup_pidlist *l, *tmp_l;
mutex_lock(&cgrp->pidlist_mutex);
list_for_each_entry_safe(l, tmp_l, &cgrp->pidlists, links)
mod_delayed_work(cgroup_pidlist_destroy_wq, &l->destroy_dwork, 0);
mutex_unlock(&cgrp->pidlist_mutex);
flush_workqueue(cgroup_pidlist_destroy_wq);
BUG_ON(!list_empty(&cgrp->pidlists));
}
static void cgroup_pidlist_destroy_work_fn(struct work_struct *work)
{
struct delayed_work *dwork = to_delayed_work(work);
struct cgroup_pidlist *l = container_of(dwork, struct cgroup_pidlist,
destroy_dwork);
struct cgroup_pidlist *tofree = NULL;
mutex_lock(&l->owner->pidlist_mutex);
/*
* Destroy iff we didn't get queued again. The state won't change
* as destroy_dwork can only be queued while locked.
*/
if (!delayed_work_pending(dwork)) {
list_del(&l->links);
pidlist_free(l->list);
put_pid_ns(l->key.ns);
tofree = l;
}
mutex_unlock(&l->owner->pidlist_mutex);
kfree(tofree);
}
/*
* pidlist_uniq - given a kmalloc()ed list, strip out all duplicate entries
* Returns the number of unique elements.
*/
static int pidlist_uniq(pid_t *list, int length)
{
int src, dest = 1;
/*
* we presume the 0th element is unique, so i starts at 1. trivial
* edge cases first; no work needs to be done for either
*/
if (length == 0 || length == 1)
return length;
/* src and dest walk down the list; dest counts unique elements */
for (src = 1; src < length; src++) {
/* find next unique element */
while (list[src] == list[src-1]) {
src++;
if (src == length)
goto after;
}
/* dest always points to where the next unique element goes */
list[dest] = list[src];
dest++;
}
after:
return dest;
}
/*
* The two pid files - task and cgroup.procs - guaranteed that the result
* is sorted, which forced this whole pidlist fiasco. As pid order is
* different per namespace, each namespace needs differently sorted list,
* making it impossible to use, for example, single rbtree of member tasks
* sorted by task pointer. As pidlists can be fairly large, allocating one
* per open file is dangerous, so cgroup had to implement shared pool of
* pidlists keyed by cgroup and namespace.
*
* All this extra complexity was caused by the original implementation
* committing to an entirely unnecessary property. In the long term, we
* want to do away with it. Explicitly scramble sort order if on the
* default hierarchy so that no such expectation exists in the new
* interface.
*
* Scrambling is done by swapping every two consecutive bits, which is
* non-identity one-to-one mapping which disturbs sort order sufficiently.
*/
static pid_t pid_fry(pid_t pid)
{
unsigned a = pid & 0x55555555;
unsigned b = pid & 0xAAAAAAAA;
return (a << 1) | (b >> 1);
}
static pid_t cgroup_pid_fry(struct cgroup *cgrp, pid_t pid)
{
if (cgroup_on_dfl(cgrp))
return pid_fry(pid);
else
return pid;
}
static int cmppid(const void *a, const void *b)
{
return *(pid_t *)a - *(pid_t *)b;
}
static int fried_cmppid(const void *a, const void *b)
{
return pid_fry(*(pid_t *)a) - pid_fry(*(pid_t *)b);
}
static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp,
enum cgroup_filetype type)
{
struct cgroup_pidlist *l;
/* don't need task_nsproxy() if we're looking at ourself */
struct pid_namespace *ns = task_active_pid_ns(current);
lockdep_assert_held(&cgrp->pidlist_mutex);
list_for_each_entry(l, &cgrp->pidlists, links)
if (l->key.type == type && l->key.ns == ns)
return l;
return NULL;
}
/*
* find the appropriate pidlist for our purpose (given procs vs tasks)
* returns with the lock on that pidlist already held, and takes care
* of the use count, or returns NULL with no locks held if we're out of
* memory.
*/
static struct cgroup_pidlist *cgroup_pidlist_find_create(struct cgroup *cgrp,
enum cgroup_filetype type)
{
struct cgroup_pidlist *l;
lockdep_assert_held(&cgrp->pidlist_mutex);
l = cgroup_pidlist_find(cgrp, type);
if (l)
return l;
/* entry not found; create a new one */
l = kzalloc(sizeof(struct cgroup_pidlist), GFP_KERNEL);
if (!l)
return l;
INIT_DELAYED_WORK(&l->destroy_dwork, cgroup_pidlist_destroy_work_fn);
l->key.type = type;
/* don't need task_nsproxy() if we're looking at ourself */
l->key.ns = get_pid_ns(task_active_pid_ns(current));
l->owner = cgrp;
list_add(&l->links, &cgrp->pidlists);
return l;
}
/*
* Load a cgroup's pidarray with either procs' tgids or tasks' pids
*/
static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type,
struct cgroup_pidlist **lp)
{
pid_t *array;
int length;
int pid, n = 0; /* used for populating the array */
struct css_task_iter it;
struct task_struct *tsk;
struct cgroup_pidlist *l;
lockdep_assert_held(&cgrp->pidlist_mutex);
/*
* If cgroup gets more users after we read count, we won't have
* enough space - tough. This race is indistinguishable to the
* caller from the case that the additional cgroup users didn't
* show up until sometime later on.
*/
length = cgroup_task_count(cgrp);
array = pidlist_allocate(length);
if (!array)
return -ENOMEM;
/* now, populate the array */
css_task_iter_start(&cgrp->self, &it);
while ((tsk = css_task_iter_next(&it))) {
if (unlikely(n == length))
break;
/* get tgid or pid for procs or tasks file respectively */
if (type == CGROUP_FILE_PROCS)
pid = task_tgid_vnr(tsk);
else
pid = task_pid_vnr(tsk);
if (pid > 0) /* make sure to only use valid results */
array[n++] = pid;
}
css_task_iter_end(&it);
length = n;
/* now sort & (if procs) strip out duplicates */
if (cgroup_on_dfl(cgrp))
sort(array, length, sizeof(pid_t), fried_cmppid, NULL);
else
sort(array, length, sizeof(pid_t), cmppid, NULL);
if (type == CGROUP_FILE_PROCS)
length = pidlist_uniq(array, length);
l = cgroup_pidlist_find_create(cgrp, type);
if (!l) {
pidlist_free(array);
return -ENOMEM;
}
/* store array, freeing old if necessary */
pidlist_free(l->list);
l->list = array;
l->length = length;
*lp = l;
return 0;
}
/**
* cgroupstats_build - build and fill cgroupstats
* @stats: cgroupstats to fill information into
* @dentry: A dentry entry belonging to the cgroup for which stats have
* been requested.
*
* Build and fill cgroupstats so that taskstats can export it to user
* space.
*/
int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry)
{
struct kernfs_node *kn = kernfs_node_from_dentry(dentry);
struct cgroup *cgrp;
struct css_task_iter it;
struct task_struct *tsk;
/* it should be kernfs_node belonging to cgroupfs and is a directory */
if (dentry->d_sb->s_type != &cgroup_fs_type || !kn ||
kernfs_type(kn) != KERNFS_DIR)
return -EINVAL;
mutex_lock(&cgroup_mutex);
/*
* We aren't being called from kernfs and there's no guarantee on
* @kn->priv's validity. For this and css_tryget_online_from_dir(),
* @kn->priv is RCU safe. Let's do the RCU dancing.
*/
rcu_read_lock();
cgrp = rcu_dereference(kn->priv);
if (!cgrp || cgroup_is_dead(cgrp)) {
rcu_read_unlock();
mutex_unlock(&cgroup_mutex);
return -ENOENT;
}
rcu_read_unlock();
css_task_iter_start(&cgrp->self, &it);
while ((tsk = css_task_iter_next(&it))) {
switch (tsk->state) {
case TASK_RUNNING:
stats->nr_running++;
break;
case TASK_INTERRUPTIBLE:
stats->nr_sleeping++;
break;
case TASK_UNINTERRUPTIBLE:
stats->nr_uninterruptible++;
break;
case TASK_STOPPED:
stats->nr_stopped++;
break;
default:
if (delayacct_is_task_waiting_on_io(tsk))
stats->nr_io_wait++;
break;
}
}
css_task_iter_end(&it);
mutex_unlock(&cgroup_mutex);
return 0;
}
/*
* seq_file methods for the tasks/procs files. The seq_file position is the
* next pid to display; the seq_file iterator is a pointer to the pid
* in the cgroup->l->list array.
*/
static void *cgroup_pidlist_start(struct seq_file *s, loff_t *pos)
{
/*
* Initially we receive a position value that corresponds to
* one more than the last pid shown (or 0 on the first call or
* after a seek to the start). Use a binary-search to find the
* next pid to display, if any
*/
struct kernfs_open_file *of = s->private;
struct cgroup *cgrp = seq_css(s)->cgroup;
struct cgroup_pidlist *l;
enum cgroup_filetype type = seq_cft(s)->private;
int index = 0, pid = *pos;
int *iter, ret;
mutex_lock(&cgrp->pidlist_mutex);
/*
* !NULL @of->priv indicates that this isn't the first start()
* after open. If the matching pidlist is around, we can use that.
* Look for it. Note that @of->priv can't be used directly. It
* could already have been destroyed.
*/
if (of->priv)
of->priv = cgroup_pidlist_find(cgrp, type);
/*
* Either this is the first start() after open or the matching
* pidlist has been destroyed inbetween. Create a new one.
*/
if (!of->priv) {
ret = pidlist_array_load(cgrp, type,
(struct cgroup_pidlist **)&of->priv);
if (ret)
return ERR_PTR(ret);
}
l = of->priv;
if (pid) {
int end = l->length;
while (index < end) {
int mid = (index + end) / 2;
if (cgroup_pid_fry(cgrp, l->list[mid]) == pid) {
index = mid;
break;
} else if (cgroup_pid_fry(cgrp, l->list[mid]) <= pid)
index = mid + 1;
else
end = mid;
}
}
/* If we're off the end of the array, we're done */
if (index >= l->length)
return NULL;
/* Update the abstract position to be the actual pid that we found */
iter = l->list + index;
*pos = cgroup_pid_fry(cgrp, *iter);
return iter;
}
static void cgroup_pidlist_stop(struct seq_file *s, void *v)
{
struct kernfs_open_file *of = s->private;
struct cgroup_pidlist *l = of->priv;
if (l)
mod_delayed_work(cgroup_pidlist_destroy_wq, &l->destroy_dwork,
CGROUP_PIDLIST_DESTROY_DELAY);
mutex_unlock(&seq_css(s)->cgroup->pidlist_mutex);
}
static void *cgroup_pidlist_next(struct seq_file *s, void *v, loff_t *pos)
{
struct kernfs_open_file *of = s->private;
struct cgroup_pidlist *l = of->priv;
pid_t *p = v;
pid_t *end = l->list + l->length;
/*
* Advance to the next pid in the array. If this goes off the
* end, we're done
*/
p++;
if (p >= end) {
return NULL;
} else {
*pos = cgroup_pid_fry(seq_css(s)->cgroup, *p);
return p;
}
}
static int cgroup_pidlist_show(struct seq_file *s, void *v)
{
return seq_printf(s, "%d\n", *(int *)v);
}
static u64 cgroup_read_notify_on_release(struct cgroup_subsys_state *css,
struct cftype *cft)
{
return notify_on_release(css->cgroup);
}
static int cgroup_write_notify_on_release(struct cgroup_subsys_state *css,
struct cftype *cft, u64 val)
{
clear_bit(CGRP_RELEASABLE, &css->cgroup->flags);
if (val)
set_bit(CGRP_NOTIFY_ON_RELEASE, &css->cgroup->flags);
else
clear_bit(CGRP_NOTIFY_ON_RELEASE, &css->cgroup->flags);
return 0;
}
static u64 cgroup_clone_children_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
return test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags);
}
static int cgroup_clone_children_write(struct cgroup_subsys_state *css,
struct cftype *cft, u64 val)
{
if (val)
set_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags);
else
clear_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags);
return 0;
}
/* cgroup core interface files for the default hierarchy */
static struct cftype cgroup_dfl_base_files[] = {
{
.name = "cgroup.procs",
.seq_start = cgroup_pidlist_start,
.seq_next = cgroup_pidlist_next,
.seq_stop = cgroup_pidlist_stop,
.seq_show = cgroup_pidlist_show,
.private = CGROUP_FILE_PROCS,
.write = cgroup_procs_write,
.mode = S_IRUGO | S_IWUSR,
},
{
.name = "cgroup.controllers",
.flags = CFTYPE_ONLY_ON_ROOT,
.seq_show = cgroup_root_controllers_show,
},
{
.name = "cgroup.controllers",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = cgroup_controllers_show,
},
{
.name = "cgroup.subtree_control",
.seq_show = cgroup_subtree_control_show,
.write = cgroup_subtree_control_write,
},
{
.name = "cgroup.populated",
.flags = CFTYPE_NOT_ON_ROOT,
.seq_show = cgroup_populated_show,
},
{ } /* terminate */
};
/* cgroup core interface files for the legacy hierarchies */
static struct cftype cgroup_legacy_base_files[] = {
{
.name = "cgroup.procs",
.seq_start = cgroup_pidlist_start,
.seq_next = cgroup_pidlist_next,
.seq_stop = cgroup_pidlist_stop,
.seq_show = cgroup_pidlist_show,
.private = CGROUP_FILE_PROCS,
.write = cgroup_procs_write,
.mode = S_IRUGO | S_IWUSR,
},
{
.name = "cgroup.clone_children",
.read_u64 = cgroup_clone_children_read,
.write_u64 = cgroup_clone_children_write,
},
{
.name = "cgroup.sane_behavior",
.flags = CFTYPE_ONLY_ON_ROOT,
.seq_show = cgroup_sane_behavior_show,
},
{
.name = "tasks",
.seq_start = cgroup_pidlist_start,
.seq_next = cgroup_pidlist_next,
.seq_stop = cgroup_pidlist_stop,
.seq_show = cgroup_pidlist_show,
.private = CGROUP_FILE_TASKS,
.write = cgroup_tasks_write,
.mode = S_IRUGO | S_IWUSR,
},
{
.name = "notify_on_release",
.read_u64 = cgroup_read_notify_on_release,
.write_u64 = cgroup_write_notify_on_release,
},
{
.name = "release_agent",
.flags = CFTYPE_ONLY_ON_ROOT,
.seq_show = cgroup_release_agent_show,
.write = cgroup_release_agent_write,
.max_write_len = PATH_MAX - 1,
},
{ } /* terminate */
};
/**
* cgroup_populate_dir - create subsys files in a cgroup directory
* @cgrp: target cgroup
* @subsys_mask: mask of the subsystem ids whose files should be added
*
* On failure, no file is added.
*/
static int cgroup_populate_dir(struct cgroup *cgrp, unsigned int subsys_mask)
{
struct cgroup_subsys *ss;
int i, ret = 0;
/* process cftsets of each subsystem */
for_each_subsys(ss, i) {
struct cftype *cfts;
if (!(subsys_mask & (1 << i)))
continue;
list_for_each_entry(cfts, &ss->cfts, node) {
ret = cgroup_addrm_files(cgrp, cfts, true);
if (ret < 0)
goto err;
}
}
return 0;
err:
cgroup_clear_dir(cgrp, subsys_mask);
return ret;
}
/*
* css destruction is four-stage process.
*
* 1. Destruction starts. Killing of the percpu_ref is initiated.
* Implemented in kill_css().
*
* 2. When the percpu_ref is confirmed to be visible as killed on all CPUs
* and thus css_tryget_online() is guaranteed to fail, the css can be
* offlined by invoking offline_css(). After offlining, the base ref is
* put. Implemented in css_killed_work_fn().
*
* 3. When the percpu_ref reaches zero, the only possible remaining
* accessors are inside RCU read sections. css_release() schedules the
* RCU callback.
*
* 4. After the grace period, the css can be freed. Implemented in
* css_free_work_fn().
*
* It is actually hairier because both step 2 and 4 require process context
* and thus involve punting to css->destroy_work adding two additional
* steps to the already complex sequence.
*/
static void css_free_work_fn(struct work_struct *work)
{
struct cgroup_subsys_state *css =
container_of(work, struct cgroup_subsys_state, destroy_work);
struct cgroup *cgrp = css->cgroup;
percpu_ref_exit(&css->refcnt);
if (css->ss) {
/* css free path */
if (css->parent)
css_put(css->parent);
css->ss->css_free(css);
cgroup_put(cgrp);
} else {
/* cgroup free path */
atomic_dec(&cgrp->root->nr_cgrps);
cgroup_pidlist_destroy_all(cgrp);
if (cgroup_parent(cgrp)) {
/*
* We get a ref to the parent, and put the ref when
* this cgroup is being freed, so it's guaranteed
* that the parent won't be destroyed before its
* children.
*/
cgroup_put(cgroup_parent(cgrp));
kernfs_put(cgrp->kn);
kfree(cgrp);
} else {
/*
* This is root cgroup's refcnt reaching zero,
* which indicates that the root should be
* released.
*/
cgroup_destroy_root(cgrp->root);
}
}
}
static void css_free_rcu_fn(struct rcu_head *rcu_head)
{
struct cgroup_subsys_state *css =
container_of(rcu_head, struct cgroup_subsys_state, rcu_head);
INIT_WORK(&css->destroy_work, css_free_work_fn);
queue_work(cgroup_destroy_wq, &css->destroy_work);
}
static void css_release_work_fn(struct work_struct *work)
{
struct cgroup_subsys_state *css =
container_of(work, struct cgroup_subsys_state, destroy_work);
struct cgroup_subsys *ss = css->ss;
struct cgroup *cgrp = css->cgroup;
mutex_lock(&cgroup_mutex);
css->flags |= CSS_RELEASED;
list_del_rcu(&css->sibling);
if (ss) {
/* css release path */
cgroup_idr_remove(&ss->css_idr, css->id);
} else {
/* cgroup release path */
cgroup_idr_remove(&cgrp->root->cgroup_idr, cgrp->id);
cgrp->id = -1;
/*
* There are two control paths which try to determine
* cgroup from dentry without going through kernfs -
* cgroupstats_build() and css_tryget_online_from_dir().
* Those are supported by RCU protecting clearing of
* cgrp->kn->priv backpointer.
*/
RCU_INIT_POINTER(*(void __rcu __force **)&cgrp->kn->priv, NULL);
}
mutex_unlock(&cgroup_mutex);
call_rcu(&css->rcu_head, css_free_rcu_fn);
}
static void css_release(struct percpu_ref *ref)
{
struct cgroup_subsys_state *css =
container_of(ref, struct cgroup_subsys_state, refcnt);
INIT_WORK(&css->destroy_work, css_release_work_fn);
queue_work(cgroup_destroy_wq, &css->destroy_work);
}
static void init_and_link_css(struct cgroup_subsys_state *css,
struct cgroup_subsys *ss, struct cgroup *cgrp)
{
lockdep_assert_held(&cgroup_mutex);
cgroup_get(cgrp);
memset(css, 0, sizeof(*css));
css->cgroup = cgrp;
css->ss = ss;
INIT_LIST_HEAD(&css->sibling);
INIT_LIST_HEAD(&css->children);
css->serial_nr = css_serial_nr_next++;
if (cgroup_parent(cgrp)) {
css->parent = cgroup_css(cgroup_parent(cgrp), ss);
css_get(css->parent);
}
BUG_ON(cgroup_css(cgrp, ss));
}
/* invoke ->css_online() on a new CSS and mark it online if successful */
static int online_css(struct cgroup_subsys_state *css)
{
struct cgroup_subsys *ss = css->ss;
int ret = 0;
lockdep_assert_held(&cgroup_mutex);
if (ss->css_online)
ret = ss->css_online(css);
if (!ret) {
css->flags |= CSS_ONLINE;
rcu_assign_pointer(css->cgroup->subsys[ss->id], css);
}
return ret;
}
/* if the CSS is online, invoke ->css_offline() on it and mark it offline */
static void offline_css(struct cgroup_subsys_state *css)
{
struct cgroup_subsys *ss = css->ss;
lockdep_assert_held(&cgroup_mutex);
if (!(css->flags & CSS_ONLINE))
return;
if (ss->css_offline)
ss->css_offline(css);
css->flags &= ~CSS_ONLINE;
RCU_INIT_POINTER(css->cgroup->subsys[ss->id], NULL);
wake_up_all(&css->cgroup->offline_waitq);
}
/**
* create_css - create a cgroup_subsys_state
* @cgrp: the cgroup new css will be associated with
* @ss: the subsys of new css
* @visible: whether to create control knobs for the new css or not
*
* Create a new css associated with @cgrp - @ss pair. On success, the new
* css is online and installed in @cgrp with all interface files created if
* @visible. Returns 0 on success, -errno on failure.
*/
static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss,
bool visible)
{
struct cgroup *parent = cgroup_parent(cgrp);
struct cgroup_subsys_state *parent_css = cgroup_css(parent, ss);
struct cgroup_subsys_state *css;
int err;
lockdep_assert_held(&cgroup_mutex);
css = ss->css_alloc(parent_css);
if (IS_ERR(css))
return PTR_ERR(css);
init_and_link_css(css, ss, cgrp);
err = percpu_ref_init(&css->refcnt, css_release);
if (err)
goto err_free_css;
err = cgroup_idr_alloc(&ss->css_idr, NULL, 2, 0, GFP_NOWAIT);
if (err < 0)
goto err_free_percpu_ref;
css->id = err;
if (visible) {
err = cgroup_populate_dir(cgrp, 1 << ss->id);
if (err)
goto err_free_id;
}
/* @css is ready to be brought online now, make it visible */
list_add_tail_rcu(&css->sibling, &parent_css->children);
cgroup_idr_replace(&ss->css_idr, css, css->id);
err = online_css(css);
if (err)
goto err_list_del;
if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
cgroup_parent(parent)) {
pr_warn("%s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
current->comm, current->pid, ss->name);
if (!strcmp(ss->name, "memory"))
pr_warn("\"memory\" requires setting use_hierarchy to 1 on the root\n");
ss->warned_broken_hierarchy = true;
}
return 0;
err_list_del:
list_del_rcu(&css->sibling);
cgroup_clear_dir(css->cgroup, 1 << css->ss->id);
err_free_id:
cgroup_idr_remove(&ss->css_idr, css->id);
err_free_percpu_ref:
percpu_ref_exit(&css->refcnt);
err_free_css:
call_rcu(&css->rcu_head, css_free_rcu_fn);
return err;
}
static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
umode_t mode)
{
struct cgroup *parent, *cgrp;
struct cgroup_root *root;
struct cgroup_subsys *ss;
struct kernfs_node *kn;
struct cftype *base_files;
int ssid, ret;
/* Do not accept '\n' to prevent making /proc/<pid>/cgroup unparsable.
*/
if (strchr(name, '\n'))
return -EINVAL;
parent = cgroup_kn_lock_live(parent_kn);
if (!parent)
return -ENODEV;
root = parent->root;
/* allocate the cgroup and its ID, 0 is reserved for the root */
cgrp = kzalloc(sizeof(*cgrp), GFP_KERNEL);
if (!cgrp) {
ret = -ENOMEM;
goto out_unlock;
}
ret = percpu_ref_init(&cgrp->self.refcnt, css_release);
if (ret)
goto out_free_cgrp;
/*
* Temporarily set the pointer to NULL, so idr_find() won't return
* a half-baked cgroup.
*/
cgrp->id = cgroup_idr_alloc(&root->cgroup_idr, NULL, 2, 0, GFP_NOWAIT);
if (cgrp->id < 0) {
ret = -ENOMEM;
goto out_cancel_ref;
}
init_cgroup_housekeeping(cgrp);
cgrp->self.parent = &parent->self;
cgrp->root = root;
if (notify_on_release(parent))
set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &parent->flags))
set_bit(CGRP_CPUSET_CLONE_CHILDREN, &cgrp->flags);
/* create the directory */
kn = kernfs_create_dir(parent->kn, name, mode, cgrp);
if (IS_ERR(kn)) {
ret = PTR_ERR(kn);
goto out_free_id;
}
cgrp->kn = kn;
/*
* This extra ref will be put in cgroup_free_fn() and guarantees
* that @cgrp->kn is always accessible.
*/
kernfs_get(kn);
cgrp->self.serial_nr = css_serial_nr_next++;
/* allocation complete, commit to creation */
list_add_tail_rcu(&cgrp->self.sibling, &cgroup_parent(cgrp)->self.children);
atomic_inc(&root->nr_cgrps);
cgroup_get(parent);
/*
* @cgrp is now fully operational. If something fails after this
* point, it'll be released via the normal destruction path.
*/
cgroup_idr_replace(&root->cgroup_idr, cgrp, cgrp->id);
ret = cgroup_kn_set_ugid(kn);
if (ret)
goto out_destroy;
if (cgroup_on_dfl(cgrp))
base_files = cgroup_dfl_base_files;
else
base_files = cgroup_legacy_base_files;
ret = cgroup_addrm_files(cgrp, base_files, true);
if (ret)
goto out_destroy;
/* let's create and online css's */
for_each_subsys(ss, ssid) {
if (parent->child_subsys_mask & (1 << ssid)) {
ret = create_css(cgrp, ss,
parent->subtree_control & (1 << ssid));
if (ret)
goto out_destroy;
}
}
/*
* On the default hierarchy, a child doesn't automatically inherit
* subtree_control from the parent. Each is configured manually.
*/
if (!cgroup_on_dfl(cgrp)) {
cgrp->subtree_control = parent->subtree_control;
cgroup_refresh_child_subsys_mask(cgrp);
}
kernfs_activate(kn);
ret = 0;
goto out_unlock;
out_free_id:
cgroup_idr_remove(&root->cgroup_idr, cgrp->id);
out_cancel_ref:
percpu_ref_exit(&cgrp->self.refcnt);
out_free_cgrp:
kfree(cgrp);
out_unlock:
cgroup_kn_unlock(parent_kn);
return ret;
out_destroy:
cgroup_destroy_locked(cgrp);
goto out_unlock;
}
/*
* This is called when the refcnt of a css is confirmed to be killed.
* css_tryget_online() is now guaranteed to fail. Tell the subsystem to
* initate destruction and put the css ref from kill_css().
*/
static void css_killed_work_fn(struct work_struct *work)
{
struct cgroup_subsys_state *css =
container_of(work, struct cgroup_subsys_state, destroy_work);
mutex_lock(&cgroup_mutex);
offline_css(css);
mutex_unlock(&cgroup_mutex);
css_put(css);
}
/* css kill confirmation processing requires process context, bounce */
static void css_killed_ref_fn(struct percpu_ref *ref)
{
struct cgroup_subsys_state *css =
container_of(ref, struct cgroup_subsys_state, refcnt);
INIT_WORK(&css->destroy_work, css_killed_work_fn);
queue_work(cgroup_destroy_wq, &css->destroy_work);
}
/**
* kill_css - destroy a css
* @css: css to destroy
*
* This function initiates destruction of @css by removing cgroup interface
* files and putting its base reference. ->css_offline() will be invoked
* asynchronously once css_tryget_online() is guaranteed to fail and when
* the reference count reaches zero, @css will be released.
*/
static void kill_css(struct cgroup_subsys_state *css)
{
lockdep_assert_held(&cgroup_mutex);
/*
* This must happen before css is disassociated with its cgroup.
* See seq_css() for details.
*/
cgroup_clear_dir(css->cgroup, 1 << css->ss->id);
/*
* Killing would put the base ref, but we need to keep it alive
* until after ->css_offline().
*/
css_get(css);
/*
* cgroup core guarantees that, by the time ->css_offline() is
* invoked, no new css reference will be given out via
* css_tryget_online(). We can't simply call percpu_ref_kill() and
* proceed to offlining css's because percpu_ref_kill() doesn't
* guarantee that the ref is seen as killed on all CPUs on return.
*
* Use percpu_ref_kill_and_confirm() to get notifications as each
* css is confirmed to be seen as killed on all CPUs.
*/
percpu_ref_kill_and_confirm(&css->refcnt, css_killed_ref_fn);
}
/**
* cgroup_destroy_locked - the first stage of cgroup destruction
* @cgrp: cgroup to be destroyed
*
* css's make use of percpu refcnts whose killing latency shouldn't be
* exposed to userland and are RCU protected. Also, cgroup core needs to
* guarantee that css_tryget_online() won't succeed by the time
* ->css_offline() is invoked. To satisfy all the requirements,
* destruction is implemented in the following two steps.
*
* s1. Verify @cgrp can be destroyed and mark it dying. Remove all
* userland visible parts and start killing the percpu refcnts of
* css's. Set up so that the next stage will be kicked off once all
* the percpu refcnts are confirmed to be killed.
*
* s2. Invoke ->css_offline(), mark the cgroup dead and proceed with the
* rest of destruction. Once all cgroup references are gone, the
* cgroup is RCU-freed.
*
* This function implements s1. After this step, @cgrp is gone as far as
* the userland is concerned and a new cgroup with the same name may be
* created. As cgroup doesn't care about the names internally, this
* doesn't cause any problem.
*/
static int cgroup_destroy_locked(struct cgroup *cgrp)
__releases(&cgroup_mutex) __acquires(&cgroup_mutex)
{
struct cgroup_subsys_state *css;
bool empty;
int ssid;
lockdep_assert_held(&cgroup_mutex);
/*
* css_set_rwsem synchronizes access to ->cset_links and prevents
* @cgrp from being removed while put_css_set() is in progress.
*/
down_read(&css_set_rwsem);
empty = list_empty(&cgrp->cset_links);
up_read(&css_set_rwsem);
if (!empty)
return -EBUSY;
/*
* Make sure there's no live children. We can't test emptiness of
* ->self.children as dead children linger on it while being
* drained; otherwise, "rmdir parent/child parent" may fail.
*/
if (css_has_online_children(&cgrp->self))
return -EBUSY;
/*
* Mark @cgrp dead. This prevents further task migration and child
* creation by disabling cgroup_lock_live_group().
*/
cgrp->self.flags &= ~CSS_ONLINE;
/* initiate massacre of all css's */
for_each_css(css, ssid, cgrp)
kill_css(css);
/* CSS_ONLINE is clear, remove from ->release_list for the last time */
raw_spin_lock(&release_list_lock);
if (!list_empty(&cgrp->release_list))
list_del_init(&cgrp->release_list);
raw_spin_unlock(&release_list_lock);
/*
* Remove @cgrp directory along with the base files. @cgrp has an
* extra ref on its kn.
*/
kernfs_remove(cgrp->kn);
set_bit(CGRP_RELEASABLE, &cgroup_parent(cgrp)->flags);
check_for_release(cgroup_parent(cgrp));
/* put the base reference */
percpu_ref_kill(&cgrp->self.refcnt);
return 0;
};
static int cgroup_rmdir(struct kernfs_node *kn)
{
struct cgroup *cgrp;
int ret = 0;
cgrp = cgroup_kn_lock_live(kn);
if (!cgrp)
return 0;
cgroup_get(cgrp); /* for @kn->priv clearing */
ret = cgroup_destroy_locked(cgrp);
cgroup_kn_unlock(kn);
cgroup_put(cgrp);
return ret;
}
static struct kernfs_syscall_ops cgroup_kf_syscall_ops = {
.remount_fs = cgroup_remount,
.show_options = cgroup_show_options,
.mkdir = cgroup_mkdir,
.rmdir = cgroup_rmdir,
.rename = cgroup_rename,
};
static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early)
{
struct cgroup_subsys_state *css;
printk(KERN_INFO "Initializing cgroup subsys %s\n", ss->name);
mutex_lock(&cgroup_mutex);
idr_init(&ss->css_idr);
INIT_LIST_HEAD(&ss->cfts);
/* Create the root cgroup state for this subsystem */
ss->root = &cgrp_dfl_root;
css = ss->css_alloc(cgroup_css(&cgrp_dfl_root.cgrp, ss));
/* We don't handle early failures gracefully */
BUG_ON(IS_ERR(css));
init_and_link_css(css, ss, &cgrp_dfl_root.cgrp);
/*
* Root csses are never destroyed and we can't initialize
* percpu_ref during early init. Disable refcnting.
*/
css->flags |= CSS_NO_REF;
if (early) {
/* allocation can't be done safely during early init */
css->id = 1;
} else {
css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2, GFP_KERNEL);
BUG_ON(css->id < 0);
}
/* Update the init_css_set to contain a subsys
* pointer to this state - since the subsystem is
* newly registered, all tasks and hence the
* init_css_set is in the subsystem's root cgroup. */
init_css_set.subsys[ss->id] = css;
need_forkexit_callback |= ss->fork || ss->exit;
/* At system boot, before all subsystems have been
* registered, no tasks have been forked, so we don't
* need to invoke fork callbacks here. */
BUG_ON(!list_empty(&init_task.tasks));
BUG_ON(online_css(css));
mutex_unlock(&cgroup_mutex);
}
/**
* cgroup_init_early - cgroup initialization at system boot
*
* Initialize cgroups at system boot, and initialize any
* subsystems that request early init.
*/
int __init cgroup_init_early(void)
{
static struct cgroup_sb_opts __initdata opts;
struct cgroup_subsys *ss;
int i;
init_cgroup_root(&cgrp_dfl_root, &opts);
cgrp_dfl_root.cgrp.self.flags |= CSS_NO_REF;
RCU_INIT_POINTER(init_task.cgroups, &init_css_set);
for_each_subsys(ss, i) {
WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->id,
"invalid cgroup_subsys %d:%s css_alloc=%p css_free=%p name:id=%d:%s\n",
i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free,
ss->id, ss->name);
WARN(strlen(cgroup_subsys_name[i]) > MAX_CGROUP_TYPE_NAMELEN,
"cgroup_subsys_name %s too long\n", cgroup_subsys_name[i]);
ss->id = i;
ss->name = cgroup_subsys_name[i];
if (ss->early_init)
cgroup_init_subsys(ss, true);
}
return 0;
}
/**
* cgroup_init - cgroup initialization
*
* Register cgroup filesystem and /proc file, and initialize
* any subsystems that didn't request early init.
*/
int __init cgroup_init(void)
{
struct cgroup_subsys *ss;
unsigned long key;
int ssid, err;
BUG_ON(cgroup_init_cftypes(NULL, cgroup_dfl_base_files));
BUG_ON(cgroup_init_cftypes(NULL, cgroup_legacy_base_files));
mutex_lock(&cgroup_mutex);
/* Add init_css_set to the hash table */
key = css_set_hash(init_css_set.subsys);
hash_add(css_set_table, &init_css_set.hlist, key);
BUG_ON(cgroup_setup_root(&cgrp_dfl_root, 0));
mutex_unlock(&cgroup_mutex);
for_each_subsys(ss, ssid) {
if (ss->early_init) {
struct cgroup_subsys_state *css =
init_css_set.subsys[ss->id];
css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2,
GFP_KERNEL);
BUG_ON(css->id < 0);
} else {
cgroup_init_subsys(ss, false);
}
list_add_tail(&init_css_set.e_cset_node[ssid],
&cgrp_dfl_root.cgrp.e_csets[ssid]);
/*
* Setting dfl_root subsys_mask needs to consider the
* disabled flag and cftype registration needs kmalloc,
* both of which aren't available during early_init.
*/
if (ss->disabled)
continue;
cgrp_dfl_root.subsys_mask |= 1 << ss->id;
if (cgroup_legacy_files_on_dfl && !ss->dfl_cftypes)
ss->dfl_cftypes = ss->legacy_cftypes;
if (!ss->dfl_cftypes)
cgrp_dfl_root_inhibit_ss_mask |= 1 << ss->id;
if (ss->dfl_cftypes == ss->legacy_cftypes) {
WARN_ON(cgroup_add_cftypes(ss, ss->dfl_cftypes));
} else {
WARN_ON(cgroup_add_dfl_cftypes(ss, ss->dfl_cftypes));
WARN_ON(cgroup_add_legacy_cftypes(ss, ss->legacy_cftypes));
}
}
cgroup_kobj = kobject_create_and_add("cgroup", fs_kobj);
if (!cgroup_kobj)
return -ENOMEM;
err = register_filesystem(&cgroup_fs_type);
if (err < 0) {
kobject_put(cgroup_kobj);
return err;
}
proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
return 0;
}
static int __init cgroup_wq_init(void)
{
/*
* There isn't much point in executing destruction path in
* parallel. Good chunk is serialized with cgroup_mutex anyway.
* Use 1 for @max_active.
*
* We would prefer to do this in cgroup_init() above, but that
* is called before init_workqueues(): so leave this until after.
*/
cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1);
BUG_ON(!cgroup_destroy_wq);
/*
* Used to destroy pidlists and separate to serve as flush domain.
* Cap @max_active to 1 too.
*/
cgroup_pidlist_destroy_wq = alloc_workqueue("cgroup_pidlist_destroy",
0, 1);
BUG_ON(!cgroup_pidlist_destroy_wq);
return 0;
}
core_initcall(cgroup_wq_init);
/*
* proc_cgroup_show()
* - Print task's cgroup paths into seq_file, one line for each hierarchy
* - Used for /proc/<pid>/cgroup.
*/
/* TODO: Use a proper seq_file iterator */
int proc_cgroup_show(struct seq_file *m, void *v)
{
struct pid *pid;
struct task_struct *tsk;
char *buf, *path;
int retval;
struct cgroup_root *root;
retval = -ENOMEM;
buf = kmalloc(PATH_MAX, GFP_KERNEL);
if (!buf)
goto out;
retval = -ESRCH;
pid = m->private;
tsk = get_pid_task(pid, PIDTYPE_PID);
if (!tsk)
goto out_free;
retval = 0;
mutex_lock(&cgroup_mutex);
down_read(&css_set_rwsem);
for_each_root(root) {
struct cgroup_subsys *ss;
struct cgroup *cgrp;
int ssid, count = 0;
if (root == &cgrp_dfl_root && !cgrp_dfl_root_visible)
continue;
seq_printf(m, "%d:", root->hierarchy_id);
for_each_subsys(ss, ssid)
if (root->subsys_mask & (1 << ssid))
seq_printf(m, "%s%s", count++ ? "," : "", ss->name);
if (strlen(root->name))
seq_printf(m, "%sname=%s", count ? "," : "",
root->name);
seq_putc(m, ':');
cgrp = task_cgroup_from_root(tsk, root);
path = cgroup_path(cgrp, buf, PATH_MAX);
if (!path) {
retval = -ENAMETOOLONG;
goto out_unlock;
}
seq_puts(m, path);
seq_putc(m, '\n');
}
out_unlock:
up_read(&css_set_rwsem);
mutex_unlock(&cgroup_mutex);
put_task_struct(tsk);
out_free:
kfree(buf);
out:
return retval;
}
/* Display information about each subsystem and each hierarchy */
static int proc_cgroupstats_show(struct seq_file *m, void *v)
{
struct cgroup_subsys *ss;
int i;
seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n");
/*
* ideally we don't want subsystems moving around while we do this.
* cgroup_mutex is also necessary to guarantee an atomic snapshot of
* subsys/hierarchy state.
*/
mutex_lock(&cgroup_mutex);
for_each_subsys(ss, i)
seq_printf(m, "%s\t%d\t%d\t%d\n",
ss->name, ss->root->hierarchy_id,
atomic_read(&ss->root->nr_cgrps), !ss->disabled);
mutex_unlock(&cgroup_mutex);
return 0;
}
static int cgroupstats_open(struct inode *inode, struct file *file)
{
return single_open(file, proc_cgroupstats_show, NULL);
}
static const struct file_operations proc_cgroupstats_operations = {
.open = cgroupstats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/**
* cgroup_fork - initialize cgroup related fields during copy_process()
* @child: pointer to task_struct of forking parent process.
*
* A task is associated with the init_css_set until cgroup_post_fork()
* attaches it to the parent's css_set. Empty cg_list indicates that
* @child isn't holding reference to its css_set.
*/
void cgroup_fork(struct task_struct *child)
{
RCU_INIT_POINTER(child->cgroups, &init_css_set);
INIT_LIST_HEAD(&child->cg_list);
}
/**
* cgroup_post_fork - called on a new task after adding it to the task list
* @child: the task in question
*
* Adds the task to the list running through its css_set if necessary and
* call the subsystem fork() callbacks. Has to be after the task is
* visible on the task list in case we race with the first call to
* cgroup_task_iter_start() - to guarantee that the new task ends up on its
* list.
*/
void cgroup_post_fork(struct task_struct *child)
{
struct cgroup_subsys *ss;
int i;
/*
* This may race against cgroup_enable_task_cg_links(). As that
* function sets use_task_css_set_links before grabbing
* tasklist_lock and we just went through tasklist_lock to add
* @child, it's guaranteed that either we see the set
* use_task_css_set_links or cgroup_enable_task_cg_lists() sees
* @child during its iteration.
*
* If we won the race, @child is associated with %current's
* css_set. Grabbing css_set_rwsem guarantees both that the
* association is stable, and, on completion of the parent's
* migration, @child is visible in the source of migration or
* already in the destination cgroup. This guarantee is necessary
* when implementing operations which need to migrate all tasks of
* a cgroup to another.
*
* Note that if we lose to cgroup_enable_task_cg_links(), @child
* will remain in init_css_set. This is safe because all tasks are
* in the init_css_set before cg_links is enabled and there's no
* operation which transfers all tasks out of init_css_set.
*/
if (use_task_css_set_links) {
struct css_set *cset;
down_write(&css_set_rwsem);
cset = task_css_set(current);
if (list_empty(&child->cg_list)) {
rcu_assign_pointer(child->cgroups, cset);
list_add(&child->cg_list, &cset->tasks);
get_css_set(cset);
}
up_write(&css_set_rwsem);
}
/*
* Call ss->fork(). This must happen after @child is linked on
* css_set; otherwise, @child might change state between ->fork()
* and addition to css_set.
*/
if (need_forkexit_callback) {
for_each_subsys(ss, i)
if (ss->fork)
ss->fork(child);
}
}
/**
* cgroup_exit - detach cgroup from exiting task
* @tsk: pointer to task_struct of exiting process
*
* Description: Detach cgroup from @tsk and release it.
*
* Note that cgroups marked notify_on_release force every task in
* them to take the global cgroup_mutex mutex when exiting.
* This could impact scaling on very large systems. Be reluctant to
* use notify_on_release cgroups where very high task exit scaling
* is required on large systems.
*
* We set the exiting tasks cgroup to the root cgroup (top_cgroup). We
* call cgroup_exit() while the task is still competent to handle
* notify_on_release(), then leave the task attached to the root cgroup in
* each hierarchy for the remainder of its exit. No need to bother with
* init_css_set refcnting. init_css_set never goes away and we can't race
* with migration path - PF_EXITING is visible to migration path.
*/
void cgroup_exit(struct task_struct *tsk)
{
struct cgroup_subsys *ss;
struct css_set *cset;
bool put_cset = false;
int i;
/*
* Unlink from @tsk from its css_set. As migration path can't race
* with us, we can check cg_list without grabbing css_set_rwsem.
*/
if (!list_empty(&tsk->cg_list)) {
down_write(&css_set_rwsem);
list_del_init(&tsk->cg_list);
up_write(&css_set_rwsem);
put_cset = true;
}
/* Reassign the task to the init_css_set. */
cset = task_css_set(tsk);
RCU_INIT_POINTER(tsk->cgroups, &init_css_set);
if (need_forkexit_callback) {
/* see cgroup_post_fork() for details */
for_each_subsys(ss, i) {
if (ss->exit) {
struct cgroup_subsys_state *old_css = cset->subsys[i];
struct cgroup_subsys_state *css = task_css(tsk, i);
ss->exit(css, old_css, tsk);
}
}
}
if (put_cset)
put_css_set(cset, true);
}
static void check_for_release(struct cgroup *cgrp)
{
if (cgroup_is_releasable(cgrp) && list_empty(&cgrp->cset_links) &&
!css_has_online_children(&cgrp->self)) {
/*
* Control Group is currently removeable. If it's not
* already queued for a userspace notification, queue
* it now
*/
int need_schedule_work = 0;
raw_spin_lock(&release_list_lock);
if (!cgroup_is_dead(cgrp) &&
list_empty(&cgrp->release_list)) {
list_add(&cgrp->release_list, &release_list);
need_schedule_work = 1;
}
raw_spin_unlock(&release_list_lock);
if (need_schedule_work)
schedule_work(&release_agent_work);
}
}
/*
* Notify userspace when a cgroup is released, by running the
* configured release agent with the name of the cgroup (path
* relative to the root of cgroup file system) as the argument.
*
* Most likely, this user command will try to rmdir this cgroup.
*
* This races with the possibility that some other task will be
* attached to this cgroup before it is removed, or that some other
* user task will 'mkdir' a child cgroup of this cgroup. That's ok.
* The presumed 'rmdir' will fail quietly if this cgroup is no longer
* unused, and this cgroup will be reprieved from its death sentence,
* to continue to serve a useful existence. Next time it's released,
* we will get notified again, if it still has 'notify_on_release' set.
*
* The final arg to call_usermodehelper() is UMH_WAIT_EXEC, which
* means only wait until the task is successfully execve()'d. The
* separate release agent task is forked by call_usermodehelper(),
* then control in this thread returns here, without waiting for the
* release agent task. We don't bother to wait because the caller of
* this routine has no use for the exit status of the release agent
* task, so no sense holding our caller up for that.
*/
static void cgroup_release_agent(struct work_struct *work)
{
BUG_ON(work != &release_agent_work);
mutex_lock(&cgroup_mutex);
raw_spin_lock(&release_list_lock);
while (!list_empty(&release_list)) {
char *argv[3], *envp[3];
int i;
char *pathbuf = NULL, *agentbuf = NULL, *path;
struct cgroup *cgrp = list_entry(release_list.next,
struct cgroup,
release_list);
list_del_init(&cgrp->release_list);
raw_spin_unlock(&release_list_lock);
pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
if (!pathbuf)
goto continue_free;
path = cgroup_path(cgrp, pathbuf, PATH_MAX);
if (!path)
goto continue_free;
agentbuf = kstrdup(cgrp->root->release_agent_path, GFP_KERNEL);
if (!agentbuf)
goto continue_free;
i = 0;
argv[i++] = agentbuf;
argv[i++] = path;
argv[i] = NULL;
i = 0;
/* minimal command environment */
envp[i++] = "HOME=/";
envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
envp[i] = NULL;
/* Drop the lock while we invoke the usermode helper,
* since the exec could involve hitting disk and hence
* be a slow process */
mutex_unlock(&cgroup_mutex);
call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
mutex_lock(&cgroup_mutex);
continue_free:
kfree(pathbuf);
kfree(agentbuf);
raw_spin_lock(&release_list_lock);
}
raw_spin_unlock(&release_list_lock);
mutex_unlock(&cgroup_mutex);
}
static int __init cgroup_disable(char *str)
{
struct cgroup_subsys *ss;
char *token;
int i;
while ((token = strsep(&str, ",")) != NULL) {
if (!*token)
continue;
for_each_subsys(ss, i) {
if (!strcmp(token, ss->name)) {
ss->disabled = 1;
printk(KERN_INFO "Disabling %s control group"
" subsystem\n", ss->name);
break;
}
}
}
return 1;
}
__setup("cgroup_disable=", cgroup_disable);
static int __init cgroup_set_legacy_files_on_dfl(char *str)
{
printk("cgroup: using legacy files on the default hierarchy\n");
cgroup_legacy_files_on_dfl = true;
return 0;
}
__setup("cgroup__DEVEL__legacy_files_on_dfl", cgroup_set_legacy_files_on_dfl);
/**
* css_tryget_online_from_dir - get corresponding css from a cgroup dentry
* @dentry: directory dentry of interest
* @ss: subsystem of interest
*
* If @dentry is a directory for a cgroup which has @ss enabled on it, try
* to get the corresponding css and return it. If such css doesn't exist
* or can't be pinned, an ERR_PTR value is returned.
*/
struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry,
struct cgroup_subsys *ss)
{
struct kernfs_node *kn = kernfs_node_from_dentry(dentry);
struct cgroup_subsys_state *css = NULL;
struct cgroup *cgrp;
/* is @dentry a cgroup dir? */
if (dentry->d_sb->s_type != &cgroup_fs_type || !kn ||
kernfs_type(kn) != KERNFS_DIR)
return ERR_PTR(-EBADF);
rcu_read_lock();
/*
* This path doesn't originate from kernfs and @kn could already
* have been or be removed at any point. @kn->priv is RCU
* protected for this access. See css_release_work_fn() for details.
*/
cgrp = rcu_dereference(kn->priv);
if (cgrp)
css = cgroup_css(cgrp, ss);
if (!css || !css_tryget_online(css))
css = ERR_PTR(-ENOENT);
rcu_read_unlock();
return css;
}
/**
* css_from_id - lookup css by id
* @id: the cgroup id
* @ss: cgroup subsys to be looked into
*
* Returns the css if there's valid one with @id, otherwise returns NULL.
* Should be called under rcu_read_lock().
*/
struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss)
{
WARN_ON_ONCE(!rcu_read_lock_held());
return idr_find(&ss->css_idr, id);
}
#ifdef CONFIG_CGROUP_DEBUG
static struct cgroup_subsys_state *
debug_css_alloc(struct cgroup_subsys_state *parent_css)
{
struct cgroup_subsys_state *css = kzalloc(sizeof(*css), GFP_KERNEL);
if (!css)
return ERR_PTR(-ENOMEM);
return css;
}
static void debug_css_free(struct cgroup_subsys_state *css)
{
kfree(css);
}
static u64 debug_taskcount_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
return cgroup_task_count(css->cgroup);
}
static u64 current_css_set_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
return (u64)(unsigned long)current->cgroups;
}
static u64 current_css_set_refcount_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{
u64 count;
rcu_read_lock();
count = atomic_read(&task_css_set(current)->refcount);
rcu_read_unlock();
return count;
}
static int current_css_set_cg_links_read(struct seq_file *seq, void *v)
{
struct cgrp_cset_link *link;
struct css_set *cset;
char *name_buf;
name_buf = kmalloc(NAME_MAX + 1, GFP_KERNEL);
if (!name_buf)
return -ENOMEM;
down_read(&css_set_rwsem);
rcu_read_lock();
cset = rcu_dereference(current->cgroups);
list_for_each_entry(link, &cset->cgrp_links, cgrp_link) {
struct cgroup *c = link->cgrp;
cgroup_name(c, name_buf, NAME_MAX + 1);
seq_printf(seq, "Root %d group %s\n",
c->root->hierarchy_id, name_buf);
}
rcu_read_unlock();
up_read(&css_set_rwsem);
kfree(name_buf);
return 0;
}
#define MAX_TASKS_SHOWN_PER_CSS 25
static int cgroup_css_links_read(struct seq_file *seq, void *v)
{
struct cgroup_subsys_state *css = seq_css(seq);
struct cgrp_cset_link *link;
down_read(&css_set_rwsem);
list_for_each_entry(link, &css->cgroup->cset_links, cset_link) {
struct css_set *cset = link->cset;
struct task_struct *task;
int count = 0;
seq_printf(seq, "css_set %p\n", cset);
list_for_each_entry(task, &cset->tasks, cg_list) {
if (count++ > MAX_TASKS_SHOWN_PER_CSS)
goto overflow;
seq_printf(seq, " task %d\n", task_pid_vnr(task));
}
list_for_each_entry(task, &cset->mg_tasks, cg_list) {
if (count++ > MAX_TASKS_SHOWN_PER_CSS)
goto overflow;
seq_printf(seq, " task %d\n", task_pid_vnr(task));
}
continue;
overflow:
seq_puts(seq, " ...\n");
}
up_read(&css_set_rwsem);
return 0;
}
static u64 releasable_read(struct cgroup_subsys_state *css, struct cftype *cft)
{
return test_bit(CGRP_RELEASABLE, &css->cgroup->flags);
}
static struct cftype debug_files[] = {
{
.name = "taskcount",
.read_u64 = debug_taskcount_read,
},
{
.name = "current_css_set",
.read_u64 = current_css_set_read,
},
{
.name = "current_css_set_refcount",
.read_u64 = current_css_set_refcount_read,
},
{
.name = "current_css_set_cg_links",
.seq_show = current_css_set_cg_links_read,
},
{
.name = "cgroup_css_links",
.seq_show = cgroup_css_links_read,
},
{
.name = "releasable",
.read_u64 = releasable_read,
},
{ } /* terminate */
};
struct cgroup_subsys debug_cgrp_subsys = {
.css_alloc = debug_css_alloc,
.css_free = debug_css_free,
.legacy_cftypes = debug_files,
};
#endif /* CONFIG_CGROUP_DEBUG */
| dperezde/little-penguin | linux-eudyptula/kernel/cgroup.c | C | gpl-2.0 | 154,146 | [
30522,
1013,
1008,
1008,
12391,
2832,
1011,
19765,
2291,
1012,
1008,
1008,
2241,
2761,
2006,
1996,
17368,
13462,
2291,
1010,
15901,
2011,
2703,
2273,
4270,
1008,
9385,
1006,
1039,
1007,
2294,
8224,
1010,
4297,
1008,
1008,
26828,
2015,
2490,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
// Bloxx - Open Source Content Management System
//
// Copyright (c) 2002 - 2005 The Bloxx Team. All rights reserved.
//
// Bloxx is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// Bloxx is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Bloxx; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// Authors: Telmo Menezes <telmo@cognitiva.net>
//
// $Id: bloxx_lang_PT_personalinfo.php,v 1.3 2005-02-18 17:34:56 tmenezes Exp $
define('F_LANG_PERSONALINFO_USER_ID', 'ID do Utilizador');
define('F_LANG_PERSONALINFO_FULL_NAME', 'Nome Completo');
define('F_LANG_PERSONALINFO_ADDRESS', 'Morada');
define('F_LANG_PERSONALINFO_POSTAL_CODE', 'Código Postal');
define('F_LANG_PERSONALINFO_CITY', 'Cidade');
define('F_LANG_PERSONALINFO_PHONE_HOME', 'Telefone de Casa');
define('F_LANG_PERSONALINFO_PHONE_WORK', 'Telefone do Trabalho');
define('F_LANG_PERSONALINFO_PHONE_MOBILE', 'Telemóvel');
define('F_LANG_PERSONALINFO_BIRTH_DATE', 'Data de Nascimento');
define('F_LANG_PERSONALINFO_INFO', 'Informações');
define('LANG_PERSONALINFO_CREATE_INFO', 'Criar informação pessoal');
define('LANG_PERSONALINFO_EDIT_INFO', 'Editar informação pessoal');
?>
| telmomenezes/bloxx | lang/PT/bloxx_lang_PT_personalinfo.php | PHP | gpl-2.0 | 1,664 | [
30522,
1026,
1029,
25718,
1013,
1013,
1038,
4135,
20348,
1011,
2330,
3120,
4180,
2968,
2291,
1013,
1013,
1013,
1013,
9385,
1006,
1039,
1007,
2526,
1011,
2384,
1996,
1038,
4135,
20348,
2136,
1012,
2035,
2916,
9235,
1012,
1013,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("a11yhelp","tr",{title:"Erişilebilirlik Talimatları",contents:"Yardım içeriği. Bu pencereyi kapatmak için ESC tuşuna basın.",legend:[{name:"Genel",items:[{name:"Düzenleyici Araç Çubuğu",legend:"Araç çubuğunda gezinmek için ${toolbarFocus} basın. TAB ve SHIFT-TAB ile önceki ve sonraki araç çubuğu grubuna taşıyın. SAĞ OK veya SOL OK ile önceki ve sonraki bir araç çubuğu düğmesini hareket ettirin. SPACE tuşuna basın veya araç çubuğu düğmesini etkinleştirmek için ENTER tuşna basın."},
{name:"Diyalog Düzenleyici",legend:"Dialog penceresi içinde, sonraki iletişim alanına gitmek için SEKME tuşuna basın, önceki alana geçmek için SHIFT + TAB tuşuna basın, pencereyi göndermek için ENTER tuşuna basın, dialog penceresini iptal etmek için ESC tuşuna basın. Birden çok sekme sayfaları olan diyalogların, sekme listesine gitmek için ALT + F10 tuşlarına basın. Sonra TAB veya SAĞ OK sonraki sekmeye taşıyın. SHIFT + TAB veya SOL OK ile önceki sekmeye geçin. Sekme sayfayı seçmek için SPACE veya ENTER tuşuna basın."},
{name:"İçerik Menü Editörü",legend:"İçerik menüsünü açmak için ${contextMenu} veya UYGULAMA TUŞU'na basın. Daha sonra SEKME veya AŞAĞI OK ile bir sonraki menü seçeneği taşıyın. SHIFT + TAB veya YUKARI OK ile önceki seçeneğe gider. Menü seçeneğini seçmek için SPACE veya ENTER tuşuna basın. Seçili seçeneğin alt menüsünü SPACE ya da ENTER veya SAĞ OK açın. Üst menü öğesini geçmek için ESC veya SOL OK ile geri dönün. ESC ile bağlam menüsünü kapatın."},{name:"Liste Kutusu Editörü",legend:"Liste kutusu içinde, bir sonraki liste öğesine SEKME VEYA AŞAĞI OK ile taşıyın. SHIFT + TAB veya YUKARI önceki liste öğesi taşıyın. Liste seçeneği seçmek için SPACE veya ENTER tuşuna basın. Liste kutusunu kapatmak için ESC tuşuna basın."},
{name:"Element Yol Çubuğu Editörü",legend:"Elementlerin yol çubuğunda gezinmek için ${ElementsPathFocus} basın. SEKME veya SAĞ OK ile sonraki element düğmesine taşıyın. SHIFT + TAB veya SOL OK önceki düğmeye hareket ettirin. Editör içindeki elementi seçmek için ENTER veya SPACE tuşuna basın."}]},{name:"Komutlar",items:[{name:"Komutu geri al",legend:"$(undo)'ya basın"},{name:"Komutu geri al",legend:"${redo} basın"},{name:" Kalın komut",legend:"${bold} basın"},{name:" İtalik komutu",legend:"${italic} basın"},
{name:" Alttan çizgi komutu",legend:"${underline} basın"},{name:" Bağlantı komutu",legend:"${link} basın"},{name:" Araç çubuğu Toplama komutu",legend:"${toolbarCollapse} basın"},{name:"Önceki komut alanına odaklan",legend:"Düzeltme imleçinden önce, en yakın uzaktaki alana erişmek için ${accessPreviousSpace} basın, örneğin: iki birleşik HR elementleri. Aynı tuş kombinasyonu tekrarıyla diğer alanlarada ulaşın."},{name:"Sonraki komut alanına odaklan",legend:"Düzeltme imleçinden sonra, en yakın uzaktaki alana erişmek için ${accessNextSpace} basın, örneğin: iki birleşik HR elementleri. Aynı tuş kombinasyonu tekrarıyla diğer alanlarada ulaşın."},
{name:"Erişilebilirlik Yardımı",legend:"${a11yHelp}'e basın"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Sayfa Yukarı",pageDown:"Sayfa Aşağı",end:"End",home:"Home",leftArrow:"Sol ok",upArrow:"Yukarı ok",rightArrow:"Sağ ok",downArrow:"Aşağı ok",insert:"Insert","delete":"Silme",leftWindowKey:"Sol windows tuşu",rightWindowKey:"Sağ windows tuşu",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",
numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Çarpma",add:"Toplama",subtract:"Çıkarma",decimalPoint:"Ondalık işareti",divide:"Bölme",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Noktalı virgül",equalSign:"Eşittir",comma:"Virgül",dash:"Eksi",period:"Nokta",forwardSlash:"Forward Slash",
graveAccent:"Grave Accent",openBracket:"Parantez aç",backSlash:"Backslash",closeBracket:"Parantez kapa",singleQuote:"Tek tırnak"});
| mJehanno/myLittleBlog | Back/ckeditor/plugins/a11yhelp/dialogs/lang/tr.js | JavaScript | gpl-2.0 | 4,484 | [
30522,
1013,
1008,
9385,
1006,
1039,
1007,
2494,
1011,
2325,
1010,
23616,
6499,
3126,
3401,
1011,
15296,
2080,
14161,
7875,
10609,
1012,
2035,
2916,
9235,
1012,
2005,
13202,
1010,
2156,
6105,
1012,
9108,
2030,
8299,
1024,
1013,
1013,
23616,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jface.text.source;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.ITextViewerExtension5;
import org.eclipse.jface.text.JFaceTextUtil;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.source.projection.AnnotationBag;
/**
* Ruler presented next to a source viewer showing all annotations of the
* viewer's annotation model in a compact format. The ruler has the same height
* as the source viewer.
* <p>
* Clients usually instantiate and configure objects of this class.</p>
*
* @since 2.1
*/
public class OverviewRuler implements IOverviewRuler {
/**
* Internal listener class.
*/
class InternalListener implements ITextListener, IAnnotationModelListener, IAnnotationModelListenerExtension {
/*
* @see ITextListener#textChanged
*/
public void textChanged(TextEvent e) {
if (fTextViewer != null && e.getDocumentEvent() == null && e.getViewerRedrawState()) {
// handle only changes of visible document
redraw();
}
}
/*
* @see IAnnotationModelListener#modelChanged(IAnnotationModel)
*/
public void modelChanged(IAnnotationModel model) {
update();
}
/*
* @see org.eclipse.jface.text.source.IAnnotationModelListenerExtension#modelChanged(org.eclipse.jface.text.source.AnnotationModelEvent)
* @since 3.3
*/
public void modelChanged(AnnotationModelEvent event) {
if (!event.isValid())
return;
if (event.isWorldChange()) {
update();
return;
}
Annotation[] annotations= event.getAddedAnnotations();
int length= annotations.length;
for (int i= 0; i < length; i++) {
if (!skip(annotations[i].getType())) {
update();
return;
}
}
annotations= event.getRemovedAnnotations();
length= annotations.length;
for (int i= 0; i < length; i++) {
if (!skip(annotations[i].getType())) {
update();
return;
}
}
annotations= event.getChangedAnnotations();
length= annotations.length;
for (int i= 0; i < length; i++) {
if (!skip(annotations[i].getType())) {
update();
return;
}
}
}
}
/**
* Enumerates the annotations of a specified type and characteristics
* of the associated annotation model.
*/
class FilterIterator implements Iterator {
final static int TEMPORARY= 1 << 1;
final static int PERSISTENT= 1 << 2;
final static int IGNORE_BAGS= 1 << 3;
private Iterator fIterator;
private Object fType;
private Annotation fNext;
private int fStyle;
/**
* Creates a new filter iterator with the given specification.
*
* @param annotationType the annotation type
* @param style the style
*/
public FilterIterator(Object annotationType, int style) {
fType= annotationType;
fStyle= style;
if (fModel != null) {
fIterator= fModel.getAnnotationIterator();
skip();
}
}
/**
* Creates a new filter iterator with the given specification.
*
* @param annotationType the annotation type
* @param style the style
* @param iterator the iterator
*/
public FilterIterator(Object annotationType, int style, Iterator iterator) {
fType= annotationType;
fStyle= style;
fIterator= iterator;
skip();
}
private void skip() {
boolean temp= (fStyle & TEMPORARY) != 0;
boolean pers= (fStyle & PERSISTENT) != 0;
boolean ignr= (fStyle & IGNORE_BAGS) != 0;
while (fIterator.hasNext()) {
Annotation next= (Annotation) fIterator.next();
if (next.isMarkedDeleted())
continue;
if (ignr && (next instanceof AnnotationBag))
continue;
fNext= next;
Object annotationType= next.getType();
if (fType == null || fType.equals(annotationType) || !fConfiguredAnnotationTypes.contains(annotationType) && isSubtype(annotationType)) {
if (temp && pers) return;
if (pers && next.isPersistent()) return;
if (temp && !next.isPersistent()) return;
}
}
fNext= null;
}
private boolean isSubtype(Object annotationType) {
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess;
return extension.isSubtype(annotationType, fType);
}
return fType.equals(annotationType);
}
/*
* @see Iterator#hasNext()
*/
public boolean hasNext() {
return fNext != null;
}
/*
* @see Iterator#next()
*/
public Object next() {
try {
return fNext;
} finally {
if (fIterator != null)
skip();
}
}
/*
* @see Iterator#remove()
*/
public void remove() {
throw new UnsupportedOperationException();
}
}
/**
* The painter of the overview ruler's header.
*/
class HeaderPainter implements PaintListener {
private Color fIndicatorColor;
private Color fSeparatorColor;
/**
* Creates a new header painter.
*/
public HeaderPainter() {
fSeparatorColor= fHeader.getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
}
/**
* Sets the header color.
*
* @param color the header color
*/
public void setColor(Color color) {
fIndicatorColor= color;
}
private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topLeft, Color bottomRight) {
gc.setForeground(topLeft == null ? fSeparatorColor : topLeft);
gc.drawLine(x, y, x + w -1, y);
gc.drawLine(x, y, x, y + h -1);
gc.setForeground(bottomRight == null ? fSeparatorColor : bottomRight);
gc.drawLine(x + w, y, x + w, y + h);
gc.drawLine(x, y + h, x + w, y + h);
}
public void paintControl(PaintEvent e) {
if (fIndicatorColor == null)
return;
Point s= fHeader.getSize();
e.gc.setBackground(fIndicatorColor);
Rectangle r= new Rectangle(INSET, (s.y - (2*ANNOTATION_HEIGHT)) / 2, s.x - (2*INSET), 2*ANNOTATION_HEIGHT);
e.gc.fillRectangle(r);
Display d= fHeader.getDisplay();
if (d != null)
// drawBevelRect(e.gc, r.x, r.y, r.width -1, r.height -1, d.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW), d.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
drawBevelRect(e.gc, r.x, r.y, r.width -1, r.height -1, null, null);
e.gc.setForeground(fSeparatorColor);
e.gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
e.gc.drawLine(0, s.y -1, s.x -1, s.y -1);
}
}
private static final int INSET= 2;
private static final int ANNOTATION_HEIGHT= 4;
private static boolean ANNOTATION_HEIGHT_SCALABLE= true;
/** The model of the overview ruler */
private IAnnotationModel fModel;
/** The view to which this ruler is connected */
private ITextViewer fTextViewer;
/** The ruler's canvas */
private Canvas fCanvas;
/** The ruler's header */
private Canvas fHeader;
/** The buffer for double buffering */
private Image fBuffer;
/** The internal listener */
private InternalListener fInternalListener= new InternalListener();
/** The width of this vertical ruler */
private int fWidth;
/** The hit detection cursor. Do not dispose. */
private Cursor fHitDetectionCursor;
/** The last cursor. Do not dispose. */
private Cursor fLastCursor;
/** The line of the last mouse button activity */
private int fLastMouseButtonActivityLine= -1;
/** The actual annotation height */
private int fAnnotationHeight= -1;
/** The annotation access */
private IAnnotationAccess fAnnotationAccess;
/** The header painter */
private HeaderPainter fHeaderPainter;
/**
* The list of annotation types to be shown in this ruler.
* @since 3.0
*/
private Set fConfiguredAnnotationTypes= new HashSet();
/**
* The list of annotation types to be shown in the header of this ruler.
* @since 3.0
*/
private Set fConfiguredHeaderAnnotationTypes= new HashSet();
/** The mapping between annotation types and colors */
private Map fAnnotationTypes2Colors= new HashMap();
/** The color manager */
private ISharedTextColors fSharedTextColors;
/**
* All available annotation types sorted by layer.
*
* @since 3.0
*/
private List fAnnotationsSortedByLayer= new ArrayList();
/**
* All available layers sorted by layer.
* This list may contain duplicates.
* @since 3.0
*/
private List fLayersSortedByLayer= new ArrayList();
/**
* Map of allowed annotation types.
* An allowed annotation type maps to <code>true</code>, a disallowed
* to <code>false</code>.
* @since 3.0
*/
private Map fAllowedAnnotationTypes= new HashMap();
/**
* Map of allowed header annotation types.
* An allowed annotation type maps to <code>true</code>, a disallowed
* to <code>false</code>.
* @since 3.0
*/
private Map fAllowedHeaderAnnotationTypes= new HashMap();
/**
* The cached annotations.
* @since 3.0
*/
private List fCachedAnnotations= new ArrayList();
/**
* Redraw runnable lock
* @since 3.3
*/
private Object fRunnableLock= new Object();
/**
* Redraw runnable state
* @since 3.3
*/
private boolean fIsRunnablePosted= false;
/**
* Redraw runnable
* @since 3.3
*/
private Runnable fRunnable= new Runnable() {
public void run() {
synchronized (fRunnableLock) {
fIsRunnablePosted= false;
}
redraw();
updateHeader();
}
};
/**
* Tells whether temporary annotations are drawn with
* a separate color. This color will be computed by
* discoloring the original annotation color.
*
* @since 3.4
*/
private boolean fIsTemporaryAnnotationDiscolored;
/**
* Constructs a overview ruler of the given width using the given annotation access and the given
* color manager.
* <p><strong>Note:</strong> As of 3.4, temporary annotations are no longer discolored.
* Use {@link #OverviewRuler(IAnnotationAccess, int, ISharedTextColors, boolean)} if you
* want to keep the old behavior.</p>
*
* @param annotationAccess the annotation access
* @param width the width of the vertical ruler
* @param sharedColors the color manager
*/
public OverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors) {
this(annotationAccess, width, sharedColors, false);
}
/**
* Constructs a overview ruler of the given width using the given annotation
* access and the given color manager.
*
* @param annotationAccess the annotation access
* @param width the width of the vertical ruler
* @param sharedColors the color manager
* @param discolorTemporaryAnnotation <code>true</code> if temporary annotations should be discolored
* @since 3.4
*/
public OverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors, boolean discolorTemporaryAnnotation) {
fAnnotationAccess= annotationAccess;
fWidth= width;
fSharedTextColors= sharedColors;
fIsTemporaryAnnotationDiscolored= discolorTemporaryAnnotation;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRulerInfo#getControl()
*/
public Control getControl() {
return fCanvas;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRulerInfo#getWidth()
*/
public int getWidth() {
return fWidth;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#setModel(org.eclipse.jface.text.source.IAnnotationModel)
*/
public void setModel(IAnnotationModel model) {
if (model != fModel || model != null) {
if (fModel != null)
fModel.removeAnnotationModelListener(fInternalListener);
fModel= model;
if (fModel != null)
fModel.addAnnotationModelListener(fInternalListener);
update();
}
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#createControl(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.ITextViewer)
*/
public Control createControl(Composite parent, ITextViewer textViewer) {
fTextViewer= textViewer;
fHitDetectionCursor= parent.getDisplay().getSystemCursor(SWT.CURSOR_HAND);
fHeader= new Canvas(parent, SWT.NONE);
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
fHeader.addMouseTrackListener(new MouseTrackAdapter() {
/*
* @see org.eclipse.swt.events.MouseTrackAdapter#mouseHover(org.eclipse.swt.events.MouseEvent)
* @since 3.3
*/
public void mouseEnter(MouseEvent e) {
updateHeaderToolTipText();
}
});
}
fCanvas= new Canvas(parent, SWT.NO_BACKGROUND);
fCanvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent event) {
if (fTextViewer != null)
doubleBufferPaint(event.gc);
}
});
fCanvas.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
handleDispose();
fTextViewer= null;
}
});
fCanvas.addMouseListener(new MouseAdapter() {
public void mouseDown(MouseEvent event) {
handleMouseDown(event);
}
});
fCanvas.addMouseMoveListener(new MouseMoveListener() {
public void mouseMove(MouseEvent event) {
handleMouseMove(event);
}
});
if (fTextViewer != null)
fTextViewer.addTextListener(fInternalListener);
return fCanvas;
}
/**
* Disposes the ruler's resources.
*/
private void handleDispose() {
if (fTextViewer != null) {
fTextViewer.removeTextListener(fInternalListener);
fTextViewer= null;
}
if (fModel != null)
fModel.removeAnnotationModelListener(fInternalListener);
if (fBuffer != null) {
fBuffer.dispose();
fBuffer= null;
}
fConfiguredAnnotationTypes.clear();
fAllowedAnnotationTypes.clear();
fConfiguredHeaderAnnotationTypes.clear();
fAllowedHeaderAnnotationTypes.clear();
fAnnotationTypes2Colors.clear();
fAnnotationsSortedByLayer.clear();
fLayersSortedByLayer.clear();
}
/**
* Double buffer drawing.
*
* @param dest the GC to draw into
*/
private void doubleBufferPaint(GC dest) {
Point size= fCanvas.getSize();
if (size.x <= 0 || size.y <= 0)
return;
if (fBuffer != null) {
Rectangle r= fBuffer.getBounds();
if (r.width != size.x || r.height != size.y) {
fBuffer.dispose();
fBuffer= null;
}
}
if (fBuffer == null)
fBuffer= new Image(fCanvas.getDisplay(), size.x, size.y);
GC gc= new GC(fBuffer);
try {
gc.setBackground(fCanvas.getBackground());
gc.fillRectangle(0, 0, size.x, size.y);
cacheAnnotations();
if (fTextViewer instanceof ITextViewerExtension5)
doPaint1(gc);
else
doPaint(gc);
} finally {
gc.dispose();
}
dest.drawImage(fBuffer, 0, 0);
}
/**
* Draws this overview ruler.
*
* @param gc the GC to draw into
*/
private void doPaint(GC gc) {
Rectangle r= new Rectangle(0, 0, 0, 0);
int yy, hh= ANNOTATION_HEIGHT;
IDocument document= fTextViewer.getDocument();
IRegion visible= fTextViewer.getVisibleRegion();
StyledText textWidget= fTextViewer.getTextWidget();
int maxLines= textWidget.getLineCount();
Point size= fCanvas.getSize();
int writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines);
if (size.y > writable)
size.y= Math.max(writable - fHeader.getSize().y, 0);
for (Iterator iterator= fAnnotationsSortedByLayer.iterator(); iterator.hasNext();) {
Object annotationType= iterator.next();
if (skip(annotationType))
continue;
int[] style= new int[] { FilterIterator.PERSISTENT, FilterIterator.TEMPORARY };
for (int t=0; t < style.length; t++) {
Iterator e= new FilterIterator(annotationType, style[t], fCachedAnnotations.iterator());
boolean areColorsComputed= false;
Color fill= null;
Color stroke= null;
for (int i= 0; e.hasNext(); i++) {
Annotation a= (Annotation) e.next();
Position p= fModel.getPosition(a);
if (p == null || !p.overlapsWith(visible.getOffset(), visible.getLength()))
continue;
int annotationOffset= Math.max(p.getOffset(), visible.getOffset());
int annotationEnd= Math.min(p.getOffset() + p.getLength(), visible.getOffset() + visible.getLength());
int annotationLength= annotationEnd - annotationOffset;
try {
if (ANNOTATION_HEIGHT_SCALABLE) {
int numbersOfLines= document.getNumberOfLines(annotationOffset, annotationLength);
// don't count empty trailing lines
IRegion lastLine= document.getLineInformationOfOffset(annotationOffset + annotationLength);
if (lastLine.getOffset() == annotationOffset + annotationLength) {
numbersOfLines -= 2;
hh= (numbersOfLines * size.y) / maxLines + ANNOTATION_HEIGHT;
if (hh < ANNOTATION_HEIGHT)
hh= ANNOTATION_HEIGHT;
} else
hh= ANNOTATION_HEIGHT;
}
fAnnotationHeight= hh;
int startLine= textWidget.getLineAtOffset(annotationOffset - visible.getOffset());
yy= Math.min((startLine * size.y) / maxLines, size.y - hh);
if (!areColorsComputed) {
fill= getFillColor(annotationType, style[t] == FilterIterator.TEMPORARY);
stroke= getStrokeColor(annotationType, style[t] == FilterIterator.TEMPORARY);
areColorsComputed= true;
}
if (fill != null) {
gc.setBackground(fill);
gc.fillRectangle(INSET, yy, size.x-(2*INSET), hh);
}
if (stroke != null) {
gc.setForeground(stroke);
r.x= INSET;
r.y= yy;
r.width= size.x - (2 * INSET);
r.height= hh;
gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
gc.drawRectangle(r);
}
} catch (BadLocationException x) {
}
}
}
}
}
private void cacheAnnotations() {
fCachedAnnotations.clear();
if (fModel != null) {
Iterator iter= fModel.getAnnotationIterator();
while (iter.hasNext()) {
Annotation annotation= (Annotation) iter.next();
if (annotation.isMarkedDeleted())
continue;
if (skip(annotation.getType()))
continue;
fCachedAnnotations.add(annotation);
}
}
}
/**
* Draws this overview ruler. Uses <code>ITextViewerExtension5</code> for
* its implementation. Will replace <code>doPaint(GC)</code>.
*
* @param gc the GC to draw into
*/
private void doPaint1(GC gc) {
Rectangle r= new Rectangle(0, 0, 0, 0);
int yy, hh= ANNOTATION_HEIGHT;
ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
IDocument document= fTextViewer.getDocument();
StyledText textWidget= fTextViewer.getTextWidget();
int maxLines= textWidget.getLineCount();
Point size= fCanvas.getSize();
int writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines);
if (size.y > writable)
size.y= Math.max(writable - fHeader.getSize().y, 0);
for (Iterator iterator= fAnnotationsSortedByLayer.iterator(); iterator.hasNext();) {
Object annotationType= iterator.next();
if (skip(annotationType))
continue;
int[] style= new int[] { FilterIterator.PERSISTENT, FilterIterator.TEMPORARY };
for (int t=0; t < style.length; t++) {
Iterator e= new FilterIterator(annotationType, style[t], fCachedAnnotations.iterator());
boolean areColorsComputed= false;
Color fill= null;
Color stroke= null;
for (int i= 0; e.hasNext(); i++) {
Annotation a= (Annotation) e.next();
Position p= fModel.getPosition(a);
if (p == null)
continue;
IRegion widgetRegion= extension.modelRange2WidgetRange(new Region(p.getOffset(), p.getLength()));
if (widgetRegion == null)
continue;
try {
if (ANNOTATION_HEIGHT_SCALABLE) {
int numbersOfLines= document.getNumberOfLines(p.getOffset(), p.getLength());
// don't count empty trailing lines
IRegion lastLine= document.getLineInformationOfOffset(p.getOffset() + p.getLength());
if (lastLine.getOffset() == p.getOffset() + p.getLength()) {
numbersOfLines -= 2;
hh= (numbersOfLines * size.y) / maxLines + ANNOTATION_HEIGHT;
if (hh < ANNOTATION_HEIGHT)
hh= ANNOTATION_HEIGHT;
} else
hh= ANNOTATION_HEIGHT;
}
fAnnotationHeight= hh;
int startLine= textWidget.getLineAtOffset(widgetRegion.getOffset());
yy= Math.min((startLine * size.y) / maxLines, size.y - hh);
if (!areColorsComputed) {
fill= getFillColor(annotationType, style[t] == FilterIterator.TEMPORARY);
stroke= getStrokeColor(annotationType, style[t] == FilterIterator.TEMPORARY);
areColorsComputed= true;
}
if (fill != null) {
gc.setBackground(fill);
gc.fillRectangle(INSET, yy, size.x-(2*INSET), hh);
}
if (stroke != null) {
gc.setForeground(stroke);
r.x= INSET;
r.y= yy;
r.width= size.x - (2 * INSET);
r.height= hh;
gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
gc.drawRectangle(r);
}
} catch (BadLocationException x) {
}
}
}
}
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#update()
*/
public void update() {
if (fCanvas != null && !fCanvas.isDisposed()) {
Display d= fCanvas.getDisplay();
if (d != null) {
synchronized (fRunnableLock) {
if (fIsRunnablePosted)
return;
fIsRunnablePosted= true;
}
d.asyncExec(fRunnable);
}
}
}
/**
* Redraws the overview ruler.
*/
private void redraw() {
if (fTextViewer == null || fModel == null)
return;
if (fCanvas != null && !fCanvas.isDisposed()) {
GC gc= new GC(fCanvas);
doubleBufferPaint(gc);
gc.dispose();
}
}
/**
* Translates a given y-coordinate of this ruler into the corresponding
* document lines. The number of lines depends on the concrete scaling
* given as the ration between the height of this ruler and the length
* of the document.
*
* @param y_coordinate the y-coordinate
* @return the corresponding document lines
*/
private int[] toLineNumbers(int y_coordinate) {
StyledText textWidget= fTextViewer.getTextWidget();
int maxLines= textWidget.getContent().getLineCount();
int rulerLength= fCanvas.getSize().y;
int writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines);
if (rulerLength > writable)
rulerLength= Math.max(writable - fHeader.getSize().y, 0);
if (y_coordinate >= writable || y_coordinate >= rulerLength)
return new int[] {-1, -1};
int[] lines= new int[2];
int pixel0= Math.max(y_coordinate - 1, 0);
int pixel1= Math.min(rulerLength, y_coordinate + 1);
rulerLength= Math.max(rulerLength, 1);
lines[0]= (pixel0 * maxLines) / rulerLength;
lines[1]= (pixel1 * maxLines) / rulerLength;
if (fTextViewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
lines[0]= extension.widgetLine2ModelLine(lines[0]);
lines[1]= extension.widgetLine2ModelLine(lines[1]);
} else {
try {
IRegion visible= fTextViewer.getVisibleRegion();
int lineNumber= fTextViewer.getDocument().getLineOfOffset(visible.getOffset());
lines[0] += lineNumber;
lines[1] += lineNumber;
} catch (BadLocationException x) {
}
}
return lines;
}
/**
* Returns the position of the first annotation found in the given line range.
*
* @param lineNumbers the line range
* @return the position of the first found annotation
*/
private Position getAnnotationPosition(int[] lineNumbers) {
if (lineNumbers[0] == -1)
return null;
Position found= null;
try {
IDocument d= fTextViewer.getDocument();
IRegion line= d.getLineInformation(lineNumbers[0]);
int start= line.getOffset();
line= d.getLineInformation(lineNumbers[lineNumbers.length - 1]);
int end= line.getOffset() + line.getLength();
for (int i= fAnnotationsSortedByLayer.size() -1; i >= 0; i--) {
Object annotationType= fAnnotationsSortedByLayer.get(i);
Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY);
while (e.hasNext() && found == null) {
Annotation a= (Annotation) e.next();
if (a.isMarkedDeleted())
continue;
if (skip(a.getType()))
continue;
Position p= fModel.getPosition(a);
if (p == null)
continue;
int posOffset= p.getOffset();
int posEnd= posOffset + p.getLength();
IRegion region= d.getLineInformationOfOffset(posEnd);
// trailing empty lines don't count
if (posEnd > posOffset && region.getOffset() == posEnd) {
posEnd--;
region= d.getLineInformationOfOffset(posEnd);
}
if (posOffset <= end && posEnd >= start)
found= p;
}
}
} catch (BadLocationException x) {
}
return found;
}
/**
* Returns the line which corresponds best to one of
* the underlying annotations at the given y-coordinate.
*
* @param lineNumbers the line numbers
* @return the best matching line or <code>-1</code> if no such line can be found
*/
private int findBestMatchingLineNumber(int[] lineNumbers) {
if (lineNumbers == null || lineNumbers.length < 1)
return -1;
try {
Position pos= getAnnotationPosition(lineNumbers);
if (pos == null)
return -1;
return fTextViewer.getDocument().getLineOfOffset(pos.getOffset());
} catch (BadLocationException ex) {
return -1;
}
}
/**
* Handles mouse clicks.
*
* @param event the mouse button down event
*/
private void handleMouseDown(MouseEvent event) {
if (fTextViewer != null) {
int[] lines= toLineNumbers(event.y);
Position p= getAnnotationPosition(lines);
if (p == null && event.button == 1) {
try {
p= new Position(fTextViewer.getDocument().getLineInformation(lines[0]).getOffset(), 0);
} catch (BadLocationException e) {
// do nothing
}
}
if (p != null) {
fTextViewer.revealRange(p.getOffset(), p.getLength());
fTextViewer.setSelectedRange(p.getOffset(), p.getLength());
}
fTextViewer.getTextWidget().setFocus();
}
fLastMouseButtonActivityLine= toDocumentLineNumber(event.y);
}
/**
* Handles mouse moves.
*
* @param event the mouse move event
*/
private void handleMouseMove(MouseEvent event) {
if (fTextViewer != null) {
int[] lines= toLineNumbers(event.y);
Position p= getAnnotationPosition(lines);
Cursor cursor= (p != null ? fHitDetectionCursor : null);
if (cursor != fLastCursor) {
fCanvas.setCursor(cursor);
fLastCursor= cursor;
}
}
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#addAnnotationType(java.lang.Object)
*/
public void addAnnotationType(Object annotationType) {
fConfiguredAnnotationTypes.add(annotationType);
fAllowedAnnotationTypes.clear();
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#removeAnnotationType(java.lang.Object)
*/
public void removeAnnotationType(Object annotationType) {
fConfiguredAnnotationTypes.remove(annotationType);
fAllowedAnnotationTypes.clear();
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#setAnnotationTypeLayer(java.lang.Object, int)
*/
public void setAnnotationTypeLayer(Object annotationType, int layer) {
int j= fAnnotationsSortedByLayer.indexOf(annotationType);
if (j != -1) {
fAnnotationsSortedByLayer.remove(j);
fLayersSortedByLayer.remove(j);
}
if (layer >= 0) {
int i= 0;
int size= fLayersSortedByLayer.size();
while (i < size && layer >= ((Integer)fLayersSortedByLayer.get(i)).intValue())
i++;
Integer layerObj= new Integer(layer);
fLayersSortedByLayer.add(i, layerObj);
fAnnotationsSortedByLayer.add(i, annotationType);
}
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#setAnnotationTypeColor(java.lang.Object, org.eclipse.swt.graphics.Color)
*/
public void setAnnotationTypeColor(Object annotationType, Color color) {
if (color != null)
fAnnotationTypes2Colors.put(annotationType, color);
else
fAnnotationTypes2Colors.remove(annotationType);
}
/**
* Returns whether the given annotation type should be skipped by the drawing routine.
*
* @param annotationType the annotation type
* @return <code>true</code> if annotation of the given type should be skipped
*/
private boolean skip(Object annotationType) {
return !contains(annotationType, fAllowedAnnotationTypes, fConfiguredAnnotationTypes);
}
/**
* Returns whether the given annotation type should be skipped by the drawing routine of the header.
*
* @param annotationType the annotation type
* @return <code>true</code> if annotation of the given type should be skipped
* @since 3.0
*/
private boolean skipInHeader(Object annotationType) {
return !contains(annotationType, fAllowedHeaderAnnotationTypes, fConfiguredHeaderAnnotationTypes);
}
/**
* Returns whether the given annotation type is mapped to <code>true</code>
* in the given <code>allowed</code> map or covered by the <code>configured</code>
* set.
*
* @param annotationType the annotation type
* @param allowed the map with allowed annotation types mapped to booleans
* @param configured the set with configured annotation types
* @return <code>true</code> if annotation is contained, <code>false</code>
* otherwise
* @since 3.0
*/
private boolean contains(Object annotationType, Map allowed, Set configured) {
Boolean cached= (Boolean) allowed.get(annotationType);
if (cached != null)
return cached.booleanValue();
boolean covered= isCovered(annotationType, configured);
allowed.put(annotationType, covered ? Boolean.TRUE : Boolean.FALSE);
return covered;
}
/**
* Computes whether the annotations of the given type are covered by the given <code>configured</code>
* set. This is the case if either the type of the annotation or any of its
* super types is contained in the <code>configured</code> set.
*
* @param annotationType the annotation type
* @param configured the set with configured annotation types
* @return <code>true</code> if annotation is covered, <code>false</code>
* otherwise
* @since 3.0
*/
private boolean isCovered(Object annotationType, Set configured) {
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess;
Iterator e= configured.iterator();
while (e.hasNext()) {
if (extension.isSubtype(annotationType,e.next()))
return true;
}
return false;
}
return configured.contains(annotationType);
}
/**
* Returns a specification of a color that lies between the given
* foreground and background color using the given scale factor.
*
* @param fg the foreground color
* @param bg the background color
* @param scale the scale factor
* @return the interpolated color
*/
private static RGB interpolate(RGB fg, RGB bg, double scale) {
return new RGB(
(int) ((1.0-scale) * fg.red + scale * bg.red),
(int) ((1.0-scale) * fg.green + scale * bg.green),
(int) ((1.0-scale) * fg.blue + scale * bg.blue)
);
}
/**
* Returns the grey value in which the given color would be drawn in grey-scale.
*
* @param rgb the color
* @return the grey-scale value
*/
private static double greyLevel(RGB rgb) {
if (rgb.red == rgb.green && rgb.green == rgb.blue)
return rgb.red;
return (0.299 * rgb.red + 0.587 * rgb.green + 0.114 * rgb.blue + 0.5);
}
/**
* Returns whether the given color is dark or light depending on the colors grey-scale level.
*
* @param rgb the color
* @return <code>true</code> if the color is dark, <code>false</code> if it is light
*/
private static boolean isDark(RGB rgb) {
return greyLevel(rgb) > 128;
}
/**
* Returns a color based on the color configured for the given annotation type and the given scale factor.
*
* @param annotationType the annotation type
* @param scale the scale factor
* @return the computed color
*/
private Color getColor(Object annotationType, double scale) {
Color base= findColor(annotationType);
if (base == null)
return null;
RGB baseRGB= base.getRGB();
RGB background= fCanvas.getBackground().getRGB();
boolean darkBase= isDark(baseRGB);
boolean darkBackground= isDark(background);
if (darkBase && darkBackground)
background= new RGB(255, 255, 255);
else if (!darkBase && !darkBackground)
background= new RGB(0, 0, 0);
return fSharedTextColors.getColor(interpolate(baseRGB, background, scale));
}
/**
* Returns the color for the given annotation type
*
* @param annotationType the annotation type
* @return the color
* @since 3.0
*/
private Color findColor(Object annotationType) {
Color color= (Color) fAnnotationTypes2Colors.get(annotationType);
if (color != null)
return color;
if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess;
Object[] superTypes= extension.getSupertypes(annotationType);
if (superTypes != null) {
for (int i= 0; i < superTypes.length; i++) {
color= (Color) fAnnotationTypes2Colors.get(superTypes[i]);
if (color != null)
return color;
}
}
}
return null;
}
/**
* Returns the stroke color for the given annotation type and characteristics.
*
* @param annotationType the annotation type
* @param temporary <code>true</code> if for temporary annotations
* @return the stroke color
*/
private Color getStrokeColor(Object annotationType, boolean temporary) {
return getColor(annotationType, temporary && fIsTemporaryAnnotationDiscolored ? 0.5 : 0.2);
}
/**
* Returns the fill color for the given annotation type and characteristics.
*
* @param annotationType the annotation type
* @param temporary <code>true</code> if for temporary annotations
* @return the fill color
*/
private Color getFillColor(Object annotationType, boolean temporary) {
return getColor(annotationType, temporary && fIsTemporaryAnnotationDiscolored ? 0.9 : 0.75);
}
/*
* @see IVerticalRulerInfo#getLineOfLastMouseButtonActivity()
*/
public int getLineOfLastMouseButtonActivity() {
if (fLastMouseButtonActivityLine >= fTextViewer.getDocument().getNumberOfLines())
fLastMouseButtonActivityLine= -1;
return fLastMouseButtonActivityLine;
}
/*
* @see IVerticalRulerInfo#toDocumentLineNumber(int)
*/
public int toDocumentLineNumber(int y_coordinate) {
if (fTextViewer == null || y_coordinate == -1)
return -1;
int[] lineNumbers= toLineNumbers(y_coordinate);
int bestLine= findBestMatchingLineNumber(lineNumbers);
if (bestLine == -1 && lineNumbers.length > 0)
return lineNumbers[0];
return bestLine;
}
/*
* @see org.eclipse.jface.text.source.IVerticalRuler#getModel()
*/
public IAnnotationModel getModel() {
return fModel;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#getAnnotationHeight()
*/
public int getAnnotationHeight() {
return fAnnotationHeight;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#hasAnnotation(int)
*/
public boolean hasAnnotation(int y) {
return findBestMatchingLineNumber(toLineNumbers(y)) != -1;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#getHeaderControl()
*/
public Control getHeaderControl() {
return fHeader;
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#addHeaderAnnotationType(java.lang.Object)
*/
public void addHeaderAnnotationType(Object annotationType) {
fConfiguredHeaderAnnotationTypes.add(annotationType);
fAllowedHeaderAnnotationTypes.clear();
}
/*
* @see org.eclipse.jface.text.source.IOverviewRuler#removeHeaderAnnotationType(java.lang.Object)
*/
public void removeHeaderAnnotationType(Object annotationType) {
fConfiguredHeaderAnnotationTypes.remove(annotationType);
fAllowedHeaderAnnotationTypes.clear();
}
/**
* Updates the header of this ruler.
*/
private void updateHeader() {
if (fHeader == null || fHeader.isDisposed())
return;
fHeader.setToolTipText(null);
Object colorType= null;
outer: for (int i= fAnnotationsSortedByLayer.size() -1; i >= 0; i--) {
Object annotationType= fAnnotationsSortedByLayer.get(i);
if (skipInHeader(annotationType) || skip(annotationType))
continue;
Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY | FilterIterator.IGNORE_BAGS, fCachedAnnotations.iterator());
while (e.hasNext()) {
if (e.next() != null) {
colorType= annotationType;
break outer;
}
}
}
Color color= null;
if (colorType != null)
color= findColor(colorType);
if (color == null) {
if (fHeaderPainter != null)
fHeaderPainter.setColor(null);
} else {
if (fHeaderPainter == null) {
fHeaderPainter= new HeaderPainter();
fHeader.addPaintListener(fHeaderPainter);
}
fHeaderPainter.setColor(color);
}
fHeader.redraw();
}
/**
* Updates the header tool tip text of this ruler.
*/
private void updateHeaderToolTipText() {
if (fHeader == null || fHeader.isDisposed())
return;
if (fHeader.getToolTipText() != null)
return;
String overview= ""; //$NON-NLS-1$
for (int i= fAnnotationsSortedByLayer.size() -1; i >= 0; i--) {
Object annotationType= fAnnotationsSortedByLayer.get(i);
if (skipInHeader(annotationType) || skip(annotationType))
continue;
int count= 0;
String annotationTypeLabel= null;
Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY | FilterIterator.IGNORE_BAGS, fCachedAnnotations.iterator());
while (e.hasNext()) {
Annotation annotation= (Annotation)e.next();
if (annotation != null) {
if (annotationTypeLabel == null)
annotationTypeLabel= ((IAnnotationAccessExtension)fAnnotationAccess).getTypeLabel(annotation);
count++;
}
}
if (annotationTypeLabel != null) {
if (overview.length() > 0)
overview += "\n"; //$NON-NLS-1$
overview += JFaceTextMessages.getFormattedString("OverviewRulerHeader.toolTipTextEntry", new Object[] {annotationTypeLabel, new Integer(count)}); //$NON-NLS-1$
}
}
if (overview.length() > 0)
fHeader.setToolTipText(overview);
}
}
| neelance/jface4ruby | jface4ruby/src/org/eclipse/jface/text/source/OverviewRuler.java | Java | epl-1.0 | 39,538 | [
30522,
1013,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
# AUTOGENERATED FILE
FROM balenalib/jetson-tx1-ubuntu:focal-run
ENV NODE_VERSION 14.18.3
ENV YARN_VERSION 1.22.4
RUN buildDeps='curl libatomic1' \
&& set -x \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-arm64.tar.gz" \
&& echo "2d071ca1bc1d0ea1eb259e79b81ebb4387237b2f77b3cf616806534e0030eaa8 node-v$NODE_VERSION-linux-arm64.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-arm64.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-arm64.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt/yarn \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& npm config set unsafe-perm true -g --unsafe-perm \
&& rm -rf /tmp/*
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \
&& echo "Running test-stack@node" \
&& chmod +x test-stack@node.sh \
&& bash test-stack@node.sh \
&& rm -rf test-stack@node.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Ubuntu focal \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.18.3, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | resin-io-library/base-images | balena-base-images/node/jetson-tx1/ubuntu/focal/14.18.3/run/Dockerfile | Dockerfile | apache-2.0 | 2,906 | [
30522,
1001,
8285,
6914,
16848,
5371,
2013,
28352,
8189,
29521,
1013,
9924,
2239,
1011,
19067,
2487,
1011,
1057,
8569,
3372,
2226,
1024,
15918,
1011,
2448,
4372,
2615,
13045,
1035,
2544,
2403,
1012,
2324,
1012,
1017,
4372,
2615,
27158,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
from django import template
from django.utils.safestring import mark_safe
from mezzanine.conf import settings
from mezzanine_developer_extension.utils import refactor_html
register = template.Library()
# Checking settings.TEMPLATE_STYLE.
# Possible values are:
# - mezzanine_developer_extension.styles.macos
# - mezzanine_developer_extension.styles.ubuntu
# - mezzanine_developer_extension.styles.windows
_prefix = "mezzanine_developer_extension.styles"
try:
if settings.TERMINAL_STYLE not in \
["%s.macos" % _prefix, "%s.ubuntu" % _prefix, "%s.windows" % _prefix]:
# If the user has specified a wrong terminal styling format, we
# raise an exception warning about this.
msg = "Wrong terminal style format. Check the value of TERMINAL_STYLE"\
" in your settings.py file."
raise Exception(msg)
except AttributeError:
msg = "You have not specified a terminal output format. You have to"\
" define the attribute TERMINAL_STYLE in your settings.py"
raise Exception(msg)
@register.filter(name='safe_developer')
def safe_developer(content, style="macos"):
"""
Renders content without cleaning the original.
Replaces the terminal divs for a more complext html layout.
"""
new_content = refactor_html(content, style)
return mark_safe(new_content) | educalleja/mezzanine-developer-extension | mezzanine_developer_extension/templatetags/devfilters.py | Python | bsd-3-clause | 1,349 | [
30522,
2013,
6520,
23422,
12324,
23561,
2013,
6520,
23422,
1012,
21183,
12146,
1012,
3647,
3367,
4892,
12324,
2928,
1035,
3647,
2013,
2033,
20715,
19105,
1012,
9530,
2546,
12324,
10906,
2013,
2033,
20715,
19105,
1035,
9722,
1035,
5331,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!--
* Asterisk-GUI - an Asterisk configuration interface
*
* Set Date on the Digium Appliance - AA50
*
* Copyright (C) 2007-2008, Digium, Inc.
*
* Pari Nannapaneni <pari@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*
*
-->
<html>
<head>
<title>Update Date & Time</title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<style type="text/css"></style>
</head>
<body>
<div class="iframeTitleBar"> Update Date & Time <span style="cursor: pointer; cursor: hand;" onclick="window.location.reload();" > <img src="images/refresh.png" title=" Refresh " border=0 > </span> </div>
<div class='lite_Heading'> Update Date & Time </div>
<table width=700 border=0 align=left>
<tr> <td align=right><B>NTP server :</B></td>
<td>
<span id='NTPSERVER'></span>
<A href='#' class='splbutton' title='Edit NTP server' onclick="parent.miscFunctions.click_panel('networking.html');"><B>Edit</B></A>
</td>
</tr>
<tr> <td height=15></td><td></td></tr>
<tr> <td valign=top align=right><B>Current System Date :</B></td>
<td id='current_date'></td>
</tr>
<tr class='lite'>
<td valign=top align=right><B>Current System Date in Local Time :</B></td>
<td id='current_date_local'></td>
</tr>
<tr> <td height=15></td><td></td></tr>
<tr> <td valign=top align=right>
<B>Set New Date & Time :</B><BR>
<span class='lite'>Enter Date & Time in your Local time </span>
</td>
<td> <TABLE cellpadding=6 cellspacing=1 border=0>
<TR> <TD width=70 align=right>Date </TD>
<TD><input size=10 id="date_day"></TD>
</TR>
<TR> <TD width=70 align=right>Time</TD>
<TD> <!-- Time -->
<select id="hod"></select>:
<select id="minute"></select>
<select id="ampm">
<option value="AM">AM</option>
<option value="PM">PM</option>
</select>
<!-- Time -->
</TD>
</TR>
<TR>
<TD colspan=2 align=center>
<span class='guiButton' onclick='update_systemdate();'>Update</span>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
<script src="js/jquery.js"></script>
<script src="js/astman.js"></script>
<script src="js/jquery.tooltip.js"></script>
<script src="js/jquery.date_input.js"></script>
<script>
function localajaxinit(){
top.document.title = 'Set Date & Time' ;
parent.ASTGUI.dialog.waitWhile('Loading...');
$("#date_day").date_input();
(function(){
var x;
var hod = _$('hod');
var minute = _$('minute');
for(var i=1; i < 13; i++){
x = i.addZero();
ASTGUI.selectbox.append(hod, x , x);
}
for(var i=0; i < 60; i++){
x = i.addZero();
ASTGUI.selectbox.append(minute, x , x);
}
hod.selectedIndex = -1;
minute.selectedIndex = -1;
})();
(function(){
var c = context2json({ filename:'networking.conf' , context : 'general' , usf:1 });
_$('NTPSERVER').innerHTML = (c && c['NTP_ADDRESS']) || ' --';
})();
ASTGUI.systemCmdWithOutput( "date ", function(output){
_$('current_date').innerHTML = ' ' + output.bold_X('UTC') ;
_$('current_date_local').innerHTML = ' ' + ASTGUI.toLocalTime(output);
parent.ASTGUI.dialog.hide();
});
};
function update_systemdate(){
parent.ASTGUI.dialog.waitWhile('Updating Date & Time ...');
try{
// convert local time to UTC
var lt_minutes = _$('minute').value ; // 0 to 59
var date_day = _$("date_day").value ;
if( !date_day || (_$('hod').selectedIndex == -1 ) || ( _$('minute').selectedIndex == -1) ){
parent.ASTGUI.dialog.hide();
return;
}
var date_day_split = date_day.split(' ');
var lt_month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"].indexOf(date_day_split[1]); // 0 to 11
var lt_dom = date_day_split[0] ; // 1 to 31
lt_dom = lt_dom.addZero() ;
var lt_year = date_day_split[2] ; // 2007
// prepare commands to set the date
if( _$('ampm').value == "AM" ){
var lt_hours = (_$('hod').value == "12" )? "00" : _$('hod').value;
}else if( _$('ampm').value == "PM"){
var lt_hours = ( _$('hod').value == "12") ? parseInt( _$('hod').value) : parseInt( _$('hod').value) + 12 ;
}
var lt = new Date();
lt.setFullYear ( lt_year, lt_month, lt_dom );
lt.setHours ( lt_hours, lt_minutes );
var utc_hours = lt.getUTCHours(); // 0 to 23
var utc_minutes = lt.getUTCMinutes(); // 0 to 59
var utc_month = lt.getUTCMonth(); // 0 to 11
var utc_dom = lt.getUTCDate(); // 1 to 31
var utc_year = lt.getUTCFullYear() ; // 2007
if (utc_month < 10) { utc_month = "0"+ String(utc_month+1); }else{utc_month = String(utc_month+1) ;}
if (utc_dom < 10) { utc_dom = "0"+ String(utc_dom) ; }
if (utc_hours < 10) { utc_hours = "0"+ String(utc_hours) ; }
if (utc_minutes < 10) { utc_minutes = "0"+ String(utc_minutes) ; }
var newdate = utc_month + utc_dom + utc_hours + utc_minutes + utc_year ;
}catch(err){
parent.ASTGUI.dialog.hide();
return false;
}
parent.ASTGUI.systemCmd( "date -s " + newdate , function(){
parent.ASTGUI.dialog.hide();
var after = function(){
alert("You will be now logged out of the gui.\n Please login again !!");
var f = makeSyncRequest({ action :'logoff'});
top.window.location.reload();
};
ASTGUI.feedback( { msg:'updated date & time', showfor:2 });
setTimeout( after, 1000 );
});
}
</script>
</body>
</html>
| wardmundy/asterisk-gui-2.0 | config/date.html | HTML | gpl-2.0 | 5,866 | [
30522,
1026,
999,
1011,
1011,
1008,
2004,
3334,
20573,
1011,
26458,
1011,
2019,
2004,
3334,
20573,
9563,
8278,
1008,
1008,
2275,
3058,
2006,
1996,
10667,
5007,
10439,
15204,
3401,
1011,
9779,
12376,
1008,
1008,
9385,
1006,
1039,
1007,
2289,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "{{%vacancy}}".
*
* @property integer $id
* @property string $date
* @property integer $firm_id
* @property integer $profession_id
* @property string $salary
* @property string $note
* @property integer $workplace_id
* @property integer $rec_status_id
* @property integer $user_id
* @property string $dc
*
* @property Resume[] $resumes
* @property Profession $profession
* @property Workplace $workplace
* @property User $user
* @property RecStatus $recStatus
* @property Firm $firm
*/
class Vacancy extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%vacancy}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['note', 'date'], 'filter', 'filter' => 'trim'],
[['note', 'date', 'user_id'], 'default'],
[['rec_status_id'], 'default', 'value' => 1],
[['user_id'], 'default', 'value' => Yii::$app->user->id],
[['date'], 'default', 'value' => Yii::$app->formatter->asDate(time())],
[['firm_id', 'profession_id', 'workplace_id'], 'required'],
[['date'], 'date', 'format' => 'dd.mm.yyyy'],
[['note'], 'string'],
[['firm_id', 'profession_id', 'workplace_id', 'rec_status_id', 'user_id'], 'integer'],
[['dc'], 'safe'],
[['salary'], 'number'],
];
}
/**
* @inheritdoc
*/
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
$this->date = $this->date ? Yii::$app->formatter->asDate($this->date,'php:Y-m-d') : null;
return true;
} else {
return false;
}
}
/**
* @inheritdoc
*/
public function afterFind()
{
$this->date = $this->date ? Yii::$app->formatter->asDate($this->date) : null;
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('app', 'ID'),
'date' => Yii::t('app', 'Дата'),
'firm_id' => Yii::t('app', 'Фирма-работодатель'),
'profession_id' => Yii::t('app', 'Должность'),
'salary' => Yii::t('app', 'Зарплата'),
'note' => Yii::t('app', 'Описание'),
'workplace_id' => Yii::t('app', 'Рабочее место'),
'rec_status_id' => Yii::t('app', 'Состояние записи'),
'user_id' => Yii::t('app', 'Кем добавлена запись'),
'dc' => Yii::t('app', 'Когда добавлена запись'),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getResumes()
{
return $this->hasMany(Resume::className(), ['vacancy_id' => 'id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProfession()
{
return $this->hasOne(Profession::className(), ['id' => 'profession_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getWorkplace()
{
return $this->hasOne(Workplace::className(), ['id' => 'workplace_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getUser()
{
return $this->hasOne(User::className(), ['id' => 'user_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getRecStatus()
{
return $this->hasOne(RecStatus::className(), ['id' => 'rec_status_id']);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getFirm()
{
return $this->hasOne(Firm::className(), ['id' => 'firm_id']);
}
/**
* @inheritdoc
* @return \app\models\queries\VacancyQuery the active query used by this AR class.
*/
public static function find()
{
return new \app\models\queries\VacancyQuery(get_called_class());
}
}
| slavam/placement | models/Vacancy.php | PHP | bsd-3-clause | 4,058 | [
30522,
1026,
1029,
25718,
3415,
15327,
10439,
1032,
4275,
1025,
2224,
12316,
2072,
1025,
1013,
1008,
1008,
1008,
2023,
2003,
1996,
2944,
2465,
2005,
2795,
1000,
1063,
1063,
1003,
15619,
1065,
1065,
1000,
1012,
1008,
1008,
1030,
3200,
16109,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
#include "queue.h"
struct qmessage genrandmessage(){
int i;
struct qmessage ret;
i=rand()%10;
strcpy(ret.text,getmesstext(i)); //Установка текста сообщения
ret.delay=rand()%200000+400000;
strcpy(ret.iface,"IFACE");
return ret;
}
| Finikssky/fdhcp | src/libqueue/genrandmessage.c | C | gpl-2.0 | 284 | [
30522,
1001,
2421,
1000,
24240,
1012,
1044,
1000,
2358,
6820,
6593,
1053,
7834,
3736,
3351,
8991,
13033,
7834,
3736,
3351,
1006,
1007,
1063,
20014,
1045,
1025,
2358,
6820,
6593,
1053,
7834,
3736,
3351,
2128,
2102,
1025,
1045,
1027,
14566,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jan Kuhl</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/stylesheets/style.css" rel="stylesheet" type="text/css" />
<link href="/feed/atom.xml" rel="alternate" type="application/atom+xml" />
<script src="/javascripts/css_browser_selector.js" type="text/javascript"></script>
</head>
<body>
<div id="header">
<div class="inside">
<h2><a href="/">Jan Kuhl</a></h2>
<p class="description">Geschenk-, Schul- und Kinderbuchautor</p>
</div>
</div>
<div id="primary" class="single-post">
<div class="inside">
<div class="secondary">
<div class="featured">
<dl>
<dt>Erstmals veröffentlicht:</dt>
<dd>05.10.05</dd>
</dl>
<dl>
<dt>Updated:</dt>
<dd>14.11.07</dd>
</dl>
<dl>
<dt>Kategorien:</dt>
<dd>
<a href="/pressestimmen">Pressestimmen</a>
</dd>
</dl>
<dl>
<dt>Tags:</dt>
<dd>
<a href="/tags/König-Fittipaldi" rel="tag">König-Fittipaldi</a>
<a href="/tags/Presse" rel="tag">Presse</a>
<a href="/tags/Schreiben-mit-Kindern" rel="tag">Schreiben-mit-Kindern</a>
</dd>
</dl>
</div>
</div>
<hr class="hide" />
<div class="primary story">
<h1><a href="/2005/10/5/geschichten-von-koenig-fittipaldi-lassen-kinderherzen-hoeher-schlagen">Geschichten von "König Fittipaldi" lassen Kinderherzen höher schlagen</a></h1>
<p><img src="/assets/2007/11/7/Scan10018.jpg" alt="jan" title="jan"/></p>
</div>
<div class="clear"></div>
</div>
</div>
<!-- [END] #primary -->
<!-- Comments -->
<hr class="hide" />
<div id="ancillary">
<div class="inside">
<div class="block first">
<h2>Zur Person</h2>
<img src="/images/jankuhl.png" align=left height=120>
<p>Jan Kuhl ist Geschenk-, Schul- und Kinderbuchautor. Im Rahmen der Leseförderung an Grundschulen führt er regelmäßig gemeinsam mit SchülerInnen Kinderbuchprojekte durch.
Er ist Träger des Marburger Literaturpreises Regio 2005.</p>
</div>
<div class="block">
<h2>Weitere aktuelle Themen</h2>
<ul class="dates">
<li>
<a href="/2008/6/1/neu-neu-neu">
<span class="date">
01.06.
</span>
Neu! Neu! Neu!
</a>
</li>
<li>
<a href="/2008/5/31/ein-blick-durch-die-rosarote-brille">
<span class="date">
31.05.
</span>
Ein Blick durch die rosarote Brille...
</a>
</li>
<li>
<a href="/2008/5/31/jan-kuhl-referiert-auf-dem-jako-o-familienkongress-2008">
<span class="date">
31.05.
</span>
Jan Kuhl referiert auf dem JAKO-O-Familienkongress 2008
</a>
</li>
<li>
<a href="/2008/5/28/harry-sucht-sally-auf-der-frankfurter-buchmesse">
<span class="date">
28.05.
</span>
"Harry sucht Sally" auf der Frankfurter Buchmesse
</a>
</li>
<li>
<a href="/2007/11/18/meine-neue-website-ist-online">
<span class="date">
18.11.
</span>
Neue Webseite ist online!
</a>
</li>
<li><a href="/feed/atom.xml">
<img src="/images/feed_icon32x32.png" align=right height=16>
Abonniere Feed</a></li>
</ul>
</div>
<div class="block">
<h2>Konkrete Informationen zu</h2>
<ul class="counts">
<li><a href="http://astore.amazon.de/jankuhl-21">Online Shop</a>
</li>
<li><a class="selected" href="/profil">Profil</a></li>
<li><a href="/buecher">Buchveröffentlichungen</a></li>
<li><a href="/projekte">Projekte</a></li>
<li><a href="/gedanken-zu-schule-und-lernen">Gedanken zu Schule und Lernen</a></li>
<li><a href="/mein-leben-als-autor">Mein Leben als Autor</a></li>
<li><a href="/auszeichnungen-und-preise">Auszeichnungen und Preise</a></li>
<li><a href="/fotogalarie">Fotogalerie</a></li>
<li><a href="/pressestimmen">Pressestimmen</a></li>
</ul>
</div>
<div class="block">
<!-- tagcloud -->
<h2>Suche nach Stichworten/ Tagcloud</h2>
<p style="overflow:hidden" class="tagcloud">
<span style='font-size: 1.18em'><a title='Auszeichnung (6)' href='/tags/Auszeichnung'>Auszeichnung</a></span>/
<span style='font-size: 1.04em'><a title='Buchmesse (2)' href='/tags/Buchmesse'>Buchmesse</a></span>/
<span style='font-size: 1.07em'><a title='Jan-Kuhl (3)' href='/tags/Jan-Kuhl'>Jan-Kuhl</a></span>/
<span style='font-size: 1.15em'><a title='König-Fittipaldi (5)' href='/tags/König-Fittipaldi'>König-Fittipaldi</a></span>/
<span style='font-size: 1.18em'><a title='Literaturpreis (6)' href='/tags/Literaturpreis'>Literaturpreis</a></span>/
<span style='font-size: 1.00em'><a title='Neue ars edition Reihen 2008 (1)' href='/tags/Neue ars edition Reihen 2008'>Neue ars edition Reihen 2008</a></span>/
<span style='font-size: 1.41em'><a title='Presse (12)' href='/tags/Presse'>Presse</a></span>/
<span style='font-size: 1.11em'><a title='Projekt:Kinderbuch (4)' href='/tags/Projekt:Kinderbuch'>Kinderbuch</a></span>/
<span style='font-size: 1.15em'><a title='Projekt:König-Fittipaldi (5)' href='/tags/Projekt:König-Fittipaldi'>König-Fittipaldi</a></span>/
<span style='font-size: 1.04em'><a title='Projekt:Lesung (2)' href='/tags/Projekt:Lesung'>Lesung</a></span>/
<span style='font-size: 1.07em'><a title='Schreiben-mit-Kindern (3)' href='/tags/Schreiben-mit-Kindern'>Schreiben-mit-Kindern</a></span>/
<span style='font-size: 1.70em'><a title='Teaser:Geschenkbuch (20)' href='/tags/Teaser:Geschenkbuch'>Geschenkbuch</a></span>/
<span style='font-size: 1.00em'><a title='Teaser:Kinderbuch (1)' href='/tags/Teaser:Kinderbuch'>Kinderbuch</a></span>/
<span style='font-size: 1.00em'><a title='Teaser:Schulbuch (1)' href='/tags/Teaser:Schulbuch'>Schulbuch</a></span>/
<span style='font-size: 1.00em'><a title='Teaser:Unterrichtsmaterialien (1)' href='/tags/Teaser:Unterrichtsmaterialien'>Unterrichtsmaterialien</a></span>/
</p>
<!-- search -->
<div id="search" class="search">
<form action="/search" id="sform" method="get" name="sform">
<p>
<input type="text" id="q" name="q" tag="Warten" value="Stichworte eingeben und bestätigen" />
</p>
</form>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<hr class="hide" />
<div id="footer">
<div class="inside">
<p>Copyright © 2004-2008 Jan Kuhl. All rights reserved.</p>
<p><a href="/profil/impressum">Impressum</a></p>
</div>
</div>
<!-- [END] #footer -->
</body>
</html>
| vaudoc/jk | public/2005/10/5/geschichten-von-koenig-fittipaldi-lassen-kinderherzen-hoeher-schlagen.html | HTML | mit | 7,155 | [
30522,
1026,
999,
9986,
13874,
16129,
2270,
1000,
1011,
1013,
1013,
1059,
2509,
2278,
1013,
1013,
26718,
2094,
1060,
11039,
19968,
1015,
1012,
1014,
17459,
1013,
1013,
4372,
1000,
1000,
8299,
1024,
1013,
1013,
7479,
1012,
1059,
2509,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/* MapleLib - A general-purpose MapleStory library
* Copyright (C) 2009, 2010, 2015 Snow and haha01haha01
* This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
* This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.*/
using System.IO;
using MapleLib.WzLib.Util;
namespace MapleLib.WzLib.WzProperties
{
/// <summary>
/// A property with a string as a value
/// </summary>
public class WzStringProperty : WzImageProperty
{
#region Fields
internal string name, val;
internal WzObject parent;
//internal WzImage imgParent;
#endregion
#region Inherited Members
public override void SetValue(object value)
{
val = (string)value;
}
public override WzImageProperty DeepClone()
{
WzStringProperty clone = new WzStringProperty(name, val);
return clone;
}
public override object WzValue { get { return Value; } }
/// <summary>
/// The parent of the object
/// </summary>
public override WzObject Parent { get { return parent; } internal set { parent = value; } }
/*/// <summary>
/// The image that this property is contained in
/// </summary>
public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/
/// <summary>
/// The WzPropertyType of the property
/// </summary>
public override WzPropertyType PropertyType { get { return WzPropertyType.String; } }
/// <summary>
/// The name of the property
/// </summary>
public override string Name { get { return name; } set { name = value; } }
public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
{
writer.Write((byte)8);
writer.WriteStringValue(Value, 0, 1);
}
public override void ExportXml(StreamWriter writer, int level)
{
writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedValuePair("WzString", this.Name, this.Value));
}
/// <summary>
/// Disposes the object
/// </summary>
public override void Dispose()
{
name = null;
val = null;
}
#endregion
#region Custom Members
/// <summary>
/// The value of the property
/// </summary>
public string Value { get { return val; } set { val = value; } }
/// <summary>
/// Creates a blank WzStringProperty
/// </summary>
public WzStringProperty() { }
/// <summary>
/// Creates a WzStringProperty with the specified name
/// </summary>
/// <param name="name">The name of the property</param>
public WzStringProperty(string name)
{
this.name = name;
}
/// <summary>
/// Creates a WzStringProperty with the specified name and value
/// </summary>
/// <param name="name">The name of the property</param>
/// <param name="value">The value of the property</param>
public WzStringProperty(string name, string value)
{
this.name = name;
this.val = value;
}
#endregion
#region Cast Values
public override string GetString()
{
return val;
}
public override string ToString()
{
return val;
}
#endregion
}
} | haha01haha01/MapleLib | WzLib/WzProperties/WzStringProperty.cs | C# | gpl-3.0 | 3,632 | [
30522,
1013,
1008,
11035,
29521,
1011,
1037,
2236,
1011,
3800,
11035,
23809,
2100,
3075,
1008,
9385,
1006,
1039,
1007,
2268,
1010,
2230,
1010,
2325,
4586,
1998,
5292,
3270,
24096,
3270,
3270,
24096,
1008,
2023,
2565,
2003,
2489,
4007,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
/*
DO NOT EDIT THIS FILE!
it has been automaticaly created by php7/scripts/credits from
the information found in the various php7/ext/.../CREDITS and
php7/sapi/.../CREDITS files
if you want to change an entry you have to edit the appropriate
CREDITS file instead
*/
CREDIT_LINE("Apache 2.0 Handler", "Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code)");
CREDIT_LINE("CGI / FastCGI", "Rasmus Lerdorf, Stig Bakken, Shane Caraveo, Dmitry Stogov");
CREDIT_LINE("CLI", "Edin Kadribasic, Marcus Boerger, Johannes Schlueter, Moriyoshi Koizumi, Xinchen Hui");
CREDIT_LINE("Embed", "Edin Kadribasic");
CREDIT_LINE("FastCGI Process Manager", "Andrei Nigmatulin, dreamcat4, Antony Dovgal, Jerome Loyet");
CREDIT_LINE("litespeed", "George Wang");
CREDIT_LINE("phpdbg", "Felipe Pena, Joe Watkins, Bob Weinand");
| elmoke/openshift-cartridge-php | usr/php-7.0.1/include/php/ext/standard/credits_sapi.h | C | mit | 851 | [
30522,
1013,
1008,
2079,
2025,
10086,
2023,
5371,
999,
2009,
2038,
2042,
6882,
20766,
2580,
2011,
25718,
2581,
1013,
14546,
1013,
6495,
2013,
1996,
2592,
2179,
1999,
1996,
2536,
25718,
2581,
1013,
4654,
2102,
1013,
1012,
1012,
1012,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.