|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Number java.math.BigDecimal
public class BigDecimal
Immutable, arbitrary-precision signed decimal numbers. A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale. If zero or positive, the scale is the number of digits to the right of the decimal point. If negative, the unscaled value of the number is multiplied by ten to the power of the negation of the scale. The value of the number represented by the BigDecimal is therefore (unscaledValue × 10-scale).
The BigDecimal class provides operations for
arithmetic, scale manipulation, rounding, comparison, hashing, and
format conversion. The toString()
method provides a
canonical representation of a BigDecimal.
The BigDecimal class gives its user complete control
over rounding behavior. If no rounding mode is specified and the
exact result cannot be represented, an exception is thrown;
otherwise, calculations can be carried out to a chosen precision
and rounding mode by supplying an appropriate MathContext
object to the operation. In either case, eight rounding
modes are provided for the control of rounding. Using the
integer fields in this class (such as ROUND_HALF_UP
) to
represent rounding mode is largely obsolete; the enumeration values
of the RoundingMode enum, (such as RoundingMode.HALF_UP
) should be used instead.
When a MathContext object is supplied with a precision
setting of 0 (for example, MathContext.UNLIMITED
),
arithmetic operations are exact, as are the arithmetic methods
which take no MathContext object. (This is the only
behavior that was supported in releases prior to 5.) As a
corollary of computing the exact result, the rounding mode setting
of a MathContext object with a precision setting of 0 is
not used and thus irrelevant. In the case of divide, the exact
quotient could have an infinitely long decimal expansion; for
example, 1 divided by 3. If the quotient has a nonterminating
decimal expansion and the operation is specified to return an exact
result, an ArithmeticException is thrown. Otherwise, the
exact result of the division is returned, as done for other
operations.
When the precision setting is not 0, the rules of BigDecimal arithmetic are broadly compatible with selected modes of operation of the arithmetic defined in ANSI X3.274-1996 and ANSI X3.274-1996/AM 1-2000 (section 7.4). Unlike those standards, BigDecimal includes many rounding modes, which were mandatory for division in BigDecimal releases prior to 5. Any conflicts between these ANSI standards and the BigDecimal specification are resolved in favor of BigDecimal.
Since the same numerical value can have different representations (with different scales), the rules of arithmetic and rounding must specify both the numerical result and the scale used in the result's representation.
In general the rounding modes and precision setting determine how operations return results with a limited number of digits when the exact result has more digits (perhaps infinitely many in the case of division) than the number of digits returned. First, the total number of digits to return is specified by the MathContext's precision setting; this determines the result's precision. The digit count starts from the leftmost nonzero digit of the exact result. The rounding mode determines how any discarded trailing digits affect the returned result.
For all arithmetic operators , the operation is carried out as though an exact intermediate result were first calculated and then rounded to the number of digits specified by the precision setting (if necessary), using the selected rounding mode. If the exact result is not returned, some digit positions of the exact result are discarded. When rounding increases the magnitude of the returned result, it is possible for a new digit position to be created by a carry propagating to a leading "9" digit. For example, rounding the value 999.9 to three digits rounding up would be numerically equal to one thousand, represented as 100×101. In such cases, the new "1" is the leading digit position of the returned result.
Besides a logical exact result, each arithmetic operation has a preferred scale for representing a result. The preferred scale for each operation is listed in the table below.
| Operation | Preferred Scale of Result |
|---|---|
| Add | max(addend.scale(), augend.scale()) |
| Subtract | max(minuend.scale(), subtrahend.scale()) |
| Multiply | multiplier.scale() + multiplicand.scale() |
| Divide | dividend.scale() - divisor.scale() |
Before rounding, the scale of the logical exact intermediate
result is the preferred scale for that operation. If the exact
numerical result cannot be represented in precision
digits, rounding selects the set of digits to return and the scale
of the result is reduced from the scale of the intermediate result
to the least scale which can represent the precision
digits actually returned. If the exact result can be represented
with at most precision
digits, the representation
of the result with the scale closest to the preferred scale is
returned. In particular, an exactly representable quotient may be
represented in fewer than precision
digits by removing
trailing zeros and decreasing the scale. For example, rounding to
three digits using the floor
rounding mode,
19/100 = 0.19 // integer=19, scale=2
but
21/110 = 0.190 // integer=190, scale=3
Note that for add, subtract, and multiply, the reduction in scale will equal the number of digit positions of the exact result which are discarded. If the rounding causes a carry propagation to create a new high-order digit position, an additional digit of the result is discarded than when no new digit position is created.
Other methods may have slightly different rounding semantics. For example, the result of the pow method using the specified algorithm can occasionally differ from the rounded mathematical result by more than one unit in the last place, one ulp.
Two types of operations are provided for manipulating the scale
of a BigDecimal: scaling/rounding operations and decimal
point motion operations. Scaling/rounding operations (setScale
and round
) return a
BigDecimal whose value is approximately (or exactly) equal
to that of the operand, but whose scale or precision is the
specified value; that is, they increase or decrease the precision
of the stored number with minimal effect on its value. Decimal
point motion operations (movePointLeft
and
movePointRight
) return a
BigDecimal created from the operand by moving the decimal
point a specified distance in the specified direction.
For the sake of brevity and clarity, pseudo-code is used throughout the descriptions of BigDecimal methods. The pseudo-code expression (i + j) is shorthand for "a BigDecimal whose value is that of the BigDecimal i added to that of the BigDecimal j." The pseudo-code expression (i == j) is shorthand for "true if and only if the BigDecimal i represents the same value as the BigDecimal j." Other pseudo-code expressions are interpreted similarly. Square brackets are used to represent the particular BigInteger and scale pair defining a BigDecimal value; for example [19, 2] is the BigDecimal numerically equal to 0.19 having a scale of 2.
Note: care should be exercised if BigDecimal objects
are used as keys in a SortedMap
or
elements in a SortedSet
since
BigDecimal's natural ordering is inconsistent
with equals. See Comparable
, SortedMap
or SortedSet
for more
information.
All methods and constructors for this class throw NullPointerException when passed a null object reference for any input parameter.
BigInteger
,
MathContext
,
RoundingMode
,
SortedMap
,
SortedSet
,
Serialized Form| Field Summary | |
|---|---|
static BigDecimal |
ONE
The value 1, with a scale of 0. |
static int |
ROUND_CEILING
Rounding mode to round towards positive infinity. |
static int |
ROUND_DOWN
Rounding mode to round towards zero. |
static int |
ROUND_FLOOR
Rounding mode to round towards negative infinity. |
static int |
ROUND_HALF_DOWN
Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. |
static int |
ROUND_HALF_EVEN
Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor. |
static int |
ROUND_HALF_UP
Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. |
static int |
ROUND_UNNECESSARY
Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary. |
static int |
ROUND_UP
Rounding mode to round away from zero. |
static BigDecimal |
TEN
The value 10, with a scale of 0. |
static BigDecimal |
ZERO
The value 0, with a scale of 0. |
| Constructor Summary | |
|---|---|
BigDecimal(BigInteger val)
Translates a BigInteger into a BigDecimal. |
|
BigDecimal(BigInteger unscaledVal,
int scale)
Translates a BigInteger unscaled value and an int scale into a BigDecimal. |
|
BigDecimal(BigInteger unscaledVal,
int scale,
MathContext mc)
Translates a BigInteger unscaled value and an int scale into a BigDecimal, with rounding according to the context settings. |
|
BigDecimal(BigInteger val,
MathContext mc)
Translates a BigInteger into a BigDecimal rounding according to the context settings. |
|
BigDecimal(char[] in)
Translates a character array representation of a BigDecimal into a BigDecimal, accepting the same sequence of characters as the BigDecimal(String)
constructor. |
|
BigDecimal(char[] in,
int offset,
int len)
Translates a character array representation of a BigDecimal into a BigDecimal, accepting the same sequence of characters as the BigDecimal(String)
constructor, while allowing a sub-array to be specified. |
|
BigDecimal(char[] in,
int offset,
int len,
MathContext mc)
Translates a character array representation of a BigDecimal into a BigDecimal, accepting the same sequence of characters as the BigDecimal(String)
constructor, while allowing a sub-array to be specified and
with rounding according to the context settings. |
|
BigDecimal(char[] in,
MathContext mc)
Translates a character array representation of a BigDecimal into a BigDecimal, accepting the same sequence of characters as the BigDecimal(String)
constructor and with rounding according to the context
settings. |
|
BigDecimal(double val)
Translates a double into a BigDecimal which is the exact decimal representation of the double's binary floating-point value. |
|
BigDecimal(double val,
MathContext mc)
Translates a double into a BigDecimal, with rounding according to the context settings. |
|
BigDecimal(int val)
Translates an int into a BigDecimal. |
|
BigDecimal(int val,
MathContext mc)
Translates an int into a BigDecimal, with rounding according to the context settings. |
|
BigDecimal(long val)
Translates a long into a BigDecimal. |
|
BigDecimal(long val,
MathContext mc)
Translates a long into a BigDecimal, with rounding according to the context settings. |
|
BigDecimal(String val)
Translates the string representation of a BigDecimal into a BigDecimal. |
|
BigDecimal(String val,
MathContext mc)
Translates the string representation of a BigDecimal into a BigDecimal, accepting the same strings as the BigDecimal(String) constructor, with rounding
according to the context settings. |
| Method Summary | |
|---|---|
BigDecimal |
abs()
Returns a BigDecimal whose value is the absolute value of this BigDecimal, and whose scale is this.scale(). |
BigDecimal |
abs(MathContext mc)
Returns a BigDecimal whose value is the absolute value of this BigDecimal, with rounding according to the context settings. |
BigDecimal |
add(BigDecimal augend)
Returns a BigDecimal whose value is (this + augend), and whose scale is max(this.scale(), augend.scale()). |
BigDecimal |
add(BigDecimal augend,
MathContext mc)
Returns a BigDecimal whose value is (this + augend), with rounding according to the context settings. |
byte |
byteValueExact()
Converts this BigDecimal to a byte, checking for lost information. |
int |
compareTo(BigDecimal val)
Compares this BigDecimal with the specified BigDecimal. |
BigDecimal |
divide(BigDecimal divisor)
Returns a BigDecimal whose value is (this / divisor), and whose preferred scale is (this.scale() - divisor.scale()); if the exact quotient cannot be represented (because it has a non-terminating decimal expansion) an ArithmeticException is thrown. |
BigDecimal |
divide(BigDecimal divisor,
int roundingMode)
Returns a BigDecimal whose value is (this / divisor), and whose scale is this.scale(). |
BigDecimal |
divide(BigDecimal divisor,
int scale,
int roundingMode)
Returns a BigDecimal whose value is (this / divisor), and whose scale is as specified. |
BigDecimal |
divide(BigDecimal divisor,
int scale,
RoundingMode roundingMode)
Returns a BigDecimal whose value is (this / divisor), and whose scale is as specified. |
BigDecimal |
divide(BigDecimal divisor,
MathContext mc)
Returns a BigDecimal whose value is (this / divisor), with rounding according to the context settings. |
BigDecimal |
divide(BigDecimal divisor,
RoundingMode roundingMode)
Returns a BigDecimal whose value is (this / divisor), and whose scale is this.scale(). |
BigDecimal[] |
divideAndRemainder(BigDecimal divisor)
Returns a two-element BigDecimal array containing the result of divideToIntegralValue followed by the result of remainder on the two operands. |
BigDecimal[] |
divideAndRemainder(BigDecimal divisor,
MathContext mc)
Returns a two-element BigDecimal array containing the result of divideToIntegralValue followed by the result of remainder on the two operands calculated with rounding according to the context settings. |
BigDecimal |
divideToIntegralValue(BigDecimal divisor)
Returns a BigDecimal whose value is the integer part of the quotient (this / divisor) rounded down. |
BigDecimal |
divideToIntegralValue(BigDecimal divisor,
MathContext mc)
Returns a BigDecimal whose value is the integer part of (this / divisor). |
double |
doubleValue()
Converts this BigDecimal to a double. |
boolean |
equals(Object x)
Compares this BigDecimal with the specified Object for equality. |
float |
floatValue()
Converts this BigDecimal to a float. |
int |
hashCode()
Returns the hash code for this BigDecimal. |
int |
intValue()
Converts this BigDecimal to an int. |
int |
intValueExact()
Converts this BigDecimal to an int, checking for lost information. |
long |
longValue()
Converts this BigDecimal to a long. |
long |
longValueExact()
Converts this BigDecimal to a long, checking for lost information. |
BigDecimal |
max(BigDecimal val)
Returns the maximum of this BigDecimal and val. |
BigDecimal |
min(BigDecimal val)
Returns the minimum of this BigDecimal and val. |
BigDecimal |
movePointLeft(int n)
Returns a BigDecimal which is equivalent to this one with the decimal point moved n places to the left. |
BigDecimal |
movePointRight(int n)
Returns a BigDecimal which is equivalent to this one with the decimal point moved n places to the right. |
BigDecimal |
multiply(BigDecimal multiplicand)
Returns a BigDecimal whose value is (this × multiplicand), and whose scale is (this.scale() + multiplicand.scale()). |
BigDecimal |
multiply(BigDecimal multiplicand,
MathContext mc)
Returns a BigDecimal whose value is (this × multiplicand), with rounding according to the context settings. |
BigDecimal |
negate()
Returns a BigDecimal whose value is (-this), and whose scale is this.scale(). |
BigDecimal |
negate(MathContext mc)
Returns a BigDecimal whose value is (-this), with rounding according to the context settings. |
BigDecimal |
plus()
Returns a BigDecimal whose value is (+this), and whose scale is this.scale(). |
BigDecimal |
plus(MathContext mc)
Returns a BigDecimal whose value is (+this), with rounding according to the context settings. |
BigDecimal |
pow(int n)
Returns a BigDecimal whose value is (thisn), The power is computed exactly, to unlimited precision. |
BigDecimal |
pow(int n,
MathContext mc)
Returns a BigDecimal whose value is (thisn). |
int |
precision()
Returns the precision of this BigDecimal. |
BigDecimal |
remainder(BigDecimal divisor)
Returns a BigDecimal whose value is (this % divisor). |
BigDecimal |
remainder(BigDecimal divisor,
MathContext mc)
Returns a BigDecimal whose value is (this % divisor), with rounding according to the context settings. |
BigDecimal |
round(MathContext mc)
Returns a BigDecimal rounded according to the MathContext settings. |
int |
scale()
Returns the scale of this BigDecimal. |
BigDecimal |
scaleByPowerOfTen(int n)
Returns a BigDecimal whose numerical value is equal to (this * 10n). |
BigDecimal |
setScale(int newScale)
Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to this BigDecimal's. |
BigDecimal |
setScale(int newScale,
int roundingMode)
Returns a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value. |
BigDecimal |
setScale(int newScale,
RoundingMode roundingMode)
Returns a BigDecimal whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this BigDecimal's unscaled value by the appropriate power of ten to maintain its overall value. |
short |
shortValueExact()
Converts this BigDecimal to a short, checking for lost information. |
int |
signum()
Returns the signum function of this BigDecimal. |
BigDecimal |
stripTrailingZeros()
Returns a BigDecimal which is numerically equal to this one but with any trailing zeros removed from the representation. |
BigDecimal |
subtract(BigDecimal subtrahend)
Returns a BigDecimal whose value is (this - subtrahend), and whose scale is max(this.scale(), subtrahend.scale()). |
BigDecimal |
subtract(BigDecimal subtrahend,
MathContext mc)
Returns a BigDecimal whose value is (this - subtrahend), with rounding according to the context settings. |
BigInteger |
toBigInteger()
Converts this BigDecimal to a BigInteger. |
BigInteger |
toBigIntegerExact()
Converts this BigDecimal to a BigInteger, checking for lost information. |
String |
toEngineeringString()
Returns a string representation of this BigDecimal, using engineering notation if an exponent is needed. |
String |
toPlainString()
Returns a string representation of this BigDecimal without an exponent field. |
String |
toString()
Returns the string representation of this BigDecimal, using scientific notation if an exponent is needed. |
BigDecimal |
ulp()
Returns the size of an ulp, a unit in the last place, of this BigDecimal. |
BigInteger |
unscaledValue()
Returns a BigInteger whose value is the unscaled value of this BigDecimal. |
static BigDecimal |
valueOf(double val)
Translates a double into a BigDecimal, using the double's canonical string representation provided by the Double.toString(double) method. |
static BigDecimal |
valueOf(long val)
Translates a long value into a BigDecimal with a scale of zero. |
static BigDecimal |
valueOf(long unscaledVal,
int scale)
Translates a long unscaled value and an int scale into a BigDecimal. |
| Methods inherited from class java.lang.Number |
|---|
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final BigDecimal ZERO
public static final BigDecimal ONE
public static final BigDecimal TEN
public static final int ROUND_UP
public static final int ROUND_DOWN
public static final int ROUND_CEILING
public static final int ROUND_FLOOR
public static final int ROUND_HALF_UP
public static final int ROUND_HALF_DOWN
public static final int ROUND_HALF_EVEN
public static final int ROUND_UNNECESSARY
| Constructor Detail |
|---|
public BigDecimal(char[] in, int offset, int len)
BigDecimal(String)
constructor, while allowing a sub-array to be specified.
Note that if the sequence of characters is already available within a character array, using this constructor is faster than converting the char array to string and using the BigDecimal(String) constructor .
in
- char array that is the source of characters.offset
- first character in the array to inspect.len
- number of characters to consider.
NumberFormatException
- if in is not a valid
representation of a BigDecimal or the defined subarray
is not wholly within in.public BigDecimal(char[] in, int offset, int len, MathContext mc)
BigDecimal(String)
constructor, while allowing a sub-array to be specified and
with rounding according to the context settings.
Note that if the sequence of characters is already available within a character array, using this constructor is faster than converting the char array to string and using the BigDecimal(String) constructor .
in
- char array that is the source of characters.offset
- first character in the array to inspect.len
- number of characters to consider..mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.
NumberFormatException
- if in is not a valid
representation of a BigDecimal or the defined subarray
is not wholly within in.public BigDecimal(char[] in)
BigDecimal(String)
constructor.
Note that if the sequence of characters is already available as a character array, using this constructor is faster than converting the char array to string and using the BigDecimal(String) constructor .
in
- char array that is the source of characters.
NumberFormatException
- if in is not a valid
representation of a BigDecimal.public BigDecimal(char[] in, MathContext mc)
BigDecimal(String)
constructor and with rounding according to the context
settings.
Note that if the sequence of characters is already available as a character array, using this constructor is faster than converting the char array to string and using the BigDecimal(String) constructor .
in
- char array that is the source of characters.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.
NumberFormatException
- if in is not a valid
representation of a BigDecimal.public BigDecimal(String val)
The fraction consists of a decimal point followed by zero or more decimal digits. The string must contain at least one digit in either the integer or the fraction. The number formed by the sign, the integer and the fraction is referred to as the significand.
The exponent consists of the character 'e'
('\u0075') or 'E' ('\u0045')
followed by one or more decimal digits. The value of the
exponent must lie between -Integer.MAX_VALUE
(Integer.MIN_VALUE
+1) and Integer.MAX_VALUE
, inclusive.
More formally, the strings this constructor accepts are described by the following grammar:
- BigDecimalString:
- Signopt Significand Exponentopt
- Sign:
- +
- -
- Significand:
- IntegerPart . FractionPartopt
- . FractionPart
- IntegerPart
- IntegerPart:
- Digits
- FractionPart:
- Digits
- Exponent:
- ExponentIndicator SignedInteger
- ExponentIndicator:
- e
- E
- SignedInteger:
- Signopt Digits
- Digits:
- Digit
- Digits Digit
- Digit:
- any character for which
Character.isDigit(char)
returns true, including 0, 1, 2 ...
The scale of the returned BigDecimal will be the number of digits in the fraction, or zero if the string contains no decimal point, subject to adjustment for any exponent; if the string contains an exponent, the exponent is subtracted from the scale. The value of the resulting scale must lie between Integer.MIN_VALUE and Integer.MAX_VALUE, inclusive.
The character-to-digit mapping is provided by Character.digit(char, int)
set to convert to radix 10. The
String may not contain any extraneous characters (whitespace,
for example).
Examples:
The value of the returned BigDecimal is equal to
significand × 10 exponent.
For each string on the left, the resulting representation
[BigInteger, scale] is shown on the right.
"0" [0,0] "0.00" [0,2] "123" [123,0] "-123" [-123,0] "1.23E3" [123,-1] "1.23E+3" [123,-1] "12.3E+7" [123,-6] "12.0" [120,1] "12.3" [123,1] "0.00123" [123,5] "-1.23E-12" [-123,14] "1234.5E-4" [12345,5] "0E+7" [0,-7] "-0" [0,0]
Note: For values other than float and
double NaN and ±Infinity, this constructor is
compatible with the values returned by Float.toString(float)
and Double.toString(double)
. This is generally the preferred
way to convert a float or double into a
BigDecimal, as it doesn't suffer from the unpredictability of
the BigDecimal(double)
constructor.
val
- String representation of BigDecimal.
NumberFormatException
- if val is not a valid
representation of a BigDecimal.public BigDecimal(String val, MathContext mc)
BigDecimal(String)
constructor, with rounding
according to the context settings.
val
- string representation of a BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.
NumberFormatException
- if val is not a valid
representation of a BigDecimal.public BigDecimal(double val)
Notes:
Double.toString(double)
method and then using the
BigDecimal(String)
constructor. To get that result,
use the static valueOf(double)
method.
val
- double value to be converted to
BigDecimal.
NumberFormatException
- if val is infinite or NaN.public BigDecimal(double val, MathContext mc)
The results of this constructor can be somewhat unpredictable
and its use is generally not recommended; see the notes under
the BigDecimal(double)
constructor.
val
- double value to be converted to
BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
RoundingMode is UNNECESSARY.
NumberFormatException
- if val is infinite or NaN.public BigDecimal(BigInteger val)
val
- BigInteger value to be converted to
BigDecimal.public BigDecimal(BigInteger val, MathContext mc)
val
- BigInteger value to be converted to
BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal(BigInteger unscaledVal, int scale)
unscaledVal
- unscaled value of the BigDecimal.scale
- scale of the BigDecimal.public BigDecimal(BigInteger unscaledVal, int scale, MathContext mc)
unscaledVal
- unscaled value of the BigDecimal.scale
- scale of the BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal(int val)
val
- int value to be converted to
BigDecimal.public BigDecimal(int val, MathContext mc)
val
- int value to be converted to BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal(long val)
val
- long value to be converted to BigDecimal.public BigDecimal(long val, MathContext mc)
val
- long value to be converted to BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.| Method Detail |
|---|
public static BigDecimal valueOf(long unscaledVal, int scale)
unscaledVal
- unscaled value of the BigDecimal.scale
- scale of the BigDecimal.
public static BigDecimal valueOf(long val)
val
- value of the BigDecimal.
public static BigDecimal valueOf(double val)
Double.toString(double)
method.
Note: This is generally the preferred way to convert
a double (or float) into a
BigDecimal, as the value returned is equal to that
resulting from constructing a BigDecimal from the
result of using Double.toString(double)
.
val
- double to convert to a BigDecimal.
NumberFormatException
- if val is infinite or NaN.public BigDecimal add(BigDecimal augend)
augend
- value to be added to this BigDecimal.
public BigDecimal add(BigDecimal augend, MathContext mc)
augend
- value to be added to this BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal subtract(BigDecimal subtrahend)
subtrahend
- value to be subtracted from this BigDecimal.
public BigDecimal subtract(BigDecimal subtrahend, MathContext mc)
subtrahend
- value to be subtracted from this BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal multiply(BigDecimal multiplicand)
multiplicand
- value to be multiplied by this BigDecimal.
public BigDecimal multiply(BigDecimal multiplicand, MathContext mc)
multiplicand
- value to be multiplied by this BigDecimal.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal divide(BigDecimal divisor, int scale, int roundingMode)
The new divide(BigDecimal, int, RoundingMode)
method
should be used in preference to this legacy method.
divisor
- value by which this BigDecimal is to be divided.scale
- scale of the BigDecimal quotient to be returned.roundingMode
- rounding mode to apply.
ArithmeticException
- if divisor is zero,
roundingMode==ROUND_UNNECESSARY and
the specified scale is insufficient to represent the result
of the division exactly.
IllegalArgumentException
- if roundingMode does not
represent a valid rounding mode.ROUND_UP
,
ROUND_DOWN
,
ROUND_CEILING
,
ROUND_FLOOR
,
ROUND_HALF_UP
,
ROUND_HALF_DOWN
,
ROUND_HALF_EVEN
,
ROUND_UNNECESSARY
public BigDecimal divide(BigDecimal divisor, int scale, RoundingMode roundingMode)
divisor
- value by which this BigDecimal is to be divided.scale
- scale of the BigDecimal quotient to be returned.roundingMode
- rounding mode to apply.
ArithmeticException
- if divisor is zero,
roundingMode==RoundingMode.UNNECESSARY and
the specified scale is insufficient to represent the result
of the division exactly.public BigDecimal divide(BigDecimal divisor, int roundingMode)
The new divide(BigDecimal, RoundingMode)
method
should be used in preference to this legacy method.
divisor
- value by which this BigDecimal is to be divided.roundingMode
- rounding mode to apply.
ArithmeticException
- if divisor==0, or
roundingMode==ROUND_UNNECESSARY and
this.scale() is insufficient to represent the result
of the division exactly.
IllegalArgumentException
- if roundingMode does not
represent a valid rounding mode.ROUND_UP
,
ROUND_DOWN
,
ROUND_CEILING
,
ROUND_FLOOR
,
ROUND_HALF_UP
,
ROUND_HALF_DOWN
,
ROUND_HALF_EVEN
,
ROUND_UNNECESSARY
public BigDecimal divide(BigDecimal divisor, RoundingMode roundingMode)
divisor
- value by which this BigDecimal is to be divided.roundingMode
- rounding mode to apply.
ArithmeticException
- if divisor==0, or
roundingMode==RoundingMode.UNNECESSARY and
this.scale() is insufficient to represent the result
of the division exactly.public BigDecimal divide(BigDecimal divisor)
divisor
- value by which this BigDecimal is to be divided.
ArithmeticException
- if the exact quotient does not have a
terminating decimal expansionpublic BigDecimal divide(BigDecimal divisor, MathContext mc)
divisor
- value by which this BigDecimal is to be divided.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY or
mc.precision == 0 and the quotient has a
non-terminating decimal expansion.public BigDecimal divideToIntegralValue(BigDecimal divisor)
(this.scale() -
divisor.scale())
.
divisor
- value by which this BigDecimal is to be divided.
ArithmeticException
- if divisor==0public BigDecimal divideToIntegralValue(BigDecimal divisor, MathContext mc)
(this.scale() - divisor.scale())
. An
ArithmeticException is thrown if the integer part of
the exact quotient needs more than mc.precision
digits.
divisor
- value by which this BigDecimal is to be divided.mc
- the context to use.
ArithmeticException
- if divisor==0
ArithmeticException
- if mc.precision > 0 and the result
requires a precision of more than mc.precision digits.public BigDecimal remainder(BigDecimal divisor)
The remainder is given by this.subtract(this.divideToIntegralValue(divisor).multiply(divisor)). Note that this is not the modulo operation (the result can be negative).
divisor
- value by which this BigDecimal is to be divided.
ArithmeticException
- if divisor==0public BigDecimal remainder(BigDecimal divisor, MathContext mc)
The remainder is given by this.subtract(this.divideToIntegralValue(divisor, mc).multiply(divisor)). Note that this is not the modulo operation (the result can be negative).
divisor
- value by which this BigDecimal is to be divided.mc
- the context to use.
ArithmeticException
- if divisor==0
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY, or mc.precision
> 0 and the result of this.divideToIntgralValue(divisor) would
require a precision of more than mc.precision digits.divideToIntegralValue(java.math.BigDecimal, java.math.MathContext)
public BigDecimal[] divideAndRemainder(BigDecimal divisor)
Note that if both the integer quotient and remainder are needed, this method is faster than using the divideToIntegralValue and remainder methods separately because the division need only be carried out once.
divisor
- value by which this BigDecimal is to be divided,
and the remainder computed.
ArithmeticException
- if divisor==0divideToIntegralValue(java.math.BigDecimal, java.math.MathContext)
,
remainder(java.math.BigDecimal, java.math.MathContext)
public BigDecimal[] divideAndRemainder(BigDecimal divisor, MathContext mc)
Note that if both the integer quotient and remainder are needed, this method is faster than using the divideToIntegralValue and remainder methods separately because the division need only be carried out once.
divisor
- value by which this BigDecimal is to be divided,
and the remainder computed.mc
- the context to use.
ArithmeticException
- if divisor==0
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY, or mc.precision
> 0 and the result of this.divideToIntgralValue(divisor) would
require a precision of more than mc.precision digits.divideToIntegralValue(java.math.BigDecimal, java.math.MathContext)
,
remainder(java.math.BigDecimal, java.math.MathContext)
public BigDecimal pow(int n)
The parameter n must be in the range 0 through
999999999, inclusive. ZERO.pow(0) returns ONE
.
Note that future releases may expand the allowable exponent
range of this method.
n
- power to raise this BigDecimal to.
ArithmeticException
- if n is out of range.public BigDecimal pow(int n, MathContext mc)
The X3.274-1996 algorithm is:
ONE
is returned even if
this is zero, otherwise
n
- power to raise this BigDecimal to.mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY, or n is out
of range.public BigDecimal abs()
public BigDecimal abs(MathContext mc)
mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal negate()
public BigDecimal negate(MathContext mc)
mc
- the context to use.
ArithmeticException
- if or the result is inexact but the
rounding mode is UNNECESSARY.public BigDecimal plus()
This method, which simply returns this BigDecimal
is included for symmetry with the unary minus method negate()
.
negate()
public BigDecimal plus(MathContext mc)
The effect of this method is identical to that of the round(MathContext)
method.
mc
- the context to use.
ArithmeticException
- if the result is inexact but the
rounding mode is UNNECESSARY.round(MathContext)
public int signum()
public int scale()
public int precision()
The precision of a zero value is 1.
public BigInteger unscaledValue()
public BigDecimal round(MathContext mc)
The effect of this method is identical to that of the
plus(MathContext)
method.
mc
- the context to use.
ArithmeticException
- if the rounding mode is
UNNECESSARY and the
BigDecimal operation would require rounding.plus(MathContext)
public BigDecimal setScale(int newScale, RoundingMode roundingMode)
newScale
- scale of the BigDecimal value to be returned.roundingMode
- The rounding mode to apply.
ArithmeticException
- if roundingMode==UNNECESSARY
and the specified scaling operation would require
rounding.RoundingMode
public BigDecimal setScale(int newScale, int roundingMode)
Note that since BigDecimal objects are immutable, calls of this method do not result in the original object being modified, contrary to the usual convention of having methods named setX mutate field X. Instead, setScale returns an object with the proper scale; the returned object may or may not be newly allocated.
The new setScale(int, RoundingMode)
method should
be used in preference to this legacy method.
newScale
- scale of the BigDecimal value to be returned.roundingMode
- The rounding mode to apply.
ArithmeticException
- if roundingMode==ROUND_UNNECESSARY
and the specified scaling operation would require
rounding.
IllegalArgumentException
- if roundingMode does not
represent a valid rounding mode.ROUND_UP
,
ROUND_DOWN
,
ROUND_CEILING
,
ROUND_FLOOR
,
ROUND_HALF_UP
,
ROUND_HALF_DOWN
,
ROUND_HALF_EVEN
,
ROUND_UNNECESSARY
public BigDecimal setScale(int newScale)
This call is typically used to increase the scale, in which case it is guaranteed that there exists a BigDecimal of the specified scale and the correct value. The call can also be used to reduce the scale if the caller knows that the BigDecimal has sufficiently many zeros at the end of its fractional part (i.e., factors of ten in its integer value) to allow for the rescaling without changing its value.
This method returns the same result as the two-argument versions of setScale, but saves the caller the trouble of specifying a rounding mode in cases where it is irrelevant.
Note that since BigDecimal objects are immutable, calls of this method do not result in the original object being modified, contrary to the usual convention of having methods named setX mutate field X. Instead, setScale returns an object with the proper scale; the returned object may or may not be newly allocated.
newScale
- scale of the BigDecimal value to be returned.
ArithmeticException
- if the specified scaling operation would
require rounding.setScale(int, int)
,
setScale(int, RoundingMode)
public BigDecimal movePointLeft(int n)
n
- number of places to move the decimal point to the left.
ArithmeticException
- if scale overflows.public BigDecimal movePointRight(int n)
n
- number of places to move the decimal point to the right.
ArithmeticException
- if scale overflows.public BigDecimal scaleByPowerOfTen(int n)
ArithmeticException
- if the scale would be
outside the range of a 32-bit integer.public BigDecimal stripTrailingZeros()
public int compareTo(BigDecimal val)
compareTo
in interface Comparable<BigDecimal>
val
- BigDecimal to which this BigDecimal is
to be compared.
public boolean equals(Object x)
compareTo
, this method considers two
BigDecimal objects equal only if they are equal in
value and scale (thus 2.0 is not equal to 2.00 when compared by
this method).
equals
in class Object
x
- Object to which this BigDecimal is
to be compared.
compareTo(java.math.BigDecimal)
,
hashCode()
public BigDecimal min(BigDecimal val)
val
- value with which the minimum is to be computed.
compareTo
method, this is returned.compareTo(java.math.BigDecimal)
public BigDecimal max(BigDecimal val)
val
- value with which the maximum is to be computed.
compareTo
method, this is returned.compareTo(java.math.BigDecimal)
public int hashCode()
hashCode
in class Object
equals(Object)
public String toString()
A standard canonical string form of the BigDecimal is created as though by the following steps: first, the absolute value of the unscaled value of the BigDecimal is converted to a string in base ten using the characters '0' through '9' with no leading zeros (except if its value is zero, in which case a single '0' character is used).
Next, an adjusted exponent is calculated; this is the negated scale, plus the number of characters in the converted unscaled value, less one. That is, -scale+(ulength-1), where ulength is the length of the absolute value of the unscaled value in decimal digits (its precision).
If the scale is greater than or equal to zero and the adjusted exponent is greater than or equal to -6, the number will be converted to a character form without using exponential notation. In this case, if the scale is zero then no decimal point is added and if the scale is positive a decimal point will be inserted with the scale specifying the number of characters to the right of the decimal point. '0' characters are added to the left of the converted unscaled value as necessary. If no character precedes the decimal point after this insertion then a conventional '0' character is prefixed.
Otherwise (that is, if the scale is negative, or the adjusted exponent is less than -6), the number will be converted to a character form using exponential notation. In this case, if the converted BigInteger has more than one digit a decimal point is inserted after the first digit. An exponent in character form is then suffixed to the converted unscaled value (perhaps with inserted decimal point); this comprises the letter 'E' followed immediately by the adjusted exponent converted to a character form. The latter is in base ten, using the characters '0' through '9' with no leading zeros, and is always prefixed by a sign character '-' ('\u002D') if the adjusted exponent is negative, '+' ('\u002B') otherwise).
Finally, the entire string is prefixed by a minus sign character '-' ('\u002D') if the unscaled value is less than zero. No sign character is prefixed if the unscaled value is zero or positive.
Examples:
For each representation [unscaled value, scale] on the left, the resulting string is shown on the right.
[123,0] "123" [-123,0] "-123" [123,-1] "1.23E+3" [123,-3] "1.23E+5" [123,1] "12.3" [123,5] "0.00123" [123,10] "1.23E-8" [-123,12] "-1.23E-10"Notes:
BigDecimal(String)
constructor, then the original
value will be recovered.
NumberFormat
class and its subclasses.
toEngineeringString()
method may be used for
presenting numbers with exponents in engineering notation, and the
setScale
method may be used for
rounding a BigDecimal so it has a known number of digits after
the decimal point.
toString
in class Object
Character.forDigit(int, int)
,
BigDecimal(java.lang.String)
public String toEngineeringString()
Returns a string that represents the BigDecimal as
described in the toString()
method, except that if
exponential notation is used, the power of ten is adjusted to
be a multiple of three (engineering notation) such that the
integer part of nonzero values will be in the range 1 through
999. If exponential notation is used for zero values, a
decimal point and one or two fractional zero digits are used so
that the scale of the zero value is preserved. Note that
unlike the output of toString()
, the output of this
method is not guaranteed to recover the same [integer,
scale] pair of this BigDecimal if the output string is
converting back to a BigDecimal using the string constructor. The result of this method meets
the weaker constraint of always producing a numerically equal
result from applying the string constructor to the method's output.
public String toPlainString()
toString()
,
toEngineeringString()
public BigInteger toBigInteger()
To have an exception thrown if the conversion is inexact (in
other words if a nonzero fractional part is discarded), use the
toBigIntegerExact()
method.
public BigInteger toBigIntegerExact()
ArithmeticException
- if this has a nonzero
fractional part.public long longValue()
longValue
in class Number
public long longValueExact()
ArithmeticException
- if this has a nonzero
fractional part, or will not fit in a long.public int intValue()
intValue
in class Number
public int intValueExact()
ArithmeticException
- if this has a nonzero
fractional part, or will not fit in an int.public short shortValueExact()
ArithmeticException
- if this has a nonzero
fractional part, or will not fit in a short.public byte byteValueExact()
ArithmeticException
- if this has a nonzero
fractional part, or will not fit in a byte.public float floatValue()
Float.NEGATIVE_INFINITY
or Float.POSITIVE_INFINITY
as appropriate. Note that even when
the return value is finite, this conversion can lose
information about the precision of the BigDecimal
value.
floatValue
in class Number
public double doubleValue()
Double.NEGATIVE_INFINITY
or Double.POSITIVE_INFINITY
as appropriate. Note that even when
the return value is finite, this conversion can lose
information about the precision of the BigDecimal
value.
doubleValue
in class Number
public BigDecimal ulp()
this
so the result
for zero and nonzero values is equal to [1,
this.scale()]
.
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


