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

<title>BigRational (ch.obermuhlner.math.big 2.2.1 API)</title>
<meta name="date" content="2019-10-09">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

ch.obermuhlner.math.big

Class BigRational

java.lang.Object

ch.obermuhlner.math.big.BigRational

All Implemented Interfaces:

java.lang.Comparable<BigRational>

public class BigRational
extends java.lang.Object
implements java.lang.Comparable<BigRational>

A rational number represented as a quotient of two values.

Basic calculations with rational numbers (+ - * /) have no loss of precision.
 This allows to use BigRational as a replacement for BigDecimal if absolute accuracy is desired.

Wikipedia: Rational number

The values are internally stored as BigDecimal (for performance optimizations) but represented
 as BigInteger (for mathematical correctness)
 when accessed with getNumeratorBigInteger() and getDenominatorBigInteger().

The following basic calculations have no loss of precision:

add(BigRational)

subtract(BigRational)

multiply(BigRational)

divide(BigRational)

pow(int)

The following calculations are special cases of the ones listed above and have no loss of precision:

negate()

reciprocal()

increment()

decrement()

Any BigRational value can be converted into an arbitrary precision (number of significant digits)
 or scale (number of digits after the decimal point).

Field Summary

Fields

Modifier and Type
Field and Description

static BigRational
ONE

The value 1 as BigRational.

static BigRational
TEN

The value 10 as BigRational.

static BigRational
TWO

The value 2 as BigRational.

static BigRational
ZERO

The value 0 as BigRational.

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

BigRational
abs()

Returns the absolute value of this rational number.

BigRational
add(java.math.BigInteger value)

Calculates the addition (+) of this rational number and the specified argument.

BigRational
add(BigRational value)

Calculates the addition (+) of this rational number and the specified argument.

BigRational
add(int value)

Calculates the addition (+) of this rational number and the specified argument.

static BigRational
bernoulli(int n)

Calculates the Bernoulli number for the specified index.

int
compareTo(BigRational other)

BigRational
decrement()

Calculates the decrement of this rational number (- 1).

BigRational
divide(java.math.BigInteger value)

Calculates the division (/) of this rational number and the specified argument.

BigRational
divide(BigRational value)

Calculates the division (/) of this rational number and the specified argument.

BigRational
divide(int value)

Calculates the division (/) of this rational number and the specified argument.

boolean
equals(java.lang.Object obj)

BigRational
fractionPart()

Returns the fraction part of this rational number.

java.math.BigDecimal
getDenominator()

Returns the denominator of this rational number as BigDecimal.

java.math.BigInteger
getDenominatorBigInteger()

Returns the denominator of this rational number as BigInteger.

java.math.BigDecimal
getNumerator()

Returns the numerator of this rational number as BigDecimal.

java.math.BigInteger
getNumeratorBigInteger()

Returns the numerator of this rational number as BigInteger.

int
hashCode()

BigRational
increment()

Calculates the increment of this rational number (+ 1).

BigRational
integerPart()

Returns the integer part of this rational number.

boolean
isInteger()

Returns whether this rational number is an integer number without fraction part.

boolean
isZero()

Returns whether this rational number is zero.

static BigRational
max(BigRational... values)

Returns the largest of the specified rational numbers.

static BigRational
min(BigRational... values)

Returns the smallest of the specified rational numbers.

BigRational
multiply(java.math.BigInteger value)

Calculates the multiplication (*) of this rational number and the specified argument.

BigRational
multiply(BigRational value)

Calculates the multiplication (*) of this rational number and the specified argument.

BigRational
multiply(int value)

Calculates the multiplication (*) of this rational number and the specified argument.

BigRational
negate()

Negates this rational number (inverting the sign).

BigRational
pow(int exponent)

Calculates this rational number to the power (xy) of the specified argument.

BigRational
reciprocal()

Calculates the reciprocal of this rational number (1/x).

BigRational
reduce()

Reduces this rational number to the smallest numerator/denominator with the same value.

int
signum()

Returns the signum function of this rational number.

BigRational
subtract(java.math.BigInteger value)

Calculates the subtraction (-) of this rational number and the specified argument.

BigRational
subtract(BigRational value)

Calculates the subtraction (-) of this rational number and the specified argument.

BigRational
subtract(int value)

Calculates the subtraction (-) of this rational number and the specified argument.

java.math.BigDecimal
toBigDecimal()

Returns this rational number as a BigDecimal.

java.math.BigDecimal
toBigDecimal(java.math.MathContext mc)

Returns this rational number as a BigDecimal with the precision specified by the MathContext.

double
toDouble()

Returns this rational number as a double value.

float
toFloat()

Returns this rational number as a float value.

java.lang.String
toIntegerRationalString()

Returns the string representation of this rational number as integer and fraction parts in the form "integerPart fractionNominator/fractionDenominator".

java.lang.String
toPlainString()

Returns a plain string representation of this rational number without any exponent.

java.lang.String
toRationalString()

Returns the string representation of this rational number in the form "numerator/denominator".

java.lang.String
toString()

static BigRational
valueOf(java.math.BigDecimal value)

Creates a rational number of the specified BigDecimal value.

static BigRational
valueOf(java.math.BigDecimal numerator,
       java.math.BigDecimal denominator)

Creates a rational number of the specified numerator/denominator BigDecimal values.

static BigRational
valueOf(java.math.BigInteger value)

Creates a rational number of the specified BigInteger value.

static BigRational
valueOf(java.math.BigInteger numerator,
       java.math.BigInteger denominator)

Creates a rational number of the specified numerator/denominator BigInteger values.

static BigRational
valueOf(boolean positive,
       java.lang.String integerPart,
       java.lang.String fractionPart,
       java.lang.String fractionRepeatPart,
       java.lang.String exponentPart)

static BigRational
valueOf(double value)

Creates a rational number of the specified double value.

static BigRational
valueOf(int value)

Creates a rational number of the specified int value.

static BigRational
valueOf(int numerator,
       int denominator)

Creates a rational number of the specified numerator/denominator int values.

static BigRational
valueOf(int integer,
       int fractionNumerator,
       int fractionDenominator)

Creates a rational number of the specified integer and fraction parts.

static BigRational
valueOf(java.lang.String string)

Creates a rational number of the specified string representation.

BigRational
withPrecision(int precision)

Returns a rational number with approximatively this value and the specified precision.

BigRational
withScale(int scale)

Returns a rational number with approximatively this value and the specified scale.

Methods inherited from class java.lang.Object

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

Field Detail

ZERO

public static final BigRational ZERO

The value 0 as BigRational.

ONE

public static final BigRational ONE

The value 1 as BigRational.

TWO

public static final BigRational TWO

The value 2 as BigRational.

TEN

public static final BigRational TEN

The value 10 as BigRational.

Method Detail

getNumeratorBigInteger

public java.math.BigInteger getNumeratorBigInteger()

Returns the numerator of this rational number as BigInteger.

Returns:

the numerator as BigInteger

getNumerator

public java.math.BigDecimal getNumerator()

Returns the numerator of this rational number as BigDecimal.

Returns:

the numerator as BigDecimal

getDenominatorBigInteger

public java.math.BigInteger getDenominatorBigInteger()

Returns the denominator of this rational number as BigInteger.

Guaranteed to not be 0.

Guaranteed to be positive.

Returns:

the denominator as BigInteger

getDenominator

public java.math.BigDecimal getDenominator()

Returns the denominator of this rational number as BigDecimal.

Guaranteed to not be 0.

Guaranteed to be positive.

Returns:

the denominator as BigDecimal

reduce

public BigRational reduce()

Reduces this rational number to the smallest numerator/denominator with the same value.

Returns:

the reduced rational number

integerPart

public BigRational integerPart()

Returns the integer part of this rational number.

Examples:

BigRational.valueOf(3.5).integerPart() returns BigRational.valueOf(3)

Returns:

the integer part of this rational number

fractionPart

public BigRational fractionPart()

Returns the fraction part of this rational number.

Examples:

BigRational.valueOf(3.5).integerPart() returns BigRational.valueOf(0.5)

Returns:

the fraction part of this rational number

negate

public BigRational negate()

Negates this rational number (inverting the sign).

The result has no loss of precision.

Examples:

BigRational.valueOf(3.5).negate() returns BigRational.valueOf(-3.5)

Returns:

the negated rational number

reciprocal

public BigRational reciprocal()

Calculates the reciprocal of this rational number (1/x).

The result has no loss of precision.

Examples:

BigRational.valueOf(0.5).reciprocal() returns BigRational.valueOf(2)

BigRational.valueOf(-2).reciprocal() returns BigRational.valueOf(-0.5)

Returns:

the reciprocal rational number

Throws:

java.lang.ArithmeticException - if this number is 0 (division by zero)

abs

public BigRational abs()

Returns the absolute value of this rational number.

The result has no loss of precision.

Examples:

BigRational.valueOf(-2).abs() returns BigRational.valueOf(2)

BigRational.valueOf(2).abs() returns BigRational.valueOf(2)

Returns:

the absolute rational number (positive, or 0 if this rational is 0)

signum

public int signum()

Returns the signum function of this rational number.

Returns:

-1, 0 or 1 as the value of this rational number is negative, zero or positive.

increment

public BigRational increment()

Calculates the increment of this rational number (+ 1).

This is functionally identical to
 this.add(BigRational.ONE)
 but slightly faster.

The result has no loss of precision.

Returns:

the incremented rational number

decrement

public BigRational decrement()

Calculates the decrement of this rational number (- 1).

This is functionally identical to
 this.subtract(BigRational.ONE)
 but slightly faster.

The result has no loss of precision.

Returns:

the decremented rational number

add

public BigRational add(BigRational value)

Calculates the addition (+) of this rational number and the specified argument.

The result has no loss of precision.

Parameters:

value - the rational number to add

Returns:

the resulting rational number

add

public BigRational add(java.math.BigInteger value)

Calculates the addition (+) of this rational number and the specified argument.

