public final class Formatter extends Object implements Closeable, Flushable
byte
, BigDecimal
, and Calendar
are supported. Limited formatting customization for arbitrary user types is
provided through the Formattable
interface.
Formatters are not necessarily safe for multithreaded access. Thread safety is optional and is the responsibility of users of methods in this class.
Formatted printing for the Java language is heavily inspired by C's
printf
. Although the format strings are similar to C, some
customizations have been made to accommodate the Java language and exploit
some of its features. Also, Java formatting is more strict than C's; for
example, if a conversion is incompatible with a flag, an exception will be
thrown. In C inapplicable flags are silently ignored. The format strings
are thus intended to be recognizable to C programmers but not necessarily
completely compatible with those in C.
Examples of expected usage:
StringBuilder sb = new StringBuilder(); // Send all output to the Appendable object sb Formatter formatter = new Formatter(sb, Locale.US); // Explicit argument indices may be used to re-order output. formatter.format("%4$2s %3$2s %2$2s %1$2s", "a", "b", "c", "d") // -> " d c b a" // Optional locale as the first argument can be used to get // locale-specific formatting of numbers. The precision and width can be // given to round and align the value. formatter.format(Locale.FRANCE, "e = %+10.4f", Math.E); // -> "e = +2,7183" // The '(' numeric flag may be used to format negative numbers with // parentheses rather than a minus sign. Group separators are // automatically inserted. formatter.format("Amount gained or lost since last statement: $ %(,.2f", balanceDelta); // -> "Amount gained or lost since last statement: $ (6,217.58)"
Convenience methods for common formatting requests exist as illustrated by the following invocations:
// Writes a formatted string to System.out. System.out.format("Local time: %tT", Calendar.getInstance()); // -> "Local time: 13:34:18" // Writes formatted output to System.err. System.err.printf("Unable to open file '%1$s': %2$s", fileName, exception.getMessage()); // -> "Unable to open file 'food': No such file or directory"
Like C's sprintf(3)
, Strings may be formatted using the static
method String.format
:
// Format a string containing a date. import java.util.Calendar; import java.util.GregorianCalendar; import static java.util.Calendar.*; Calendar c = new GregorianCalendar(1995, MAY, 23); String s = String.format("Duke's Birthday: %1$tb %1$te, %1$tY", c); // -> s == "Duke's Birthday: May 23, 1995"
This specification is divided into two sections. The first section, Summary, covers the basic formatting concepts. This section is intended for users who want to get started quickly and are familiar with formatted printing in other programming languages. The second section, Details, covers the specific implementation details. It is intended for users who want more precise specification of formatting behavior.
This section is intended to provide a brief overview of formatting concepts. For precise behavioral details, refer to the Details section.
Every method which produces formatted output requires a format
string and an argument list. The format string is a String
which may contain fixed text and one or more embedded format
specifiers. Consider the following example:
This format string is the first argument to theCalendar c = ...; String s = String.format("Duke's Birthday: %1$tm %1$te,%1$tY", c);
format
method. It
contains three format specifiers "%1$tm
", "%1$te
", and
"%1$tY
" which indicate how the arguments should be processed and
where they should be inserted in the text. The remaining portions of the
format string are fixed text including "Dukes Birthday: "
and any
other spaces or punctuation.
The argument list consists of all arguments passed to the method after the
format string. In the above example, the argument list is of size one and
consists of the Calendar
object c
.
%[argument_index$][flags][width][.precision]conversion
The optional argument_index is a decimal integer indicating the
position of the argument in the argument list. The first argument is
referenced by "1$
", the second by "2$
", etc.
The optional flags is a set of characters that modify the output format. The set of valid flags depends on the conversion.
The optional width is a positive decimal integer indicating the minimum number of characters to be written to the output.
The optional precision is a non-negative decimal integer usually used to restrict the number of characters. The specific behavior depends on the conversion.
The required conversion is a character indicating how the argument should be formatted. The set of valid conversions for a given argument depends on the argument's data type.
%[argument_index$][flags][width]conversion
The optional argument_index, flags and width are defined as above.
The required conversion is a two character sequence. The first
character is 't'
or 'T'
. The second character indicates
the format to be used. These characters are similar to but not completely
identical to those defined by GNU date
and POSIX
strftime(3c)
.
%[flags][width]conversion
The optional flags and width is defined as above.
The required conversion is a character indicating content to be inserted in the output.
Conversions are divided into the following categories:
char
, Character
, byte
, Byte
, short
, and Short
. This conversion may also be
applied to the types int
and Integer
when Character.isValidCodePoint(int)
returns true
byte
,
Byte
, short
, Short
, int
and Integer
, long
, Long
, and BigInteger
(but not char
or Character
)
float
, Float
, double
, Double
, and BigDecimal
long
, Long
, Calendar
,
Date
and TemporalAccessor
'%'
('\u0025')
The following table summarizes the supported conversions. Conversions
denoted by an upper-case character (i.e. 'B'
, 'H'
,
'S'
, 'C'
, 'X'
, 'E'
, 'G'
,
'A'
, and 'T'
) are the same as those for the corresponding
lower-case conversion characters except that the result is converted to
upper case according to the rules of the prevailing Locale
. The result is equivalent to the following invocation of String.toUpperCase()
out.toUpperCase()
| Conversion | Argument Category | Description |
|---|---|---|
'b' , 'B'
| general | If the argument arg is null , then the result is
"false ". If arg is a boolean or Boolean , then the result is the string returned by String.valueOf(arg) . Otherwise, the result is
"true".
|
'h' , 'H'
| general | If the argument arg is null , then the result is
"null ". Otherwise, the result is obtained by invoking
Integer.toHexString(arg.hashCode()) .
|
's' , 'S'
| general | If the argument arg is null , then the result is
"null ". If arg implements Formattable , then
arg.formatTo is invoked. Otherwise, the
result is obtained by invoking arg.toString() .
|
'c' , 'C'
| character | The result is a Unicode character |
'd'
| integral | The result is formatted as a decimal integer |
'o'
| integral | The result is formatted as an octal integer |
'x' , 'X'
| integral | The result is formatted as a hexadecimal integer |
'e' , 'E'
| floating point | The result is formatted as a decimal number in computerized scientific notation |
'f'
| floating point | The result is formatted as a decimal number |
'g' , 'G'
| floating point | The result is formatted using computerized scientific notation or decimal format, depending on the precision and the value after rounding. |
'a' , 'A'
| floating point | The result is formatted as a hexadecimal floating-point number with
a significand and an exponent. This conversion is not supported
for the BigDecimal type despite the latter's being in the
floating point argument category.
|
't' , 'T'
| date/time | Prefix for date and time conversion characters. See Date/Time Conversions. |
'%'
| percent | The result is a literal '%' ('\u0025')
|
'n'
| line separator | The result is the platform-specific line separator |
Any characters not explicitly defined as conversions are illegal and are reserved for future extensions.
The following date and time conversion suffix characters are defined for
the 't'
and 'T'
conversions. The types are similar to but
not completely identical to those defined by GNU date
and POSIX
strftime(3c)
. Additional conversion types are provided to access
Java-specific functionality (e.g. 'L'
for milliseconds within the
second).
The following conversion characters are used for formatting times:
'H'
| Hour of the day for the 24-hour clock, formatted as two digits with
a leading zero as necessary i.e. 00 - 23 .
|
'I'
| Hour for the 12-hour clock, formatted as two digits with a leading
zero as necessary, i.e. 01 - 12 .
|
'k'
| Hour of the day for the 24-hour clock, i.e. 0 - 23 .
|
'l'
| Hour for the 12-hour clock, i.e. 1 - 12 .
|
'M'
| Minute within the hour formatted as two digits with a leading zero
as necessary, i.e. 00 - 59 .
|
'S'
| Seconds within the minute, formatted as two digits with a leading
zero as necessary, i.e. 00 - 60 ("60 " is a special
value required to support leap seconds).
|
'L'
| Millisecond within the second formatted as three digits with
leading zeros as necessary, i.e. 000 - 999 .
|
'N'
| Nanosecond within the second, formatted as nine digits with leading
zeros as necessary, i.e. 000000000 - 999999999 .
|
'p'
| Locale-specific morning or afternoon marker
in lower case, e.g."am " or "pm ". Use of the conversion
prefix 'T' forces this output to upper case.
|
'z'
| RFC 822
style numeric time zone offset from GMT, e.g. -0800 . This
value will be adjusted as necessary for Daylight Saving Time. For
long , Long , and Date the time zone used is
the default time zone for this
instance of the Java virtual machine.
|
'Z'
| A string representing the abbreviation for the time zone. This
value will be adjusted as necessary for Daylight Saving Time. For
long , Long , and Date the time zone used is
the default time zone for this
instance of the Java virtual machine. The Formatter's locale will
supersede the locale of the argument (if any).
|
's'
| Seconds since the beginning of the epoch starting at 1 January 1970
00:00:00 UTC, i.e. Long.MIN_VALUE/1000 to
Long.MAX_VALUE/1000 .
|
'Q'
| Milliseconds since the beginning of the epoch starting at 1 January
1970 00:00:00 UTC, i.e. Long.MIN_VALUE to
Long.MAX_VALUE .
|
The following conversion characters are used for formatting dates:
'B'
| Locale-specific full month name, e.g. "January" , "February" .
|
'b'
| Locale-specific abbreviated month name,
e.g. "Jan" , "Feb" .
|
'h'
| Same as 'b' .
|
'A'
| Locale-specific full name of the day of the week,
e.g. "Sunday" , "Monday"
|
'a'
| Locale-specific short name of the day of the week,
e.g. "Sun" , "Mon"
|
'C'
| Four-digit year divided by 100 , formatted as two digits
with leading zero as necessary, i.e. 00 - 99
|
'Y'
| Year, formatted as at least four digits with leading zeros as
necessary, e.g. 0092 equals 92 CE for the Gregorian
calendar.
|
'y'
| Last two digits of the year, formatted with leading zeros as
necessary, i.e. 00 - 99 .
|
'j'
| Day of year, formatted as three digits with leading zeros as
necessary, e.g. 001 - 366 for the Gregorian calendar.
|
'm'
| Month, formatted as two digits with leading zeros as necessary,
i.e. 01 - 13 .
|
'd'
| Day of month, formatted as two digits with leading zeros as
necessary, i.e. 01 - 31
|
'e'
| Day of month, formatted as two digits, i.e. 1 - 31 .
|
The following conversion characters are used for formatting common date/time compositions.
'R'
| Time formatted for the 24-hour clock as "%tH:%tM"
|
'T'
| Time formatted for the 24-hour clock as "%tH:%tM:%tS" .
|
'r'
| Time formatted for the 12-hour clock as "%tI:%tM:%tS %Tp" .
The location of the morning or afternoon marker ('%Tp' ) may be
locale-dependent.
|
'D'
| Date formatted as "%tm/%td/%ty" .
|
'F'
| ISO 8601
complete date formatted as "%tY-%tm-%td" .
|
'c'
| Date and time formatted as "%ta %tb %td %tT %tZ %tY" ,
e.g. "Sun Jul 20 16:17:00 EDT 1969" .
|
Any characters not explicitly defined as date/time conversion suffixes are illegal and are reserved for future extensions.
The following table summarizes the supported flags. y means the flag is supported for the indicated argument types.
| Flag | General | Character | Integral | Floating Point | Date/Time | Description |
|---|---|---|---|---|---|---|
| '-' | y | y | y | y | y | The result will be left-justified. |
| '#' | y1 | - | y3 | y | - | The result should use a conversion-dependent alternate form |
| '+' | - | - | y4 | y | - | The result will always include a sign |
| ' ' | - | - | y4 | y | - | The result will include a leading space for positive values |
| '0' | - | - | y | y | - | The result will be zero-padded |
| ',' | - | - | y2 | y5 | - | The result will include locale-specific grouping separators |
| '(' | - | - | y4 | y5 | - | The result will enclose negative numbers in parentheses |
1 Depends on the definition of Formattable
.
2 For 'd'
conversion only.
3 For 'o'
, 'x'
, and 'X'
conversions only.
4 For 'd'
, 'o'
, 'x'
, and
'X'
conversions applied to BigInteger
or 'd'
applied to byte
, Byte
, short
, Short
, int
and Integer
, long
, and Long
.
5 For 'e'
, 'E'
, 'f'
,
'g'
, and 'G'
conversions only.
Any characters not explicitly defined as flags are illegal and are reserved for future extensions.
The width is the minimum number of characters to be written to the output. For the line separator conversion, width is not applicable; if it is provided, an exception will be thrown.
For general argument types, the precision is the maximum number of characters to be written to the output.
For the floating-point conversions 'a'
, 'A'
, 'e'
,
'E'
, and 'f'
the precision is the number of digits after the
radix point. If the conversion is 'g'
or 'G'
, then the
precision is the total number of digits in the resulting magnitude after
rounding.
For character, integral, and date/time argument types and the percent and line separator conversions, the precision is not applicable; if a precision is provided, an exception will be thrown.
The argument index is a decimal integer indicating the position of the
argument in the argument list. The first argument is referenced by
"1$
", the second by "2$
", etc.
Another way to reference arguments by position is to use the
'<'
('\u003c') flag, which causes the argument for
the previous format specifier to be re-used. For example, the following two
statements would produce identical strings:
Calendar c = ...; String s1 = String.format("Duke's Birthday: %1$tm %1$te,%1$tY", c); String s2 = String.format("Duke's Birthday: %1$tm %<te,%<tY", c);
This section is intended to provide behavioral details for formatting, including conditions and exceptions, supported data types, localization, and interactions between flags, conversions, and data types. For an overview of formatting concepts, refer to the Summary
Any characters not explicitly defined as conversions, date/time
conversion suffixes, or flags are illegal and are reserved for
future extensions. Use of such a character in a format string will
cause an UnknownFormatConversionException
or UnknownFormatFlagsException
to be thrown.
If the format specifier contains a width or precision with an invalid
value or which is otherwise unsupported, then a IllegalFormatWidthException
or IllegalFormatPrecisionException
respectively will be thrown.
If a format specifier contains a conversion character that is not
applicable to the corresponding argument, then an IllegalFormatConversionException
will be thrown.
All specified exceptions may be thrown by any of the format
methods of Formatter
as well as by any format
convenience
methods such as String.format
and
PrintStream.printf
.
Conversions denoted by an upper-case character (i.e. 'B'
,
'H'
, 'S'
, 'C'
, 'X'
, 'E'
,
'G'
, 'A'
, and 'T'
) are the same as those for the
corresponding lower-case conversion characters except that the result is
converted to upper case according to the rules of the prevailing Locale
. The result is equivalent to the following
invocation of String.toUpperCase()
out.toUpperCase()
The following general conversions may be applied to any argument type:
'b'
| '\u0062' | Produces either "true " or "false " as returned by
Boolean.toString(boolean) .
If the argument is If the |
'B'
| '\u0042' | The upper-case variant of 'b' .
|
'h'
| '\u0068' | Produces a string representing the hash code value of the object.
If the argument, arg is If the |
'H'
| '\u0048' | The upper-case variant of 'h' .
|
's'
| '\u0073' | Produces a string.
If the argument is If the |
'S'
| '\u0053' | The upper-case variant of 's' .
|
The following flags apply to general conversions:
'-'
| '\u002d' | Left justifies the output. Spaces ('\u0020') will be
added at the end of the converted value as required to fill the minimum
width of the field. If the width is not provided, then a MissingFormatWidthException will be thrown. If this flag is not given
then the output will be right-justified.
|
'#'
| '\u0023' | Requires the output use an alternate form. The definition of the form is specified by the conversion. |
The width is the minimum number of characters to
be written to the
output. If the length of the converted value is less than the width then
the output will be padded by ' ' ('\u0020')
until the total number of characters equals the width. The padding is on
the left by default. If the '-'
flag is given, then the padding
will be on the right. If the width is not specified then there is no
minimum.
The precision is the maximum number of characters to be written to the
output. The precision is applied before the width, thus the output will be
truncated to precision
characters even if the width is greater than
the precision. If the precision is not specified then there is no explicit
limit on the number of characters.
char
and Character
. It
may also be applied to the types byte
, Byte
,
short
, and Short
, int
and Integer
when
Character.isValidCodePoint(int)
returns true
. If it returns
false
then an IllegalFormatCodePointException
will be
thrown.
'c'
| '\u0063' | Formats the argument as a Unicode character as described in Unicode Character
Representation. This may be more than one 16-bit char in
the case where the argument represents a supplementary character.
If the |
'C'
| '\u0043' | The upper-case variant of 'c' .
|
The '-'
flag defined for General
conversions applies. If the '#'
flag is given, then a FormatFlagsConversionMismatchException
will be thrown.
The width is defined as for General conversions.
The precision is not applicable. If the precision is specified then an
IllegalFormatPrecisionException
will be thrown.
Numeric conversions are divided into the following categories:
Numeric types will be formatted according to the following algorithm:
After digits are obtained for the integer part, fractional part, and exponent (as appropriate for the data type), the following transformation is applied:
'0'
+ z.
','
('\u002c')
flag is given, then the locale-specific grouping separator is
inserted by scanning the integer part of the string from least significant
to most significant digits and inserting a separator at intervals defined by
the locale's grouping
size.
'0'
flag is given, then the locale-specific zero digits are inserted
after the sign character, if any, and before the first non-zero digit, until
the length of the string is equal to the requested field width.
'('
flag is given, then a
'('
('\u0028') is prepended and a ')'
('\u0029') is appended.
'('
flag is not given, then a '-'
('\u002d')
is prepended.
'+'
flag is given and the value is positive or zero (or
floating-point positive zero), then a '+'
('\u002b')
will be prepended.
If the value is NaN or positive infinity the literal strings "NaN" or
"Infinity" respectively, will be output. If the value is negative infinity,
then the output will be "(Infinity)" if the '('
flag is given
otherwise the output will be "-Infinity". These values are not localized.
Byte, Short, Integer, and Long
The following conversions may be applied to byte
, Byte
,
short
, Short
, int
and Integer
,
long
, and Long
.
'd'
| '\u0064' | Formats the argument as a decimal integer. The localization algorithm is applied.
If the If the |
'o'
| '\u006f' | Formats the argument as an integer in base eight. No localization
is applied.
If x is negative then the result will be an unsigned value
generated by adding 2n to the value where If the If the If |
'x'
| '\u0078' | Formats the argument as an integer in base sixteen. No
localization is applied.
If x is negative then the result will be an unsigned value
generated by adding 2n to the value where If the If the If |
'X'
| '\u0058' | The upper-case variant of 'x' . The entire string
representing the number will be converted to upper case including the 'x' (if any) and
all hexadecimal digits 'a' - 'f'
('\u0061' - '\u0066').
|
If the conversion is 'o'
, 'x'
, or 'X'
and
both the '#'
and the '0'
flags are given, then result will
contain the radix indicator ('0'
for octal and "0x"
or
"0X"
for hexadecimal), some number of zeros (based on the width),
and the value.
If the '-'
flag is not given, then the space padding will occur
before the sign.
The following flags apply to numeric integral conversions:
'+'
| '\u002b' | Requires the output to include a positive sign for all positive
numbers. If this flag is not given then only negative values will
include a sign.
If both the |
| ' ' | '\u0020' | Requires the output to include a single extra space
('\u0020') for non-negative values.
If both the |
'0'
| '\u0030' | Requires the output to be padded with leading zeros to the minimum field
width following any sign or radix indicator except when converting NaN
or infinity. If the width is not provided, then a MissingFormatWidthException will be thrown.
If both the |
','
| '\u002c' | Requires the output to include the locale-specific group separators as described in the "group" section of the localization algorithm. |
'('
| '\u0028' | Requires the output to prepend a '('
('\u0028') and append a ')'
('\u0029') to negative values.
|
If no flags are given the default formatting is as follows:
width
'-'
('\u002d')
The width is the minimum number of characters to
be written to the output. This includes any signs, digits, grouping
separators, radix indicator, and parentheses. If the length of the
converted value is less than the width then the output will be padded by
spaces ('\u0020') until the total number of characters equals
width. The padding is on the left by default. If '-'
flag is
given then the padding will be on the right. If width is not specified then
there is no minimum.
The precision is not applicable. If precision is specified then an
IllegalFormatPrecisionException
will be thrown.
The following conversions may be applied to BigInteger
.
'd'
| '\u0064' | Requires the output to be formatted as a decimal integer. The localization algorithm is applied.
If the |
'o'
| '\u006f' | Requires the output to be formatted as an integer in base eight.
No localization is applied.
If x is negative then the result will be a signed value
beginning with If x is positive or zero and the If the If the If the |
'x'
| '\u0078' | Requires the output to be formatted as an integer in base
sixteen. No localization is applied.
If x is negative then the result will be a signed value
beginning with If x is positive or zero and the If the If the If the |
'X'
| '\u0058' | The upper-case variant of 'x' . The entire string
representing the number will be converted to upper case including the 'x' (if any) and
all hexadecimal digits 'a' - 'f'
('\u0061' - '\u0066').
|
If the conversion is 'o'
, 'x'
, or 'X'
and
both the '#'
and the '0'
flags are given, then result will
contain the base indicator ('0'
for octal and "0x"
or
"0X"
for hexadecimal), some number of zeros (based on the width),
and the value.
If the '0'
flag is given and the value is negative, then the
zero padding will occur after the sign.
If the '-'
flag is not given, then the space padding will occur
before the sign.
All flags defined for Byte, Short, Integer, and Long apply. The default behavior when no flags are given is the same as for Byte, Short, Integer, and Long.
The specification of width is the same as defined for Byte, Short, Integer, and Long.
The precision is not applicable. If precision is specified then an
IllegalFormatPrecisionException
will be thrown.
The following conversions may be applied to float
, Float
, double
and Double
.
'e'
| '\u0065' | Requires the output to be formatted using computerized scientific notation. The localization algorithm is applied.
The formatting of the magnitude m depends upon its value. If m is NaN or infinite, the literal strings "NaN" or "Infinity", respectively, will be output. These values are not localized. If m is positive-zero or negative-zero, then the exponent
will be Otherwise, the result is a string that represents the sign and magnitude (absolute value) of the argument. The formatting of the sign is described in the localization algorithm. The formatting of the magnitude m depends upon its value.  The magnitude is then represented as the
integer part of a, as a single decimal digit, followed by the
decimal separator followed by decimal digits representing the fractional
part of a, followed by the exponent symbol The number of digits in the result for the fractional part of
m or a is equal to the precision. If the precision is not
specified then the default value is If the |
'E'
| '\u0045' | The upper-case variant of 'e' . The exponent symbol
will be 'E' ('\u0045').
|
'g'
| '\u0067' | Requires the output to be formatted in general scientific notation
as described below. The localization
algorithm is applied.
After rounding for the precision, the formatting of the resulting magnitude m depends on its value. If m is greater than or equal to 10-4 but less than 10precision then it is represented in decimal format. If m is less than 10-4 or greater than or equal to 10precision, then it is represented in computerized scientific notation. The total number of significant digits in m is equal to the
precision. If the precision is not specified, then the default value is
If the |
'G'
| '\u0047' | The upper-case variant of 'g' .
|
'f'
| '\u0066' | Requires the output to be formatted using decimal
format. The localization algorithm is
applied.
The result is a string that represents the sign and magnitude (absolute value) of the argument. The formatting of the sign is described in the localization algorithm. The formatting of the magnitude m depends upon its value. If m NaN or infinite, the literal strings "NaN" or "Infinity", respectively, will be output. These values are not localized. The magnitude is formatted as the integer part of m, with no leading zeroes, followed by the decimal separator followed by one or more decimal digits representing the fractional part of m. The number of digits in the result for the fractional part of
m or a is equal to the precision. If the precision is not
specified then the default value is |
'a'
| '\u0061' | Requires the output to be formatted in hexadecimal exponential
form. No localization is applied.
The result is a string that represents the sign and magnitude (absolute value) of the argument x. If x is negative or a negative-zero value then the result
will begin with If x is positive or a positive-zero value and the
The formatting of the magnitude m depends upon its value.
If the |
'A'
| '\u0041' | The upper-case variant of 'a' . The entire string
representing the number will be converted to upper case including the
'x' ('\u0078') and 'p'
('\u0070' and all hexadecimal digits 'a' -
'f' ('\u0061' - '\u0066').
|
All flags defined for Byte, Short, Integer, and Long apply.
If the '#'
flag is given, then the decimal separator will
always be present.
If no flags are given the default formatting is as follows:
width
'-'
The width is the minimum number of characters
to be written to the output. This includes any signs, digits, grouping
separators, decimal separators, exponential symbol, radix indicator,
parentheses, and strings representing infinity and NaN as applicable. If
the length of the converted value is less than the width then the output
will be padded by spaces ('\u0020') until the total number of
characters equals width. The padding is on the left by default. If the
'-'
flag is given then the padding will be on the right. If width
is not specified then there is no minimum.
If the conversion is 'e'
,
'E'
or 'f'
, then the precision is the number of digits
after the decimal separator. If the precision is not specified, then it is
assumed to be 6
.
If the conversion is 'g'
or 'G'
, then the precision is
the total number of significant digits in the resulting magnitude after
rounding. If the precision is not specified, then the default value is
6
. If the precision is 0
, then it is taken to be
1
.
If the conversion is 'a'
or 'A'
, then the precision
is the number of hexadecimal digits after the radix point. If the
precision is not provided, then all of the digits as returned by Double.toHexString(double)
will be output.
The following conversions may be applied BigDecimal
.
'e'
| '\u0065' | Requires the output to be formatted using computerized scientific notation. The localization algorithm is applied.
The formatting of the magnitude m depends upon its value. If m is positive-zero or negative-zero, then the exponent
will be Otherwise, the result is a string that represents the sign and magnitude (absolute value) of the argument. The formatting of the sign is described in the localization algorithm. The formatting of the magnitude m depends upon its value.  The magnitude is then represented as the
integer part of a, as a single decimal digit, followed by the
decimal separator followed by decimal digits representing the fractional
part of a, followed by the exponent symbol The number of digits in the result for the fractional part of
m or a is equal to the precision. If the precision is not
specified then the default value is If the |
'E'
| '\u0045' | The upper-case variant of 'e' . The exponent symbol
will be 'E' ('\u0045').
|
'g'
| '\u0067' | Requires the output to be formatted in general scientific notation
as described below. The localization
algorithm is applied.
After rounding for the precision, the formatting of the resulting magnitude m depends on its value. If m is greater than or equal to 10-4 but less than 10precision then it is represented in decimal format. If m is less than 10-4 or greater than or equal to 10precision, then it is represented in computerized scientific notation. The total number of significant digits in m is equal to the
precision. If the precision is not specified, then the default value is
If the |
'G'
| '\u0047' | The upper-case variant of 'g' .
|
'f'
| '\u0066' | Requires the output to be formatted using decimal
format. The localization algorithm is
applied.
The result is a string that represents the sign and magnitude (absolute value) of the argument. The formatting of the sign is described in the localization algorithm. The formatting of the magnitude m depends upon its value. The magnitude is formatted as the integer part of m, with no leading zeroes, followed by the decimal separator followed by one or more decimal digits representing the fractional part of m. The number of digits in the result for the fractional part of
m or a is equal to the precision. If the precision is not
specified then the default value is |
All flags defined for Byte, Short, Integer, and Long apply.
If the '#'
flag is given, then the decimal separator will
always be present.
The default behavior when no flags are given is the same as for Float and Double.
The specification of width and precision is the same as defined for Float and Double.
This conversion may be applied to long
, Long
, Calendar
, Date
and TemporalAccessor
't'
| '\u0074' | Prefix for date and time conversion characters. |
'T'
| '\u0054' | The upper-case variant of 't' .
|
The following date and time conversion character suffixes are defined
for the 't'
and 'T'
conversions. The types are similar to
but not completely identical to those defined by GNU date
and
POSIX strftime(3c)
. Additional conversion types are provided to
access Java-specific functionality (e.g. 'L'
for milliseconds
within the second).
The following conversion characters are used for formatting times:
'H'
| '\u0048' | Hour of the day for the 24-hour clock, formatted as two digits with
a leading zero as necessary i.e. 00 - 23 . 00
corresponds to midnight.
|
'I'
| '\u0049' | Hour for the 12-hour clock, formatted as two digits with a leading
zero as necessary, i.e. 01 - 12 . 01 corresponds to
one o'clock (either morning or afternoon).
|
'k'
| '\u006b' | Hour of the day for the 24-hour clock, i.e. 0 - 23 .
0 corresponds to midnight.
|
'l'
| '\u006c' | Hour for the 12-hour clock, i.e. 1 - 12 . 1
corresponds to one o'clock (either morning or afternoon).
|
'M'
| '\u004d' | Minute within the hour formatted as two digits with a leading zero
as necessary, i.e. 00 - 59 .
|
'S'
| '\u0053' | Seconds within the minute, formatted as two digits with a leading
zero as necessary, i.e. 00 - 60 ("60 " is a special
value required to support leap seconds).
|
'L'
| '\u004c' | Millisecond within the second formatted as three digits with
leading zeros as necessary, i.e. 000 - 999 .
|
'N'
| '\u004e' | Nanosecond within the second, formatted as nine digits with leading
zeros as necessary, i.e. 000000000 - 999999999 . The precision
of this value is limited by the resolution of the underlying operating
system or hardware.
|
'p'
| '\u0070' | Locale-specific morning or afternoon marker
in lower case, e.g."am " or "pm ". Use of the
conversion prefix 'T' forces this output to upper case. (Note
that 'p' produces lower-case output. This is different from
GNU date and POSIX strftime(3c) which produce
upper-case output.)
|
'z'
| '\u007a' | RFC 822
style numeric time zone offset from GMT, e.g. -0800 . This
value will be adjusted as necessary for Daylight Saving Time. For
long , Long , and Date the time zone used is
the default time zone for this
instance of the Java virtual machine.
|
'Z'
| '\u005a' | A string representing the abbreviation for the time zone. This
value will be adjusted as necessary for Daylight Saving Time. For
long , Long , and Date the time zone used is
the default time zone for this
instance of the Java virtual machine. The Formatter's locale will
supersede the locale of the argument (if any).
|
's'
| '\u0073' | Seconds since the beginning of the epoch starting at 1 January 1970
00:00:00 UTC, i.e. Long.MIN_VALUE/1000 to
Long.MAX_VALUE/1000 .
|
'Q'
| '\u004f' | Milliseconds since the beginning of the epoch starting at 1 January
1970 00:00:00 UTC, i.e. Long.MIN_VALUE to
Long.MAX_VALUE . The precision of this value is limited by
the resolution of the underlying operating system or hardware.
|
The following conversion characters are used for formatting dates:
'B'
| '\u0042' | Locale-specific full month name, e.g. "January" , "February" .
|
'b'
| '\u0062' | Locale-specific abbreviated month name,
e.g. "Jan" , "Feb" .
|
'h'
| '\u0068' | Same as 'b' .
|
'A'
| '\u0041' | Locale-specific full name of the day of the week,
e.g. "Sunday" , "Monday"
|
'a'
| '\u0061' | Locale-specific short name of the day of the week,
e.g. "Sun" , "Mon"
|
'C'
| '\u0043' | Four-digit year divided by 100 , formatted as two digits
with leading zero as necessary, i.e. 00 - 99
|
'Y'
| '\u0059' | Year, formatted to at least
four digits with leading zeros as necessary, e.g. 0092 equals
92 CE for the Gregorian calendar.
|
'y'
| '\u0079' | Last two digits of the year, formatted with leading zeros as
necessary, i.e. 00 - 99 .
|
'j'
| '\u006a' | Day of year, formatted as three digits with leading zeros as
necessary, e.g. 001 - 366 for the Gregorian calendar.
001 corresponds to the first day of the year.
|
'm'
| '\u006d' | Month, formatted as two digits with leading zeros as necessary,
i.e. 01 - 13 , where "01 " is the first month of the
year and ("13 " is a special value required to support lunar
calendars).
|
'd'
| '\u0064' | Day of month, formatted as two digits with leading zeros as
necessary, i.e. 01 - 31 , where "01 " is the first day
of the month.
|
'e'
| '\u0065' | Day of month, formatted as two digits, i.e. 1 - 31 where
"1 " is the first day of the month.
|
The following conversion characters are used for formatting common date/time compositions.
'R'
| '\u0052' | Time formatted for the 24-hour clock as "%tH:%tM"
|
'T'
| '\u0054' | Time formatted for the 24-hour clock as "%tH:%tM:%tS" .
|
'r'
| '\u0072' | Time formatted for the 12-hour clock as "%tI:%tM:%tS
%Tp" . The location of the morning or afternoon marker
('%Tp' ) may be locale-dependent.
|
'D'
| '\u0044' | Date formatted as "%tm/%td/%ty" .
|
'F'
| '\u0046' | ISO 8601
complete date formatted as "%tY-%tm-%td" .
|
'c'
| '\u0063' | Date and time formatted as "%ta %tb %td %tT %tZ %tY" ,
e.g. "Sun Jul 20 16:17:00 EDT 1969" .
|
The '-'
flag defined for General
conversions applies. If the '#'
flag is given, then a FormatFlagsConversionMismatchException
will be thrown.
The width is the minimum number of characters to
be written to the output. If the length of the converted value is less than
the width
then the output will be padded by spaces
('\u0020') until the total number of characters equals width.
The padding is on the left by default. If the '-'
flag is given
then the padding will be on the right. If width is not specified then there
is no minimum.
The precision is not applicable. If the precision is specified then an
IllegalFormatPrecisionException
will be thrown.
The conversion does not correspond to any argument.
'%'
| The result is a literal '%' ('\u0025')
The width is the minimum number of characters to
be written to the output including the The The precision is not applicable. If the precision is specified an
|
The conversion does not correspond to any argument.
'n'
| the platform-specific line separator as returned by System.getProperty("line.separator") .
|
Flags, width, and precision are not applicable. If any are provided an
IllegalFormatFlagsException
, IllegalFormatWidthException
,
and IllegalFormatPrecisionException
, respectively will be thrown.
Format specifiers can reference arguments in three ways:
1$
", the second by "2$
", etc. An argument
may be referenced more than once.
For example:
formatter.format("%4$s %3$s %2$s %1$s %4$s %3$s %2$s %1$s", "a", "b", "c", "d") // -> "d c b a d c b a"
'<'
('\u003c') flag which causes the argument for
the previous format specifier to be re-used. If there is no previous
argument, then a MissingFormatArgumentException
is thrown.
formatter.format("%s %s %<s %<s", "a", "b", "c", "d") // -> "a b b b" // "c" and "d" are ignored because they are not referenced
'<'
flag. Each format specifier
which uses ordinary indexing is assigned a sequential implicit index into
argument list which is independent of the indices used by explicit or
relative indexing.
formatter.format("%s %s %s %s", "a", "b", "c", "d") // -> "a b c d"
It is possible to have a format string which uses all forms of indexing, for example:
formatter.format("%2$s %s %<s %s", "a", "b", "c", "d") // -> "b a a b" // "c" and "d" are ignored because they are not referenced
The maximum number of arguments is limited by the maximum dimension of a
Java array as defined by
The Java™ Virtual Machine Specification.
If the argument index is does not correspond to an
available argument, then a MissingFormatArgumentException
is thrown.
If there are more arguments than format specifiers, the extra arguments are ignored.
Unless otherwise specified, passing a null
argument to any
method or constructor in this class will cause a NullPointerException
to be thrown.
| Modifier and Type | Class and Description |
|---|---|
static class |
Formatter.BigDecimalLayoutForm
Enum for
BigDecimal formatting. |
| Constructor and Description |
|---|
Formatter()
Constructs a new formatter.
|
Formatter(Appendable a)
Constructs a new formatter with the specified destination.
|
Formatter(Appendable a,
Locale l)
Constructs a new formatter with the specified destination and locale.
|
Formatter(File file)
Constructs a new formatter with the specified file.
|
Formatter(File file,
String csn)
Constructs a new formatter with the specified file and charset.
|
Formatter(File file,
String csn,
Locale l)
Constructs a new formatter with the specified file, charset, and
locale.
|
Formatter(Locale l)
Constructs a new formatter with the specified locale.
|
Formatter(OutputStream os)
Constructs a new formatter with the specified output stream.
|
Formatter(OutputStream os,
String csn)
Constructs a new formatter with the specified output stream and
charset.
|
Formatter(OutputStream os,
String csn,
Locale l)
Constructs a new formatter with the specified output stream, charset,
and locale.
|
Formatter(PrintStream ps)
Constructs a new formatter with the specified print stream.
|
Formatter(String fileName)
Constructs a new formatter with the specified file name.
|
Formatter(String fileName,
String csn)
Constructs a new formatter with the specified file name and charset.
|
Formatter(String fileName,
String csn,
Locale l)
Constructs a new formatter with the specified file name, charset, and
locale.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this formatter.
|
void |
flush()
Flushes this formatter.
|
Formatter |
format(Locale l,
String format,
Object... args)
Writes a formatted string to this object's destination using the
specified locale, format string, and arguments.
|
Formatter |
format(String format,
Object... args)
Writes a formatted string to this object's destination using the
specified format string and arguments.
|
IOException |
ioException()
Returns the
IOException last thrown by this formatter's Appendable . |
Locale |
locale()
Returns the locale set by the construction of this formatter.
|
Appendable |
out()
Returns the destination for the output.
|
String |
toString()
Returns the result of invoking
toString() on the destination
for the output. |
public Formatter()
The destination of the formatted output is a StringBuilder
which may be retrieved by invoking out()
and whose
current content may be converted into a string by invoking toString()
. The locale used is the default locale for
formatting for this instance of the Java
virtual machine.
public Formatter(Appendable a)
The locale used is the default locale for formatting for this instance of the Java virtual machine.
a
- Destination for the formatted output. If a
is
null
then a StringBuilder
will be created.public Formatter(Locale l)
The destination of the formatted output is a StringBuilder
which may be retrieved by invoking out()
and whose current
content may be converted into a string by invoking toString()
.
l
- The locale to apply during
formatting. If l
is null
then no localization
is applied.public Formatter(Appendable a, Locale l)
a
- Destination for the formatted output. If a
is
null
then a StringBuilder
will be created.l
- The locale to apply during
formatting. If l
is null
then no localization
is applied.public Formatter(String fileName) throws FileNotFoundException
The charset used is the default charset for this instance of the Java virtual machine.
The locale used is the default locale for formatting for this instance of the Java virtual machine.
fileName
- The name of the file to use as the destination of this
formatter. If the file exists then it will be truncated to
zero size; otherwise, a new file will be created. The output
will be written to the file and is buffered.SecurityException
- If a security manager is present and checkWrite(fileName)
denies write
access to the fileFileNotFoundException
- If the given file name does not denote an existing, writable
regular file and a new regular file of that name cannot be
created, or if some other error occurs while opening or
creating the filepublic Formatter(String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException
The locale used is the default locale for formatting for this instance of the Java virtual machine.
fileName
- The name of the file to use as the destination of this
formatter. If the file exists then it will be truncated to
zero size; otherwise, a new file will be created. The output
will be written to the file and is buffered.csn
- The name of a supported charsetFileNotFoundException
- If the given file name does not denote an existing, writable
regular file and a new regular file of that name cannot be
created, or if some other error occurs while opening or
creating the fileSecurityException
- If a security manager is present and checkWrite(fileName)
denies write
access to the fileUnsupportedEncodingException
- If the named charset is not supportedpublic Formatter(String fileName, String csn, Locale l) throws FileNotFoundException, UnsupportedEncodingException
fileName
- The name of the file to use as the destination of this
formatter. If the file exists then it will be truncated to
zero size; otherwise, a new file will be created. The output
will be written to the file and is buffered.csn
- The name of a supported charsetl
- The locale to apply during
formatting. If l
is null
then no localization
is applied.FileNotFoundException
- If the given file name does not denote an existing, writable
regular file and a new regular file of that name cannot be
created, or if some other error occurs while opening or
creating the fileSecurityException
- If a security manager is present and checkWrite(fileName)
denies write
access to the fileUnsupportedEncodingException
- If the named charset is not supportedpublic Formatter(File file) throws FileNotFoundException
The charset used is the default charset for this instance of the Java virtual machine.
The locale used is the default locale for formatting for this instance of the Java virtual machine.
file
- The file to use as the destination of this formatter. If the
file exists then it will be truncated to zero size; otherwise,
a new file will be created. The output will be written to the
file and is buffered.SecurityException
- If a security manager is present and checkWrite(file.getPath())
denies
write access to the fileFileNotFoundException
- If the given file object does not denote an existing, writable
regular file and a new regular file of that name cannot be
created, or if some other error occurs while opening or
creating the filepublic Formatter(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException
The locale used is the default locale for formatting for this instance of the Java virtual machine.
file
- The file to use as the destination of this formatter. If the
file exists then it will be truncated to zero size; otherwise,
a new file will be created. The output will be written to the
file and is buffered.csn
- The name of a supported charsetFileNotFoundException
- If the given file object does not denote an existing, writable
regular file and a new regular file of that name cannot be
created, or if some other error occurs while opening or
creating the fileSecurityException
- If a security manager is present and checkWrite(file.getPath())
denies
write access to the fileUnsupportedEncodingException
- If the named charset is not supportedpublic Formatter(File file, String csn, Locale l) throws FileNotFoundException, UnsupportedEncodingException
file
- The file to use as the destination of this formatter. If the
file exists then it will be truncated to zero size; otherwise,
a new file will be created. The output will be written to the
file and is buffered.csn
- The name of a supported charsetl
- The locale to apply during
formatting. If l
is null
then no localization
is applied.FileNotFoundException
- If the given file object does not denote an existing, writable
regular file and a new regular file of that name cannot be
created, or if some other error occurs while opening or
creating the fileSecurityException
- If a security manager is present and checkWrite(file.getPath())
denies
write access to the fileUnsupportedEncodingException
- If the named charset is not supportedpublic Formatter(PrintStream ps)
The locale used is the default locale for formatting for this instance of the Java virtual machine.
Characters are written to the given PrintStream
object and are therefore encoded using that object's
charset.
ps
- The stream to use as the destination of this formatter.public Formatter(OutputStream os)
The charset used is the default charset for this instance of the Java virtual machine.
The locale used is the default locale for formatting for this instance of the Java virtual machine.
os
- The output stream to use as the destination of this formatter.
The output will be buffered.public Formatter(OutputStream os, String csn) throws UnsupportedEncodingException
The locale used is the default locale for formatting for this instance of the Java virtual machine.
os
- The output stream to use as the destination of this formatter.
The output will be buffered.csn
- The name of a supported charsetUnsupportedEncodingException
- If the named charset is not supportedpublic Formatter(OutputStream os, String csn, Locale l) throws UnsupportedEncodingException
os
- The output stream to use as the destination of this formatter.
The output will be buffered.csn
- The name of a supported charsetl
- The locale to apply during
formatting. If l
is null
then no localization
is applied.UnsupportedEncodingException
- If the named charset is not supportedpublic Locale locale()
The format
method
for this object which has a locale argument does not change this value.
null
if no localization is applied, otherwise a
localeFormatterClosedException
- If this formatter has been closed by invoking its close()
methodpublic Appendable out()
FormatterClosedException
- If this formatter has been closed by invoking its close()
methodpublic String toString()
toString()
on the destination
for the output. For example, the following code formats text into a
StringBuilder
then retrieves the resultant string:
Formatter f = new Formatter(); f.format("Last reboot at %tc", lastRebootDate); String s = f.toString(); // -> s == "Last reboot at Sat Jan 01 00:00:00 PST 2000"
An invocation of this method behaves in exactly the same way as the invocation
out().toString()
Depending on the specification of toString
for the Appendable
, the returned string may or may not contain the characters
written to the destination. For instance, buffers typically return
their contents in toString()
, but streams cannot since the
data is discarded.
toString
in class Object
toString()
on the destination
for the outputFormatterClosedException
- If this formatter has been closed by invoking its close()
methodpublic void flush()
Flushable
interface, its flush
method will be invoked.
Flushing a formatter writes any buffered output in the destination to the underlying stream.
flush
in interface Flushable
FormatterClosedException
- If this formatter has been closed by invoking its close()
methodpublic void close()
Closeable
interface, its close
method will be invoked.
Closing a formatter allows it to release resources it may be holding (such as open files). If the formatter is already closed, then invoking this method has no effect.
Attempting to invoke any methods except ioException()
in
this formatter after it has been closed will result in a FormatterClosedException
.
close
in interface Closeable
close
in interface AutoCloseable
public IOException ioException()
IOException
last thrown by this formatter's Appendable
.
If the destination's append()
method never throws
IOException
, then this method will always return null
.
null
if
no such exception exists.public Formatter format(String format, Object... args)
format
- A format string as described in Format string
syntax.args
- Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
extra arguments are ignored. The maximum number of arguments is
limited by the maximum dimension of a Java array as defined by
The Java™ Virtual Machine Specification.IllegalFormatException
- If a format string contains an illegal syntax, a format
specifier that is incompatible with the given arguments,
insufficient arguments given the format string, or other
illegal conditions. For specification of all possible
formatting errors, see the Details
section of the formatter class specification.FormatterClosedException
- If this formatter has been closed by invoking its close()
methodpublic Formatter format(Locale l, String format, Object... args)
l
- The locale to apply during
formatting. If l
is null
then no localization
is applied. This does not change this object's locale that was
set during construction.format
- A format string as described in Format string
syntaxargs
- Arguments referenced by the format specifiers in the format
string. If there are more arguments than format specifiers, the
extra arguments are ignored. The maximum number of arguments is
limited by the maximum dimension of a Java array as defined by
The Java™ Virtual Machine Specification.IllegalFormatException
- If a format string contains an illegal syntax, a format
specifier that is incompatible with the given arguments,
insufficient arguments given the format string, or other
illegal conditions. For specification of all possible
formatting errors, see the Details
section of the formatter class specification.FormatterClosedException
- If this formatter has been closed by invoking its close()
methodDracula Javadoc Sample, Made with Allan Im.


A list of Activities applicable to you will be shown here. To narrow down your Activities, you can can change the view and/or input filters by clicking on the columns.


XModeler
www.wi-inf.uni-due.de/LE4MM
Pattern:
Web
Source
Projects
Models
Team Contribution
The following people have contributed to the design and development of XModeler:
Tony Clark
Ulrich Frank
Jens Gulden
Daniel Töpel
Björn Benner
Paul Sammut
James Willans
Yongjun Zheng


{{Custom Header Information}}
Home
International Project
Local Activities
Support Us
Media
News & Events
Contact Us
Home
Chapter
Projects
International Project
Local Activities
Support
Us
Media
News &
Events
Contact
Us
{{ Page Content }}
{{Page Bottom Code}}


Please read these Terms and Conditions ("Terms", "Terms and Conditions") carefully before using the
www.Pedalpay.net website (the "Service") operated by PedalPay ("us", "we", or "our").
Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms.
These Terms apply to all visitors, users and others who access or use the Service.
By accessing or using the Service you agree to be bound by these Terms. If you disagree with any part of the
terms then you may not access the Service. The Terms and Conditions agreement for PedalPay has been created
with the help of TermsFeed.
When you create an account with us, you must provide us information that is accurate, complete, and current
at all times. Failure to do so constitutes a breach of the Terms, which may result in immediate termination
of your account on our Service.
You are responsible for safeguarding the password that you use to access the Service and for any activities
or actions under your password, whether your password is with our Service or a third-party
service.
You agree not to disclose your password to any third party. You must notify us immediately upon becoming
aware of any breach of security or unauthorized use of your account.
Our Service may contain links to third-party web sites or services that are not owned or controlled by
PedalPay.
PedalPay has no control over, and assumes no responsibility for, the content, privacy policies, or practices
of any third party web sites or services. You further acknowledge and agree that PedalPay shall not be
responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or
in connection with use of or reliance on any such content, goods or services available on or through any
such web sites or services.
We strongly advise you to read the terms and conditions and privacy policies of any third-party web sites or
services that you visit.
We may terminate or suspend access to our Service immediately, without prior notice or liability, for any
reason whatsoever, including without limitation if you breach the Terms.
All provisions of the Terms which by their nature should survive termination shall survive termination,
including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of
liability.
We may terminate or suspend your account immediately, without prior notice or liability, for any reason
whatsoever, including without limitation if you breach the Terms.
Upon termination, your right to use the Service will immediately cease. If you wish to terminate your
account, you may simply discontinue using the Service.
All provisions of the Terms which by their nature should survive termination shall survive termination,
including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of
liability.
These Terms shall be governed and construed in accordance with the laws of United Kingdom, without regard to
its conflict of law provisions.
Our failure to enforce any right or provision of these Terms will not be considered a waiver of those
rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining
provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us
regarding our Service, and supersede and replace any prior agreements we might have between us regarding the
Service.
We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is
material we will try to provide at least 30 days notice prior to any new terms taking effect. What
constitutes a material change will be determined at our sole discretion.
By continuing to access or use our Service after those revisions become effective, you agree to be bound by
the revised terms. If you do not agree to the new terms, please stop using the Service.
If you have any questions about these Terms, please contact us.


THE MYTH OF FINGERPRINTS
A Film Review by James Berardinelli
RATING: *** OUT OF ****
United States, 1996 U.S. Release Date: beginning 10/97 (limited) Running Length: 1:33 MPAA Classification: R (Sex, profanity, mature themes) Theatrical Aspect Ratio: 1.85:1
Cast: Noah Wyle, Julianne Moore, Roy Scheider, Blythe Danner, Michael Vartan, Laurel Holloman, Hope Davis, Brian Kerwin, Arija Bareikis, James LeGros Director: Bart Freundlich Producers: Mary Jane Skalski, Tim Perell, Bart Freundlich Screenplay: Bart Freundlich Cinematography: Stephen Kazmierski Music: David Bridie, John Phillips U.S. Distributor: Sony Pictures Classics
In the movies, the holidays are times when dysfunctional families come together, air their differences, then renew their closeness so that everyone can go home happy. It's frequently a melodramatic and cloying process, and, even when there are gifted actors involved (such as Holly Hunter in the Jodie Foster-directed HOME FOR THE HOLIDAYS), watching such a film can be a dull, uninvolving process. With THE MYTH OF FINGERPRINTS, however, writer/director Bart Freundlich has scored a coup: he has created a low-key holiday drama that's refreshing not only because it lacks the big discovery melodrama of most similar movies but because it's entirely believable.
THE MYTH OF FINGERPRINTS begins with the familiar process of the family re-assembling at Mom and Dad's New England house during Thanksgiving week. The only one who still lives with her parents (who are ably portrayed by Roy Scheider and Blythe Danner) is Leigh (Laurel Holloman), the sprightly youngest child who has a boundless well of enthusiasm and good cheer. The same cannot be said of most of the returning children. There's Warren (Noah Wyle, from TV's ER), who hasn't been home in three years since breaking up with his high-school sweetheart (Arija Bareikis). The perpetually-cranky Mia (Julianne Moore, currently in BOOGIE NIGHTS) arrives with her latest significant other, therapist Elliot (Brian Kerwin), in tow. Their relationship is clearly on the rocks, and Mia's fascination with an old grade school pal (James LeGros) doesn't help matters. Jake (Michael Vartan) shows up with his flighty girlfriend, Margaret (Hope Davis), who amuses Jake's Mom by insisting that she and her boyfriend share the same bed.
At its best, THE MYTH OF FINGERPRINTS is a sensitive, intelligent examination of the dynamics of a dysfunctional family (note: families in movies like this must always be dysfunctional, otherwise there wouldn't be much of a story). At its worst, which isn't often, Freundlich's feature debut runs into difficulties with cliches: the overbearing father who has left his "fingerprints" on the lives of each of his offspring, the search by various couples to rekindle the old flame, etc. One of the most atypical aspects of THE MYTH OF FINGERPRINTS is that it isn't loaded with "shocking" revelations – everything is pretty much as it seems and the friction between the characters is the result of normal causes rather than motion picture contrivances. Plus, in true slice-of-life fashion, hardly anything gets wrapped up over the course of the picture. We see a few small dramas play themselves out, but the larger story, which began long before the picture's opening credits, is not cleanly closed.
Freundlich has a good sense of what makes for absorbing drama – a quality that consistently applies to THE MYTH OF FINGERPRINTS. Through strong, well-focused writing and with the help of a uniformly effective cast, the director gets us to care about every member of the family in a remarkably short span of time. The dialogue is also thoughtful and insightful, rather than trite. Examples include Warren's explanation for why he's going home this year for Thanksgiving: "It's been long enough that I can't quite remember that I shouldn't go," and Mia's observation that family members are "the first people you're supposed to be hostile to."
THE MYTH OF FINGERPRINTS contains a number of noteworthy scenes, including some strangely quiet dinners and awkward moments between estranged siblings. But the best sequence occurs early in the film, on the night when everyone has finally assembled under one roof. One-by- one, the various couples begin to make love, and the concert of moans, thumps, and squeaks creates an atmosphere that is both poignant and funny, especially as we observe Warren's reaction to all the noise around him.
Nothing much happens during THE MYTH OF FINGERPRINTS, but that's the point. For 90 minutes, Freundlich opens a window into the lives of a few characters, and our perspective is so clear that we feel we get to know them. So, although the material is not especially challenging, the results are among the best for an American film of this genre. For those who appreciate this sort of simple drama, THE MYTH OF FINGERPRINTS is worth a trip to the theater.
Copyright 1997 James Berardinelli
- James Berardinelli e-mail<EMAIL_ADDRESS>Now with more than 1300 reviews... The ReelViews web site: http://movie-reviews.colossus.net/
"For me, the cinema is not a slice of life, but a piece of cake."
- Alfred Hitchcock
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


26 Jun 2018 » Introduction to Mealy automata, Grigorchuk group and the Burnside problem
09 Mar 2018 » No tiling by convex heptagons
29 Jan 2018 » Greedy algorithm for maximum independent set
15 Jan 2018 » Magazines, rubriques et cie.
08 Jan 2018 » Travelling salesman problem on cubic graphs
23 Dec 2017 » Communication complexity and information theory
09 Nov 2017 » Blogs d’informatique théorique
22 Sep 2017 » Introduction ludique à la sémantique des jeux
11 Sep 2017 » One-bit catastrophe
07 Sep 2017 » Sturmian words
31 Aug 2017 » Combinatorics of continued fractions
29 Jun 2017 » Exploring, evacuating, and finding treasures, without a map
23 Jun 2017 » Learning with Errors- based Cryptography
12 May 2017 » Logic and distributed automata
09 Mar 2017 » Fast self-stabilizing bit dissemination
01 Feb 2017 » Un début


Try to answer the following motorcycle related questions. Keep in mind this is timed and wrong answers will impact timer and score.
Your final score is .
Enter initials:


|
GT RoboCup SSL
Soccer software, robot firmware
|
For a brief introduction to how to use the command line see here
1) Clone the repositories
2) Run the setup script There are a few setup scripts in the util directory for installing required packages, setting up udev rules, etc. Run ubuntu-setup
, arch-setup
, and osx-setup
depending on your system.
3) Compile robocup-firmware make sure you are at the top level of robocup-firmware and run make
Please see here for a brief tutorial on git as well as links to learning resources
Please see the contributing page for general contributing guidelines.
In terms of understanding the usefulness of object oriented programming I recommend the Java concept tutorials although you will be briefly introduced to java code if find its a great conceptual starter.
In terms of a full C++ tutorial I recommend W3 schools C++ tutorials as they are easier to understand for beginners. https://www.w3schools.com/cpp/
In terms of an in-depth tutorial of C++ I also recommend a Tour of C++ by Bjarne Stroustrup
For a quick intro to the basic GDB commands see here
For a interactive exercise for learning GDB see here
For details on flashing code to the mTrain after compiling and debugging programs see here
For details on building packages with Conan see here


FoodMob
Eating out with friends made easy. This is the iOS portion of the application. The backend server is in FoodMob-Node.
HTML documentation of the functions and API can be found in the docs
folder.
iOS Application
Features
- Find nearby restaurants with fine-grained criteria.
- Set up your profile including your likes and dislikes.
- Add friends to a search, which takes into account their likes and dislikes.
- Add parameters to a search to further filter restaurants.
Assistance for using the application can be found in Profile -> Help in the application, or in the FoodMob/Resources/help.html
file.
Known Issues in Version 1.0
- Login/Registration: When rotating to landscape, the application does not lay out the views properly.
- Network: A slow network may cause the application to crash if many views are loaded at once.
Development
Build Requirements
- Xcode 7.3 with iOS 9.3 SDK
- Current Swift version: 2.2
- Targeted iOS version: 9.1
- Homebrew (http://brew.sh)
- Carthage (GitHub)
Getting Started
Install the two command line tools you will need if you don’t have them:
- Homebrew
Carthage using Homebrew:
brew update brew install carthage
In this project directory, run
carthage bootstrap --platform iOS
This installs the library dependencies needed for this application.
Open the
FoodMob.xcodeproj
file using Xcode.In the top bar, the scheme should be set to FoodMob, and the destination should be a simulator or device (i.e, not
Generic iOS Device
).Click the ▶ Run button in Xcode to install to your connected iPhone or Simulator.
Adding new libraries
Please follow these procedures for adding new libraries.
- Libraries must be licensed permissively.  MIT and Apache are good ones.
- Libraries should be available as a framework (dynamic library).
- Libraries should be approved by Jonathan (@jonjesbuzz). Open a GitHub issue or contact him on Slack.
- Libraries should be available to download using Carthage.
- It would be nice if the library is written in Swift. (This effectively requires #2 for technical reasons.) Objective-C libraries are allowed, but Swift libraries tend to be nicer to work with in Swift (obviously) and tend to be more modern.


Aggressive, ambitious, approachable. TUSK Social complements and opposes.
With the collective mission of pairing big concepts with simpler executions,
TUSK Social's first project is an honor to age-old drinking, serving you cocktails
in a more casual way.
It's about time we made quality drinks easier to find.
Equal parts ambition, aggression, and approachability. Making it easier for you to enjoy quality cocktails.


Raising children in a world with stereotype threat
Stereotype threat is a new concept for me. While I am aware of certain forms of racisms and cultural biases that exist in our country, I have lived in California my entire life. And most of that stay has been in the Northern California Bay Area, home to San Francisco and likely the most progressive and accepting piece of real estate in the world. Fortunately I haven’t had to deal with the monster that is a human’s capacity for hating another that they have never met.
To begin with, stereotype threat isn’t directly a form of racism but really an indirect byproduct. The concept is basically that a common stereotype for a group of people can cause someone a natural tendency to feel threatened that they will become “yet another” member of that group. And this tends to manifest itself in certain studies when evaluating different groups of people in education. For example, if blacks are seen as succumbing to learning difficulties when they belong to low income families.
While I haven’t directly encountered stereotype threat, I do have three children that are all of mixed nationality. They are half German, and half African American. They don’t suffer from the traditional low income stereotype, but I could see how this kind of thing could manifest itself in their lives. And of course, as a parent I want to do everything in my power to foster a life for them that supports life long learning. The idea that a stereotype could try to pull them into fearing circumstances where they would become another statistic that enforces the stereotype is troublesome to me.
As a parent, my experience is that my children are unaware of these threats. That if I continue to foster them with cultural values that encourage studying, the value of a good education, and the tools to allow them freedom in their learning that they will embrace the opportunities afforded to them.
While I have never directly encountered or been affected by stereotype threat, I am happy for exposure to the issue. It provides me yet another tool in parenting three children of mixed heritage.


This is a fork of jashkenas's Ember/Backbone benchmark to include other frameworks/libraries. Note that this is just a simple benchmark: you wouldn't be doing this in an actual app.
The original fork was clocking the loops synchronously which was not accurate. This fork fixes that, and also gives a 300ms pause before clock starts to offset initialization time.


Must use DTD, proper nesting, lowercase for tags, must have html as root, must close all tags, quote all attributes or
you get "XML Parsing Error: mismatched tag. Expected:"
For the DOCTYPE DTD at line 1 of the XHTML source file:
Use the strict DOCTYPE when you want really clean markup, free of presentational clutter. Use it together with CSS.
Use the transitional DOCTYPE when you want to still use HTML's presentational features.
Use the frameset DOCTYPE when you want to use HTML frames.


$navy
$teal
$green
$blue
$orange
$purple
$red
$yellow
$white
$near-white
$gray-lightest
$gray-lighter
$gray-light
$near-medium
$gray
$gray-dark
$gray-darker
$black
To add to these items, use Sass variables that start with $ in .//components/_patterns/00-base/global/01-colors/_color-vars.scss


S3AccessControlList Class Reference
| Inherits from | NSObject |
| Declared in | S3AccessControlList.h |
Overview
Represents an access control list (ACL) for S3. An AccessControlList is represented by an Owner, and a list of Grants, where each Grant is a Grantee and a Permission.
Each bucket and object in Amazon S3 has an ACL that defines its access control policy. When a request is made, Amazon S3 authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Amazon S3 returns an error.
An ACL is a list of grants. A grant consists of one grantee and one permission. ACLs only grant permissions; they do not deny them.
Note: Bucket and object ACLs are completely independent; an object does not inherit the ACL from its bucket. For example, if you create a bucket and grant write access to another user, you will not be able to access the user’s objects unless the user explicitly grants access. This also applies if you grant anonymous write access to a bucket. Only the user “anonymous” will be able to access objects the user created unless permission is explicitly granted to the bucket owner.
Tasks
-
owner
Gets and sets the owner
property -
grantList
Returns the current grant list
property -
– initWithOwner:
Initialize the object with an owner
-
– addGrant:
Adds the grant to the grant list
-
– toXml
Returns the XML represenation of the ACL
-
– toHeaders
Returns x-amz header representation of the ACL
Properties
Instance Methods
addGrant:
Adds the grant to the grant list
- (void)addGrant:(S3Grant *)aGrant
Parameters
- aGrant
A Grant to add to the list.
Discussion
Adds the grant to the grant list
Declared In
S3AccessControlList.h
initWithOwner:
Initialize the object with an owner
- (id)initWithOwner:(S3Owner *)theOwner
Discussion
Initialize the object with an owner
Declared In
S3AccessControlList.h


Which docker storagedriver should I use?
3:16:50 PM <crosbymichael> ahmetalpbalkan:
easy, overlay
more info
(NEW)


Projects
- Computing Pioneers video series
- Curios
- Clarity
- Aldine: syntax highlighting for English
- MyFitnessPal API
- Isostamp
- Mr. Schelling's Neighborhood
- TiddlyLisp
- Instanote
- Congressional Bill Outcome Predictor
- Affitto
- My Evernote
- Zen Writer
- OrigamiJS
- Fiesta: Machine Translator
- Octagon
- Paper Trail
- In Other Words
- Bubble
Computing Pioneers video series
Like Chef's Table, but for computing pioneers / engineers rather than chefs.
More info to come!
Curios — curios.city
Curios is like Quora, but for urban infrastructure projects.
Answering questions about big urban construction projects usually requires a Google search and then digging through a bunch of information, but what I'd like to be able to do is just geolocate myself on a map and see a little marker for the project, to click on it, and learn whatever key facts I want about the project.
For example, the Transbay Terminal has been under construction as long as I've lived in San Francisco. Whenever I walk past it, I wonder "when are the buses going to start running?". I wonder other questions too, like how much it cost, who lobbied for it at City Hall, what its capacity will be, and so on. It's surprisingly hard to get information about these questions, and even more so for less prominent projects going on around the city.
Over time, I've developed a detailed mental map of infrastructure changes going on in the city. I've always wanted these reflected in a single place, as a way to both better remember this information and share it with others. Also, when I'm in another less familiar city, I'd also love to be able to explore
Infrastructure is often underappreciated. It's expensive, the victim of tragedies of the commons, and all too easy to take for granted. Most people only notice infrastructure when it isn't working for them — great infrastructure tends to disappear when it's doing its job right. My hope with this project is to bring a little more hope and positive attention to the infrastructure that's being created and maintained around us.
And even if no one else uses it, I'll have a place to keep my own personal notes about cool projects going on around me. :)
You can find Curios at curios.city, and the source code is on Github.
Clarity
"Science is a way of thinking more than it is a body of knowledge," said Carl Sagan. Writing is similar—it is a process, not a position. It's as much about challenging and polishing an idea as it is about the idea itself. When I've written something, I'm suspicious when my view doesn't change at least a little before I share it with the world.
Almost everything I publish is radically different from its original draft. Discussion, feedback, and reflection mark the most valuable stage of the writing cycle, because they might uncover a neglected argument, produce a stronger rhetorical structure, or cause me to question my assumptions all together. This process can continue after publishing, too. Writing is just a snapshot in time of the author's thoughts, and it can get out of date as they learn more. Some of the biggest updates I've had in my worldview occurred after (and in some cases because!) I published an essay on the topic.
Most writers describe a similar process, but it is hidden from the reader. Writers constantly make decisions about what to say and how to articulate it, but we only see the result. The margins of my Google docs are filled with comments from friends, and it's fascinating to see how these conversations, questions, and disagreements inform the final result. But in the end, they are resolved into oblivion, and the final version contains no trace of the commentary. A lot of work happens before the writer hits "publish", but that process is invisible.
With Clarity, I played around with some workflow ideas for bringing the revision process to the forefront, without drowning the reader in the detail that the author intentionally (and rightfully) abstracts away from them. I still haven't figured out great solutions for these problems, and Clarity is very much in the not-yet-usable, "shitty prototype" stage, but I'll continue testing out ideas in here over time.
You can find the source code on Github.
Aldine: syntax highlighting for English
A while back, I learned Rob Pike believes that code shouldn't be syntax highlighted. He argues that we get along just fine without it in English, so it's just a distraction. That made me think, "Well why don't we have it English?" It seems like more of an accident of history rather than an intentional design decision. Anyways, what are bolding and italicizing if not a limited form of syntax highlighting?
Years ago, I developed a method of reading where I focus on verbs to “anchor” clauses and then attach the rest of the sentence to those anchor points. I found it helps me to read faster and with better comprehension. Similarly, I realized that I understand just as much when I all but ignore articles and other filler words (e.g. “a”, “the”).
These experiences made me wonder what changes we could make to text to improve the experience of reading. I tried a few different syntax highlighting schemes, with some interesting results. You can find the collection of these experiments on Github. I never got around to finally deploying the final project, but it shouldn't be too hard to get it running locally from the README in the repo.
MyFitnessPal API
I've tracked my eating habits for the past eight years, and I've since added other health and productivity metrics. Data have piled up in the spreadsheets, services, and other tools I've used to collect these measurements. So far I've done little with it, but I always imagined that they would one day uncover some pattern that would suggest changes in the way I eat, work, or exercise.
So in 2016 when I started experiencing extreme fatigue nearly every afternoon, I decided to investigate whether there was a connection between the food I was eating and my energy levels. My hypothesis was that eating carbohydrates was making me “crash” in the afternoon, because I tended to feel better those days I stuck with just veggies and protein for lunch.
To test this hypothesis, I went to MyFitnessPal (MFP), where I'd been collecting data about my eating habits since high school. To my dismay, they did not have a public API or even a tool that would let me export more than a few months of data at a time. I found a few third-party tools that let me cobble together the logs, but they felt as if they were duct-taped together.
At this point, any reasonable person would have just accepted this fact and used the manual workarounds to export the data. After all, my goal was to find data to confirm or falsify my hypothesis, not to have a beautiful REST API from which I could continuously pull my food logs.
Instead of being reasonable person, I decided to build a little service that would pull all of my logs each day, persist it to a separate database, and then surface the data with a JSON API. I initially planned to write a simple web scraper to do the retrieval work. With a bit more digging through Github's less-than-spectacular search (and encouragement from John <3), I found a project by someone even less reasonable than me that inspired the approach I ended up taking.
Nathan Reynolds (nathforge on Github) had figured out that in fact MyFitnessPal did have an API, it just was for internal use in the official iPhone app only. Not only was the API completely undocumented, but the MFP team had created a custom byte encoding by which to send the data. I still have no idea how he figured out the spec of this encoding, because a lot of the design choices made appear completely random. However he did it, Nathan had built up this codec that took the stream of bytes and parsed them into a human-readable form.
Nathan's myfitnesspal-sync
was a goldmine for understanding MFP's arcane encoding, but it had some drawbacks. The package didn't support every type of packet, which mean I would have had to extend his code to be able to sync all of my data from MFP. Also, I didn't particularly like the interface he'd designed, and it was completely untested. It also had to be manually run from the command line, whereas I wanted something that would continuously sync the data. On top of all this, I'd be looking for a reason to write some Ruby this summer, so I figured this was a good excuse to do that.
I first wrote a package to decode the MFP packets and the encode human-readable data back into the byte form. All the while I was plagiarizing Nathan's detective work (yay open source!). Thanks Nathan, you are a hero.
Once I was satisfied with my Ruby implementation of the codec, I built a tiny Sinatra API to surface the data. This part is still a work-in-progress. It works, but it isn't particularly robust. There's still a bit more work to do.
I still haven't gotten around to a significant amount of data analysis. I did use Metabase to analyze the data in my Heroku Postgres instance over the holidays, but there's definitely more to dig into.
You can find the code for the full API on Github. The module for just the codec implementation is in that repository in the lib
directory. Once the API itself is stable, I'll make it available to anyone who wants to sync and retrieve their MFP data.
Isostamp — isostamp.org
Isotopic signature transfer and mass pattern prediction (Isostamp) is an enabling technique for chemically-directed proteomics. Specifically, it is an algorithm for the targeted detection and identification of modified species by mass spectrometry (MS).
Will Byrd and I worked with the Bertozzi Lab to develop their Isostamp algorithm. We also built a simple API so developers can run the executable in the cloud, and we built a web application that enables other labs to use Isostamp to upload and analyze their own data.
You can find the code for the API at github.com/devonzuegel/tagfinder-api.
You can upload your own data and learn more about Isostamp at Isostamp.org, and you can find the code for the web app at github.com/devonzuegel/Isostamp-web-v2.
We will be open-sourcing the C++ code for the algorithm soon.
Mr. Schelling's Neighborhood
Ever since reading about Schelling's "general theory of tipping" in Seeing Around Corners, I've wanted to replicate some of his models and play around with agent-based modeling as a technique.
Schelling's model of segregation found that if individuals have even just a slight preference to be surrounded by people of their own group or race, the emergent effect across a population can be total segregation, even if that is not the intention of any specific agent. This effect can be seen with a simple ABM, which I've implemented below.
You are looking at a birds-eye view of a simulated neighborhood containing two groups, blue and red with a handful of blank spaces. To start, the blues and reds are randomly distributed. Then, frame after frame, the agents are allowed to move. The agent is happy with its position if its nearest neighbors include at least a certain number of its own color; otherwise, they move to a random open space on the map.
The default number of same-colored neighbors required to make an agent satisfied with its location is the threshold, and the percent of "empty lost" on the map is the percent open. You can adjust these with the controls in the top right corner of the model.
You can find the ABM code on Github, and you can see a larger version of the model here.
TiddlyLisp
To learn the fundamentals of Lisp, I built a little interpreter based on Michael Nielsen's fantastic blog post Lisp as the Maxwell's Equations of Software. I included extensions to resolve some of the challenge problems he mentioned at the end of the post, too.
You can find the code for the interpreter on Github.
Instanote
About a month ago, I started using Instapaper obsessively. However, it left me with one major problem – all of my Instapaper bookmarks and highlights were isolated from the knowledge that I (obsessively) store in Evernote, and I wanted to have them all in one place. After all, a personal knowledge base is useless if it doesn't contain half of the things I read throughout the day.
Instanote solves this problem by syncing the text of my archived Instapaper bookmarks with their respective highlights into Evernote every 10 minutes. I figured other people might have the same frustration with Instapaper, so I built out a little Heroku app that allows other people to sign up too rather than just hard-coding my login info into a hacky script.
You can sign up at instanote-archive.herokuapp.com and see the source code on Github.
Congressional Bill Outcome Predictor
Emma Marriott, Arushi Jain, and I built a predictor that identifies which US bills will succeed in the House & Senate. We tried several different prediction methods, including: Naive Bayes with and without Principal Component Analysis (PCA), Logistic Regression, Support Vector Machine (SVM) with PCA, and Perceptron with PCA. PCA identified the 500
most important features of a set of 11,000
. Each predictor was modeled on data from the 109th – 113th Congresses from a wide range of structured & unstructured sources, including lobbying information. SVM with PCA proved to be the best model. It predicted bill outcomes with 94%
precision & 87%
recall, resulting in an F-measure of 0.92
.
You can learn more about our research and data here.
Affitto
San Francisco and the greater Bay Area have been struggling with housing shortages and decisions about how to best serve the community with policies to deal with this situation. At a micro level, we have a fairly good understanding of how individuals make economic decisions such as where tenants choose to live and how much rent landlords choose to charge. However, we lack tools to model the complex interactions of millions of individuals simultaneously making decisions and the emergent phenomena that result from these interactions.
John Luttig and I built an Agent Based Model (ABM) to simulate emergent behavior within housing markets and explore the impact of policies such as rent control and zoning regulations. With this project, we aim to provide a tool for policymakers and stakeholders to better understand these interactions that in aggregate comprise the housing market. Understanding large-scale systems requires understanding how the results of individual actions can be more than the sum of its parts. We used ABM to simulate the actions and interactions of tenants and landlords.
Here is a small version of one of our models. You may have to close the controls (by clicking the bottom of the control panel) in order to see the full simulation.
You can find the ABM code, housing data with which we initialized the model, and further information on the analysis we performed on the resulting network at github.com/devonzuegel/affitto. You can see a larger version of the model here.
My Evernote
I love Evernote. On any given day I usually create about 15 notes, ranging from highlighted blog posts and articles to trip itineraries and to-do lists. The bulk of these notes are clippings from around the web that I've read and annotated with Evernote's Clearly extension.
Evernote has lots of great sharing capabilities, including joint notebooks, public links, and social sharing. However, I've always wanted to publish a sort of feed that shares a select set from my annotated notes and displays what my friends have read. What I want is a bit like Medium, but where the posts aren't necessarily from that platform, simply clipped with Evernote into a notebook.
As a fun way to solve this little problem of mine and to teach myself more about Rails testing frameworks, I'm working on a little app called My Evernote. When I'm done, it'll automatically sync all of your notes except those you especially tag #private
. Then each evening you receive an email asking which of the synced notes you want to "publish" on your feed. It's a simple app, but I quickly learned that the Evernote documentation for Rails is basically non-existent, so it's also been a fun way to add to that.
You can find the open source code for the project on Github and the app at myevernote.herokuapp.com.
Zen Writer — zenwriter.herokuapp.com
The most difficult part of writing is that first draft. Putting your ideas to paper to generate that initial content is hard, because it's natural to edit your thoughts while translating them into words. However, this can severely hamper progress and creativity during early drafts. I've learned that I write better content faster if I don't censor myself initially and then only allow myself to revise and edit after I've exhausted my ideas. However, it's extremely difficult to contain that urge to filter out the less well-formed ideas.
During spring quarter finals, I was assigned a 10 page paper. Just three days before it was due I had a one page draft despite hours of research and staring at a blank screen. I had lots of ideas in my head, but every time I started typing I ended up using the delete button almost as much as all my other keys combined.
Since I wasn't making any progress anyways, I decided to take a break and built a tiny text editor called Zen Writer. It disables the delete button, highlights the current line, and fades out past content so that your attention is focused on moving forward and generating more content.
It didn't take much work to build a rough version, and as soon as I finished I was back to writing that first draft of my paper. In the first 15 minutes, I generated about 600 words. When I went back to revise what I'd written, I was surprised to find that most of my changes were to fix minor typos rather than large, conceptual revisions.
I finished that first draft in just over 2 hours and spent another hour the following day to revise my work, and the resulting paper was among the best I've written in my time at Stanford. Since then, I use Zen Writer every time I get stuck writing, from emails to blog posts to READMEs. I hope other people find it useful too, though I will warn you that it's still very rough and simple!
You can find the open source code for the project on Github and the app at zenwriter.herokuapp.com.
P.S. As a more robust solution to this problem, I now use the First Draft Mac app from 96 Problems. It offers all the features I built, planned to build, or never even realized I needed in ZenWriter. Ben and the whole team are super responsive and helpful too, so in short I highly recommend the app if you're looking for a tool to solve this problem!
OrigamiJS
Over spring break I decided I wanted to play around with coffeescript, so I built a little script to hierarchically fold elements on a webpage. I originally built it so I could fold long blog posts and class notes I had written in Markdown. The idea was inspired by the great header folding in Marked2, my favorite Markdown previewer, so by default Origamijs folds traditional <h*>
and <p>
elements as defined by Markdown. Origamijs also allows clients to define their own hierarchy, in the case that they're using unique tags or prefer to ignore certain levels of the traditional Markdown tag hierarchy.
You can find the open source code for the project on Github and example usage here.
Fiesta: Machine Translator
Zoe Robert, John Luttig, and I built a Spanish to English machine translator, which we called Fiesta. It is based on the IBM Model 1 algorithm and also implements several Spanish-specific strategies for improving results.
IBM Model 1 is an expectation-maximization statistical alignment algorithm. Given known pairings of Spanish and English sentences, it generates a matrix of probabilities whose rows correspond to the Spanish vocabulary and columns correspond to the English vocabulary. The value at any given cell in the matrix represents the probability that those two words have co-occurred within translations of each other. This table is then used to estimate a model for future translations.
In short, IBM Model 1 looks for the most likely English word for a Spanish word (e.g. “dog”) based off our knowledge of co-occurrences within sentences. As such, if there are no translations of a given Spanish word s
that contain a given English word e
, the value of the cell at the corresponding row and column will be 0
.
The algorithm requires 3 components:
- a language model to compute
P(E)
(the prior) - a translation model to compute
P(S|E)
(the probability that a Spanish words
translates to an English worde
) - a decoder that produces the most probable translation
Pseudocode
initialize transl_prob(e|s) uniformly
do until convergence
set count(e|s) to 0 for all e,s
set total_s(s) to 0 for all s
for all sentence pairs (en_sentence, sp_sentence)
set total_e(e) = 0 for all e
for all words e in en_sentence
for all words s in sp_sentence
total_e(e) += transl_prob(e|s)
for all words e in en_sentence
for all words s in sp_sentence
count(e|s) += transl_prob(e|s) / total_e(e)
total_s(s) += transl_prob(e|s) / total_e(e)
for all s
for all e
transl_prob(e|s) = count(e|s) / total_s(s)
You can find the open source code for the project on Github.
Octagon
This past summer, I designed and built an app called Octagon, a tool for venture capital firms. Octagon helps VCs better manage relationships with portfolio companies by visualizing important metrics about company growth and providing a repository for financial documents and quarterly updates. It also facilitates interaction between investors and board members and the startups in their portfolios in an analogous manner to CRM software. Octagon is currently in beta testing at Formation|8.
I was responsible for the full-stack of the app, though I was lucky enough for the last few weeks of the project to work with a friend named Zack who helped me immensely with the front-end, especially user interaction and fully utilizing the capabilities of our graphing libraries.
You can find the open source code for the project on Github.
Paper Trail
Some of the greatest impact individuals can have on politics is driven by daily purchasing decisions. Any time an individual patronizes a corporation, (s)he is fueling the company's lobbying and donorship capabilities and is indirectly supporting their political causes. Unfortunately, the impact of corporate political contributions is largely opaque to the general public, and the research about corporations' political activity is a tedious, complex task.
In early 2014, I set out to solve this problem with a project called Paper Trail. The web app provides users access to political profiles of companies and manufacturers. Visualizations and statistics about companies political contributions and lobbying behavior help consumers make informed choices about where their money is going. In turn, consumers' more thoughtful choices empower those corporations that represent their values.
Paper Trail was the first programming project that I pursued outside of class and has evolved significantly since I first implemented it in early 2014. It began as a simple HTML/Javascript app into which users could query the names of companies and learn about their political contributions.
You can find this initial prototype here and the open source code base on Github.
Last month, I decided to completely refactor and improve upon Paper Trail with the help of a few friends. We realized that it was unlikely that users would consistently use the app alongside real-life spending, because it would require the tedious process of pulling their phone out of their pocket, typing in the company name, and analyzing the results. We had to find a way to integrate Paper Trail more seamlessly into the users' existing workflow.
We decided that a browser extension would be far more effective than the original idea of a standalone website. Our extension lies on top of Amazon and automatically alerts users of the political activities of the manufacturers of the items in the user's cart. Beyond solving the problem of relying on users to take action, our new strategy also narrowed our focus to a single site — Amazon — and its users. This had the benefit of leveraging our own experience as Amazon customers, using Amazon's fantastic API, and generally focusing our energy on specific goals rather than broad ones.
The Paper Trail extension is currently under development. You can find an rough interactive prototype on Invision and the open source code for the actual extension on Github.
In Other Words
My brother Jeffrey was born with Cerebral Palsy and is on the autistic spectrum. Life with Jeffrey is challenging for both of us because he doesn't always communicate effectively in the conventional way, in “English.” However, he has found alternative modes with the help of his team of teachers, therapists, family, and friends.
In my junior year in high school, I became fascinated with his growing ability to communicate in non-conventional ways and decided to devote several months to learning more about this process. After conducting extensive interviews and reading further into psychology and cognitive science, I published a documentary book called In Other Words about how he and his team discovers and develops those alternatives.
You can find the book on Blurb.com.