Progress Circular
about
Dependency:
base
.
The dependencies will be installed together with this module
For use this components you need install with command:
mobileui install progress-circular
25%


---
layout: post
title: ! "Joked w/ @mfeathers about writing experience report about learning \t#agile
ALL WRONG - decided to do it for real"
published: true
date: 2009-08-03
categories: []
posterous_url: http://verdammelt.posterous.com/joked-w-mfeathers-about-writing-experience-re
posterous_slug: joked-w-mfeathers-about-writing-experience-re
---
Probably never to be published - but it seems like a good exercise to
help me learn from what we are doing wrong and what we are doing
right.


{% extends "header.html" %} {% block body %}
Now that you have drawn a 3D object, and shown it moving, it's time to show why a real 3D environment really shines: Navigating the environment yourself.
This can come in two major ways, but can be quite confusing. The question you need to answer at the end of this tutorial is: Are you moving the object, or are you moving your perspective of the object? So, in the previous tutorial, are we spinning the cube, or are we rotating around the cube? In this tutorial, are we moving the cube, or are we moving around the cube?
So let's say our objective is to "move the cube" with our arrow keys. How might we do this?
Now, we make our main function look like:
def main(): pygame.init() display = (800,600) pygame.display.set_mode(display, DOUBLEBUF|OPENGL) gluPerspective(45, (display[0]/display[1]), 0.1, 50.0) glTranslatef(0,0, -10) glRotatef(25, 2, 1, 0) while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() quit() if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: glTranslatef(-0.5,0,0) if event.key == pygame.K_RIGHT: glTranslatef(0.5,0,0) if event.key == pygame.K_UP: glTranslatef(0,1,0) if event.key == pygame.K_DOWN: glTranslatef(0,-1,0) if event.type == pygame.MOUSEBUTTONDOWN: if event.button == 4: glTranslatef(0,0,1.0) if event.button == 5: glTranslatef(0,0,-1.0) #glRotatef(1, 3, 1, 1) glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) Cube() pygame.display.flip() pygame.time.wait(10)
Notice the main change being the keydown and keyup events. Also, note the pygame.MOUSEBUTTONDOWN. pygame.MOUSEBUTTONDOWN allows us to pull data from the user's mouse wheel, so we can have it perform an expected action.
Now, again, is it the cube that is moving, or is it our perspective? Think about X, Y, Z, what direction we're "moving" whatever is being moved, and what we're seeing as a result.