This is functionally identical to
 this.add(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the BigInteger to add

Returns:

the resulting rational number

add

public BigRational add(int value)

Calculates the addition (+) of this rational number and the specified argument.

This is functionally identical to
 this.add(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the int value to add

Returns:

the resulting rational number

subtract

public BigRational subtract(BigRational value)

Calculates the subtraction (-) of this rational number and the specified argument.

The result has no loss of precision.

Parameters:

value - the rational number to subtract

Returns:

the resulting rational number

subtract

public BigRational subtract(java.math.BigInteger value)

Calculates the subtraction (-) of this rational number and the specified argument.

This is functionally identical to
 this.subtract(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the BigInteger to subtract

Returns:

the resulting rational number

subtract

public BigRational subtract(int value)

Calculates the subtraction (-) of this rational number and the specified argument.

This is functionally identical to
 this.subtract(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the int value to subtract

Returns:

the resulting rational number

multiply

public BigRational multiply(BigRational value)

Calculates the multiplication (*) of this rational number and the specified argument.

The result has no loss of precision.

Parameters:

value - the rational number to multiply

Returns:

the resulting rational number

multiply

public BigRational multiply(java.math.BigInteger value)

Calculates the multiplication (*) of this rational number and the specified argument.

This is functionally identical to
 this.multiply(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the BigInteger to multiply

Returns:

the resulting rational number

multiply

public BigRational multiply(int value)

Calculates the multiplication (*) of this rational number and the specified argument.

This is functionally identical to
 this.multiply(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the int value to multiply

Returns:

the resulting rational number

divide

public BigRational divide(BigRational value)

Calculates the division (/) of this rational number and the specified argument.

The result has no loss of precision.

Parameters:

value - the rational number to divide (0 is not allowed)

Returns:

the resulting rational number

Throws:

java.lang.ArithmeticException - if the argument is 0 (division by zero)

divide

public BigRational divide(java.math.BigInteger value)

Calculates the division (/) of this rational number and the specified argument.

This is functionally identical to
 this.divide(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the BigInteger to divide (0 is not allowed)

Returns:

the resulting rational number

Throws:

java.lang.ArithmeticException - if the argument is 0 (division by zero)

divide

public BigRational divide(int value)

Calculates the division (/) of this rational number and the specified argument.

This is functionally identical to
 this.divide(BigRational.valueOf(value))
 but slightly faster.

The result has no loss of precision.

Parameters:

value - the int value to divide (0 is not allowed)

Returns:

the resulting rational number

Throws:

java.lang.ArithmeticException - if the argument is 0 (division by zero)

isZero

public boolean isZero()

Returns whether this rational number is zero.

Returns:

true if this rational number is zero (0), false if it is not zero

isInteger

public boolean isInteger()

Returns whether this rational number is an integer number without fraction part.

Returns:

true if this rational number is an integer number, false if it has a fraction part

pow

public BigRational pow(int exponent)

Calculates this rational number to the power (xy) of the specified argument.

The result has no loss of precision.

Parameters:

exponent - exponent to which this rational number is to be raised

Returns:

the resulting rational number

withPrecision

public BigRational withPrecision(int precision)

Returns a rational number with approximatively this value and the specified precision.

Parameters:

precision - the precision (number of significant digits) of the calculated result, or 0 for unlimited precision

Returns:

the calculated rational number with the specified precision

withScale

public BigRational withScale(int scale)

Returns a rational number with approximatively this value and the specified scale.

Parameters:

scale - the scale (number of digits after the decimal point) of the calculated result

Returns:

the calculated rational number with the specified scale

toDouble

public double toDouble()

Returns this rational number as a double value.

Returns:

the double value

toFloat

public float toFloat()

Returns this rational number as a float value.

Returns:

the float value

toBigDecimal

public java.math.BigDecimal toBigDecimal()

Returns this rational number as a BigDecimal.

Returns:

the BigDecimal value

toBigDecimal

public java.math.BigDecimal toBigDecimal(java.math.MathContext mc)

Returns this rational number as a BigDecimal with the precision specified by the MathContext.

Parameters:

mc - the MathContext specifying the precision of the calculated result

Returns:

the BigDecimal

compareTo

public int compareTo(BigRational other)

Specified by:

compareTo in interface java.lang.Comparable<BigRational>

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:

equals in class java.lang.Object

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

toPlainString

public java.lang.String toPlainString()

Returns a plain string representation of this rational number without any exponent.

Returns:

the plain string representation

See Also:

BigDecimal.toPlainString()

toRationalString

public java.lang.String toRationalString()

Returns the string representation of this rational number in the form "numerator/denominator".

The resulting string is a valid input of the valueOf(String) method.

Examples:

BigRational.valueOf(0.5).toRationalString() returns "1/2"

BigRational.valueOf(2).toRationalString() returns "2"

BigRational.valueOf(4, 4).toRationalString() returns "4/4" (not reduced)

Returns:

the rational number string representation in the form "numerator/denominator", or "0" if the rational number is 0.

See Also:

valueOf(String),
valueOf(int, int)

toIntegerRationalString

public java.lang.String toIntegerRationalString()

Returns the string representation of this rational number as integer and fraction parts in the form "integerPart fractionNominator/fractionDenominator".

The integer part is omitted if it is 0 (when this absolute rational number is smaller than 1).

The fraction part is omitted it it is 0 (when this rational number is an integer).

If this rational number is 0, then "0" is returned.

Example: BigRational.valueOf(3.5).toIntegerRationalString() returns "3 1/2".

Returns:

the integer and fraction rational string representation

See Also:

valueOf(int, int, int)

valueOf

public static BigRational valueOf(int value)

Creates a rational number of the specified int value.

Parameters:

value - the int value

Returns:

the rational number

valueOf

public static BigRational valueOf(int numerator,
                                  int denominator)

Creates a rational number of the specified numerator/denominator int values.

Parameters:

numerator - the numerator int value

denominator - the denominator int value (0 not allowed)

Returns:

the rational number

Throws:

java.lang.ArithmeticException - if the denominator is 0 (division by zero)

valueOf

public static BigRational valueOf(int integer,
                                  int fractionNumerator,
                                  int fractionDenominator)

Creates a rational number of the specified integer and fraction parts.

Useful to create numbers like 3 1/2 (= three and a half = 3.5) by calling
 BigRational.valueOf(3, 1, 2).

To create a negative rational only the integer part argument is allowed to be negative:
 to create -3 1/2 (= minus three and a half = -3.5) call BigRational.valueOf(-3, 1, 2).

Parameters:

integer - the integer part int value

fractionNumerator - the fraction part numerator int value (negative not allowed)

fractionDenominator - the fraction part denominator int value (0 or negative not allowed)

Returns:

the rational number

Throws:

java.lang.ArithmeticException - if the fraction part denominator is 0 (division by zero),
 or if the fraction part numerator or denominator is negative

valueOf

public static BigRational valueOf(java.math.BigInteger numerator,
                                  java.math.BigInteger denominator)

Creates a rational number of the specified numerator/denominator BigInteger values.

Parameters:

numerator - the numerator BigInteger value

denominator - the denominator BigInteger value (0 not allowed)

Returns:

the rational number

Throws:

java.lang.ArithmeticException - if the denominator is 0 (division by zero)

valueOf

public static BigRational valueOf(java.math.BigInteger value)

Creates a rational number of the specified BigInteger value.

Parameters:

value - the BigInteger value

Returns:

the rational number

valueOf

public static BigRational valueOf(double value)

Creates a rational number of the specified double value.

Parameters:

value - the double value

Returns:

the rational number

Throws:

java.lang.NumberFormatException - if the double value is Infinite or NaN.

valueOf

public static BigRational valueOf(java.math.BigDecimal value)

Creates a rational number of the specified BigDecimal value.

Parameters:

value - the double value

Returns:

the rational number

valueOf

public static BigRational valueOf(java.lang.String string)

Creates a rational number of the specified string representation.

The accepted string representations are:

Output of toString() : "integerPart.fractionPart"

Output of toRationalString() : "numerator/denominator"

Output of toString() of BigDecimal, BigInteger, Integer, ...

Output of toString() of Double, Float - except "Infinity", "-Infinity" and "NaN"

Parameters:

string - the string representation to convert

Returns:

the rational number

Throws:

java.lang.ArithmeticException - if the denominator is 0 (division by zero)

valueOf

public static BigRational valueOf(boolean positive,
                                  java.lang.String integerPart,
                                  java.lang.String fractionPart,
                                  java.lang.String fractionRepeatPart,
                                  java.lang.String exponentPart)

valueOf

public static BigRational valueOf(java.math.BigDecimal numerator,
                                  java.math.BigDecimal denominator)

Creates a rational number of the specified numerator/denominator BigDecimal values.

Parameters:

numerator - the numerator BigDecimal value

denominator - the denominator BigDecimal value (0 not allowed)

Returns:

the rational number

Throws:

java.lang.ArithmeticException - if the denominator is 0 (division by zero)

min

public static BigRational min(BigRational... values)

Returns the smallest of the specified rational numbers.

Parameters:

values - the rational numbers to compare

Returns:

the smallest rational number, 0 if no numbers are specified

max

public static BigRational max(BigRational... values)

Returns the largest of the specified rational numbers.

Parameters:

values - the rational numbers to compare

Returns:

the largest rational number, 0 if no numbers are specified

See Also:

max(BigRational)

bernoulli

public static BigRational bernoulli(int n)

Calculates the Bernoulli number for the specified index.

This function calculates the first Bernoulli numbers and therefore bernoulli(1) returns -0.5

Note that bernoulli(x) for all odd x > 1 returns 0

See: Wikipedia: Bernoulli number

Parameters:

n - the index of the Bernoulli number to be calculated (starting at 0)

Returns:

the Bernoulli number for the specified index

Throws:

java.lang.ArithmeticException - if x is lesser than 0

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/acpi.h>

MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen@gmail.com>");
MODULE_DESCRIPTION("Toshiba Laptop ACPI Bluetooth Enable Driver");
MODULE_LICENSE("GPL");

static int toshiba_bt_rfkill_add(struct acpi_device *device);
static int toshiba_bt_rfkill_remove(struct acpi_device *device);
static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event);

static const struct acpi_device_id bt_device_ids[] = {
	{ "TOS6205", 0},
	{ "", 0},
};
MODULE_DEVICE_TABLE(acpi, bt_device_ids);

#ifdef CONFIG_PM_SLEEP
static int toshiba_bt_resume(struct device *dev);
#endif
static SIMPLE_DEV_PM_OPS(toshiba_bt_pm, NULL, toshiba_bt_resume);

static struct acpi_driver toshiba_bt_rfkill_driver = {
	.name =		"Toshiba BT",
	.class =	"Toshiba",
	.ids =		bt_device_ids,
	.ops =		{
				.add =		toshiba_bt_rfkill_add,
				.remove =	toshiba_bt_rfkill_remove,
				.notify =	toshiba_bt_rfkill_notify,
			},
	.owner = 	THIS_MODULE,
	.drv.pm =	&toshiba_bt_pm,
};

static int toshiba_bluetooth_enable(acpi_handle handle)
{
	acpi_status res1, res2;
	u64 result;

	/*
	 * Query ACPI to verify RFKill switch is set to 'on'.
	 * If not, we return silently, no need to report it as
	 * an error.
	 */
	res1 = acpi_evaluate_integer(handle, "BTST", NULL, &result);
	if (ACPI_FAILURE(res1))
		return res1;
	if (!(result & 0x01))
		return 0;

	pr_info("Re-enabling Toshiba Bluetooth\n");
	res1 = acpi_evaluate_object(handle, "AUSB", NULL, NULL);
	res2 = acpi_evaluate_object(handle, "BTPO", NULL, NULL);
	if (!ACPI_FAILURE(res1) || !ACPI_FAILURE(res2))
		return 0;

	pr_warn("Failed to re-enable Toshiba Bluetooth\n");

	return -ENODEV;
}

static void toshiba_bt_rfkill_notify(struct acpi_device *device, u32 event)
{
	toshiba_bluetooth_enable(device->handle);
}

#ifdef CONFIG_PM_SLEEP
static int toshiba_bt_resume(struct device *dev)
{
	return toshiba_bluetooth_enable(to_acpi_device(dev)->handle);
}
#endif

static int toshiba_bt_rfkill_add(struct acpi_device *device)
{
	acpi_status status;
	u64 bt_present;
	int result = -ENODEV;

	/*
	 * Some Toshiba laptops may have a fake TOS6205 device in
	 * their ACPI BIOS, so query the _STA method to see if there
	 * is really anything there, before trying to enable it.
	 */
	status = acpi_evaluate_integer(device->handle, "_STA", NULL,
				       &bt_present);

	if (!ACPI_FAILURE(status) && bt_present) {
		pr_info("Detected Toshiba ACPI Bluetooth device - "
			"installing RFKill handler\n");
		result = toshiba_bluetooth_enable(device->handle);
	}

	return result;
}

static int toshiba_bt_rfkill_remove(struct acpi_device *device)
{
	/* clean up */
	return 0;
}

module_acpi_driver(toshiba_bt_rfkill_driver);

redpajama_set_name: RedPajamaGithub


text:
<?php

	require_once(TOOLKIT . '/class.datasource.php');
	require_once(DOCROOT . '/extensions/asdc/lib/class.asdc.php');

	Class datasourceMembers extends Datasource{

		private static $_fields;
		private static $_sections;

		public $dsParamROOTELEMENT = 'members';

		public $dsParamFILTERS = array(
				'username' => '{$member}',
		);

		public function about(){
			return array(
					 'name' => 'Members',
					 'author' => array(
							'name' => 'Allen Chang',
							'website' => 'http://symphony.local:8888',
							'email' => 'allen@symphony21.com'),
					 'version' => '1.0',
					 'release-date' => '2009-04-29T15:57:43+00:00');
		}

		public static function findSectionID($handle){
			return self::$_sections[$handle];
		}

		public static function findFieldID($handle, $section){
			return self::$_fields[$section][$handle];
		}

		private function __init(){
			if(!is_array(self::$_fields)){
				self::$_fields = array();

				$rows = ASDCLoader::instance()->query("SELECT s.handle AS `section`, f.`element_name` AS `handle`, f.`id`
					FROM `tbl_fields` AS `f`
					LEFT JOIN `tbl_sections` AS `s` ON f.parent_section = s.id
					ORDER BY `id` ASC");

				if($rows->length() > 0){
					foreach($rows as $r){
						self::$_fields[$r->section][$r->handle] = $r->id;
					}
				}
			}

			if(!is_array(self::$_sections)){
				self::$_sections = array();

				$rows = ASDCLoader::instance()->query("SELECT s.handle, s.id
					FROM `tbl_sections` AS `s`
					ORDER BY s.id ASC");

				if($rows->length() > 0){
					foreach($rows as $r){
						self::$_sections[$r->handle] = $r->id;
					}
				}
			}
		}

		public function grab(&$param_pool){
			$result = new XMLElement($this->dsParamROOTELEMENT);

			self::__init();

			$db = ASDCLoader::instance();

			$sql = "SELECT
						e.id,
						e.creation_date_gmt AS `date`,
						name.value AS `name`,
						role.name AS `role`,
						website.value AS `website`,
						city.value AS `city`,
						timezone_offset.value AS `timezone-offset`,
						username.username AS `username`,
						email.value AS `email`,
						MD5(email.value) AS `hash`

					FROM `tbl_entries_data_%d` AS `name`
					LEFT JOIN `tbl_entries` AS `e` ON name.entry_id = e.id
					LEFT JOIN `tbl_entries_data_%d` AS `r` ON e.id = r.entry_id
					LEFT JOIN `tbl_members_roles` AS `role` ON r.role_id = role.id
					LEFT JOIN `tbl_entries_data_%d` AS `username` ON e.id = username.entry_id
					LEFT JOIN `tbl_entries_data_%d` AS `email` ON e.id = email.entry_id
					LEFT JOIN `tbl_entries_data_%d` AS `city` ON e.id = city.entry_id
					LEFT JOIN `tbl_entries_data_%d` AS `website` ON e.id = website.entry_id
					LEFT JOIN `tbl_entries_data_%d` AS `timezone_offset` ON e.id = timezone_offset.entry_id

					WHERE username.username = '%s'
					LIMIT 0, 1";

			try{
				$member = $db->query(
					sprintf(
						$sql,
						self::findFieldID('name', 'members'),
						self::findFieldID('role', 'members'),
						self::findFieldID('username-and-password', 'members'),
						self::findFieldID('email-address', 'members'),
						self::findFieldID('city', 'members'),
						self::findFieldID('website', 'members'),
						self::findFieldID('timezone-offset', 'members'),
						$db->escape($this->dsParamFILTERS['username'])
					)
				)->current();
			}
			catch(Exception $e){
				$result->appendChild(new XMLElement('error', $e->getMessage()));
				return $result;
			}

			if(!($member instanceof StdClass) || is_null($member)){
				$this->__redirectToErrorPage();
			}

			/*

			  	<entry id="2101">
		            <creation-date time="19:31" weekday="3">2009-01-07</creation-date>
		            <name handle="allen-chang">Allen Chang</name>
		            <role id="2">Administrator</role>
		            <username-and-password username="Allen" password="86b100a6c3a0d856be4e630959df6de9" />
		        </entry>

			*/

			$entry = new XMLElement('entry', NULL, array('id' => $member->id, 'email-hash' => $member->hash));

			$entry->appendChild(new XMLElement('name', General::sanitize($member->name)));

			if(isset($member->website) && strlen(trim($member->website)) > 0 ){
				$entry->appendChild(new XMLElement('website', General::sanitize($member->website)));
			}

			if(isset($member->city) && strlen(trim($member->city)) > 0 ){
				$entry->appendChild(new XMLElement('city', General::sanitize($member->city)));
			}

			$offset = (!is_null($member->{'timezone-offset'}) ? min(max($member->{'timezone-offset'}, -12), 12) : 0);
			$entry->appendChild(new XMLElement('timezone-offset', $offset));

			$entry->appendChild(new XMLElement('role', General::sanitize($member->role)));
			$entry->appendChild(new XMLElement('username', General::sanitize($member->username)));
			$entry->appendChild(General::createXMLDateObject(strtotime($member->date.'+00:00'), 'date-joined'));

			$result->appendChild($entry);

			return $result;
		}
	}


text:
package annotate

import (
	"bytes"
	"strings"
	"testing"
	"time"

	"github.com/GoogleCloudPlatform/golang-samples/internal/testutil"
)

func TestLogoDetection(t *testing.T) {
	testutil.EndToEndTest(t)

	file := "../testdata/googlework_short.mp4"

	testutil.Retry(t, 10, 20*time.Second, func(r *testutil.R) {
		var buf bytes.Buffer
		if err := logoDetection(&buf, file); err != nil {
			r.Errorf("logoDetection: %v", err)
			return
		}

		wants := [3]string{"Description", "Confidence", "Segment"}
		for _, want := range wants {
			if got := buf.String(); !strings.Contains(got, want) {
				r.Errorf("logoDetection(%q): got %q, want %q", file, got, want)
			}
		}
	})
}


text:
require('./setup')
const seq = require('when/sequence')
const version = require('../src/version.js')

describe('Version', function () {
  describe('should find correct version file', function () {
    var dotnetVersion, erlangVersion, nodeVersion
    var getFile = function (relativePath) {
      return function () {
        return version.getFile(relativePath)
      }
    }
    var getVersion = function (versionFile) {
      return function () {
        return version.getVersion(versionFile)
      }
    }

    before(function () {
      return seq([
        getFile('./spec/versioning/node/'),
        getFile('./spec/versioning/erlang/'),
        getFile('./spec/versioning/dotnet/')
      ])
      .then(function (paths) {
        return seq([
          getVersion(paths[ 0 ]),
          getVersion(paths[ 1 ]),
          getVersion(paths[ 2 ])
        ])
        .then(function (versions) {
          dotnetVersion = versions[ 2 ]
          erlangVersion = versions[ 1 ]
          nodeVersion = versions[ 0 ]
        })
      })
    })

    it('should retrieve the correct dotnet version', function () {
      dotnetVersion.should.equal('4.3.2')
    })

    it('should retrieve the correct erlang version', function () {
      erlangVersion.should.equal('1.0.1')
    })

    it('should retrieve the correct node version', function () {
      nodeVersion.should.equal('0.1.2')
    })
  })
})


text:
const React = require('react')
const { List, ListItem } = require('material-ui/List');
const Divider = require('material-ui').Divider;
const Subheader = require('material-ui').Subheader;
const { Tabs, Tab } = require('material-ui/Tabs');
const GenreListItem = require('./genre-list-item');
const TagListItem = require('./tag-list-item');
var Anilist = require('../../lib/anilist');

var key = 0;

class FilterTabs extends React.Component {
  constructor(props) {
    super(props)

    this.state = { tab: 'a', loaded: false, tags: {} }
    this.handleChange = this.handleChange.bind(this);

  }

  componentWillMount() {
    Anilist.getTags().then(Tags => {
      this.state = ({ tags: Tags, loaded: true })

    }).catch(error => {
      console.log(error);
    })
  }

  handleChange(value) {
    this.setState({ tab: value });
  };

  render() {
    key=0;
    return (
      <Tabs
        style={tabsStyle}
        value={this.state.value}
        onChange={this.handleChange}
        contentContainerStyle={contentContainerStyle}
      >
        <Tab  label="Genres" value="a">
          <List>
            {genres.map((item, index)=> (<GenreListItem key={index}  GenreListItem={item} />))}
          </List>
        </Tab>
        <Tab label="Tags" value="b">
          <List>
            {this.state.loaded ? makeNestedList(this.state.tags) : <ListItem primaryText='Loading' />}
          </List>
        </Tab>
      </Tabs>
    )
  }
}
module.exports = FilterTabs

const makeNestedList = (node) => {
  var title = Object.keys(node);
  return Object.values(node).map(function (branch, i) {
    if (Object.keys(branch)[0] === ('tags')) {
      return <ListItem key={key++}

        primaryTogglesNestedList={true}
        innerDivStyle={innerDivStyle}
        primaryText={title[i]}
        nestedItems={branch.tags.map(function (leaf, i) { return <TagListItem key={key++} TagListItem={leaf}
        /> })} />
    }
    else if (branch.constructor.name === "Array") {
      return <ListItem key={key++} primaryText='misc' primaryTogglesNestedList={true} nestedItems={branch.map(leaf => <TagListItem key={key++} TagListItem={leaf} /> )} />
    }
    else {
      return (<ListItem key={key++} k primaryTogglesNestedList={true} innerDivStyle={innerDivStyle} primaryText={title[i]} nestedItems={makeNestedList(branch)} />)
    }
  })
}

const genres = [
  'Action',
  'Adventure',
  'Comedy',
  "Drama",
  "Ecchi",
  "Fantasy",
  "Hentai",
  "Horror",
  "Mahou Shoujo",
  "Mecha",
  "Music",
  "Mystery",
  "Psychological",
  "Romance",
  "Sci-Fi",
  "Slice of Life",
  "Sports",
  "Supernatural",
  "Thriller",
]

tabsStyle = {
  flex: 1,
  overflowY: 'hidden',
}

const listItemStyle = {
  padding: '5px 10px',
}

const subheaderStyle = {
  fontSize: '20px'
}

const listBaseStyle = {
}

contentContainerStyle = {
  overflowY: 'scroll',
  height: 'calc(100% - 50px)'
}

const innerDivStyle = {
  paddingTop: '10px',
  paddingBottom: '10px',
}


text:
import React, {Component, PropTypes} from 'react';
import autoPrefix from '../utils/autoPrefix';
import transitions from '../styles/transitions';

function getRelativeValue(value, min, max) {
  const clampedValue = Math.min(Math.max(min, value), max);
  return clampedValue / (max - min);
}

function getArcLength(fraction, props) {
  return fraction * Math.PI * (props.size - props.thickness);
}

function getStyles(props, context) {
  const {
    max,
    min,
    size,
    value,
  } = props;

  const {baseTheme: {palette}} = context.muiTheme;

  const styles = {
    root: {
      position: 'relative',
      display: 'inline-block',
      width: size,
      height: size,
    },
    wrapper: {
      width: size,
      height: size,
      display: 'inline-block',
      transition: transitions.create('transform', '20s', null, 'linear'),
      transitionTimingFunction: 'linear',
    },
    svg: {
      width: size,
      height: size,
      position: 'relative',
    },
    path: {
      stroke: props.color || palette.primary1Color,
      strokeLinecap: 'round',
      transition: transitions.create('all', '1.5s', null, 'ease-in-out'),
    },
  };

  if (props.mode === 'determinate') {
    const relVal = getRelativeValue(value, min, max);
    styles.path.transition = transitions.create('all', '0.3s', null, 'linear');
    styles.path.strokeDasharray = `${getArcLength(relVal, props)}, ${getArcLength(1, props)}`;
  }

  return styles;
}

class CircularProgress extends Component {
  static propTypes = {
    /**
     * Override the progress's color.
     */
    color: PropTypes.string,
    /**
     * Style for inner wrapper div.
     */
    innerStyle: PropTypes.object,
    /**
     * The max value of progress, only works in determinate mode.
     */
    max: PropTypes.number,
    /**
     * The min value of progress, only works in determinate mode.
     */
    min: PropTypes.number,
    /**
     * The mode of show your progress, indeterminate
     * for when there is no value for progress.
     */
    mode: PropTypes.oneOf(['determinate', 'indeterminate']),
    /**
     * The diameter of the progress in pixels.
     */
    size: PropTypes.number,
    /**
     * Override the inline-styles of the root element.
     */
    style: PropTypes.object,
    /**
     * Stroke width in pixels.
     */
    thickness: PropTypes.number,
    /**
     * The value of progress, only works in determinate mode.
     */
    value: PropTypes.number,
  };

  static defaultProps = {
    mode: 'indeterminate',
    value: 0,
    min: 0,
    max: 100,
    size: 40,
    thickness: 3.5,
  };

  static contextTypes = {
    muiTheme: PropTypes.object.isRequired,
  };

  componentDidMount() {
    this.scalePath(this.refs.path);
    this.rotateWrapper(this.refs.wrapper);
  }

  componentWillUnmount() {
    clearTimeout(this.scalePathTimer);
    clearTimeout(this.rotateWrapperTimer);
  }

  scalePath(path, step = 0) {
    if (this.props.mode !== 'indeterminate') return;

    step %= 3;

    if (step === 0) {
      path.style.strokeDasharray = `${getArcLength(0, this.props)}, ${getArcLength(1, this.props)}`;
      path.style.strokeDashoffset = 0;
      path.style.transitionDuration = '0ms';
    } else if (step === 1) {
      path.style.strokeDasharray = `${getArcLength(0.7, this.props)}, ${getArcLength(1, this.props)}`;
      path.style.strokeDashoffset = getArcLength(-0.3, this.props);
      path.style.transitionDuration = '750ms';
    } else {
      path.style.strokeDasharray = `${getArcLength(0.7, this.props)}, ${getArcLength(1, this.props)}`;
      path.style.strokeDashoffset = getArcLength(-1, this.props);
      path.style.transitionDuration = '850ms';
    }

    this.scalePathTimer = setTimeout(() => this.scalePath(path, step + 1), step ? 750 : 250);
  }

  rotateWrapper(wrapper) {
    if (this.props.mode !== 'indeterminate') return;

    autoPrefix.set(wrapper.style, 'transform', 'rotate(0deg)');
    autoPrefix.set(wrapper.style, 'transitionDuration', '0ms');

    setTimeout(() => {
      autoPrefix.set(wrapper.style, 'transform', 'rotate(1800deg)');
      autoPrefix.set(wrapper.style, 'transitionDuration', '10s');
      autoPrefix.set(wrapper.style, 'transitionTimingFunction', 'linear');
    }, 50);

    this.rotateWrapperTimer = setTimeout(() => this.rotateWrapper(wrapper), 10050);
  }

  render() {
    const {
      style,
      innerStyle,
      size,
      thickness,
      ...other,
    } = this.props;

    const {prepareStyles} = this.context.muiTheme;
    const styles = getStyles(this.props, this.context);

    return (
      <div {...other} style={prepareStyles(Object.assign(styles.root, style))} >
        <div ref="wrapper" style={prepareStyles(Object.assign(styles.wrapper, innerStyle))} >
          <svg
            viewBox={`0 0 ${size} ${size}`}
            style={prepareStyles(styles.svg)}
          >
            <circle
              ref="path"
              style={prepareStyles(styles.path)}
              cx={size / 2}
              cy={size / 2}
              r={(size - thickness) / 2}
              fill="none"
              strokeWidth={thickness}
              strokeMiterlimit="20"
            />
          </svg>
        </div>
      </div>
    );
  }
}

export default CircularProgress;


text:
#include "NCP_PathSearch.h"
#include <assert.h>                           // for assert
#include <float.h>                            // for DBL_EPSILON, DECIMAL_DIG
#include <math.h>                             // for fmax, sqrt, fmin
#include <stdio.h>                            // for printf, NULL
#include <stdlib.h>                           // for malloc, free, exit, EXI...
#include <string.h>                           // for memset
#include "ArmijoSearch.h"                     // for armijo_extra_params
#include "LCP_Solvers.h"                      // for lcp_compute_error, lcp_...
#include "LinearComplementarityProblem.h"     // for LinearComplementarityPr...
#include "NCP_Solvers.h"                      // for ncp_compute_error, ncp_...
#include "NMS.h"                              // for NMS_data, NMS, NMS_best...
#include "NSSTools.h"                         // for pos_part
#include "Newton_methods.h"                   // for functions_LSA, init_lsa...
#include "NonlinearComplementarityProblem.h"  // for NonlinearComplementarit...
#include "NumericsFwd.h"                      // for SolverOptions, Nonlinea...
#include "NumericsMatrix.h"                   // for NM_display, NM_clear
#include "PathSearch.h"                       // for pathsearch_data
#include "SiconosBlas.h"                      // for cblas_daxpy, cblas_ddot
#include "SiconosSets.h"                      // for set_set_id, SICONOS_SET...
#include "SolverOptions.h"                    // for SolverOptions, SICONOS_...
#include "siconos_debug.h"                            // for DEBUG_PRINT, DEBUG_PRINTF
#include "lcp_cst.h"                          // for SICONOS_LCP_PIVOT_PATHS...
#include "lcp_pivot.h"                        // for LCP_PATHSEARCH_LEAVING_T
#include "line_search.h"                      // for search_data
#include "ncp_newton_FBLSA.h"                 // for FB_compute_F_ncp, FB_co...
#include "pivot-utils.h"                      // for lcp_pivot_diagnose_info
#include "sanitizer.h"                        // for cblas_dcopy_msan

/** update the lcp subproblem: M, q and r
 * \param problem the NCP problem to solve
 * \param lcp_subproblem the lcp problem to fill
 * \param n size of the NCP problem
 * \param x_plus positive part of x
 * \param x current newton iterate
   * \param r value of the normal map
   */
static void ncp_pathsearch_update_lcp_data(NonlinearComplementarityProblem* problem, LinearComplementarityProblem* lcp_subproblem, unsigned n, double* restrict x_plus, double* restrict x, double* restrict r)
{
  /* compute M = nabla F(x_plus) */
  problem->compute_nabla_F(problem->env, n, x_plus, problem->nabla_F);

  /* r = F_+(x) = F(x_+) + x - x_+ */
  /* the real q = q - r = x_+ - x - M x_plus */
  /* q = -M x_plus */
  NM_gemv(-1.0, problem->nabla_F, x_plus, 0.0, lcp_subproblem->q);

  /* first compute r = x - x_+ */
  cblas_dcopy(n, x, 1, r, 1); /* r = x */
  cblas_daxpy(n, -1.0, x_plus, 1, r, 1); /* r -= x_plus */
  /* we factorized computations */
  cblas_daxpy(n, -1.0, r, 1, lcp_subproblem->q, 1); /* q -= x - x_plus */
  /* Finish r */
  problem->compute_F(problem->env, n, x_plus, x); /* compute F(x_plus) */
  cblas_daxpy(n, 1.0, x, 1, r, 1); /* r += F(x_plus) */

}

/** Release memory used by SolverOptions members solverData and dWork.

    Internal stuff. Must be called at the end of ncp_pathsearch.
    This concerns only options parameters which management is
    specific to this solver. All others (iparam ...) are handled
    in solver_options_delete generic function.
 */
static void ncp_pathsearch_free(SolverOptions * opt)
{
  if(opt->dWork)
    free(opt->dWork);
  opt->dWork = NULL;

  if(opt->solverData)
  {
    pathsearch_data* solverData_PathSearch = (pathsearch_data*) opt->solverData;
    free_NMS_data(solverData_PathSearch->data_NMS);
    free(solverData_PathSearch->lsa_functions);
    free(opt->solverData);
  }
  opt->solverData = NULL;
}

void ncp_pathsearch(NonlinearComplementarityProblem* problem, double* z, double* F, int *info, SolverOptions* options)
{
  /* Main step of the algorithm:
   * - compute jacobians
   * - call modified lemke
  */

  unsigned int n = problem->n;
  unsigned int preAlloc = options->iparam[SICONOS_IPARAM_PREALLOC];
  int itermax = options->iparam[SICONOS_IPARAM_MAX_ITER];

  DEBUG_EXPR(double merit_norm = 1.0;);
  double nn_tol = options->dparam[SICONOS_DPARAM_TOL];
  int nbiter = 0;

  /* declare a LinearComplementarityProblem on the stack*/
  LinearComplementarityProblem lcp_subproblem;
  lcp_subproblem.size = n;

  /* do some allocation if required
   * - nabla_F (used also as M for the LCP subproblem)
   * - q for the LCP subproblem
   *
   * Then fill the LCP subproblem
   */

  assert(problem->nabla_F);
  lcp_subproblem.M = problem->nabla_F;

  if(!preAlloc || (preAlloc && !options->dWork))
  {
    options->dWork = (double *) malloc(4*n*sizeof(double));
  }
  lcp_subproblem.q = options->dWork;
  double* x = &options->dWork[n];
  double* x_plus = &options->dWork[2*n];
  double* r = &options->dWork[3*n];

  NMS_data* data_NMS;
  functions_LSA* functions;

  if(!preAlloc || (preAlloc && !options->solverData))
  {
    options->solverData = malloc(sizeof(pathsearch_data));
    pathsearch_data* solverData = (pathsearch_data*) options->solverData;

    /* do all the allocation */
    solverData->data_NMS = create_NMS_data(n, NM_DENSE, options->iparam, options->dparam);
    solverData->lsa_functions = (functions_LSA*) malloc(sizeof(functions_LSA));
    solverData->data_NMS->set = malloc(sizeof(positive_orthant));

    data_NMS = solverData->data_NMS;
    functions = solverData->lsa_functions;
    /* for use in NMS;  only those 3 functions are called */
    init_lsa_functions(functions, &FB_compute_F_ncp, &ncp_FB);
    functions->compute_H = &FB_compute_H_ncp;

    set_set_id(data_NMS->set, SICONOS_SET_POSITIVE_ORTHANT);

    /* fill ls_data */
    data_NMS->ls_data->compute_F = functions->compute_F;
    data_NMS->ls_data->compute_F_merit = functions->compute_F_merit;
    data_NMS->ls_data->z = NULL; /* XXX to check -- xhub */
    data_NMS->ls_data->zc = NMS_get_generic_workV(data_NMS->workspace, n);
    data_NMS->ls_data->F = NMS_get_F(data_NMS->workspace, n);
    data_NMS->ls_data->F_merit = NMS_get_F_merit(data_NMS->workspace, n);
    data_NMS->ls_data->desc_dir = NMS_get_dir(data_NMS->workspace, n);
    /** \todo this value should be settable by the user with a default value*/
    data_NMS->ls_data->alpha_min = fmin(data_NMS->alpha_min_watchdog, data_NMS->alpha_min_pgrad);
    data_NMS->ls_data->data = (void*)problem;
    data_NMS->ls_data->set = data_NMS->set;
    data_NMS->ls_data->sigma = options->dparam[SICONOS_DPARAM_NMS_SIGMA];
    armijo_extra_params* pG = (armijo_extra_params*)malloc(sizeof(armijo_extra_params));
    data_NMS->ls_data->extra_params = (void*) pG;
    search_Armijo_params_init(pG);
    pG->gamma = 1.;
    /* data_NMS->ls_data->searchtype is set in the NMS code */
  }
  else
  {
    pathsearch_data* solverData = (pathsearch_data*) options->solverData;
    data_NMS = solverData->data_NMS;
    functions = solverData->lsa_functions;
  }

  /* initial value for ref_merit */
  problem->compute_F(problem->env, n, z, F);
  functions->compute_F_merit(problem, z, F, data_NMS->ls_data->F_merit);

  data_NMS->ref_merit = .5 * cblas_ddot(n, data_NMS->ls_data->F_merit, 1, data_NMS->ls_data->F_merit, 1);
  data_NMS->merit_bestpoint = data_NMS->ref_merit;
  cblas_dcopy_msan(n, z, 1, NMS_checkpoint_0(data_NMS, n), 1);
  cblas_dcopy_msan(n, z, 1, NMS_checkpoint_T(data_NMS, n), 1);
  cblas_dcopy_msan(n, z, 1, NMS_bestpoint(data_NMS, n), 1);
  /* -------------------- end init ---------------------------*/

  int nms_failed = 0;
  double err = 10*nn_tol;

  /* to check the solution */
  LinearComplementarityProblem lcp_subproblem_check;
  int check_lcp_solution = 1; /* XXX add config for that */

  double normal_norm2_newton_point;

  /* F is already computed here at z */

  while((err > nn_tol) && (nbiter < itermax) && !nms_failed)
  {
    int force_watchdog_step = 0;
    int force_d_step_merit_check = 0;
    double check_ratio = 0.0;
    nbiter++;
    /* update M, q and r */

    /* First find x */
    ncp_pathsearch_compute_x_from_z(n, z, F, x);
    pos_part(n, x, x_plus); /* update x_plus */

    ncp_pathsearch_update_lcp_data(problem, &lcp_subproblem, n, x_plus, x, r);

    if(check_lcp_solution)
    {
      lcp_subproblem_check.size = n;
      lcp_subproblem_check.M = problem->nabla_F;
      lcp_subproblem_check.q = lcp_subproblem.q;
      //cblas_dcopy(n, x, 1, lcp_subproblem_check.q , 1);
      //NM_gemv(-1.0, problem->nabla_F, x_plus, 0.0, lcp_subproblem.q);
    }

    double norm_r2 = cblas_ddot(n, r, 1, r, 1);
    if(norm_r2 < DBL_EPSILON*DBL_EPSILON)  /* ||r|| < 1e-15 */
    {
      DEBUG_PRINTF("ncp_pathsearch :: ||r||  = %e < %e; path search procedure was successful!\n", norm_r2, DBL_EPSILON*DBL_EPSILON);
      (*info) = 0;
      ncp_compute_error(n, z, F, nn_tol, &err); /* XXX F should be up-to-date, we should check only CC*/
      break;
    }

    /* end update M, q and r */

    lcp_pivot_covering_vector(&lcp_subproblem, x_plus, x, info, options->internalSolvers[0], r);

    switch(*info)
    {
    case LCP_PIVOT_SUCCESS:
      DEBUG_PRINT("ncp_pathsearch :: path search procedure was successful!\n");
      if(check_lcp_solution)
      {
        double err_lcp = 0.0;
        cblas_daxpy(n, 1.0, r, 1, lcp_subproblem_check.q, 1);
        lcp_compute_error(&lcp_subproblem_check, x_plus, x, 1e-14, &err_lcp);
        double local_tol = fmax(1e-14, DBL_EPSILON*sqrt(norm_r2));
        printf("ncp_pathsearch :: lcp solved with error = %e; local_tol = %e\n", err_lcp, local_tol);
        //assert(err_lcp < local_tol && "ncp_pathsearch :: lcp solved with very bad precision");
        if(err_lcp > local_tol)
        {
          printf("ncp_pathsearch :: lcp solved with very bad precision\n");
          NM_display(lcp_subproblem.M);
          printf("z r q x_plus\n");
          for(unsigned i = 0; i < n; ++i) printf("%e %e %e %e\n", z[i], r[i], lcp_subproblem.q[i], x_plus[i]);
          options->internalSolvers[0]->iparam[SICONOS_LCP_IPARAM_PIVOTING_METHOD_TYPE] = 0; //
          // Note FP : no 0 in allowed values of the enum for PIVOTING METHOD
          lcp_pivot(&lcp_subproblem, x_plus, x, info, options->internalSolvers[0]);
          options->internalSolvers[0]->iparam[SICONOS_LCP_IPARAM_PIVOTING_METHOD_TYPE] = SICONOS_LCP_PIVOT_PATHSEARCH;
          lcp_compute_error(&lcp_subproblem_check, x_plus, x, 1e-14, &err_lcp);
          printf("ncp_pathsearch :: lcp resolved with error = %e; local_tol = %e\n", err_lcp, local_tol);
        }

        /* XXX missing recompute x ?*/
        /* recompute the normal norm */
        problem->compute_F(problem->env, n, x_plus, r);
        cblas_daxpy(n, -1.0, x, 1, r, 1);
        normal_norm2_newton_point = cblas_ddot(n, r, 1, r, 1);
        if(normal_norm2_newton_point > norm_r2)
        {
          printf("ncp_pathsearch :: lcp successfully solved, but the norm of the normal map increased! %e > %e\n", normal_norm2_newton_point, norm_r2);
          //assert(normal_norm2_newton_point <= norm_r2);
        }
        else
        {
          printf("ncp_pathsearch :: lcp successfully solved, norm of the normal map decreased! %e < %e\n", normal_norm2_newton_point, norm_r2);
          //check_ratio = norm_r2/normal_norm2_newton_point;
        }
        if(50*normal_norm2_newton_point < norm_r2)
        {
          force_d_step_merit_check = 1;
        }
        else if(10*normal_norm2_newton_point < norm_r2)
        {
//            check_ratio = sqrt(norm_r2/normal_norm2_newton_point);
        }
      }
      break;
    case LCP_PIVOT_RAY_TERMINATION:
      DEBUG_PRINT("ncp_pathsearch :: ray termination, let's fastened your seat belt!\n");
      break;
    case LCP_PATHSEARCH_LEAVING_T:
      DEBUG_PRINT("ncp_pathsearch :: leaving t, fastened your seat belt!\n");
      DEBUG_PRINTF("ncp_pathsearch :: max t value = %e\n", options->internalSolvers[0]->dparam[2]); /* XXX fix 2 */
      /* try to retry solving the problem */
      /* XXX keep or not ? */
      /* recompute the normal norm */
      problem->compute_F(problem->env, n, x_plus, r);
      cblas_daxpy(n, -1.0, x, 1, r, 1);
      normal_norm2_newton_point = cblas_ddot(n, r, 1, r, 1);
      if(normal_norm2_newton_point > norm_r2)
      {
        printf("ncp_pathsearch :: lcp successfully solved, but the norm of the normal map increased! %e > %e\n", normal_norm2_newton_point, norm_r2);
        //assert(normal_norm2_newton_point <= norm_r2);
      }
      else
      {
        printf("ncp_pathsearch :: lcp successfully solved, norm of the normal map decreased! %e < %e\n", normal_norm2_newton_point, norm_r2);
        check_ratio = 5.0*norm_r2/normal_norm2_newton_point;
      }
      if(options->internalSolvers[0]->dparam[2] > 1e-5) break;
      memset(x_plus, 0, sizeof(double) * n);
      problem->compute_F(problem->env, n, x_plus, r);
      ncp_pathsearch_compute_x_from_z(n, x_plus, r, x);
      ncp_pathsearch_update_lcp_data(problem, &lcp_subproblem, n, x_plus, x, r);
      lcp_pivot_covering_vector(&lcp_subproblem, x_plus, x, info, options->internalSolvers[0], r);
      if(*info == LCP_PIVOT_SUCCESS)
      {
        DEBUG_PRINT("ncp_pathsearch :: Lemke start worked !\n");
        double err_lcp = 0.0;
        cblas_daxpy(n, 1.0, r, 1, lcp_subproblem_check.q, 1);
        lcp_compute_error(&lcp_subproblem_check, x_plus, x, 1e-14, &err_lcp);
        double local_tol = fmax(1e-14, DBL_EPSILON*sqrt(norm_r2));
        printf("ncp_pathsearch :: lcp solved with error = %e; local_tol = %e\n", err_lcp, local_tol);
        assert(err_lcp < local_tol);
      }
      else
      {
        NM_display(lcp_subproblem.M);
        printf("z r q x_plus\n");
        for(unsigned i = 0; i < n; ++i) printf("%e %e %e %e\n", z[i], r[i], lcp_subproblem.q[i], x_plus[i]);
        DEBUG_PRINT("ncp_pathsearch :: Lemke start did not succeeded !\n");
        lcp_pivot_diagnose_info(*info);
        if(*info == LCP_PATHSEARCH_LEAVING_T)
        {
          DEBUG_PRINTF("ncp_pathsearch :: max t value after Lemke start = %e\n", options->internalSolvers[0]->dparam[2]);
        }
        options->internalSolvers[0]->iparam[SICONOS_LCP_IPARAM_PIVOTING_METHOD_TYPE] = 0;
        lcp_pivot(&lcp_subproblem, x_plus, x, info, options->internalSolvers[0]);
        options->internalSolvers[0]->iparam[SICONOS_LCP_IPARAM_PIVOTING_METHOD_TYPE] = SICONOS_LCP_PIVOT_PATHSEARCH;
        double err_lcp = 0.0;
        lcp_compute_error(&lcp_subproblem, x_plus, x, 1e-14, &err_lcp);
        printf("ncp_pathsearch :: lemke start resolved with info = %d; error = %e\n", *info, err_lcp);
        printf("x_plus x_minus\n");
        for(unsigned i = 0; i < n; ++i) printf("%e %e\n", x_plus[i], x[i]);
        /* recompute the normal norm */
        problem->compute_F(problem->env, n, x_plus, r);
        cblas_daxpy(n, -1.0, x, 1, r, 1);
        double normal_norm2_newton_point = cblas_ddot(n, r, 1, r, 1);
        if(normal_norm2_newton_point > norm_r2)
        {
          printf("ncp_pathsearch :: lcp successfully solved, but the norm of the normal map increased! %e > %e\n", normal_norm2_newton_point, norm_r2);
          //assert(normal_norm2_newton_point <= norm_r2);
        }
        else
        {
          printf("ncp_pathsearch :: lcp successfully solved, norm of the normal map decreased! %.*e < %.*e\n", DECIMAL_DIG, normal_norm2_newton_point, DECIMAL_DIG, norm_r2);
        }
        if(100*normal_norm2_newton_point < norm_r2)
        {
          force_d_step_merit_check = 1;
        }
      }
      break;
    case LCP_PIVOT_NUL:
      printf("ncp_pathsearch :: kaboom, kaboom still more work needs to be done\n");
      lcp_pivot_diagnose_info(*info);
//        exit(EXIT_FAILURE);
      force_watchdog_step = 1;
      break;
    case LCP_PATHSEARCH_NON_ENTERING_T:
      DEBUG_PRINT("ncp_pathsearch :: non entering t, something is wrong here. Fix the f****** code!\n");
      assert(0 && "ncp_pathsearch :: non entering t, something is wrong here\n");
      force_watchdog_step = 1;
      break;
    default:
      printf("ncp_pathsearch :: unknown code returned by the path search\n");
      exit(EXIT_FAILURE);
    }

    nms_failed = NMS(data_NMS, problem, functions, z, x_plus, force_watchdog_step, force_d_step_merit_check, check_ratio);
    /* at this point z has been updated */

    /* recompute the normal norm */
    problem->compute_F(problem->env, n, z, F);
    functions->compute_F_merit(problem, z, F, data_NMS->ls_data->F_merit);

    /* XXX is this correct ? */
    DEBUG_EXPR(merit_norm = .5 * cblas_ddot(n, data_NMS->ls_data->F_merit, 1, data_NMS->ls_data->F_merit, 1););
    ncp_compute_error(n, z, F, nn_tol, &err); /* XXX F should be up-to-date, we should check only CC*/
    DEBUG_PRINTF("ncp_pathsearch :: iter = %d, ncp_error = %e; merit_norm^2 = %e\n", nbiter, err, merit_norm);

  }

  options->iparam[SICONOS_IPARAM_ITER_DONE] = nbiter;
  options->dparam[SICONOS_DPARAM_RESIDU] = err;
  if(nbiter == itermax)
  {
    *info = 1;
  }
  else if(nms_failed)
  {
    *info = 2;
  }
  else
  {
    *info = 0;
  }

  DEBUG_PRINTF("ncp_pathsearch procedure finished :: info = %d; iter = %d; ncp_error = %e; merit_norm^2 = %e\n", *info, nbiter, err, merit_norm);

  if(!preAlloc)
  {

    NM_clear(problem->nabla_F);
    free(problem->nabla_F);
    problem->nabla_F = NULL;

    ncp_pathsearch_free(options);
  }
}


text:
<?php

namespace BingAds\CampaignManagement;

/**
 * Gets the reasons why the specified entities failed editorial review and whether the rejection is appealable.
 *
 * @link http://msdn.microsoft.com/en-us/library/dn236306(v=msads.90).aspx GetEditorialReasonsByIds Request Object
 *
 * @uses EntityType
 * @used-by BingAdsCampaignManagementService::GetEditorialReasonsByIds
 */
final class GetEditorialReasonsByIdsRequest
{
    /**
     * The identifier of the account that contains the specified entities.
     *
     * @var int
     */
    public $AccountId;
    /**
     * A list of unique identifiers that identifies the ads or keywords that failed editorial review.
     *
     * @var int[]
     */
    public $EntityIds;
    /**
     * The type of entities that the entity list contains.
     *
     * @var EntityType
     */
    public $EntityType;
}


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
DataBlockEncoder (HBase 0.94.16 API)
</TITLE>

<META NAME="date" CONTENT="2014-01-10">

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

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.hadoop.hbase.io.encoding

Interface DataBlockEncoder

All Known Implementing Classes:
CopyKeyDataBlockEncoder, DiffKeyDeltaEncoder, FastDiffDeltaEncoder, PrefixKeyDeltaEncoder

public interface DataBlockEncoder

Encoding of KeyValue. It aims to be fast and efficient using assumptions:

the KeyValues are stored sorted by key

we know the structure of KeyValue

the values are always iterated forward from beginning of block

knowledge of Key Value format

 It is designed to work fast enough to be feasible as in memory compression.

Nested Class Summary

static interface
DataBlockEncoder.EncodedSeeker

          An interface which enable to seek while underlying data is encoded.

Method Summary

 void
compressKeyValues(DataOutputStream out,
                  ByteBuffer in,
                  boolean includesMemstoreTS)

          Compress KeyValues and write them to output buffer.

 DataBlockEncoder.EncodedSeeker
createSeeker(org.apache.hadoop.io.RawComparator<byte[]> comparator,
             boolean includesMemstoreTS)

          Create a HFileBlock seeker which find KeyValues within a block.

 ByteBuffer
getFirstKeyInBlock(ByteBuffer block)

          Return first key in block.

 ByteBuffer
uncompressKeyValues(DataInputStream source,
                    boolean includesMemstoreTS)

          Uncompress.

 ByteBuffer
uncompressKeyValues(DataInputStream source,
                    int allocateHeaderLength,
                    int skipLastBytes,
                    boolean includesMemstoreTS)

          Uncompress.

Method Detail

compressKeyValues

void compressKeyValues(DataOutputStream out,
                       ByteBuffer in,
                       boolean includesMemstoreTS)
                       throws IOException

Compress KeyValues and write them to output buffer.

Parameters:
out - Where to write compressed data.
in - Source of KeyValue for compression.
includesMemstoreTS - true if including memstore timestamp after every
          key-value pair

Throws:

IOException - If there is an error writing to output stream.

uncompressKeyValues

ByteBuffer uncompressKeyValues(DataInputStream source,
                               boolean includesMemstoreTS)
                               throws IOException

Uncompress.

Parameters:
source - Compressed stream of KeyValues.
includesMemstoreTS - true if including memstore timestamp after every
          key-value pair

Returns:
Uncompressed block of KeyValues.

Throws:

IOException - If there is an error in source.

uncompressKeyValues

ByteBuffer uncompressKeyValues(DataInputStream source,
                               int allocateHeaderLength,
                               int skipLastBytes,
                               boolean includesMemstoreTS)
                               throws IOException

Uncompress.

Parameters:
source - Compressed stream of KeyValues.
allocateHeaderLength - allocate this many bytes for the header.
skipLastBytes - Do not copy n last bytes.
includesMemstoreTS - true if including memstore timestamp after every
          key-value pair

Returns:
Uncompressed block of KeyValues.

Throws:

IOException - If there is an error in source.

getFirstKeyInBlock

ByteBuffer getFirstKeyInBlock(ByteBuffer block)

Return first key in block. Useful for indexing. Typically does not make
 a deep copy but returns a buffer wrapping a segment of the actual block's
 byte array. This is because the first key in block is usually stored
 unencoded.

Parameters:
block - encoded block we want index, the position will not change

Returns:
First key in block.

createSeeker

DataBlockEncoder.EncodedSeeker createSeeker(org.apache.hadoop.io.RawComparator<byte[]> comparator,
                                            boolean includesMemstoreTS)

Create a HFileBlock seeker which find KeyValues within a block.

Parameters:
comparator - what kind of comparison should be used
includesMemstoreTS - true if including memstore timestamp after every
          key-value pair

Returns:
A newly created seeker.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2014 The Apache Software Foundation. All Rights Reserved.


text:
<!DOCTYPE html>

  <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Quickly convert data frame to transaction — transaction_convert • VPBank</title>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">

<link href="../pkgdown.css" rel="stylesheet">

<meta property="og:title" content="Quickly convert data frame to transaction — transaction_convert" />

<meta property="og:description" content="This function helps users to convert data frame to
transaction data quickly. The first column must be the key." />
<meta name="twitter:card" content="summary" />

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">

      </button>

        VPBank
        1.1

  Reference

    Articles

      Automate DEA analysis with `compare_group` & `map`

  Changelog

Quickly convert data frame to transaction

transaction_convert.Rd

This function helps users to convert data frame to
transaction data quickly. The first column must be the key.

transaction_convert(data, type = c("wide", "long"))

Arguments

    <colgroup><col class="name" /><col class="desc" /></colgroup>

      Data

set - This functions supports 2 kinds of data wide & long

      Type

- Two option: "wide" and "long"

Value

Return a transaction data

Examples

df1 <- data.frame(Transaction_ID = c(1,2,1,3,1,2), Products = c(2,3,2,4,4,5))
transaction_convert(df1, type = "long")

#> transactions in sparse format with
#>  3 transactions (rows) and
#>  4 items (columns)

df2 <- data.frame(ID = c(1,2,3), Product_1 = c(1,1,0), Product_2 = c(0,1,1), Product_3 = c(0,0,1))
transaction_convert(df2, type = "wide")

#> transactions in sparse format with
#>  3 transactions (rows) and
#>  3 items (columns)

Contents

Arguments

Value

Examples

Author

Anh Hoang Duc (anhhd3@vpbank.com.vn)

Developed by Anh Hoang Duc.

Site built with pkgdown.


text:
const pkg = require('../package.json')
const devDeps = pkg.devDependencies

module.exports = (api, options) => {
    api.render('./template', options)

    let deps = {
        '@yzfe/svgicon': devDeps['@yzfe/svgicon'],
    }

    if (options.isVue3) {
        deps['@yzfe/vue3-svgicon'] = devDeps['@yzfe/vue3-svgicon']
        api.injectImports(api.entryFile, [
            `import { VueSvgIconPlugin } from '@yzfe/vue3-svgicon'`,
            `import '@yzfe/svgicon/lib/svgicon.css'`,
        ])
    } else {
        deps['@yzfe/vue-svgicon'] = devDeps['@yzfe/vue-svgicon']
        api.injectImports(api.entryFile, [
            `import { VueSvgIcon } from '@yzfe/vue-svgicon'`,
            `import '@yzfe/svgicon/lib/svgicon.css'`,
        ])
    }

    api.extendPackage({
        dependencies: deps,
        devDependencies: {
            '@yzfe/svgicon-loader': devDeps['@yzfe/svgicon-loader'],
        },
    })
}

module.exports.hooks = (api, options) => {
    api.afterInvoke(() => {
        const { EOL } = require('os')
        const fs = require('fs')
        const contentMain = fs.readFileSync(api.resolve(api.entryFile), {
            encoding: 'utf-8',
        })

        const lines = contentMain.split(/\r?\n/g)

        if (options.isVue3) {
            let injectCode = `.use(VueSvgIconPlugin, { tagName: '${options.tagName}' })`
            const renderIndex = lines.findIndex((line) =>
                line.match(/createApp\(\w+\)/)
            )
            lines[renderIndex] = lines[renderIndex].replace(
                /createApp\(\w+\)/g,
                (match) => {
                    return match + injectCode
                }
            )
        } else {
            let injectCode = `
Vue.component('${options.tagName}', VueSvgIcon)
`
            const renderIndex = lines.findIndex((line) => line.match(/new Vue/))
            lines[renderIndex - 1] += `${injectCode}`
        }

        fs.writeFileSync(api.entryFile, lines.join(EOL), { encoding: 'utf-8' })
    })
}


text:
        {{ binding }}

        {{ type }}

            <ng-content></ng-content>

        {{ binding }}
        {{ type }}

            {{ contentHtml }}


text:
```sh
npm install
```

## Run development server

```sh
npm start
```

## Build for production

```sh
npm run build
```


text:
package eu.scape_project.hawarp.utils;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

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

/**
 * I/O utility methods.
 *
 * @author Sven Schlarb https://github.com/shsdev
 */
public class IOUtils {

    public static final int BUFFER_SIZE = 8192;

    private static final Log LOG = LogFactory.getLog(IOUtils.class);

    public static File copyStreamToTempFileInDir(InputStream inStream, String dir, String ext) throws IOException {
        String filename = System.currentTimeMillis() + RandomStringUtils.randomAlphabetic(5) + ext;
        if (!dir.endsWith("/")) {
            dir += "/";
        }
        File tmpFile = new File(dir, filename);
        FileUtils.copyInputStreamToFile(inStream, tmpFile);
        return tmpFile;
    }
}


text:
package main

import (
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"syscall"
	"text/tabwriter"
	"time"

	"encoding/json"

	"github.com/opencontainers/runc/libcontainer"
	"github.com/opencontainers/runc/libcontainer/user"
	"github.com/opencontainers/runc/libcontainer/utils"
	"github.com/urfave/cli"
)

const formatOptions = `table or json`

// containerState represents the platform agnostic pieces relating to a
// running container's status and state
type containerState struct {
	// Version is the OCI version for the container
	Version string `json:"ociVersion"`
	// ID is the container ID
	ID string `json:"id"`
	// InitProcessPid is the init process id in the parent namespace
	InitProcessPid int `json:"pid"`
	// Status is the current status of the container, running, paused, ...
	Status string `json:"status"`
	// Bundle is the path on the filesystem to the bundle
	Bundle string `json:"bundle"`
	// Rootfs is a path to a directory containing the container's root filesystem.
	Rootfs string `json:"rootfs"`
	// Created is the unix timestamp for the creation time of the container in UTC
	Created time.Time `json:"created"`
	// Annotations is the user defined annotations added to the config.
	Annotations map[string]string `json:"annotations,omitempty"`
	// The owner of the state directory (the owner of the container).
	Owner string `json:"owner"`
}

var listCommand = cli.Command{
	Name:  "list",
	Usage: "lists containers started by runc with the given root",
	ArgsUsage: `

Where the given root is specified via the global option "--root"
(default: "/run/runc").

EXAMPLE 1:
To list containers created via the default "--root":
       # runc list

EXAMPLE 2:
To list containers created using a non-default value for "--root":
       # runc --root value list`,
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "format, f",
			Value: "table",
			Usage: `select one of: ` + formatOptions,
		},
		cli.BoolFlag{
			Name:  "quiet, q",
			Usage: "display only container IDs",
		},
	},
	Action: func(context *cli.Context) error {
		if err := checkArgs(context, 0, exactArgs); err != nil {
			return err
		}
		s, err := getContainers(context)
		if err != nil {
			return err
		}

		if context.Bool("quiet") {
			for _, item := range s {
				fmt.Println(item.ID)
			}
			return nil
		}

		switch context.String("format") {
		case "table":
			w := tabwriter.NewWriter(os.Stdout, 12, 1, 3, ' ', 0)
			fmt.Fprint(w, "ID\tPID\tSTATUS\tBUNDLE\tCREATED\tOWNER\n")
			for _, item := range s {
				fmt.Fprintf(w, "%s\t%d\t%s\t%s\t%s\t%s\n",
					item.ID,
					item.InitProcessPid,
					item.Status,
					item.Bundle,
					item.Created.Format(time.RFC3339Nano),
					item.Owner)
			}
			if err := w.Flush(); err != nil {
				return err
			}
		case "json":
			if err := json.NewEncoder(os.Stdout).Encode(s); err != nil {
				return err
			}
		default:
			return errors.New("invalid format option")
		}
		return nil
	},
}

func getContainers(context *cli.Context) ([]containerState, error) {
	factory, err := loadFactory(context)
	if err != nil {
		return nil, err
	}
	root := context.GlobalString("root")
	absRoot, err := filepath.Abs(root)
	if err != nil {
		return nil, err
	}
	list, err := ioutil.ReadDir(absRoot)
	if err != nil {
		fatal(err)
	}

	var s []containerState
	for _, item := range list {
		if item.IsDir() {
			// This cast is safe on Linux.
			stat := item.Sys().(*syscall.Stat_t)
			owner, err := user.LookupUid(int(stat.Uid))
			if err != nil {
				owner.Name = fmt.Sprintf("#%d", stat.Uid)
			}

			container, err := factory.Load(item.Name())
			if err != nil {
				fmt.Fprintf(os.Stderr, "load container %s: %v\n", item.Name(), err)
				continue
			}
			containerStatus, err := container.Status()
			if err != nil {
				fmt.Fprintf(os.Stderr, "status for %s: %v\n", item.Name(), err)
				continue
			}
			state, err := container.State()
			if err != nil {
				fmt.Fprintf(os.Stderr, "state for %s: %v\n", item.Name(), err)
				continue
			}
			pid := state.BaseState.InitProcessPid
			if containerStatus == libcontainer.Stopped {
				pid = 0
			}
			bundle, annotations := utils.Annotations(state.Config.Labels)
			s = append(s, containerState{
				Version:        state.BaseState.Config.Version,
				ID:             state.BaseState.ID,
				InitProcessPid: pid,
				Status:         containerStatus.String(),
				Bundle:         bundle,
				Rootfs:         state.BaseState.Config.Rootfs,
				Created:        state.BaseState.Created,
				Annotations:    annotations,
				Owner:          owner.Name,
			})
		}
	}
	return s, nil
}


text:
 {{ trans('gitamin.home') }}

 {{ trans('gitamin.explore') }}

 Refresh

 Community

      {% if current_user %}

         {{ current_user.username }}
        <button class="navbar-toggle" type="button" data-toggle="dropdown" role="button" aria-expanded="false">
          Toggle

        </button>

我的主页

个人资料设置

退出

      {% else %}

注册

登录

      {% endif %}

            <form class="navbar-form form-search active" action="/search" method="GET">

                <input class="form-control" name="q" type="text" value="" placeholder="搜索本站内容">

            </form>

          {% if current_user %}

          {% endif %}


text:
<?php

/**
 * Create meta boxes
 */
class CMB_Meta_Box {

	protected $_meta_box;
	private $fields = array();

	function __construct( $meta_box ) {

		$this->_meta_box = $meta_box;

		if ( empty( $this->_meta_box['id'] ) )
			$this->_meta_box['id'] = sanitize_title( $this->_meta_box['title'] );

		$upload = false;

		foreach ( $meta_box['fields'] as $field ) {
			if ( $field['type'] == 'file' || $field['type'] == 'file_list' ) {
				$upload = true;
				break;
			}
		}

		add_action( 'dbx_post_advanced', array( &$this, 'init_fields_for_post' ) );
		add_action( 'cmb_init_fields', array( &$this, 'init_fields' ) );

		global $pagenow;

		if ( $upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) )
			add_action( 'admin_head', array( &$this, 'add_post_enctype' ) );

		add_action( 'admin_menu', array( &$this, 'add' ) );
		add_action( 'save_post', array( &$this, 'save_for_post' ) );
		add_action( 'cmb_save_fields', array( &$this, 'save' ) );

		add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_scripts' ) );
		add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_styles' ) );

		add_filter( 'cmb_show_on', array( &$this, 'add_for_id' ), 10, 2 );
		add_filter( 'cmb_show_on', array( &$this, 'add_for_page_template' ), 10, 2 );

	}

	public function init_fields( $post_id = 0 ) {

		foreach ( $this->_meta_box['fields'] as $key => $field ) {

			$values = array();

			// Set up blank or default values for empty ones
			//
			$defaults = array(
				'name' => '',
				'desc' => '',
				'std'  => '',
				'cols' => 12
			);

			$field = wp_parse_args( $field, $defaults );

			if ( 'file' == $field['type'] && ! isset( $field['allow'] ) )
				$field['allow'] = array( 'url', 'attachment' );

			if ( 'file' == $field['type'] && ! isset( $field['save_id'] ) )
				$field['save_id']  = false;

			$field['name_attr'] = $field['id'];
			$class = _cmb_field_class_for_type( $field['type'] );

			if ( ! empty( $this->_meta_box['repeatable'] ) )
				$field['repeatable'] = true;

			// Else if we are on a post edit screen
			elseif ( $post_id )
				$values = (array) get_post_meta( $post_id, $field['id'], false );

			if ( class_exists( $class ) ) {
				$this->fields[] = new $class( $field['id'], $field['name'], (array) $values, $field );
			}

		}

	}

	public function init_fields_for_post() {

		global $post, $temp_ID;

		// Get the current ID
		if( isset( $_GET['post'] ) )
			$post_id = $_GET['post'];

		elseif( isset( $_POST['post_ID'] ) )
			$post_id = $_POST['post_ID'];

		elseif ( ! empty( $post->ID ) )
			$post_id = $post->ID;

		if ( is_page() || ! isset( $post_id ) )
			return false;

		$this->init_fields( (int) $post_id );

	}

	function enqueue_scripts() {

		wp_enqueue_script( 'cmb-scripts', trailingslashit( CMB_URL ) . 'js/cmb.js', array( 'jquery' ) );

		foreach ( $this->fields as $field )
			$field->enqueue_scripts();

	}

	function enqueue_styles() {

		$suffix = CMB_DEV ? '' : '.min';

		if ( version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) )
			wp_enqueue_style( 'cmb-styles', trailingslashit( CMB_URL ) . "css/dist/cmb$suffix.css" );
		else
			wp_enqueue_style( 'cmb-styles', trailingslashit( CMB_URL ) . 'css/legacy.css' );

		foreach ( $this->fields as $field )
			$field->enqueue_styles();

	}

	function add_post_enctype() { ?>

	<?php }

	// Add metabox
	function add() {

		$this->_meta_box['context'] = empty($this->_meta_box['context']) ? 'normal' : $this->_meta_box['context'];
		$this->_meta_box['priority'] = empty($this->_meta_box['priority']) ? 'low' : $this->_meta_box['priority'];

		// Backwards compatablilty.
		if ( isset( $this->_meta_box['show_on']['key'] ) ) {
			$this->_meta_box['show_on'][ $this->_meta_box['show_on']['key'] ] = $this->_meta_box['show_on']['value'];
			unset( $this->_meta_box['show_on']['key'] );
			unset( $this->_meta_box['show_on']['value'] );
		}

		foreach ( (array) $this->_meta_box['pages'] as $page )
			if ( apply_filters( 'cmb_show_on', true, $this->_meta_box ) )
				add_meta_box( $this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority'] ) ;

	}

	/**
	 * Show On Filters
	 * Use the 'cmb_show_on' filter to further refine the conditions under which a metabox is displayed.
	 * Below you can limit it by ID and page template
	 */

	// Add for ID
	function add_for_id( $display, $meta_box ) {

		$post_id = isset( $_GET['post'] ) ? $_GET['post'] : null;

		if ( ! $post_id )
			$post_id  = isset( $_POST['post_id'] ) ? $_POST['post_id'] : null;

		if ( ! $post_id || ! isset( $meta_box['show_on']['id'] ) )
			return $display;

		// If value isn't an array, turn it into one
		$meta_box['show_on']['id'] = ! is_array( $meta_box['show_on']['id'] ) ? array( $meta_box['show_on']['id'] ) : $meta_box['show_on']['id'];

		return in_array( $post_id, $meta_box['show_on']['id'] );

	}

	// Add for Page Template
	function add_for_page_template( $display, $meta_box ) {

		$post_id = isset( $_GET['post'] ) ? $_GET['post'] : null;

		if ( ! $post_id )
			$post_id  = isset( $_POST['post_id'] ) ? $_POST['post_id'] : null;

		if ( ! $post_id || ! isset( $meta_box['show_on']['page-template'] ) )
			return $display;

		// Get current template
		$current_template = get_post_meta( $post_id, '_wp_page_template', true );

		// If value isn't an array, turn it into one
		$meta_box['show_on']['page-template'] = !is_array( $meta_box['show_on']['page-template'] ) ? array( $meta_box['show_on']['page-template'] ) : $meta_box['show_on']['page-template'];

		return in_array( $current_template, $meta_box['show_on']['page-template'] );

	}

	// Show fields
	function show() { ?>

		<input type="hidden" name="wp_meta_box_nonce" value="<?php esc_attr_e( wp_create_nonce( basename(__FILE__) ) ); ?>" />

		<?php self::layout_fields( $this->fields );

	}

	/**
	 * Layout an array of fields, depending on their 'cols' property.
	 *
	 * This is a static method so other fields can use it that rely on sub fields
	 *
	 * @param  CMB_Field[]  $fields
	 */
	static function layout_fields( array $fields ) { ?>

			<?php $current_colspan = 0;

			foreach ( $fields as $field ) :

				if ( $current_colspan == 0 ) : ?>

				<?php endif;

				$current_colspan += $field->args['cols'];

				$classes = array( 'field', get_class($field) );

				if ( ! empty( $field->args['repeatable'] ) )
					$classes[] = 'repeatable';

				if ( ! empty( $field->args['sortable'] ) )
					$classes[] = 'cmb-sortable';

				$attrs = array(
					sprintf( 'id="%s"', sanitize_html_class( $field->id ) ),
					sprintf( 'class="%s"', esc_attr( implode(' ', array_map( 'sanitize_html_class', $classes ) ) ) )
				);

				// Field Repeatable Max.
				if ( isset( $field->args['repeatable_max']  ) )
					$attrs[] = sprintf( 'data-rep-max="%s"', intval( $field->args['repeatable_max'] ) );

				?>

				<div class="cmb-cell-<?php echo intval( $field->args['cols'] ); ?>">

						<div <?php echo implode( ' ', $attrs ); ?>>
							<?php $field->display(); ?>

						<input type="hidden" name="_cmb_present_<?php esc_attr_e( $field->id ); ?>" value="1" />

				<?php if ( $current_colspan == 12 || $field === end( $fields ) ) :

					$current_colspan = 0; ?>

				<?php endif; ?>

			<?php endforeach; ?>

	<?php }

	function strip_repeatable( $values ) {

		foreach ( $values as $key => $value ) {

			if ( false !== strpos( $key, 'cmb-group-x' ) || false !==  strpos( $key, 'cmb-field-x' ) )
				unset( $values[$key] );

			elseif ( is_array( $value ) )
				$values[$key] = $this->strip_repeatable( $value );

		}

		return $values;
	}

	// Save data from metabox
	function save( $post_id = 0 )  {

		// verify nonce
		if ( ! isset( $_POST['wp_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['wp_meta_box_nonce'], basename( __FILE__ ) ) )
			return $post_id;

		foreach ( $this->_meta_box['fields'] as $field ) {

			// verify this meta box was shown on the page
			if ( ! isset( $_POST['_cmb_present_' . $field['id'] ] ) )
				continue;

			if ( isset( $_POST[$field['id']] ) )
				$value = (array) $_POST[$field['id']];
			else
				$value = array();

			$value = $this->strip_repeatable( $value );

			if ( ! $class = _cmb_field_class_for_type( $field['type'] ) ) {
				do_action('cmb_save_' . $field['type'], $field, $value);
			}

			if ( !empty(  $this->_meta_box['repeatable'] ) )
				$field['repeatable'] = true;

			$field_obj = new $class( $field['id'], $field['name'], $value, $field );
			$field_obj->save( $post_id, $value );

		}

		// If we are not on a post, need to refresh the field objects to reflect new values, as we do not get a redirect
		if ( ! $post_id ) {
			$this->fields = array();
			$this->init_fields();
		}
	}

	// Save the on save_post hook
	function save_for_post( $post_id ) {

		// check autosave
		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
			return $post_id;

		$this->save( $post_id );

	}
}


text:
$(document).ready(function(){
    $('#btnEnviar').click(function(){
        $('#formUpload').ajaxForm({
            uploadProgress: function(event, position, total, percentComplete) {
                $('progress').attr('value',percentComplete);
                $('#porcentagem').html(percentComplete+'%');
            },
            success: function(data) {
                $('progress').attr('value','100');
                $('#porcentagem').html('100%');
                if(data.sucesso == true){
                    $('#resposta').html('<img src="'+ data.msg +'" />');
                }else{
                    $('#resposta').html(data.msg);
                }
            },
            error : function(){
                $('#resposta').html('Erro ao enviar requisição!!!');
            },
            dataType: 'json',
            url: '/representadas/upload-foto',
            resetForm: true
        }).submit();
    })
})


text:
package au.gov.ga.geodesy.domain.service;

import javax.annotation.PostConstruct;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;

import au.gov.ga.geodesy.domain.model.event.Event;
import au.gov.ga.geodesy.domain.model.event.EventPublisher;
import au.gov.ga.geodesy.domain.model.event.EventSubscriber;
import au.gov.ga.geodesy.port.Notification;
import au.gov.ga.geodesy.port.NotificationPort;

@Transactional("geodesyTransactionManager")
public abstract class EventNotificationService<E extends Event>  implements EventSubscriber<E> {

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

    @Autowired
    private EventPublisher eventPublisher;

    @Autowired
    private NotificationPort notification;

    protected ObjectMapper json = new ObjectMapper();

    public EventNotificationService() {
        json = new ObjectMapper();
        json.enable(SerializationFeature.INDENT_OUTPUT);
    }

    @PostConstruct
    private void subcribe() {
        eventPublisher.subscribe(this);
    }

    public boolean canHandle(Event e) {
        return true;
    }

    protected Notification toNotification(E event) {
        return new Notification() {

            public String getSubject() {
                return event.getName();
            }

            public String getBody() {
                try {
                    StringBuilder body = new StringBuilder();
                    body.append(json.writeValueAsString(event));
                    return body.toString();
                } catch (JsonProcessingException e) {
                    String errorMessage = "Failed to serialise event with id " + event.getId();
                    log.error(errorMessage, e);
                    return errorMessage;
                }
            }
        };
    }

    public void handle(E event) {
        notification.sendNotification(toNotification(event));
        eventPublisher.handled(event);
        log.info("Handled event " + event);
    }
}


text:
import * as React from "react";
import {
  GoogleViz,
  GoogleChartWrapper,
  GoogleDataTable,
  ReactGoogleChartProps,
  GoogleChartDashboard,
  ReactGoogleChartPropsWithDefaults
} from "../types";
import { DEFAULT_CHART_COLORS } from "../constants";

import { loadDataTableFromSpreadSheet } from "../load-data-table-from-spreadsheet";
import { ContextConsumer } from "../Context";

const GRAY_COLOR = "#CCCCCC";
export type ChartDrawArgs = {
  data: ReactGoogleChartProps["data"];
};

export type GoogleChartDataTableProps = {
  googleChartWrapper: GoogleChartWrapper;
  google: GoogleViz;
  googleChartDashboard: GoogleChartDashboard | null;
};
interface State {
  hiddenColumns: string[];
}
export class GoogleChartDataTableInner extends React.Component<
  ReactGoogleChartPropsWithDefaults & GoogleChartDataTableProps,
  State
> {
  state = {
    hiddenColumns: []
  } as State;

  private listenToLegendToggle = () => {
    const { google, googleChartWrapper } = this.props;
    google.visualization.events.addListener(
      googleChartWrapper,
      "select",
      () => {
        const chart = googleChartWrapper.getChart();
        const selection = chart.getSelection();
        const dataTable = googleChartWrapper.getDataTable();
        if (
          selection.length === 0 ||
          // We want to listen to when a whole row is selected. This is the case only when row === null
          selection[0].row !== null ||
          dataTable === null
        ) {
          return;
        }
        const columnIndex = selection[0].column;
        const columnID = this.getColumnID(dataTable, columnIndex);
        if (this.state.hiddenColumns.includes(columnID)) {
          this.setState(state => ({
            ...state,
            hiddenColumns: [
              ...state.hiddenColumns.filter(colID => colID !== columnID)
            ]
          }));
        } else {
          this.setState(state => ({
            ...state,
            hiddenColumns: [...state.hiddenColumns, columnID]
          }));
        }
      }
    );
  };

  private applyFormatters = (dataTable: GoogleDataTable, formatters: any[]) => {
    const { google } = this.props;
    for (let formatter of formatters) {
      switch (formatter.type) {
        case "ArrowFormat": {
          const vizFormatter = new google.visualization.ArrowFormat(
            formatter.options
          );
          vizFormatter.format(dataTable, formatter.column);
          break;
        }
        case "BarFormat": {
          const vizFormatter = new google.visualization.BarFormat(
            formatter.options
          );
          vizFormatter.format(dataTable, formatter.column);
          break;
        }
        case "ColorFormat": {
          const vizFormatter = new google.visualization.ColorFormat(
            formatter.options
          );
          const { ranges } = formatter;
          for (let range of ranges) {
            vizFormatter.addRange(...range);
          }
          vizFormatter.format(dataTable, formatter.column);
          break;
        }
        case "DateFormat": {
          const vizFormatter = new google.visualization.DateFormat(
            formatter.options
          );
          vizFormatter.format(dataTable, formatter.column);
          break;
        }
        case "NumberFormat": {
          const vizFormatter = new google.visualization.NumberFormat(
            formatter.options
          );
          vizFormatter.format(dataTable, formatter.column);
          break;
        }
        case "PatternFormat": {
          const vizFormatter = new google.visualization.PatternFormat(
            formatter.options
          );
          vizFormatter.format(dataTable, formatter.column);
          break;
        }
      }
    }
  };
  private getColumnID = (dataTable: GoogleDataTable, columnIndex: number) => {
    return (
      dataTable.getColumnId(columnIndex) ||
      dataTable.getColumnLabel(columnIndex)
    );
  };
  private draw = async ({
    data,
    diffdata,
    rows,
    columns,
    options,
    legend_toggle,
    legendToggle,
    chartType,
    formatters,
    spreadSheetUrl,
    spreadSheetQueryParameters
  }: ReactGoogleChartPropsWithDefaults) => {
    const { google, googleChartWrapper } = this.props;
    let dataTable: GoogleDataTable;
    let chartDiff = null;
    if (diffdata !== null) {
      const oldData = google.visualization.arrayToDataTable(diffdata.old);
      const newData = google.visualization.arrayToDataTable(diffdata.new);
      chartDiff = google.visualization[chartType].prototype.computeDiff(
        oldData,
        newData
      );
    }
    if (data !== null) {
      if (Array.isArray(data)) {
        dataTable = google.visualization.arrayToDataTable(data);
      } else {
        dataTable = new google.visualization.DataTable(data);
      }
    } else if (rows !== null && columns !== null) {
      dataTable = google.visualization.arrayToDataTable([columns, ...rows]);
    } else if (spreadSheetUrl !== null) {
      dataTable = (await loadDataTableFromSpreadSheet(
        google,
        spreadSheetUrl,
        spreadSheetQueryParameters
      )) as GoogleDataTable;
    } else {
      dataTable = google.visualization.arrayToDataTable([]);
    }
    const columnCount = dataTable.getNumberOfColumns();
    for (let i = 0; i < columnCount; i += 1) {
      const columnID = this.getColumnID(dataTable, i);
      if (this.state.hiddenColumns.includes(columnID)) {
        const previousColumnLabel = dataTable.getColumnLabel(i);
        const previousColumnID = dataTable.getColumnId(i);
        const previousColumnType = dataTable.getColumnType(i);
        dataTable.removeColumn(i);
        dataTable.addColumn({
          label: previousColumnLabel,
          id: previousColumnID,
          type: previousColumnType
        });
      }
    }
    const chart = googleChartWrapper.getChart();
    if (googleChartWrapper.getChartType() === "Timeline") {
      chart && chart.clearChart();
    }

    googleChartWrapper.setOptions(options);
    googleChartWrapper.setDataTable(dataTable);
    googleChartWrapper.draw();
    if (this.props.googleChartDashboard !== null) {
      this.props.googleChartDashboard.draw(dataTable);
    }

    if (chartDiff !== null) {
      googleChartWrapper.setDataTable(chartDiff);
      googleChartWrapper.draw();
    }
    if (formatters !== null) {
      this.applyFormatters(dataTable, formatters);
      googleChartWrapper.setDataTable(dataTable);
      googleChartWrapper.draw();
    }
    if (legendToggle === true || legend_toggle === true) {
      this.grayOutHiddenColumns({ options });
    }
    return;
  };
  private grayOutHiddenColumns = ({
    options
  }: {
    options: ReactGoogleChartPropsWithDefaults["options"];
  }) => {
    const { googleChartWrapper } = this.props;
    const dataTable = googleChartWrapper.getDataTable();
    if (dataTable === null) return;
    const columnCount = dataTable.getNumberOfColumns();
    const hasAHiddenColumn = this.state.hiddenColumns.length > 0;
    if (hasAHiddenColumn === false) return;
    const colors = Array.from({ length: columnCount - 1 }).map(
      (dontcare, i) => {
        const columnID = this.getColumnID(dataTable, i + 1);
        if (this.state.hiddenColumns.includes(columnID)) {
          return GRAY_COLOR;
        } else if (
          typeof options.colors !== "undefined" &&
          options.colors !== null
        ) {
          return options.colors[i];
        } else {
          return DEFAULT_CHART_COLORS[i];
        }
      }
    );
    googleChartWrapper.setOptions({
      ...options,
      colors
    });
    googleChartWrapper.draw();
  };
  private onResize = () => {
    const { googleChartWrapper } = this.props;
    googleChartWrapper.draw();
  };
  componentDidMount() {
    this.draw(this.props);
    window.addEventListener("resize", this.onResize);
    if (this.props.legend_toggle || this.props.legendToggle) {
      this.listenToLegendToggle();
    }
  }

  componentWillUnmount() {
    const { google, googleChartWrapper } = this.props;
    window.removeEventListener("resize", this.onResize);
    google.visualization.events.removeAllListeners(googleChartWrapper);
    if (googleChartWrapper.getChartType() === "Timeline") {
      googleChartWrapper.getChart() &&
        googleChartWrapper.getChart().clearChart();
    }
  }

  componentDidUpdate() {
    this.draw(this.props);
  }
  render() {
    return null;
  }
}

export class GoogleChartDataTable extends React.Component<
  GoogleChartDataTableProps
> {
  componentDidMount() {}

  componentWillUnmount() {}
  shouldComponentUpdate() {
    return false;
  }
  render() {
    const { google, googleChartWrapper, googleChartDashboard } = this.props;
    return (
      <ContextConsumer
        render={props => {
          return (
            <GoogleChartDataTableInner
              {...props}
              google={google}
              googleChartWrapper={googleChartWrapper}
              googleChartDashboard={googleChartDashboard}
            />
          );
        }}
      />
    );
  }
}


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Paleontological Journal 42: -. [425-430]

#### Original name
null

### Remarks
null