|
| static | exists ($path) |
| |
| static | get ($path) |
| |
| static | getRequire ($path) |
| |
| static | requireOnce ($file) |
| |
| static | put ($path, $contents) |
| |
| static | prepend ($path, $data) |
| |
| static | append ($path, $data) |
| |
| static | delete ($paths) |
| |
| static | move ($path, $target) |
| |
| static | copy ($path, $target) |
| |
| static | name ($path) |
| |
| static | extension ($path) |
| |
| static | type ($path) |
| |
| static | size ($path) |
| |
| static | lastModified ($path) |
| |
| static | isDirectory ($directory) |
| |
| static | isWritable ($path) |
| |
| static | isFile ($file) |
| |
| static | glob ($pattern, $flags=0) |
| |
| static | files ($directory) |
| |
| static | allFiles ($directory) |
| |
| static | directories ($directory) |
| |
| static | makeDirectory ($path, $mode=493, $recursive=false, $force=false) |
| |
| static | copyDirectory ($directory, $destination, $options=null) |
| |
| static | deleteDirectory ($directory, $preserve=false) |
| |
| static | cleanDirectory ($directory) |
| |
| static | swap ($instance) |
| |
| static | shouldReceive () |
| |
| static | getFacadeRoot () |
| |
| static | clearResolvedInstance ($name) |
| |
| static | clearResolvedInstances () |
| |
| static | getFacadeApplication () |
| |
| static | setFacadeApplication ($app) |
| |
| static | __callStatic ($method, $args) |
| |
| static | swap ($instance) |
| |
| static | shouldReceive () |
| |
| static | getFacadeRoot () |
| |
| static | clearResolvedInstance ($name) |
| |
| static | clearResolvedInstances () |
| |
| static | getFacadeApplication () |
| |
| static | setFacadeApplication ($app) |
| |
| static | __callStatic ($method, $args) |
| |
Definition at line 5048 of file _ide_helper.php.
| static allFiles |
( |
|
$directory | ) |
|
|
static |
Get all of the files from the given directory (recursive).
- Parameters
-
- Returns
- array
Definition at line 5285 of file _ide_helper.php.
| static append |
( |
|
$path, |
|
|
|
$data |
|
) |
| |
|
static |
| static cleanDirectory |
( |
|
$directory | ) |
|
|
static |
Empty the specified directory of all files and folders.
- Parameters
-
- Returns
- bool
Definition at line 5348 of file _ide_helper.php.
| static copy |
( |
|
$path, |
|
|
|
$target |
|
) |
| |
|
static |
Copy a file to a new location.
- Parameters
-
| string | $path | |
| string | $target | |
- Returns
- bool
Definition at line 5163 of file _ide_helper.php.
| static copyDirectory |
( |
|
$directory, |
|
|
|
$destination, |
|
|
|
$options = null |
|
) |
| |
|
static |
Copy a directory from one location to another.
- Parameters
-
| string | $directory | |
| string | $destination | |
| int | $options | |
- Returns
- bool
Definition at line 5323 of file _ide_helper.php.
Delete the file at a given path.
- Parameters
-
- Returns
- bool
Definition at line 5139 of file _ide_helper.php.
| static deleteDirectory |
( |
|
$directory, |
|
|
|
$preserve = false |
|
) |
| |
|
static |
Recursively delete a directory.
The directory itself may be optionally preserved.
- Parameters
-
| string | $directory | |
| bool | $preserve | |
- Returns
- bool
Definition at line 5337 of file _ide_helper.php.
| static directories |
( |
|
$directory | ) |
|
|
static |
Get all of the directories within a given directory.
- Parameters
-
- Returns
- array
Definition at line 5296 of file _ide_helper.php.
Determine if a file exists.
- Parameters
-
- Returns
- bool
Definition at line 5057 of file _ide_helper.php.
| static extension |
( |
|
$path | ) |
|
|
static |
Extract the file extension from a file path.
- Parameters
-
- Returns
- string
Definition at line 5185 of file _ide_helper.php.
| static files |
( |
|
$directory | ) |
|
|
static |
Get an array of all files in a directory.
- Parameters
-
- Returns
- array
Definition at line 5274 of file _ide_helper.php.
Get the contents of a file.
- Parameters
-
- Returns
- string
- Exceptions
-
Definition at line 5069 of file _ide_helper.php.
| static getRequire |
( |
|
$path | ) |
|
|
static |
Get the returned value of a file.
- Parameters
-
- Returns
- mixed
- Exceptions
-
Definition at line 5081 of file _ide_helper.php.
| static glob |
( |
|
$pattern, |
|
|
|
$flags = 0 |
|
) |
| |
|
static |
Find path names matching a given pattern.
- Parameters
-
- Returns
- array
Definition at line 5263 of file _ide_helper.php.
| static isDirectory |
( |
|
$directory | ) |
|
|
static |
Determine if the given path is a directory.
- Parameters
-
- Returns
- bool
Definition at line 5229 of file _ide_helper.php.
Determine if the given path is a file.
- Parameters
-
- Returns
- bool
Definition at line 5251 of file _ide_helper.php.
| static isWritable |
( |
|
$path | ) |
|
|
static |
Determine if the given path is writable.
- Parameters
-
- Returns
- bool
Definition at line 5240 of file _ide_helper.php.
| static lastModified |
( |
|
$path | ) |
|
|
static |
Get the file's last modification time.
- Parameters
-
- Returns
- int
Definition at line 5218 of file _ide_helper.php.
| static makeDirectory |
( |
|
$path, |
|
|
|
$mode = 493 , |
|
|
|
$recursive = false , |
|
|
|
$force = false |
|
) |
| |
|
static |
Create a directory.
- Parameters
-
| string | $path | |
| int | $mode | |
| bool | $recursive | |
| bool | $force | |
- Returns
- bool
Definition at line 5310 of file _ide_helper.php.
| static move |
( |
|
$path, |
|
|
|
$target |
|
) |
| |
|
static |
Move a file to a new location.
- Parameters
-
| string | $path | |
| string | $target | |
- Returns
- bool
Definition at line 5151 of file _ide_helper.php.
Extract the file name from a file path.
- Parameters
-
- Returns
- string
Definition at line 5174 of file _ide_helper.php.
| static prepend |
( |
|
$path, |
|
|
|
$data |
|
) |
| |
|
static |
| static put |
( |
|
$path, |
|
|
|
$contents |
|
) |
| |
|
static |
Write the contents of a file.
- Parameters
-
| string | $path | |
| string | $contents | |
- Returns
- int
Definition at line 5104 of file _ide_helper.php.
| static requireOnce |
( |
|
$file | ) |
|
|
static |
Require the given file once.
- Parameters
-
- Returns
- mixed
Definition at line 5092 of file _ide_helper.php.
Get the file size of a given file.
- Parameters
-
- Returns
- int
Definition at line 5207 of file _ide_helper.php.
Get the file type of a given file.
- Parameters
-
- Returns
- string
Definition at line 5196 of file _ide_helper.php.
The documentation for this class was generated from the following file:


--- layout: post title: "Semantic Versioning with Continuous Deployment" description: "When you use Semantic Versioning with Continuous Deployment, version numbers must be checked into source control systems by programmers." date: 2013-12-10 15:19 UTC tags: [Productivity] --- {% include JB/setup %}
{{ page.description }}
If you aren't already using Semantic Versioning, you should. It makes it much easier to figure out how to version your releases. Even if you're 'just' building software for your internal organization, or a single customer, you should still care about versioning of the software you release. Instead of an ad-hoc versioning scheme, Semantic Versioning offers a set of easy-to-understand rules about when to increment which version number.
In short, you
While Semantic Versioning is great, it requires a bit of consideration when combined with Continuous Deployment. Every time you deploy a new version, you should increment the version number.
Continuous Delivery and Continuous Deployment rely on automation. A code check-in triggers an automated build, which is subsequently processed by a Deployment Pipeline, and potentially released to end-users. Each released (or releasable) build should have a unique version.
Traditionally, Build Servers have had the responsibility of incrementing version numbers - typically by incrementing a build number, like this:
Unfortunately, this versioning scheme is wrong if you combine Semantic Versioning with Continuous Deployment. Even if you throw away the fourth build number, you're left with a sequence like this:
Semantic Versioning might look like this:
With Continuous Deployment, every time you integrate code (check in, merge, rebase, whatever), you produce a version of the software that will be deployed. This means that every time you integrate, something or somebody should assign a new version to the software.
The rules of Semantic Versioning require explicit decisions to be made.  Is it a fix? Is it a new feature? Is it a breaking change? A Build Server doesn't know how to answer these questions, but you do.
A few years ago, I changed the delivery scheme for my open source project AutoFixture to use Semantic Versioning with Continuous Deployment. When I did that, I realised that I could no longer rely on a Build Server for controlling the version. Instead, I would have to explicitly control the versioning as part of the commit process.
Because AutoFixture is a .NET project, I decided to use the version assignment mechanism already present in the framework: The [AssemblyVersion] and [AssemblyFileVersion] attributes that you typically put in AssemblyInfo files.
The version control system used for AutoFixture is Git, so it works like this in practice:
After more than two years of experience with this way of controlling software versions, I'm consistently using this approach for all my open source software, as well as the internal software we create in Grean.
If you want to use Continuous Deployment (or Delivery) with Semantic Versioning, the assignment of a new version number is a programmer decision.  The new version number must be committed to the version control system, so that whomever or whatever compiles and/or releases the software will always use the same version number for the same version of the source code.
The version number is kept in the source control system, together with the source code. It's not the realm of a Build Server.
Comments
Augi, it's true that you can create other approaches in order to attempt to address the issue, but the bottom line remains that a human being must make the decision about how to increment the version number. As you suggest, you can put information guiding that decision outside the source code itself, but then you'd be introducing another movable part that can break. If you do something like you suggest, you'll still need to add some machine-readable metadata to the linked issue ID. To add spite to injury, this also makes it more difficult to reproduce what the Build Server does on your local machine - particularly if you're attempting to build while offline.
While it sounds like it would be possible, what do you gain by doing something like that?
Mark, I also have a Visual Studio solution or two with multiple AssemblyInfo.cs files (although not as many as you) and wish to use a common version number for each contained project. I came up with the following approach, which doesn't require any automation. It only uses the Visual Studio/MSBuild <Link /> functionality. The key is simply to use the Add As Link functionality for common attributes.
Simply put, I split out the common information (Version info and company/copyright/trademark info) from projects' AssemblyInfo.cs files into another file called SolutionAssemblyInfo.cs. I place that file at the root of the solution (outside of any project folders). Then, for each project, remove the version information from the AssemblyInfo.cs file and use the 'Add As Link' function in the 'Add Existing Item' function in Visual Studio to link to the SolutionAssemblyInfo.cs file. With that, you have only one place to update the version information: the SolutionAssemblyInfo.cs file. Any change to that version information will be included in each project.
That might be enough information to get you going, but if not, I'll expand and outline the specific process. The basic idea is to look at the AssemblyInfo.cs file as having two sets of metadata:
You can separate the shared metadata into a common AssemblyInfo.cs file. Then, by linking to that common file in each project (as opposed to including), you won't need to update 28 files; you'll only need to update the common one.
Assume I have the following AssemblyInfo.cs file for one of my projects:
I split this out into two files: andThe SolutionAssemblyInfo.cs goes in the root of your solution and should initially not be included in any projects. Then, for each project:
- Remove all attributes that went into SolutionAssemblyInfo.cs
- Right-click the project and "Add..., Existing Item..."
- Navigate to the SolutionAssemblyInfo.cs file
- Instead of clicking the "Add" button, click the little drop-down on it and select
"Add As Link"
- If you want the new linked SolutionAssemblyInfo.cs file to show up under the Properties folder
(like the AssesmblyInfo.cs file), just drag it from the project root into the Properties folder.
Unfortunately, you can't simply add the link to the Properties folder directly (at least not in VS 2012).
(Note: it looks like there may be an easier method in VS 2012+ only to get the "Add As Link" function, mentioned on StackOverflow, by simply dragging and dropping while holding the Alt key.)That's it. Now, you will be able to access this SolutionAssemblyInfo.cs file from any of your projects and any changes you make to that file will persist into the linked file, being shared with all projects.
The downside to this, as opposed to an automation solution, is that you need to repeat this process (starting with "Remove all attributes...") for all new projects you add. However, in my opinion, that's a small, one-time-per-project price to pay. With the above, you let the established tool work for you with built-in features.
Chris, thank you for your comment. That may actually be a good way to do it, too. While I did know about the add as link feature of Visual Studio, I've had bad experiences with it in the past. This may actually be a Pavlovian reaction on my part, because I must admit that I can no longer remember what those bad experiences were :$
I had been thinking about this a bit myself and I believe an easy solution to this is to just make use of a modified branching structure in the same/similar setup as the versioning. So you'd have your major/minor/build branches and your build server could increment numbers differently depending on which branch you update which would fully take care of the automation side of things for you. This would be rather trivial to setup and maintain but fulfill your requirements set out in the post.
Of course you would have to be quite disciplined as to which branch you commit your code to but I don't see that being too much of an overhead, you usually know when you're going to be patching/creating new featuresd or introducing breaking changes before you start working. Worst case make use of git stash save/pop to move work between branches.
Could call this semantic branching?
You might be interested in the GitFlowVersion project, which leverages some of the concepts you mention.
Laurence, Marijn, thank you for your comments. As cool as Git is (currently, I'm not aware of anything better), I don't like coupling a process unnecessarily to a particular tool. What if, some day, something better than Git arrives?
Additionally, I agree with Martin Fowler, Jez Humble, and others, that branching is essentially evil, so I don't think it's a good idea building an entire versioning scheme around branches.
As an alternative, I've introduced ZeroToNine, a command-line tool (and library) that works independently of any version control system.
Humans are/have moving parts that can break too ;). In large organisations there are often as many differences of opinion as there are people. One developer's "breaking change" or "feature" is another's "improvement" or "bugfix". Human decision making also introduces arbitrarily variable logic. Software projects rotate developers in and out all the time. Will they all apply consistent logic to their versioning decisions?
Developers can make a decision about releases without incrementing a number in a file. They can for example click on a "Push to NuGet" or "Release to GitHub" button (which is a human, developer decision). It's then trivial for a CI server to calculate or increment a PATCH number based on the last NuGet or GitHub Push/Release. A MINOR version can be easily determined by linking to an issue tracker with issues that are linked to milestones. A MAJOR version is probably simplest when a human increments it, but I see no reason why it couldn't also be triggered by monitoring changes or breakages to existing unit tests (for example). Considering the clarity of the semver MAJOR.MINOR.PATCH definitions, I think an algorithm determining the version number is more consistent than a human decision. For example (in pseudo-code):
Rob, thank you for writing. If I could have defined a trustworthy automated system to figure out semantic versioning, I would have done it. Is your proposed algorithm sufficiently robust?
What about versioning based on the branch names. I mean, what if we name a branch regarding to what it is suposed to do at the end. For instance, naming branches as feature-xxx, major-xxx, patch-xxx. Where I want to go is to automate the semantic versioning everytime a pull/merge request is accepted. So then the CI/CD tool, through a shell for instance, can just look at the last commit comment which is usually 'Merge branch xxx into master' (where xxx can be feature-yyy, major-yyy, patch-yyy) and increment the version acording to the branch merged. If it's a feature it increases the digit in the middle and resets the last one. On the other hand it it's a patch it only increases the last digit. Would it work? I mean the assignment of the new version is still a programmer decision which is done when they branch from master.
Gus, thank you for writing. I think your suggestion could work as well, although I haven't tried it.
The advantage of your suggestion is that it's more declarative. You address the question of what should happen (major, minor, patch), instead of how it should happen (which number). That's usually a good thing.
The disadvantage is that you push the burden of this to a central build step (on a build server, I presume), so it introduces more moving parts into the process, as well as a single point of failure.
Fortunately, the evaluation of advantages versus disadvantages can be a personal (or team) decision, so one can choose the option one likes best. It's always good to have options to choose from in the first place, so thank you for sharing!
Mark, I feel a bit outdated responding to a post that has a 4th birthday coming up. I completely agree with Semantic versioning, even for cloud application deployments which my team is working with at this moment. I am intrigued to how your workflow is working.
In our current workflow, we are forcing a version and changelog to be associated with a Pull Request. Thus, the developer is incrementing this as part of the PR and our auditor pipeline is ensuring that the version/changelog is updated. The team of course still have to ensure this version is correct, ie are you sure this is a micro change, look like a new feature to me or looks to me like you broke API compatibility and this is a major increment. The issue we are starting to hit with this early model is our team is growing and we are facing constant merge conflicts with our version file and Changelog (its a ruby on rails project thus we use a config.yml for the version which is read in at runtime by our app and displayed properly as a link on the apps's page back to our Changelog version)
It appears in your workflow that you have hooks set up so that these are initiated by the person merging the code such these files are only changed post-merge and commited then. If this is elaborated on in one of your books, let me know and my team could take a "work" break to go do some reading. I appreciate your time on the matter.
Jonathan, thank you for writing, and don't worry about the age of the post. It only pleases me that apparently I've managed to produce something durable enough to be of interest four years later.
In the interest of full disclosure, the busiest code base on which I've ever used this technique is AutoFixture, and to be clear, I've handed off the reigns of that project. I've worked on bigger and more busy code bases than that, but these were internal enterprise code bases that didn't use Semantic Versioning.
Based on my experience with AutoFixture, I'd still use the process I used back then. It went something like this:
- If a code review resulted in my decision to accept a pull request, I'd pull it down on my laptop.
- Once on my laptop, I'd run the entire build locally. While I do realise that GitHub has a merge button, I regarded this as an extra verification step. While we had CI servers running, I think it never hurts to verify that it also builds on a developer's machine. Otherwise, you'd just have a problem the next time someone pulls master.
- If the build passed, I'd merge the branch locally.
- I'd then run a single Zero29 command to update all version information in all appropriate files.
- This single command would modify a set of text files, which I'd then check in. If you look at the AutoFixture commit history, you'll see lots of those check-ins.
- Once checked in, I'd tag the commit with the version. Often I'd use a cryptic bash command that I no longer remember to first read the current version with Zero29, then pipe that number to some other utility that could produce the appropriate tag, and then pipe that to
- Then I'd build the release binaries. That would be one other command.
- Penultimately, I'd publish the release by pushing all binaries to NuGet.org. That would be one other bash command.
- Finally, I'd push master and the new tag to GitHub.
As you can tell, that's less than a dozen bash commands. I could have automated most of it to one or two shell scripts, but I never got around to do that because I rather enjoyed the process. Consider that I didn't do this every day. If I had to do it several times a day, I would probably automate it more.git tag
. The point is: that could be an automated step as well.I'm sure you could even write a server-side script with a Web UI that could do this, if you wanted to, but I've always preferred doing a local build as part of the verification process.
I don't think I've written much more about this, rather than the announcement post for ZeroToNine, as well as the documentation for it.


PING-PONG-GAME
Learning Math is fun!!!
Numbers divisible by 3 becomes ping
Numbers divisible by 5 becomes pong
Numbers divisible by both 5 and 3 becomes pingpong
Enter a number:
Submit


Lawsuit could deactivate 234,000 voters in Wisconsin
MADISON, Wis. - More than 234,000 voters in Wisconsin would be made unable to cast their ballot unless they register again before the next election under a lawsuit that liberals fear could dampen turnout among Democrats in the 2020 presidential race.
The lawsuit being filed Wednesday could affect how many voters are able to cast ballots in both the April presidential primary and November 2020 general election in Wisconsin.
The conservative Wisconsin Institute for Law and Liberty alleges that the Wisconsin Elections Commission broke the law when it decided to wait up to two years to deactivate voters who may have moved. The lawsuit alleges state law requires voters to respond within 30 days of receiving the October mailing or be deactivated.
The commission has said it is confident it is complying with the law.


The One True

HTML may not be a programming language, but I will literate it anyways.
Work in progress.
A Normal

Directly Under
- HTML (according to HTML Standard)
- Not fancy link :(
- Use tab to see that even non-fancy link gets the
focus
love. - Fancy link ;)
- Possible topics
img
&svg
tagtable
tagform
&input
tagiframe
tagmap
tag
- CSS
- Example project

inside

looks like

This is not recommended since it will mess up the document tree for screenreaders.
A normal

inside

HTML vs Body in CSS | CSS-Tricks (中文翻译 by CSSPod)
A normal

inside

body { font-family: 'Roboto',sans-serif; } .regular { font-weight: 300; } .bold { font-weight: 700; }
Accessible Pure CSS Accordion Menu
This is a checkbox
menu (use tab + space to navigate):
-
- Going to-do
Finished to-doFinished to-do
-
- Going to-do
- Going to-do
Finished to-do
This is a radio
menu (use arrow keys to navigate):
-
- Going to-do
Finished to-doFinished to-do
-
- Going to-do
- Going to-do
Finished to-do
Accessibility Statement
This is the official accessibility statement for Example Project of Literate HTML.
If you have any questions or comments, feel free to email me at<EMAIL_ADDRESS>Standards Compliance
All pages on this site are WCAG AA approved,
complying with WCAG 2.0 Checklist.
This is a judgement call; many accessibility features can be measured, but many can not.
I have reviewed all the guidelines and believe that all these pages are in compliance.
All pages on this site validate as valid current HTML document.
This is not a judgement call. A program can determine with 100% accuracy whether a page is valid HTML. For example, you can check the home page for HTML validity yourself.
All pages on this site use structured semantic markup.
Visual Design
- This site uses only relative font sizes, compatible with the user-specified “text size” option in visual browsers.
- If your browser or browsing device does not support stylesheets at all, the content of each page is still readable.


Bandit (Agrabah), Fat Bandit (Agrabah), White Mushroom (Fire)
Red Nocturne (Wonderland), White Mushroom (Fire)
Defender (Hollow Bastion)
Search Ghost (Atlantica), White Mushroom (Cure)
Green Requiem (Traverse Town), White Mushroom (Cure)
Sea Neon (Atlantica), Sheltering Zone (Atlantica), White Mushroom (Blizzard)
Blue Rhapsody (Traverse Town), White Mushroom (Blizzard)
Angel Star (End of the World), Invisible (End of the World)
Darkball (Hollow Bastion)
Gargoyle (Halloween Town), Wight Knight (Halloween Town), White Mushroom (Gravity)
Shadow (Traverse Town), White Mushroom (Gravity)
White Mushroom
Angel Star (End of the World), Behemoth (End of the World)
Barrel Spider (Neverland), Behemoth (End of the World), Pot Spider (Agrabah)
Behemoth (End of the World), Invisible (End of the World)
Wyvern (Hollow Bastion)
Air Pirate (Neverland), Battleship (Neverland), Pirate (Neverland), White Mushroom (Stop)
Bouncywild (Deep Jungle), Powerwild (Deep Jungle), White Mushroom (Stop)
Wizard (Hollow Bastion)
Air Soldier (Agrabah), White Mushroom (Aero)
Large Body (Traverse Town), Soldier (Traverse Town), White Mushroom (Aero)
Aquatank (Atlantica), Screwdriver (Atlantica), White Mushroom (Thunder)
Yellow Opera (Traverse Town), White Mushroom (Thunder)


Fandomzzz
All Products
Add Product
Login
0
Sign up
Shipping Information
Street Address
Apartment / Suite
Postal Code
City
Province
Country
Error:
Submit


Gulf Island: Insiders Think $5 Stock Is Undervalued
by The Insiders ForumSummary
- Today, we take an in-depth look at Gulf Island Fabrication whose stock has had a rough go of it in 2019.
- However, the company has a huge order backlog, pristine balance sheet and has picked up some significant insider buying recently.
- An investment analysis on this small cap concern is presented in the paragraphs below.
"You don't drown by falling in the water; you drown by staying there.”― Edwin Louis Cole
The other day we took a look at a beaten down $5 tech stock that had been cut in half recently, but with new and significant buying from its CEO. Today, we do the same with a $5 small cap concern in an entirely different sector of the economy that has seen an insider scarf up more than $1 million new shares this week.
Company Overview:
Gulf Island Fabrication, Inc. (GIFI) is based just out of Houston. The company operates as a fabricator of steel structures, modules, and marine vessels in the United States. With the recent decline in the stock, the shares have an approximate $75 million market capitalization. The company has four business segments: Fabrication, Shipyard, Services, and EPC.
Recent News:
On November 4th, the company reported Q3 results. Gulf Island reported a loss of 44 cents a share despite an over 50% increase in overall revenues to just over $75 million. The company posted a loss of 34 cents a share in the second quarter which missed expectations significantly. The lower than expected earnings were mostly due to cost overruns and charges at two shipyard projects. Late last month the company announced that its CEO was retiring and a search for a new leader was underway. In late September, it was announced the stock was being removed from the SmallCap 600 Index.
Insider Buying, Analyst Activity & Balance Sheet:
Analyst activity on Gulf Island is easy to report as there is none that I can find. A beneficial owner just bought just over $1.3 million of the shares through three transactions November 19th through yesterday. It was the first insider activity in the stock so far in 2019. The company ended the third quarter with just over $71 million in cash and marketable securities on the balance sheet. The company has a $40 million credit facility in place but at this time has no debit. In addition, Gulf Island has just over $18 million in assets it plans to sell.
| Available Liquidity | Total | |||
| Cash and cash equivalents | $ | 45,911 | ||
| Short-term investments | 25,457 | |||
| Total cash, cash equivalents and short-term investments | 71,368 | |||
| Credit Agreement total capacity | 40,000 | |||
| Outstanding letters of credit | (10,434 | ) | ||
| Availability under Credit Agreement | 29,566 | |||
| Total available liquidity | $ | 100,934 |
Verdict:
Gulf Island's major problem seems to be its operating margins. The company has a near record order backlog of over $460 million, approximately $400 million from its shipyard division. The good news is cash flow is better than earnings so far this year would indicate. The company's cash balance has shrunk just less than $8 million through the first three quarters of 2019.
If Gulf Island (under new leadership perhaps) can turn things around in its main division and increase operating margins, the stock would appear dirt cheap as it largely sells for 'cash on the barrel head' and has a huge order backlog given its market capitalization. While there are no analysts to 'chime in' on this name, one insider is signaling he sees significant undervaluation in the shares on a long-term basis.
Options are available on this stock, but liquidity is almost nonexistent so a buy-write strategy is not feasible on Gulf Island. That said, I have picked up a few hundred shares of GIFI as it seems to more than merit 'watch item' status.
"The enemy is anybody who's going to get you killed, no matter which side he is on.” ― Joseph Heller, Catch-22
Bret Jensen is the Founder of and authors articles for the Biotech Forum, Busted IPO Forum, and Insiders Forum
Author's note: I present an update my best small and mid-cap stock ideas that insiders are buying only to subscribers of my exclusive marketplace, The Insiders Forum. Try a free 2-week trial today by clicking on our logo below!
Disclosure: I am/we are long GIFI. I wrote this article myself, and it expresses my own opinions. I am not receiving compensation for it (other than from Seeking Alpha). I have no business relationship with any company whose stock is mentioned in this article.


Anytime is Train Time
Choo choo.
Current Train Schedule
Train Name
Origin
Frequency (Minutes)
Arrival Time
Expected Arrival (minutes)
Add a Train
Train Name
Origin
First Train Time (HH:MM 24 Hours Format)
Frequency (Minutes)


Samuel Ferrell
<EMAIL_ADDRESS>727.834.1235 https://samcf.me https://github.com/samcf Denver, COExperience
Haven Connect
Denver, CO (2019 - 2021)
Housing waitlist management and automation
Engineering Lead
- Developed an internal browser-based tool which validated and transformed customer data during onboarding. This preprocess ETL tool reduced implementation time by about 20% by catching flaws in customer data early.
- Implemented waitlist update automation with a batch messaging broadcast system in Elixir to send emails, text messages, and physical letters to thousands of housing applicants to notify them to update their application. Scheduled work using PostgreSQL as a job queue which handled cases like rate limits, timeouts, and insufficient contact information.
- Designed and implemented a highly configurable form system which provided customers with forms that are specific to their property's needs. Customizations were defined in TOML documents to be easily updated by customer success. Form submissions are persisted immutably in a PostgreSQL database which can be used as a trusted record of truth in the case of audits.
- Lead a team of four engineers while practicing agile development. Helped plan product roadmaps and developed user stories with the CEO. Practiced code reviews, sprint retrospectives, and story planning.
CS Disco
Austin, TX (2015 - 2019)
Legal document discovery and review
Software Engineer
- Implemented an efficient filesystem explorer with TypeScript and React using an LRU cache with virtualized rendering to display the user's files as a tree. This supported arbitrary selections (and deselections) that allowed the user to attach metadata likes tags to those files.
- Designed a human-readable serialization format of the current search state that could be persisted in the URL which supported complex queries, filters, and sorting.
- Authored a ReduxJS extension called a redux-keyed-reducer which allowed developers to maintain multiple independent copies of the same reducer state. This allowed us to develop complex features while keeping the reducer state simple.
Education
St. Petersburg College
St. Petersburg, FL (2008-2010)
- Studied math, statistics, and advertising.
- Tutored technical writing and basic statistics to dozens of students. Promoted use of the tutoring center by giving fifteen minute class presentations.
- Helped a 76 year old woman receive an A in her computer science class.


Bluehost Virtual Checkout Assistant
This is a user checkout flow for simplifying a hosting and add-on package based on the customers needs. Winner of the 2019 Endurance Innojam
This is a user checkout flow for simplifying a hosting and add-on package based on the customers needs. Winner of the 2019 Endurance Innojam


One of the challenges of introducing new metrics to measure the scholarly impact of journal articles is that we want these metrics to be consistent and reproducible. This task ranges from easy (single authoritative source), hard (mediated by middlemen), and very hard (multiple sources). Twitter falls in the last group – there is no single, defined set of tweets about a paper as Twitter itself doesn’t make old tweets available. But there are multiple ways to get around the problem using a plethora of online services (e.g., multiple Twitter APIs, Topsy, private, in-house applications, etc.). The second category is common amongst ALM providers, including PLOS: we collect citations, bookmarks, etc. from CrossRef, Web of Science, Mendeley, etc. and then display these numbers next to our journal articles.
Apples & Oranges – They don’t Compare. Flickr photo from thebusybrain.
Scott Chamberlain from the rOpenSci project has shed light on this problem, analyzing ALM data harvested by each of the following four metrics providers:
(rOpenSci is a larger project to provide wrappers for all science APIs for the R statistical programming environment. This includes packages that talk to the metrics providers listed above.)
He compared the following metrics for a single set of 565 papers published by PLOS:
- Scopus
- PLOS usage stats
- PubMed Central usage stats
- Mendeley
- CiteULike
Scott found that most metrics are similar between providers, but the consistency could be better overall:
A comparison of 7 different metrics from Altmetric.com, ImpactStory and PLOS on a set of 20 PLOS DOIs. Fig. 3 from http://dx.doi.org/10.3789/isqv25no2.2013.02.
He identified two reasons for these inconsistencies: different collection dates and different methods of data collection (most prominently for Twitter). To address the disparity, the refresh date specifying the last update is critical and should also be accompanied by a link to the original data source (ex: Scopus or Mendeley page showing citation counts or bookmarks). At the moment, most article-level metrics providers, including PLOS, do provide this information when possible (ex: CrossRef, Facebook, etc. do not have a reference page for each article) .
Read the full set of findings for more insights on the work ahead for this maturing set of metrics, published in Information Standards Quarterly last week: Consuming article-level metrics: observations and lessons from comparing aggregator provider data. The source code for his analysis is available on Github, and he has written ablog post.
We as the data providers have to become better in providing consistent numbers across providers and, when there’s variance, explain the difference. The ALM Workshop 2013 should provide that venue as we raise these issues together with the community-at-large and collectively identify practices that represent good data stewardship.
Otherwise, we run the risk that all the consumers (of these data) lose their appetite for these fresh new fruits and return to old, boring fare that only comes in a single citation flavor and is already dried up (i.e., at least two years old).
Have been drying apples today. Flickr photo from tusnelda.
8/9/13: Updated post to include to blog post by Scott Chamberlain.
References
Chamberlain, S. (2013). Consuming Article-Level Metrics: Observations and Lessons. Information Standards Quarterly, 25(2), 4. National Information Standards Organization. doi:10.3789/isqv25no2.2013.02
blog comments powered by Disqus


{{ _('Are you sure you want to delete this thread?') }}
{{ thread.title }}
{{ display_name(thread.creator) }}
{{ datetimeformat(thread.created, format='longdatetime') }}
{{ thread.replies }}
{% extends "kbforums/base.html" %} {% from "kbforums/includes/macros.html" import kbforums_warning with context %} {# L10n: {t} is the title of the thread. {d} is the name of the document. #} {% set title = _('Delete Thread | {t} | {d} Discussion | Knowledge Base')|f(t=thread.title, d=document.title) %} {% set crumbs = [(document.get_absolute_url(), document.title), ((url('wiki.discuss.threads', document.slug), 'rel="ugc nofollow"'), _('Discuss')), ((url('wiki.discuss.posts', document.slug, thread.id), 'rel="ugc nofollow"'), thread.title), (None, _('Delete Thread'))] %} {% block content %}


{% extends "site_base.html" %} {% load i18n %} {% load uni_form_tags %} {% load facebook_tags %} {% block head_title %}{% trans "Signup" %}{% endblock %} {% block body %}
{% trans "You are already logged in." %}
{% else %}Connect your Facebook to sign in by clicking the button Connect with Facebook.
Connect to Twitter to sign in by clicking the button Connect with Twitter.
Connect to Google to sign in by clicking the button Connect with Google.


These are a few useful links related to our services. Some of these links are electrical utilities where you can find info and help regarding your home electrical service such as paying your bill or report an outage. Also we have included links to the Massachusetts Board of Electrician where you can verify the status of a license for a specific contractor. If you do not see what you are looking for please feel free to contact us, we might be able to direct you or provide you with a reference to help you with your particular project or need.


- What is Cueanda?
- How do I ask questions?
- How do I answer and comment on questions?
- How do I know if I was asked a question or if I was mentioned in a question?
- How do I follow and unfollow a user on Cueanda?
- What kind of media is supported in questions?
- What do I do if I see spam or an inappropriate question?
- Legal mumbo jumbo?
- How do I contact you?
What is Cueanda?
Cueanda is a web application that allows users the ability to ask, answer and comment on questions asked by friends and strangers alike.
How do I ask questions?
Asking a question is as simple as signing up and clicking on “Add a Question!” in the Question Stream.You are able to ask a question to the public (i.e. all Cueanda users) or privately to specific users. Public questions can be viewed and answered by anyone on the website, and can also be recommended and reposted through other applications such as Facebook and Twitter. When asking private questions, only the users you have specifically asked your questions to will be able to view and answer your question.
How do I answer and comment on questions?
Any public question can be answered by any Cueanda user on the Question Stream. However, a user must sign up and sign in to comment on questions. Also, Cueanda allows users to toggle between results from the general public as well as the people they follow. So, please join us on Cueanda!
How do I know if I was asked a question or if I was mentioned in a question?
In addition to allowing users the ability to filter by the questions asked by the people they follow, the Question Stream allows users the ability to filter by private and recommended questions. You can also view the questions that you were mentioned in on your profile page.
How do I follow and unfollow a user on Cueanda?
You are able to follow and unfollow another user by going to their profile page and selecting “Follow Me” or “Unfollow Me.”
What kind of media is supported in questions?
You can ask questions with images, gifs and videos!
What do I do if I see spam or an inappropriate question?
If you notice spam or an inappropriate question, you’re able to flag the question. In order to flag a question, select the question and then select the flag icon button which is located under the result data and above the comment section. Also, feel free to contact us with any concerns Insert email address.
How do I contact you?
Feel free to contact us – we’d love to hear from you
info@cueanda.com


My aim is to succeed in an environment of growth and excellence, earn a job which provides me not only job satisfaction but also self-development, leads to achieve personal as well as organizational goals.
 Mostly i would like to play cricket in my hometown.
In my spare time, I love taking pictures. I have even documented many university events as part of my artistic practice. Working hand in hand with others has surely stood out to me as a passion in my life. I enjoy collaborating with others, artistically through photography and most certainly, through mentorship. I look forward to continuing to develop these skills and passions through this opportunity.


--- layout: archive title: Zulip Chat Archive permalink: /stream/116395-maths/topic/tensors.html ---
Does Lean code exist for working with tensors the classical way (https://en.wikipedia.org/wiki/Tensor#Tensor_product) with Einstein summation convention? I'm defining iterated linear maps and tensors using the definition of iterated_continuous_linear_map from mathlib/analysis/calculus/iterated..
I wonder if such definitions already exist. The Einstein summation convention is a bit tricky to implement.. Is there any way to give meaning to upper vs lower script arguments?
We don't have Einstein summation. We do have something called holor
s that I've never heard of before.
I don't know of any Lean code already there which will help. For upper and lower numbering with a fixed number of indices you could do it with notation I guess (maybe just with ^ and _ ?)
Of course ^
is already claimed by has_pow
... but you could override that if you want.
Last updated: Apr 24 2020 at 19:02 UTC


Sorry, We're upgrading the system to make it even better.
This will take just a few minutes, and you'll be able to access your accounts as usual.
Thank you for you patience and understanding.


Release calendar
57 releases by Inflation and Price Indices publisher after 1 January 2015
-
Employment and employee types
21 March 2015
-
Earnings and working hours
21 March 2015
-
Workplace disputes and working conditions
21 March 2015
-
Labour productivity
21 March 2015
-
Public sector personnel
21 March 2015
-
Unemployment
21 March 2015
-
Population projections
21 March 2015
-
International migration
21 March 2015
-
Leisure and tourism
21 March 2015
-
Drug use, alcohol and smoking
21 March 2015
-
Disability
21 March 2015
-
Conditions and diseases
21 March 2015
-
Crime and justice
21 March 2015
-
Gross Value Added (GVA)
21 March 2015
-
Gross Domestic Product (GDP)
21 March 2015
-
Environmental accounts
21 March 2015
-
Inflation and price indices
21 March 2015
-
Investments, pensions and trusts
21 March 2015
-
Regional accounts
21 March 2015
-
Economic output and productivity
21 March 2015
-
Manufacturing and production industry
21 March 2015
-
Tourism industry
21 March 2015
-
Business activity, size and location
21 March 2015
-
International trade
21 March 2015
-
IT and internet industry
21 March 2015
-
Construction industry
21 March 2015
-
Mergers and acquisitions
21 March 2015
-
Business births, deaths and survival rates
21 March 2015
-
Retail industry
21 March 2015
-
National Accounts
21 March 2015
-
Public sector finance
21 March 2015
-
Research and Development expenditure
21 March 2015
-
Home internet and social media usage
21 March 2015
-
Housing
21 March 2015
-
Religion
21 March 2015
-
Language
21 March 2015
-
Sexuality
21 March 2015
-
Ethnicity
21 March 2015
-
Expenditure
21 March 2015
-
Debt
21 March 2015
-
Income and wealth
21 March 2015
-
Elections
21 March 2015
-
Well-being
21 March 2015
-
Conception and fertility rates
21 March 2015
-
Adoption
21 March 2015
-
Marriage, cohabitation and civil partnerships
21 March 2015
-
Maternities
21 March 2015
-
Stillbirths
21 March 2015
-
Deaths
21 March 2015
-
Divorce
21 March 2015
-
Live births
21 March 2015
-
Ageing
21 March 2015
-
Families
21 March 2015
-
Life expectancies
21 March 2015
-
Population estimates
21 March 2015
-
Migration within the UK
21 March 2015


Arrays vs. Hashes
Arrays are lists of ordered items. They're like a list that you can store anything in. They can store any objects such as fixnums, strings, or other arrays, just to name a few. Arrays are objects too, so you can create new arrays. You assign values to an array with brackets. For example, if you wanted to make yourself into an array, you just put your name, add some brackets, and fill out your empty form. Age, height, favorite color, ANYTHING can be stored under your name and it will be remembered!
Hashes are like arrays in that they are an indexed collection of object references. However, they are used more for mapping than order. You can index a hash with objects of any types: strings, regular expressions, and others. When you store a value in a hash, you actually supply two objects - the key and the value.
If you think about how you want to gather the items you are storing the choice of array vs. hash is simple. If you need to store a list that doesnt need to be in order, but can be sorted and compared, an array is what you want. When you are storing things and care more for speed than order, and just want something to hold values, then it's best to use a hash.
The Cool Kids Use Javascript
Why, you ask? It's easy, fast, and versatile. JavaScript doesn't need a compiler, and is supported by every web browser at this point. It can be added to a web site without any worry that it may not be readable.
With Javascript, you can modify a page without having to wait for any new information to be sent back and forth from a server. JavaScript is also able to load more content on a page without being refreshed! Even though more data is being transfered from the server, the page feels faster to the user because of it.
Whole web apps can be built in JavaScript and create dynamic pages where a single language is used for both front and back end interactions. There's no need to link multiple files to do one job. Javascript does it all!
Padding, Margins, and Borders
Padding is the space between the content and the border. Without it, you risk things looking kinda cramped. So, padding is essential if you want things to look pleasant.
The margin is the space outside the border. This way things arent bumping into eachother. Or for example, if you want each section of your page with the same amount of space inbetween them. Margins are what handle that.
Borders are what's in between the padding and margin. Borders are the "edge" between padding and margin. You can change the width, style, and color of a border. This way, all your content has a defined separation other than just space.
3 sites to make life easy
When I go to a website there's one thing above all else that keeps me on - simplicity. Now, not to say I don't enjoy flashy websites. But I like to navigate easily through my entertainment.
One of my favorite sites is Eat Geek Play - which is a websites featuring comic news, web comics, and tons of geeky fun. My favorite thing about this site is how easy you can get to everything. It's all in the navigation bar - no going through a tree of links to find something.
The second site that comes to mind is Smosh.com. Smosh is a YouTube channel featuring a couple funny guys who also happen to have a nifty website. They post about current events and random pop culture, as well as their videos and other shenanigans. The site catches my eye because of how clean it is. Organized, modern, and filled with things to catch your eye.
Lastly, I frequent StumbleUpon whenever I have some time to kill. It does its job of feeding you random websites you may like in a way that seems fluid and easy. Jumping from site to site and still being able to log what sites you've enjoyed with no interuption is what I call innovation.


ConnexOpen
| Syntax | ||
| int ConnexOpen(char *host,int remote_port); | ||
| Header | ||
| base/connex.h | ||
| Library | ||
| cnx | ||
| Description | ||
The The arguments host and remote_port give the hostname and remote port number to connect to. | ||
| Returns | ||
| Returns the file descriptor of the socket on success. On error, (-1) is returned. | ||
| Errors | ||
| On error, (-1) is returned. | ||
| Example | ||
|


{% extends "microsite_base.html" %}{% load snippets_tags thumbnail %} {% block title %}Global City Teams Challenge - {{ block.super }}{% endblock title %} {% block content %}
Find the latest on IoT smart city projects.
Deploy and assess your IoT solutions.
GCTC SuperClusters will result in tangible deployments that are multi-city and multi-stakeholder in nature.
Join GCTC next month in Portland for the Transportation Super Action Cluster Workshop.


ERA Vice Chair; Keele University, UK<EMAIL_ADDRESS>ISAL Board Liaison Chair; Braintree Ltd & University College London, UK<EMAIL_ADDRESS>ERA Conference Chair; Durham University, UK<EMAIL_ADDRESS>ERA General Chair; Cleveland Clinic Lerner Research Institute, US; EmilyLDolson@gmail.com