| Package | Description |
|---|---|
| java.applet |
Provides the classes necessary to create an applet and the classes an applet
uses to communicate with its applet context.
|
| java.awt |
Contains all of the classes for creating user
interfaces and for painting graphics and images.
|
| java.awt.color |
Provides classes for color spaces.
|
| java.beans |
Contains classes related to developing
beans -- components
based on the JavaBeans™ architecture.
|
| java.beans.beancontext |
Provides classes and interfaces relating to bean context.
|
| java.io |
Provides for system input and output through data streams,
serialization and the file system.
|
| java.lang |
Provides classes that are fundamental to the design of the Java
programming language.
|
| java.net |
Provides the classes for implementing networking applications.
|
| java.nio.channels |
Defines channels, which represent connections to entities that are capable of
performing I/O operations, such as files and sockets; defines selectors, for
multiplexed, non-blocking I/O operations.
|
| java.nio.file |
Defines interfaces and classes for the Java virtual machine to access files,
file attributes, and file systems.
|
| java.nio.file.spi |
Service-provider classes for the
java.nio.file package. |
| java.security |
Provides the classes and interfaces for the security framework.
|
| java.security.cert |
Provides classes and interfaces for parsing and managing
certificates, certificate revocation lists (CRLs), and
certification paths.
|
| java.sql |
Provides the API for accessing and processing data stored in a
data source (usually a relational database) using the
JavaTM programming language.
|
| java.util |
Contains the collections framework, legacy collection classes, event model,
date and time facilities, internationalization, and miscellaneous utility
classes (a string tokenizer, a random-number generator, and a bit array).
|
| java.util.jar |
Provides classes for reading and writing the JAR (Java ARchive) file
format, which is based on the standard ZIP file format with an
optional manifest file.
|
| java.util.logging |
Provides the classes and interfaces of
the JavaTM 2
platform's core logging facilities.
|
| java.util.prefs |
This package allows applications to store and retrieve user and system
preference and configuration data.
|
| java.util.zip |
Provides classes for reading and writing the standard ZIP and GZIP
file formats.
|
| javax.accessibility |
Defines a contract between user-interface components and an assistive technology
that provides access to those components.
|
| javax.activation | |
| javax.crypto |
Provides the classes and interfaces for cryptographic operations.
|
| javax.imageio |
The main package of the Java Image I/O API.
|
| javax.imageio.stream |
A package of the Java Image I/O API dealing with low-level I/O from
files and streams.
|
| javax.management.loading |
Provides the classes which implement advanced dynamic
loading.
|
| javax.net.ssl |
Provides classes for the secure socket package.
|
| javax.print |
Provides the principal classes and interfaces for the
JavaTM Print Service API.
|
| javax.security.auth.x500 |
This package contains the classes that should be used to store
X500 Principal and X500 Private Credentials in a
Subject.
|
| javax.security.cert |
Provides classes for public key certificates.
|
| javax.sound.midi |
Provides interfaces and classes for I/O, sequencing, and synthesis of MIDI
(Musical Instrument Digital Interface) data.
|
| javax.sound.midi.spi |
Supplies interfaces for service providers to implement when
offering new MIDI devices, MIDI file readers and writers, or sound bank readers.
|
| javax.sound.sampled |
Provides interfaces and classes for capture, processing, and playback of sampled audio data.
|
| javax.sound.sampled.spi |
Supplies abstract classes for service providers to subclass when
offering new audio devices, sound file readers and writers, or audio format converters.
|
| javax.sql |
Provides the API for server side data source access and processing from
the JavaTM programming language.
|
| javax.sql.rowset |
Standard interfaces and base classes for JDBC
RowSet
implementations. |
| javax.sql.rowset.serial |
Provides utility classes to allow serializable mappings between SQL types
and data types in the Java programming language.
|
| javax.swing |
Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms.
|
| javax.swing.plaf.synth |
Synth is a skinnable look and feel in which all painting is
delegated.
|
| javax.swing.text |
Provides classes and interfaces that deal with editable
and noneditable text components.
|
| javax.swing.text.rtf |
Provides a class (
RTFEditorKit ) for creating Rich-Text-Format
text editors. |
| javax.tools |
Provides interfaces for tools which can be invoked from a program,
for example, compilers.
|
| javax.xml.bind |
Provides a runtime binding framework for client applications including
unmarshalling, marshalling, and validation capabilities.
|
| javax.xml.bind.helpers |
JAXB Provider Use Only: Provides partial default implementations for
some of the javax.xml.bind interfaces.
|
| javax.xml.crypto |
Common classes for XML cryptography.
|
| javax.xml.crypto.dsig |
Classes for generating and validating XML digital
signatures.
|
| javax.xml.parsers |
Provides classes allowing the processing of XML documents.
|
| javax.xml.soap |
Provides the API for creating and building SOAP messages.
|
| javax.xml.stream | |
| javax.xml.transform.stream |
This package implements stream- and URI- specific transformation APIs.
|
| javax.xml.ws.spi.http |
Provides HTTP SPI that is used for portable deployment of JAX-WS
web services in containers(for e.g.
|
| org.ietf.jgss |
This package presents a framework that allows application developers to
make use of security services like authentication, data integrity and
data confidentiality from a variety of underlying security mechanisms
like Kerberos, using a unified API.
|
| org.omg.CORBA.portable |
Provides a portability layer, that is, a set of ORB APIs
that makes it possible for code generated
by one vendor to run on another vendor's ORB.
|
| org.w3c.dom.ls | |
| org.xml.sax |
This package provides the core SAX APIs.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
AppletContext.getStream(String key)
Returns the stream to which specified key is associated within this
applet context.
|
| Modifier and Type | Method and Description |
|---|---|
void |
AppletContext.setStream(String key,
InputStream stream)
Associates the specified stream with the specified key in this
applet context.
|
| Modifier and Type | Method and Description |
|---|---|
static Font |
Font.createFont(int fontFormat,
InputStream fontStream)
Returns a new
Font using the specified font type
and input data. |
| Modifier and Type | Method and Description |
|---|---|
static ICC_Profile |
ICC_Profile.getInstance(InputStream s)
Constructs an ICC_Profile corresponding to the data in an InputStream.
|
| Constructor and Description |
|---|
XMLDecoder(InputStream in)
Creates a new input stream for reading archives
created by the
XMLEncoder class. |
XMLDecoder(InputStream in,
Object owner)
Creates a new input stream for reading archives
created by the
XMLEncoder class. |
XMLDecoder(InputStream in,
Object owner,
ExceptionListener exceptionListener)
Creates a new input stream for reading archives
created by the
XMLEncoder class. |
XMLDecoder(InputStream in,
Object owner,
ExceptionListener exceptionListener,
ClassLoader cl)
Creates a new input stream for reading archives
created by the
XMLEncoder class. |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
BeanContext.getResourceAsStream(String name,
BeanContextChild bcc)
Analagous to
java.lang.ClassLoader.getResourceAsStream() ,
this method allows a BeanContext implementation
to interpose behavior between the child Component
and underlying ClassLoader . |
InputStream |
BeanContextSupport.getResourceAsStream(String name,
BeanContextChild bcc) |
| Modifier and Type | Class and Description |
|---|---|
class |
BufferedInputStream
A
BufferedInputStream adds
functionality to another input stream-namely,
the ability to buffer the input and to
support the mark and reset
methods. |
class |
ByteArrayInputStream
A
ByteArrayInputStream contains
an internal buffer that contains bytes that
may be read from the stream. |
class |
DataInputStream
A data input stream lets an application read primitive Java data
types from an underlying input stream in a machine-independent
way.
|
class |
FileInputStream
A
FileInputStream obtains input bytes
from a file in a file system. |
class |
FilterInputStream
A
FilterInputStream contains
some other input stream, which it uses as
its basic source of data, possibly transforming
the data along the way or providing additional
functionality. |
class |
LineNumberInputStream
Deprecated.
This class incorrectly assumes that bytes adequately represent
characters. As of JDK 1.1, the preferred way to operate on
character streams is via the new character-stream classes, which
include a class for counting line numbers.
|
class |
ObjectInputStream
An ObjectInputStream deserializes primitive data and objects previously
written using an ObjectOutputStream.
|
class |
PipedInputStream
A piped input stream should be connected
to a piped output stream; the piped input
stream then provides whatever data bytes
are written to the piped output stream.
|
class |
PushbackInputStream
A
PushbackInputStream adds
functionality to another input stream, namely
the ability to "push back" or "unread"
one byte. |
class |
SequenceInputStream
A
SequenceInputStream represents
the logical concatenation of other input
streams. |
class |
StringBufferInputStream
Deprecated.
This class does not properly convert characters into bytes. As
of JDK 1.1, the preferred way to create a stream from a
string is via the
StringReader class. |
| Modifier and Type | Field and Description |
|---|---|
protected InputStream |
FilterInputStream.in
The input stream to be filtered.
|
| Constructor and Description |
|---|
BufferedInputStream(InputStream in)
Creates a
BufferedInputStream
and saves its argument, the input stream
in , for later use. |
BufferedInputStream(InputStream in,
int size)
Creates a
BufferedInputStream
with the specified buffer size,
and saves its argument, the input stream
in , for later use. |
DataInputStream(InputStream in)
Creates a DataInputStream that uses the specified
underlying InputStream.
|
FilterInputStream(InputStream in)
Creates a
FilterInputStream
by assigning the argument in
to the field this.in so as
to remember it for later use. |
InputStreamReader(InputStream in)
Creates an InputStreamReader that uses the default charset.
|
InputStreamReader(InputStream in,
Charset cs)
Creates an InputStreamReader that uses the given charset.
|
InputStreamReader(InputStream in,
CharsetDecoder dec)
Creates an InputStreamReader that uses the given charset decoder.
|
InputStreamReader(InputStream in,
String charsetName)
Creates an InputStreamReader that uses the named charset.
|
LineNumberInputStream(InputStream in)
Deprecated.
Constructs a newline number input stream that reads its input
from the specified input stream.
|
ObjectInputStream(InputStream in)
Creates an ObjectInputStream that reads from the specified InputStream.
|
PushbackInputStream(InputStream in)
Creates a
PushbackInputStream
and saves its argument, the input stream
in , for later use. |
PushbackInputStream(InputStream in,
int size)
Creates a
PushbackInputStream
with a pushback buffer of the specified size ,
and saves its argument, the input stream
in , for later use. |
SequenceInputStream(InputStream s1,
InputStream s2)
Initializes a newly
created
SequenceInputStream
by remembering the two arguments, which
will be read in order, first s1
and then s2 , to provide the
bytes to be read from this SequenceInputStream . |
StreamTokenizer(InputStream is)
Deprecated.
As of JDK version 1.1, the preferred way to tokenize an
input stream is to convert it into a character stream, for example:
Reader r = new BufferedReader(new InputStreamReader(is)); StreamTokenizer st = new StreamTokenizer(r); |
| Constructor and Description |
|---|
SequenceInputStream(Enumeration<? extends InputStream> e)
Initializes a newly created
SequenceInputStream
by remembering the argument, which must
be an Enumeration that produces
objects whose run-time type is InputStream . |
| Modifier and Type | Field and Description |
|---|---|
static InputStream |
System.in
The "standard" input stream.
|
| Modifier and Type | Method and Description |
|---|---|
abstract InputStream |
Process.getErrorStream()
Returns the input stream connected to the error output of the
subprocess.
|
abstract InputStream |
Process.getInputStream()
Returns the input stream connected to the normal output of the
subprocess.
|
InputStream |
Runtime.getLocalizedInputStream(InputStream in)
Deprecated.
As of JDK 1.1, the preferred way to translate a byte
stream in the local encoding into a character stream in Unicode is via
the
InputStreamReader and BufferedReader
classes. |
InputStream |
Class.getResourceAsStream(String name)
Finds a resource with a given name.
|
InputStream |
ClassLoader.getResourceAsStream(String name)
Returns an input stream for reading the specified resource.
|
static InputStream |
ClassLoader.getSystemResourceAsStream(String name)
Open for reading, a resource of the specified name from the search path
used to load classes.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
Runtime.getLocalizedInputStream(InputStream in)
Deprecated.
As of JDK 1.1, the preferred way to translate a byte
stream in the local encoding into a character stream in Unicode is via
the
InputStreamReader and BufferedReader
classes. |
static void |
System.setIn(InputStream in)
Reassigns the "standard" input stream.
|
| Modifier and Type | Method and Description |
|---|---|
abstract InputStream |
CacheResponse.getBody()
Returns the response body as an InputStream.
|
InputStream |
HttpURLConnection.getErrorStream()
Returns the error stream if the connection failed
but the server sent useful data nonetheless.
|
protected abstract InputStream |
SocketImpl.getInputStream()
Returns an input stream for this socket.
|
InputStream |
URLConnection.getInputStream()
Returns an input stream that reads from this open connection.
|
InputStream |
Socket.getInputStream()
Returns an input stream for this socket.
|
InputStream |
URLClassLoader.getResourceAsStream(String name)
Returns an input stream for reading the specified resource.
|
InputStream |
URL.openStream()
Opens a connection to this
URL and returns an
InputStream for reading from that connection. |
| Modifier and Type | Method and Description |
|---|---|
static String |
URLConnection.guessContentTypeFromStream(InputStream is)
Tries to determine the type of an input stream based on the
characters at the beginning of the input stream.
|
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
Channels.newInputStream(AsynchronousByteChannel ch)
Constructs a stream that reads bytes from the given channel.
|
static InputStream |
Channels.newInputStream(ReadableByteChannel ch)
Constructs a stream that reads bytes from the given channel.
|
| Modifier and Type | Method and Description |
|---|---|
static ReadableByteChannel |
Channels.newChannel(InputStream in)
Constructs a channel that reads bytes from the given stream.
|
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
Files.newInputStream(Path path,
OpenOption... options)
Opens a file, returning an input stream to read from the file.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
Files.copy(InputStream in,
Path target,
CopyOption... options)
Copies all bytes from an input stream to a file.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
FileSystemProvider.newInputStream(Path path,
OpenOption... options)
Opens a file, returning an input stream to read from the file.
|
| Modifier and Type | Class and Description |
|---|---|
class |
DigestInputStream
A transparent stream that updates the associated message digest using
the bits going through the stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Certificate.decode(InputStream stream)
Deprecated.
Decodes a certificate from an input stream.
|
abstract void |
KeyStoreSpi.engineLoad(InputStream stream,
char[] password)
Loads the keystore from the given input stream.
|
void |
Provider.load(InputStream inStream)
Reads a property list (key and element pairs) from the input stream.
|
void |
KeyStore.load(InputStream stream,
char[] password)
Loads this KeyStore from the given input stream.
|
| Constructor and Description |
|---|
DigestInputStream(InputStream stream,
MessageDigest digest)
Creates a digest input stream, using the specified input stream
and message digest.
|
| Modifier and Type | Method and Description |
|---|---|
abstract Certificate |
CertificateFactorySpi.engineGenerateCertificate(InputStream inStream)
Generates a certificate object and initializes it with
the data read from the input stream
inStream . |
abstract Collection<? extends Certificate> |
CertificateFactorySpi.engineGenerateCertificates(InputStream inStream)
Returns a (possibly empty) collection view of the certificates read
from the given input stream
inStream . |
CertPath |
CertificateFactorySpi.engineGenerateCertPath(InputStream inStream)
Generates a
CertPath object and initializes it with
the data read from the InputStream inStream. |
CertPath |
CertificateFactorySpi.engineGenerateCertPath(InputStream inStream,
String encoding)
Generates a
CertPath object and initializes it with
the data read from the InputStream inStream. |
abstract CRL |
CertificateFactorySpi.engineGenerateCRL(InputStream inStream)
Generates a certificate revocation list (CRL) object and initializes it
with the data read from the input stream
inStream . |
abstract Collection<? extends CRL> |
CertificateFactorySpi.engineGenerateCRLs(InputStream inStream)
Returns a (possibly empty) collection view of the CRLs read
from the given input stream
inStream . |
Certificate |
CertificateFactory.generateCertificate(InputStream inStream)
Generates a certificate object and initializes it with
the data read from the input stream
inStream . |
Collection<? extends Certificate> |
CertificateFactory.generateCertificates(InputStream inStream)
Returns a (possibly empty) collection view of the certificates read
from the given input stream
inStream . |
CertPath |
CertificateFactory.generateCertPath(InputStream inStream)
Generates a
CertPath object and initializes it with
the data read from the InputStream inStream. |
CertPath |
CertificateFactory.generateCertPath(InputStream inStream,
String encoding)
Generates a
CertPath object and initializes it with
the data read from the InputStream inStream. |
CRL |
CertificateFactory.generateCRL(InputStream inStream)
Generates a certificate revocation list (CRL) object and initializes it
with the data read from the input stream
inStream . |
Collection<? extends CRL> |
CertificateFactory.generateCRLs(InputStream inStream)
Returns a (possibly empty) collection view of the CRLs read
from the given input stream
inStream . |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
Clob.getAsciiStream()
Retrieves the
CLOB value designated by this Clob
object as an ascii stream. |
InputStream |
ResultSet.getAsciiStream(int columnIndex)
Retrieves the value of the designated column in the current row
of this
ResultSet object as
a stream of ASCII characters. |
InputStream |
ResultSet.getAsciiStream(String columnLabel)
Retrieves the value of the designated column in the current row
of this
ResultSet object as a stream of
ASCII characters. |
InputStream |
SQLXML.getBinaryStream()
Retrieves the XML value designated by this SQLXML instance as a stream.
|
InputStream |
Blob.getBinaryStream()
Retrieves the
BLOB value designated by this
Blob instance as a stream. |
InputStream |
ResultSet.getBinaryStream(int columnIndex)
Retrieves the value of the designated column in the current row
of this
ResultSet object as a stream of
uninterpreted bytes. |
InputStream |
Blob.getBinaryStream(long pos,
long length)
Returns an
InputStream object that contains a partial Blob value,
starting with the byte specified by pos, which is length bytes in length. |
InputStream |
ResultSet.getBinaryStream(String columnLabel)
Retrieves the value of the designated column in the current row
of this
ResultSet object as a stream of uninterpreted
byte s. |
InputStream |
ResultSet.getUnicodeStream(int columnIndex)
Deprecated.
use
getCharacterStream in place of
getUnicodeStream |
InputStream |
ResultSet.getUnicodeStream(String columnLabel)
Deprecated.
use
getCharacterStream instead |
InputStream |
SQLInput.readAsciiStream()
Reads the next attribute in the stream and returns it as a stream of ASCII characters.
|
InputStream |
SQLInput.readBinaryStream()
Reads the next attribute in the stream and returns it as a stream of uninterpreted
bytes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
PreparedStatement.setAsciiStream(int parameterIndex,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
PreparedStatement.setAsciiStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
PreparedStatement.setAsciiStream(int parameterIndex,
InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
CallableStatement.setAsciiStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
CallableStatement.setAsciiStream(String parameterName,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
CallableStatement.setAsciiStream(String parameterName,
InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
PreparedStatement.setBinaryStream(int parameterIndex,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
PreparedStatement.setBinaryStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
PreparedStatement.setBinaryStream(int parameterIndex,
InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
CallableStatement.setBinaryStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
CallableStatement.setBinaryStream(String parameterName,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
CallableStatement.setBinaryStream(String parameterName,
InputStream x,
long length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
PreparedStatement.setBlob(int parameterIndex,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
PreparedStatement.setBlob(int parameterIndex,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
void |
CallableStatement.setBlob(String parameterName,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
CallableStatement.setBlob(String parameterName,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
void |
PreparedStatement.setUnicodeStream(int parameterIndex,
InputStream x,
int length)
Deprecated.
Use
setCharacterStream |
void |
ResultSet.updateAsciiStream(int columnIndex,
InputStream x)
Updates the designated column with an ascii stream value.
|
void |
ResultSet.updateAsciiStream(int columnIndex,
InputStream x,
int length)
Updates the designated column with an ascii stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateAsciiStream(int columnIndex,
InputStream x,
long length)
Updates the designated column with an ascii stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateAsciiStream(String columnLabel,
InputStream x)
Updates the designated column with an ascii stream value.
|
void |
ResultSet.updateAsciiStream(String columnLabel,
InputStream x,
int length)
Updates the designated column with an ascii stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateAsciiStream(String columnLabel,
InputStream x,
long length)
Updates the designated column with an ascii stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateBinaryStream(int columnIndex,
InputStream x)
Updates the designated column with a binary stream value.
|
void |
ResultSet.updateBinaryStream(int columnIndex,
InputStream x,
int length)
Updates the designated column with a binary stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateBinaryStream(int columnIndex,
InputStream x,
long length)
Updates the designated column with a binary stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateBinaryStream(String columnLabel,
InputStream x)
Updates the designated column with a binary stream value.
|
void |
ResultSet.updateBinaryStream(String columnLabel,
InputStream x,
int length)
Updates the designated column with a binary stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateBinaryStream(String columnLabel,
InputStream x,
long length)
Updates the designated column with a binary stream value, which will have
the specified number of bytes.
|
void |
ResultSet.updateBlob(int columnIndex,
InputStream inputStream)
Updates the designated column using the given input stream.
|
void |
ResultSet.updateBlob(int columnIndex,
InputStream inputStream,
long length)
Updates the designated column using the given input stream, which
will have the specified number of bytes.
|
void |
ResultSet.updateBlob(String columnLabel,
InputStream inputStream)
Updates the designated column using the given input stream.
|
void |
ResultSet.updateBlob(String columnLabel,
InputStream inputStream,
long length)
Updates the designated column using the given input stream, which
will have the specified number of bytes.
|
void |
SQLOutput.writeAsciiStream(InputStream x)
Writes the next attribute to the stream as a stream of ASCII characters.
|
void |
SQLOutput.writeBinaryStream(InputStream x)
Writes the next attribute to the stream as a stream of uninterpreted
bytes.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
Base64.Decoder.wrap(InputStream is)
Returns an input stream for decoding
Base64 encoded byte stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
Properties.load(InputStream inStream)
Reads a property list (key and element pairs) from the input
byte stream.
|
void |
Properties.loadFromXML(InputStream in)
Loads all of the properties represented by the XML document on the
specified input stream into this properties table.
|
InputStream |
Base64.Decoder.wrap(InputStream is)
Returns an input stream for decoding
Base64 encoded byte stream. |
| Constructor and Description |
|---|
PropertyResourceBundle(InputStream stream)
Creates a property resource bundle from an
InputStream . |
Scanner(InputStream source)
Constructs a new
Scanner that produces values scanned
from the specified input stream. |
Scanner(InputStream source,
String charsetName)
Constructs a new
Scanner that produces values scanned
from the specified input stream. |
| Modifier and Type | Class and Description |
|---|---|
class |
JarInputStream
The
JarInputStream class is used to read the contents of
a JAR file from any input stream. |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
JarFile.getInputStream(ZipEntry ze)
Returns an input stream for reading the contents of the specified
zip file entry.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Manifest.read(InputStream is)
Reads the Manifest from the specified InputStream.
|
void |
Pack200.Unpacker.unpack(InputStream in,
JarOutputStream out)
Read a Pack200 archive, and write the encoded JAR to
a JarOutputStream.
|
| Constructor and Description |
|---|
JarInputStream(InputStream in)
Creates a new
JarInputStream and reads the optional
manifest. |
JarInputStream(InputStream in,
boolean verify)
Creates a new
JarInputStream and reads the optional
manifest. |
Manifest(InputStream is)
Constructs a new Manifest from the specified input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
LogManager.readConfiguration(InputStream ins)
Reinitialize the logging properties and reread the logging configuration
from the given stream, which should be in java.util.Properties format.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
Preferences.importPreferences(InputStream is)
Imports all of the preferences represented by the XML document on the
specified input stream.
|
| Modifier and Type | Class and Description |
|---|---|
class |
CheckedInputStream
An input stream that also maintains a checksum of the data being read.
|
class |
DeflaterInputStream
Implements an input stream filter for compressing data in the "deflate"
compression format.
|
class |
GZIPInputStream
This class implements a stream filter for reading compressed data in
the GZIP file format.
|
class |
InflaterInputStream
This class implements a stream filter for uncompressing data in the
"deflate" compression format.
|
class |
ZipInputStream
This class implements an input stream filter for reading files in the
ZIP file format.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
ZipFile.getInputStream(ZipEntry entry)
Returns an input stream for reading the contents of the specified
zip file entry.
|
| Constructor and Description |
|---|
CheckedInputStream(InputStream in,
Checksum cksum)
Creates an input stream using the specified Checksum.
|
DeflaterInputStream(InputStream in)
Creates a new input stream with a default compressor and buffer
size.
|
DeflaterInputStream(InputStream in,
Deflater defl)
Creates a new input stream with the specified compressor and a
default buffer size.
|
DeflaterInputStream(InputStream in,
Deflater defl,
int bufLen)
Creates a new input stream with the specified compressor and buffer
size.
|
GZIPInputStream(InputStream in)
Creates a new input stream with a default buffer size.
|
GZIPInputStream(InputStream in,
int size)
Creates a new input stream with the specified buffer size.
|
InflaterInputStream(InputStream in)
Creates a new input stream with a default decompressor and buffer size.
|
InflaterInputStream(InputStream in,
Inflater inf)
Creates a new input stream with the specified decompressor and a
default buffer size.
|
InflaterInputStream(InputStream in,
Inflater inf,
int size)
Creates a new input stream with the specified decompressor and
buffer size.
|
ZipInputStream(InputStream in)
Creates a new ZIP input stream.
|
ZipInputStream(InputStream in,
Charset charset)
Creates a new ZIP input stream.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
AccessibleStreamable.getStream(DataFlavor flavor)
Returns an InputStream for a DataFlavor
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
DataHandler.getInputStream()
Get the InputStream for this object.
|
InputStream |
URLDataSource.getInputStream()
The getInputStream method from the URL.
|
InputStream |
DataSource.getInputStream()
This method returns an
InputStream representing
the data and throws the appropriate exception if it can
not do so. |
InputStream |
FileDataSource.getInputStream()
This method will return an InputStream representing the
the data and will throw an IOException if it can
not do so.
|
| Constructor and Description |
|---|
MailcapCommandMap(InputStream is)
Constructor that allows the caller to specify an InputStream
containing a mailcap file.
|
MimetypesFileTypeMap(InputStream is)
Construct a MimetypesFileTypeMap with programmatic entries
added from the InputStream.
|
| Modifier and Type | Class and Description |
|---|---|
class |
CipherInputStream
A CipherInputStream is composed of an InputStream and a Cipher so
that read() methods return data that are read in from the
underlying InputStream but have been additionally processed by the
Cipher.
|
| Constructor and Description |
|---|
CipherInputStream(InputStream is)
Constructs a CipherInputStream from an InputStream without
specifying a Cipher.
|
CipherInputStream(InputStream is,
Cipher c)
Constructs a CipherInputStream from an InputStream and a
Cipher.
|
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
ImageIO.read(InputStream input)
Returns a
BufferedImage as the result of decoding
a supplied InputStream with an ImageReader
chosen automatically from among those currently registered. |
| Constructor and Description |
|---|
FileCacheImageInputStream(InputStream stream,
File cacheDir)
Constructs a
FileCacheImageInputStream that will read
from a given InputStream . |
MemoryCacheImageInputStream(InputStream stream)
Constructs a
MemoryCacheImageInputStream that will read
from a given InputStream . |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
MLetMBean.getResourceAsStream(String name)
Returns an input stream for reading the specified resource.
|
| Modifier and Type | Method and Description |
|---|---|
Socket |
SSLSocketFactory.createSocket(Socket s,
InputStream consumed,
boolean autoClose)
Creates a server mode
Socket layered over an
existing connected socket, and is able to read data which has
already been consumed/removed from the Socket 's
underlying InputStream . |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
SimpleDoc.getStreamForBytes()
Obtains an input stream for extracting byte print data from
this doc.
|
InputStream |
Doc.getStreamForBytes()
Obtains an input stream for extracting byte print data from this
doc.
|
| Constructor and Description |
|---|
X500Principal(InputStream is)
Creates an
X500Principal from an InputStream
containing the distinguished name in ASN.1 DER encoded form. |
| Modifier and Type | Method and Description |
|---|---|
static X509Certificate |
X509Certificate.getInstance(InputStream inStream)
Instantiates an X509Certificate object, and initializes it with
the data read from the input stream
inStream . |
| Modifier and Type | Method and Description |
|---|---|
static MidiFileFormat |
MidiSystem.getMidiFileFormat(InputStream stream)
Obtains the MIDI file format of the data in the specified input stream.
|
static Sequence |
MidiSystem.getSequence(InputStream stream)
Obtains a MIDI sequence from the specified input stream.
|
static Soundbank |
MidiSystem.getSoundbank(InputStream stream)
Constructs a MIDI sound bank by reading it from the specified stream.
|
void |
Sequencer.setSequence(InputStream stream)
Sets the current sequence on which the sequencer operates.
|
| Modifier and Type | Method and Description |
|---|---|
abstract MidiFileFormat |
MidiFileReader.getMidiFileFormat(InputStream stream)
Obtains the MIDI file format of the input stream provided.
|
abstract Sequence |
MidiFileReader.getSequence(InputStream stream)
Obtains a MIDI sequence from the input stream provided.
|
abstract Soundbank |
SoundbankReader.getSoundbank(InputStream stream)
Obtains a soundbank object from the
InputStream provided. |
| Modifier and Type | Class and Description |
|---|---|
class |
AudioInputStream
An audio input stream is an input stream with a specified audio format and
length.
|
| Modifier and Type | Method and Description |
|---|---|
static AudioFileFormat |
AudioSystem.getAudioFileFormat(InputStream stream)
Obtains the audio file format of the provided input stream.
|
static AudioInputStream |
AudioSystem.getAudioInputStream(InputStream stream)
Obtains an audio input stream from the provided input stream.
|
| Constructor and Description |
|---|
AudioInputStream(InputStream stream,
AudioFormat format,
long length)
Constructs an audio input stream that has the requested format and length in sample frames,
using audio data from the specified input stream.
|
| Modifier and Type | Method and Description |
|---|---|
abstract AudioFileFormat |
AudioFileReader.getAudioFileFormat(InputStream stream)
Obtains the audio file format of the input stream provided.
|
abstract AudioInputStream |
AudioFileReader.getAudioInputStream(InputStream stream)
Obtains an audio input stream from the input stream provided.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RowSet.setAsciiStream(int parameterIndex,
InputStream x)
Sets the designated parameter in this
RowSet object's command
to the given input stream. |
void |
RowSet.setAsciiStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter in this
RowSet object's command
to the given java.io.InputStream value. |
void |
RowSet.setAsciiStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
RowSet.setAsciiStream(String parameterName,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
RowSet.setBinaryStream(int parameterIndex,
InputStream x)
Sets the designated parameter in this
RowSet object's command
to the given input stream. |
void |
RowSet.setBinaryStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter in this
RowSet object's command
to the given java.io.InputStream value. |
void |
RowSet.setBinaryStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
RowSet.setBinaryStream(String parameterName,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
RowSet.setBlob(int parameterIndex,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
RowSet.setBlob(int parameterIndex,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
void |
RowSet.setBlob(String parameterName,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
RowSet.setBlob(String parameterName,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
| Modifier and Type | Field and Description |
|---|---|
protected InputStream |
BaseRowSet.asciiStream
The
InputStream object that will be
returned by the method getAsciiStream ,
which is specified in the ResultSet interface. |
protected InputStream |
BaseRowSet.binaryStream
The
InputStream object that will be
returned by the method getBinaryStream , which is
specified in the ResultSet interface. |
protected InputStream |
BaseRowSet.unicodeStream
The
InputStream object that will be
returned by the method getUnicodeStream ,
which is specified in the ResultSet interface. |
| Modifier and Type | Method and Description |
|---|---|
void |
WebRowSet.readXml(InputStream iStream)
Reads a stream based XML input to populate this
WebRowSet
object. |
void |
BaseRowSet.setAsciiStream(int parameterIndex,
InputStream x)
Sets the designated parameter in this
RowSet object's command
to the given input stream. |
void |
BaseRowSet.setAsciiStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter to the given
java.io.InputStream object,
which will have the specified number of bytes. |
void |
BaseRowSet.setAsciiStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
BaseRowSet.setAsciiStream(String parameterName,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
BaseRowSet.setBinaryStream(int parameterIndex,
InputStream x)
Sets the designated parameter in this
RowSet object's command
to the given input stream. |
void |
BaseRowSet.setBinaryStream(int parameterIndex,
InputStream x,
int length)
Sets the designated parameter to the given
java.io.InputStream
object, which will have the specified number of bytes. |
void |
BaseRowSet.setBinaryStream(String parameterName,
InputStream x)
Sets the designated parameter to the given input stream.
|
void |
BaseRowSet.setBinaryStream(String parameterName,
InputStream x,
int length)
Sets the designated parameter to the given input stream, which will have
the specified number of bytes.
|
void |
BaseRowSet.setBlob(int parameterIndex,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
BaseRowSet.setBlob(int parameterIndex,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
void |
BaseRowSet.setBlob(String parameterName,
InputStream inputStream)
Sets the designated parameter to a
InputStream object. |
void |
BaseRowSet.setBlob(String parameterName,
InputStream inputStream,
long length)
Sets the designated parameter to a
InputStream object. |
void |
BaseRowSet.setUnicodeStream(int parameterIndex,
InputStream x,
int length)
Deprecated.
getCharacterStream should be used in its place
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
SerialClob.getAsciiStream()
Retrieves the
CLOB value designated by this SerialClob
object as an ascii stream. |
InputStream |
SerialBlob.getBinaryStream()
Returns this
SerialBlob object as an input stream. |
InputStream |
SerialBlob.getBinaryStream(long pos,
long length)
Returns an
InputStream object that contains a partial
Blob value, starting with the byte specified by pos, which is
length bytes in length. |
InputStream |
SQLInputImpl.readAsciiStream()
Returns the next attribute in this
SQLInputImpl object
as a stream of ASCII characters. |
InputStream |
SQLInputImpl.readBinaryStream()
Returns the next attribute in this
SQLInputImpl object
as a stream of uninterpreted bytes. |
| Modifier and Type | Method and Description |
|---|---|
void |
SQLOutputImpl.writeAsciiStream(InputStream x)
Writes a stream of ASCII characters to this
SQLOutputImpl object. |
void |
SQLOutputImpl.writeBinaryStream(InputStream x)
Writes a stream of uninterpreted bytes to this
SQLOutputImpl
object. |
| Modifier and Type | Class and Description |
|---|---|
class |
ProgressMonitorInputStream
Monitors the progress of reading from some InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
protected InputStream |
JEditorPane.getStream(URL page)
Fetches a stream for the given URL, which is about to
be loaded by the
setPage method. |
| Modifier and Type | Method and Description |
|---|---|
void |
JEditorPane.read(InputStream in,
Object desc)
This method initializes from a stream.
|
| Constructor and Description |
|---|
ProgressMonitorInputStream(Component parentComponent,
Object message,
InputStream in)
Constructs an object to monitor the progress of an input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
SynthLookAndFeel.load(InputStream input,
Class<?> resourceBase)
Loads the set of
SynthStyle s that will be used by
this SynthLookAndFeel . |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
EditorKit.read(InputStream in,
Document doc,
int pos)
Inserts content from the given stream which is expected
to be in a format appropriate for this kind of content
handler.
|
void |
DefaultEditorKit.read(InputStream in,
Document doc,
int pos)
Inserts content from the given stream which is expected
to be in a format appropriate for this kind of content
handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RTFEditorKit.read(InputStream in,
Document doc,
int pos)
Insert content from the given stream which is expected
to be in a format appropriate for this kind of content
handler.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
FileObject.openInputStream()
Gets an InputStream for this file object.
|
InputStream |
SimpleJavaFileObject.openInputStream()
This implementation always throws UnsupportedOperationException.
|
InputStream |
ForwardingFileObject.openInputStream() |
| Modifier and Type | Method and Description |
|---|---|
int |
Tool.run(InputStream in,
OutputStream out,
OutputStream err,
String... arguments)
Run the tool with the given I/O channels and arguments.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
Unmarshaller.unmarshal(InputStream is)
Unmarshal XML data from the specified InputStream and return the
resulting content tree.
|
static <T> T |
JAXB.unmarshal(InputStream xml,
Class<T> type)
Reads in a Java object tree from the given XML input.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
AbstractUnmarshallerImpl.unmarshal(InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
OctetStreamData.getOctetStream()
Returns the input stream of this
OctetStreamData . |
| Constructor and Description |
|---|
OctetStreamData(InputStream octetStream)
Creates a new
OctetStreamData . |
OctetStreamData(InputStream octetStream,
String uri,
String mimeType)
Creates a new
OctetStreamData . |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
SignedInfo.getCanonicalizedData()
Returns the canonicalized signed info bytes after a signing or
validation operation.
|
InputStream |
Reference.getDigestInputStream()
Returns the pre-digested input stream, if
reference caching
is enabled.
|
| Modifier and Type | Method and Description |
|---|---|
Document |
DocumentBuilder.parse(InputStream is)
Parse the content of the given
InputStream as an XML
document and return a new DOM Document object. |
void |
SAXParser.parse(InputStream is,
DefaultHandler dh)
Parse the content of the given
InputStream
instance as XML using the specified
DefaultHandler . |
void |
SAXParser.parse(InputStream is,
DefaultHandler dh,
String systemId)
Parse the content of the given
InputStream
instance as XML using the specified
DefaultHandler . |
void |
SAXParser.parse(InputStream is,
HandlerBase hb)
Parse the content of the given
InputStream
instance as XML using the specified HandlerBase . |
void |
SAXParser.parse(InputStream is,
HandlerBase hb,
String systemId)
Parse the content of the given
InputStream
instance as XML using the specified HandlerBase . |
Document |
DocumentBuilder.parse(InputStream is,
String systemId)
Parse the content of the given
InputStream as an
XML document and return a new DOM Document object. |
| Modifier and Type | Method and Description |
|---|---|
abstract InputStream |
AttachmentPart.getBase64Content()
Returns an
InputStream which can be used to obtain the
content of AttachmentPart as Base64 encoded
character data, this method would base64 encode the raw bytes
of the attachment and return. |
abstract InputStream |
AttachmentPart.getRawContent()
Gets the content of this
AttachmentPart object as an
InputStream as if a call had been made to getContent and no
DataContentHandler had been registered for the
content-type of this AttachmentPart . |
| Modifier and Type | Method and Description |
|---|---|
abstract SOAPMessage |
MessageFactory.createMessage(MimeHeaders headers,
InputStream in)
Internalizes the contents of the given
InputStream object into a
new SOAPMessage object and returns the SOAPMessage
object. |
abstract void |
AttachmentPart.setBase64Content(InputStream content,
String contentType)
Sets the content of this attachment part from the Base64 source
InputStream and sets the value of the
Content-Type header to the value contained in
contentType , This method would first decode the base64
input and write the resulting raw bytes to the attachment. |
abstract void |
AttachmentPart.setRawContent(InputStream content,
String contentType)
Sets the content of this attachment part to that contained by the
InputStream content and sets the value of the
Content-Type header to the value contained in
contentType . |
| Modifier and Type | Method and Description |
|---|---|
abstract XMLEventReader |
XMLInputFactory.createXMLEventReader(InputStream stream)
Create a new XMLEventReader from a java.io.InputStream
|
abstract XMLEventReader |
XMLInputFactory.createXMLEventReader(InputStream stream,
String encoding)
Create a new XMLEventReader from a java.io.InputStream
|
abstract XMLEventReader |
XMLInputFactory.createXMLEventReader(String systemId,
InputStream stream)
Create a new XMLEventReader from a java.io.InputStream
|
abstract XMLStreamReader |
XMLInputFactory.createXMLStreamReader(InputStream stream)
Create a new XMLStreamReader from a java.io.InputStream
|
abstract XMLStreamReader |
XMLInputFactory.createXMLStreamReader(InputStream stream,
String encoding)
Create a new XMLStreamReader from a java.io.InputStream
|
abstract XMLStreamReader |
XMLInputFactory.createXMLStreamReader(String systemId,
InputStream stream)
Create a new XMLStreamReader from a java.io.InputStream
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
StreamSource.getInputStream()
Get the byte stream that was set with setByteStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
StreamSource.setInputStream(InputStream inputStream)
Set the byte stream to be used as input.
|
| Constructor and Description |
|---|
StreamSource(InputStream inputStream)
Construct a StreamSource from a byte stream.
|
StreamSource(InputStream inputStream,
String systemId)
Construct a StreamSource from a byte stream.
|
| Modifier and Type | Method and Description |
|---|---|
abstract InputStream |
HttpExchange.getRequestBody()
Returns a stream from which the request body can be read.
|
| Modifier and Type | Method and Description |
|---|---|
void |
GSSContext.acceptSecContext(InputStream inStream,
OutputStream outStream)
Called by the context acceptor to process a token from the peer using
streams.
|
void |
GSSContext.getMIC(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
Uses streams to produce a token containing a cryptographic MIC for
the supplied message, for transfer to the peer application.
|
int |
GSSContext.initSecContext(InputStream inStream,
OutputStream outStream)
Called by the context initiator to start the context creation
phase and process any tokens generated
by the peer's
acceptSecContext method using
streams. |
void |
GSSContext.unwrap(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
Uses streams to process tokens generated by the
wrap
method on the other side of the context. |
void |
GSSContext.verifyMIC(InputStream tokStream,
InputStream msgStream,
MessageProp msgProp)
Uses streams to verify the cryptographic MIC, contained in the token
parameter, over the supplied message.
|
void |
GSSContext.wrap(InputStream inStream,
OutputStream outStream,
MessageProp msgProp)
Applies per-message security services over the established security
context using streams.
|
| Constructor and Description |
|---|
Oid(InputStream derOid)
Creates an Oid object from its ASN.1 DER encoding.
|
| Modifier and Type | Class and Description |
|---|---|
class |
InputStream
InputStream is the Java API for reading IDL types
from CDR marshal streams.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
LSInput.getByteStream()
An attribute of a language and binding dependent type that represents
a stream of bytes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
LSInput.setByteStream(InputStream byteStream)
An attribute of a language and binding dependent type that represents
a stream of bytes.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
InputSource.getByteStream()
Get the byte stream for this input source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
InputSource.setByteStream(InputStream byteStream)
Set the byte stream for this input source.
|
| Constructor and Description |
|---|
InputSource(InputStream byteStream)
Create a new input source with a byte stream.
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.


Elastic search wrapper to make handling results easier.
Bases: dict
A dictionary like collection for creating faceted ResultSets.
Elastic Search doesn’t support nested facets, which are incredibly useful for things like faceting by build_status then by build_uuid. This is a client side implementation that processes a ResultSet with an ordered list of facets, and turns it into a data structure which is FacetSet -> FacetSet ... -> ResultSet (arbitrary nesting of FaceSets with ResultSet as the leaves.
Treat this basically like a dictionary (which it inherits from).
Bases: list
An easy iterator object for handling elasticsearch results.
pyelasticsearch returns very complex result structures, and manipulating them directly is both ugly and error prone. The point of this wrapper class is to give us a container that makes working with pyes results more natural.
For instance:
results = se.search(...)
for hit in results:
print hit.build_status
This greatly simplifies code that is interacting with search results, and allows us to handle some schema instability with elasticsearch, through adapting our __getattr__ methods.
Design goals for ResultSet are that it is an iterator, and that all the data that we want to work with is mapped to a flat attribute namespace (pyes goes way overboard with nesting, which is fine in the general case, but in the elastic_recheck case is just added complexity).
Bases: object
Wrapper for pyelasticsearch so that it returns result sets.
Search an elasticsearch server.
query parameter is the complicated query structure that pyelasticsearch uses. More details in their documentation.
size is the max number of results to return from the search engine. We default it to 1000 to ensure we don’t loose things. For certain classes of queries (like faceted ones), this can actually be set very low, as it won’t impact the facet counts.
recent search only most recent indexe(s), assuming this is basically a real time query that you only care about the last hour of time. Using recent dramatically reduces the load on the ES cluster.
days search only the last number of days.
The returned result is a ResultSet query.


Email address
We'll never share your email with anyone else.
Password
Example select
1
2
3
4
5
Example textarea
Check me out
Submit
Email address
We'll never share your email with anyone else.
Submit


m3/s
m
degrees
m/s
Hz
Synchronous speed(Nsyn):
Number of poles(P):
Height at inlet(B):
Runner diameter at inlet(D1):
Runner diameter at outlet(D2):
Runner blade angle at inlet(β1):
Guide vane angle at inlet(α1):
Net Positive Suction Head required(NPSHR):


Unfortunately, the app could not be loaded properly.
This site requires JavaScript. If you have disabled it, please enable JavaScript from your settings and try again.
If you have an Adblocker installed, consider disabling it for this site and try again. There are no ads on this site, but Adblockers still sometimes prevent JavaScript from working.
If the problem presists, please raise a ticket or write an email describing your problem and your browser, OS, etc.


$ export PATH=$PATH:$KEYCLOAK_HOME/bin
$ kcreg.sh
Client Registration CLI
Client Registration CLI
is a command line interface tool that can be used by application developers to configure new clients
to integrate with {book_project_name}. It is specifically designed to interact with Keycloak Client Registration REST endpoints.
It is necessary to create a new client configuration for each new application hosted on a unique hostname in order for Keycloak to be able to interact with the application (and vice-versa) and perform its function of providing a login page, SSO session management etc.
Client Registration CLI
allows you to configure application clients from a command line, and can be used in shell scripts as well.
To allow a particular user to use Client Registration CLI
a {book_project_name} administrator will typically use Admin Console
to configure
a new user, or configure a new client, and a client secret, to protect access to Client Registration REST API
.
Configuring a new regular user for use with Client Registration CLI
Login as admin
into Admin Console
(e.g. http://localhost:8080/auth/admin
). Select a realm you want to administer.
If you want to use existing user, select it for edit, otherwise create a new user. Go to Role Mappings
tab. Under
Client Roles
select realm-management
. Under Available Roles
select manage-client
for full set of client management
permissions. Alternatively you can choose view-clients
for read-only or create-client
for ability to create new clients.
These permissions grant user the capability to perform operations without the use of Initial Access Token
or
Registration Access Token
.
It’s possible to not assign users any of realm-management
roles. In that case user can still login with Registration Client CLI
but will not be able to use it without having possession of an Initial Access Token
. Trying to perform any operations
without it will result in 403 Forbidden
error.
Administrator can issue Initial Access Tokens
from Admin Console
by selecting Initial Access Token
tab under Realm Settings
.
Configuring a client for use with Client Registration CLI
By default the Client Registration CLI
identifies as admin-cli
client which is automatically configured for every new realm.
No additional client configuration is required when using login with a username. You may wish to strengthen security by
configuring the client Access Type
as Confidential
, and under Credentials
tab select ClientId and Secret
. When
running kcreg config credentials
you would then also have to provide a secret e.g. by using --secret
.
If you want to use a separate client configuration for Registration Client CLI
then you can create a new client - for
example you can call it reg-cli
. When running kcreg config credentials
you then need to specify a clientId
to use e.g. --client reg-cli
.
If you want to use a service account associated with the client, then you need to enable a service account. In Admin Client
you go to Clients
section, and select a client for edit. Then under Settings
first change Access Type
to Confidential
.
Then toggle Service Accounts Enabled
setting to On
, and Save
the configuration.
Under Credentials
tab you can choose to configure either Client Id and Secret
, or Signed JWT
.
You can now avoid specifying user when using kcreg config credentials
and only provide a client secret or keystore info.
Installing Client Registration CLI
Client Registration CLI is packaged inside Keycloak Server distribution. You can find execution scripts inside bin
directory.
The Linux script is called kcreg.sh
, and the one for Windows is called kcreg.bat
.
In order to setup the client to be used from any location on the filesystem you may want to add Keycloak server directory to your PATH.
On Linux:
On Windows:
c:\> set PATH=%PATH%;%KEYCLOAK_HOME%\bin
c:\> kcreg
Using Client Registration CLI
Usually a user will first start an authenticated session by providing credentials, then perform some CRUD operations.
For example on Linux:
$ kcreg.sh config credentials --server http://localhost:8080/auth --realm demo --user user --client reg-cli
$ kcreg.sh create -s clientId=my_client -s 'redirectUris=["http://localhost:8980/myapp/*"]'
$ kcreg.sh get my_client
Or on Windows:
c:\> kcreg config credentials --server http://localhost:8080/auth --realm demo --user user --client reg-cli
c:\> kcreg create -s clientId=my_client -s "redirectUris=[\"http://localhost:8980/myapp/*\"]"
c:\> kcreg get my_client
In a production environment Keycloak has to be accessed with https:
to avoid exposing tokens to network sniffers. If server’s
certificate is not issued by one of the trusted CAs that are included in Java’s default certificate truststore, then you will
need to prepare a truststore.jks file, and instruct Client Registration CLI
to use it.
For example on Linux:
$ kcreg.sh config truststore --trustpass $PASSWORD ~/.keycloak/truststore.jks
Or on Windows:
c:\> kcreg config truststore --trustpass %PASSWORD% %HOMEPATH%\.keycloak\truststore.jks
Logging In
When logging in with Client Registration CLI
you specify a server endpoint url, and a realm. Then you specify a username,
or alternatively you can only specify a client id, which will result in special service account being used. In the first case,
a password for the specified user has to be used at login. In the latter case there is no user password - only client secret
or a Signed JWT
is used.
Regardless of the method, the account that logs in needs to have proper permissions in order to be able to perform client registration operations. Keep in mind that any account can only have permissions to manage clients within the same realm. If you need to manage different realms, you need to configure users in different realms with permissions to manage clients.
Client Registration CLI
by itself does not support configuring the users, for that you would need to use Admin Console
web interface or Admin Client CLI
once it’s available.
When kcreg
successfully logs in it receives authorization tokens and saves them into a private config file so they can be
used for subsequent invocations. See next chapter for more info on configuration file.
See built-in help for more information on using Client Registration CLI
.
For example on Linux:
$ kcreg.sh help
Or on Windows:
c:\> kcreg help
See kcreg config credentials --help
for more information about starting an authenticated session.
Working with alternative configurations
By default, Client Registration CLI
automatically maintains a configuration file at a default location - .keycloak/kcreg.config
under user’s home directory.
You can use --config
option at any time to point to a different file / location. This way you can mantain multiple authenticated
sessions in parallel. It is safest to perform operations tied to a single config file from a single thread.
Make sure to not make a config file visible to other users on the system as it contains access tokens, and secrets that should be kept private.
You may want to avoid storing any secrets at all inside a config file for the price of less convenience and having to do more token requests.
In that case you can use --no-config
option with all your commands. You will have to specify all authentication info with each
kcreg
invocation.
Initial Access and Registration Access Tokens
Client Registration CLI
can be used by developers who don’t have an account configured at Keycloak server they want to use.
That’s possible when realm administrator issues developer an Initial Access Token
. It is up to realm administrator to decide
how to issue and distribute these tokens. Admin can limit an Initial Access Token by maximum age, and a total number of clients
that can be created with it. Many Initial Access Tokens can be created, and it’s up to realm administrator to distribute them.
Once a developer is in possession of Initial Access Token they can use it to create new clients without authenticating
with kcreg config credentials
. Rather, Initial Access Token can be stored in configuration, or specified as part of kcreg create
command.
For example on Linux:
$ kcreg.sh config initial-token $TOKEN
$ kcreg.sh create -s clientId=myclient
or
$ kcreg.sh create -s clientId=myclient -t $TOKEN
On Windows:
c:\> kcreg config initial-token %TOKEN%
c:\> kcreg create -s clientId=myclient
or
c:\> kcreg create -s clientId=myclient -t %TOKEN%
When Initial Access Token is used, the server response will include a newly issued Registration Access Token for client that was just created. Any subsequent operation for that client needs to be performed by authenticating with that token.
Client Registration CLI
automatically uses its private configuration file to save, and make use of this token for each
created client. As long as the same configuration file is used for all client operations, the developer will not need to
authenticate in order to read, update, or delete a client they created.
You can read more about Initial Access and Registration Access Tokens in Client Registration chapter.
See kcreg config initial-token --help
and kcreg config registration-token --help
for more information on how to configure them with Client Registration CLI
.
Performing CRUD operations
After authenticating with credentials or configuring Initial Access Token, the first operation will usually be to create a new client.
We’ve seen the simplest command to create a new client already. Often we may want to use a prepared JSON file as a template, and set / override some of the attributes. For example, this is how you read a JSON file in default client configuration format, override any clientId it may contain with a new one, override / set any other attributes as well, and after successful creation print the new client configuration to standard output.
On Linux:
$ kcreg.sh create -s clientId=myclient -f client-template.json -s baseUrl=/myclient -s 'redirectUris=["/myclient/*"]' -o
On Windows:
C:\> kcreg create -s clientId=myclient -f client-template.json -s baseUrl=/myclient -s "redirectUris=[\"/myclient/*\"]" -o
See kcreg create --help
for more information about kcreg create
.
You can use kcreg attrs
to list the available attributes. Note, that many configuration attributes are not checked for
validity or consistency. It is up to you to specify proper values. Also note, that you should not have any id
fields in your
template or specify them as arguments to kcreg create
.
Once a new client is created you can retrieve it again by using kcreg get
.
On Linux:
$ kcreg.sh get myclient
On Windows:
C:\> kcreg get myclient
You can also get an adapter configuration which you can drop into your web application in order to integrate with Keycloak server.
On Linux:
$ kcreg.sh get myclient -e install
On Windows:
C:\> kcreg get myclient -e install
See kcreg get --help
for more information about kcreg get
.
It’s simple to update client configurations as well. There are two modes of updating.
One is to submit a complete new state to the server after getting current configuration, saving it into a file, editing it, and posting it back.
On Linux:
$ kcreg.sh get myclient > myclient.json
$ vi myclient.json
$ kcreg.sh update myclient -f myclient.json
On Windows:
C:\> kcreg get myclient > myclient.json
C:\> notepad myclient.json
C:\> kcreg update myclient -f myclient.json
Another is to get current client, set or delete fields on it, and post it back all in one single step.
On Linux:
$ kcreg.sh update myclient -s enabled=false -d redirectUris
On Windows:
C:\> kcreg update myclient -s enabled=false -d redirectUris
You can even use a file that contains only changes to be applied so you don’t have to specify too many values as arguments.
In this case we specify --merge
to tell Client Registration CLI
that rather than treating mychanges.json as full
new configuration, it should see it as a set of attributes to be applied over existing configuration.
On Linux:
$ kcreg.sh update myclient --merge -d redirectUris -f mychanges.json
On Windows:
C:\> kcreg update myclient --merge -d redirectUris -f mychanges.json
See kcreg update --help
for more information about kcreg update
.
You may sometimes also need to delete a client.
On Linux:
$ kcreg.sh delete myclient
On Windows:
C:\> kcreg delete myclient
See kcreg delete --help
for more information about kcreg delete
.
Refreshing Invalid Registration Access Tokens
When performing CRUD operation using no-config
mode Client Registration CLI
can no longer handle Registration Access Tokens for you.
In that case it is possible to lose track of most recently issued Registration Access Token for a client, which makes it impossible to
perform any further CRUD operations on that client without using credentials of an account with 'manage-clients' permissions.
If you have permissions you can reissue a new Registration Access Token for the client, and have it printed to stdout or saved to a config
file of your choice. If not you have to ask realm administrator to reissue a new Registration Access Token for your client, and send it
to you. You can then use the token by passing it to any CRUD command via --token
option. You can also use kcreg config registration-token
command to save the new token in configuration file, and have Client Registration CLI
automatically handle it for you from that point on.
See kcreg update-token --help
for more information about kcreg update-token
.
Troubleshooting
-
Q: When logging in I get an error:
Parameter client_assertion_type is missing [invalid_client]
A: Your client is configured with
Signed JWT
token credentials which means you have to use--keystore
parameter when logging in.


Amazon's simple answer to Apple TV
Don’t call it a hobby. Amazon is serious about its living room aspirations and is about to launch a second-generation Fire TV media receiver. The company launched the original Fire TV a year-and-a-half ago, and it includes a similar feature set as the newly revamped Apple TV. From voice search to apps to games, the original Fire TV packs a punch, and the new one seems to be even stronger.
The company’s upcoming device was recently uncovered by Dave Zatz, who found the device listed on the FCC website under a shell name. A new microSD card slot is listed in the documentation along with 802.11ac, Bluetooth 4.1 connectivity, an ethernet port and USB port. But hardware specs doesn’t sell gadgets alone.
At this point it’s unclear if the new Fire TV packs an updated interface or renewed focus on gaming — both of which are needed to properly stand tall against the new Apple TV. And as Dave Zatz points out, 4k output, which could be a killer feature for some, is still up in the air.
Chances are good that the company is gearing up to launch this new model very soon. Amazon generally unveils new hardware in early fall, and Amazon currently lists the original Fire TV as unavailable.


class: top, right, inverse, title-slide # STT 2820 Chapter 11 ### Alan Arnholt ### updated: 2019-02-13 --- class: inverse, center, middle # Idea 1: Examine a Part of the Whole --- When we take a survey, we want to know something about an entire group. This group is called the **population**. What we want to know is the **parameter**. Typically, we take a smaller group from the big group and use it to make conclusions about the big group. The small group is the **sample**. The actual list of individuals from which a sample is chosen is the **sampling frame**. A sample that systematically misrepresents the population is **biased**. --- # Example 11.1 A computer network manager wants to test the reliability of some new and expensive fiber-optic Ethernet cables that the computer department just received. The computer department received 8 boxes containing 40 cables each. The manager does not have the time to test every cable in each box. The manager will choose one box at random and test 8 cables chosen randomly within that box. -- - What is the population? -- 320 cables - What is the population parameter of interest? -- reliability (percentage) of Ethernet cables that work - What is the sampling frame? -- randomly chosen box - What is the sample? -- 8 cables --- class: inverse, center, middle # Idea 2: Randomize To avoid **bias**, select the sample at random. --- # Example 11.2 * Sample heights outside a basketball locker room. -- Biased TALL. -- * Sample ages at a nursing home. -- Biased OLD --- class: inverse, center, middle # Idea 3: The Sample Size Matters! --- The actual size of a sample determines how accurate your results can be. * We always estimate parameters of the population: True, exist, unknown. -- * With statistics from the sample: known, can be calculated. -- * If a statistic that is computed from a sample reflects the value of the corresponding parameter, the sample is **representative**. Changes from one random sample to another are **sampling variability**. --- # Kinds of good Samples 1. census---a sample of the whole. Problems? cost, time, underrepresentation -- 2. simple random sample --- each sample of the same size has an equal chance of being chosen -- 3. stratified --- set the proportions of the sample to those in the population BEFORE sampling -- 4. cluster --- a group that is all together---represents the population as a whole. -- 5. systematic --- every `\(k^{th}\)` unit is chosen -- 6. multistage --- any combination of the above --- class: inverse, center, middle # To get a valid sample, several things must happen --- To get a valid sample, several things must happen: 1. Identify the population and select the best sampling frame you can. -- 2. Know what you want to know. -- 3. Ask specific questions. -- 4. Ask for numerical results. -- 5. Phrase carefully--even subtle differences can shade results. -- 6. Do what you can to reduce bias. -- 7. Run a pilot survey--test the survey on a small group -- 8. EDIT!!! Spend time and resources reducing biases. There is no way to recover from a biased sample or survey that asks biased questions. --- class: inverse, center, middle # What can go wrong? --- # In sampling? * Voluntary response samples---a group that is invited to respond, and only those who do are counted. A voluntary reponse bias ALWAYS invalidates a survey. -- Kinsey report, Ann Landers (kids) * Convenience sample --- pick an easy group. A convenience sample always invalidates results. -- The polls, reporters, political writers - they all believed Dewey was going to win by a landslide. While President Truman was still on the road campaigning, Newsweek polled 50 key political journalists to determine which candidate they thought would win. Appearing in the October 11 issue, Newsweek stated the results: all 50 believed Dewey would win. Dewey defeats Truman Chicago Daily Tribune, November 3, 1948 --- You remember President Dewey right? --- # In sampling? * Choosing a bad sampling frame * Udercoverage bias---Undercoverage bias occurs when some group is not sampled at all or is sampled less frequently than they occur in the population. * Non-reponse bias. Non-reponse bias is when a particular group categorically does not respond. --- class: inverse, center, middle # What can go wrong in design? --- # What can go wrong in design? * Long surveys -- * Biasing responses with lead-in statements yields response bias.


Interfacing between Ruby and Fortran (Via C)
(Spring - 2014)
Introduction
You might be thinking that Ruby and Fortran is an odd mixture... and you're certainly correct. But in addition to being an exercise in hooking things together, I feel that the languages complement each other:
| Ruby | Fortran |
|---|---|
| Elegant, expressive, & maleable... at the expense of speed and native support for matrix operations. | Awesome for numerical computing... at the expense of being rigid, unelegant and antiquated. |
| Has an extensive and vibrant community. (Modern codebase) | Historically established (Some things are only in Fortran) and rich (There are tons of Fortran programs sitting around on the web from years past.) (Large historical codebase) |
Overview:
- Fortran & C -- Calling a Fortran function from C
- Compilation Flags and Automation -- Creating a build script
- C and Ruby -- Calling a C function from Ruby
- Fortran from Ruby -- Putting it all together with the Sieve of Eratosthenes
- Benchmarks & Conclusion
I don't know if there's a reason or way to use this in production... but lets figure it out anyway!
If you're interested in the subject and you have time, you might want to check out the reference reading as well.
Section 1: Calling Fortran from C.
Lets first look at calling a Fortran function. This function will simply add to its integer parameter.
:::fortran ! test1.f08 function test_function(test_input) bind(c, name="test_function") result(test_output) use, intrinsic :: iso_c_binding implicit none integer(kind=c_int), intent(in) :: test_input integer(kind=c_int) :: test_output test_output = test_input + 10 end function test_function
Notable features:
- According to the GFortran spec, the bind statement is required. In practice, it allows us to specify the exported symbol name which by default has an extra underscore suffix.
- The iso_c_binding module is used to get interoperable datatypes. We make Fortran play by C's rules. Although I only used integers, there is a whole set of equivalents.
And then we're going to need the C program which calls it:
:::C // test1.c #include <stdio.h> int test_function(int *); // Equivalent to int test_function_(int*); int main() { int i = 10; int return_value; return_value = test_function(&i); // NOT equivalent to test_function_(&i) unless we omit bind(c, "test_function") printf("Return value was: %d\n", return_value); return 0; }
Notes:
- We forward-declare our imported function. If we omit bind(c), it doesn't seem to matter if this declaration has the underscore suffix.
- We pass the function parameter by reference... C can handle either method, but Fortran only handles by references.
- We can see that C recieves two different symbol names for our function depending on the bind statement.
Finally, we can compile, link and execute to prove our method works.
Section 2: Creating a Build Script
In order to compile our C files with Ruby support, we need to include the Ruby headers. This is most easily accomplished with rbconfig. Lets automate the process using a Rakefile:
:::ruby # Rakefile require 'rake/clean' require 'rbconfig' # Add our output files to clobber list so we can call 'rake clobber' CLOBBER.include('*.o', '*.so') # Use RbConfig to get the Ruby library locations for inclusion into our C programs. CFLAGS = RbConfig::CONFIG["CFLAGS"] HDRDIR = RbConfig::CONFIG["rubyhdrdir"] ARCHHDRDIR = RbConfig::CONFIG["rubyarchhdrdir"] # Task for test 1 (C and Fortran interop). # If you've never used Rake (or Make) before, our output files depend on the input files, # and the task being completed depends on us having those output files. task :test1 => ["test1_f.o", "test1_c.o"] file "test1_f.o" => "test1.f08" do |t| compile(t.prerequisites.first, t.name) end file "test1_c.o" => "test1.c" do |t| compile(t.prerequisites.first, t.name) end # Task for test 2 (Ruby and C interop) task :test2 => "test2.o" file "test2.o" => "test2.c" do |t| compile_c_for_ruby(t.prerequisites.first, t.name) end # Task for test 3 (Calling Fortran from Ruby through C) task :test3 => "sievemodule.so" task :default => :test3 file "sievemodule.so" => ["driver.o", "provider.o"] do |t| sh "gcc -shared -o sievemodule.so driver.o provider.o -lgfortran -lm -lruby" end file "driver.o" => "driver.c" do |t| compile_c_for_ruby(t.prerequisites.first, t.name) end file "provider.o" => "provider.f08" do |t| compile(t.prerequisites.first, t.name) end # Generic compilation function which works for both C and F08 files without special inclusions. def compile(src, target) sh "gcc -c -fPIC -o #{target} #{src}" end # Specific compilation function to include Ruby headers for C. def compile_c_for_ruby(src, target) sh "gcc -c -I #{ARCHHDRDIR} -I#{HDRDIR} #{CFLAGS} -o #{target} #{src}" end
Some features of our build script:
- We set up three commands: 'rake test1', 'rake test2' and 'rake test3' for compilation (and in the third case, linking together) and 'rake clobber' to remove our generated files.
- RbConfig provides the Ruby header locations and C compilation flags.
- Both the Fortran and C files are compiled with fPIC. (It's included in CFLAGS.)
- In the third case, the C and Fortran object code is linked into our sievemodule.so, linked against the GFortran, math and Ruby libraries.
With this in hand, we can proceed into the realm of C/Ruby integration...
Section 3: Calling C from Ruby
Calling C from Ruby is more complicated... Not only do we have to write our functional C code, but also have to create a ruby module & method using the tools provided with the Ruby header, and handle data types between the two languages. I strongly suggest looking over the Ruby/C Interop references to understand what's going on. This time, lets just print out a string.
:::C // test2.c #include "ruby.h" #include "stdio.h" VALUE TestModule = Qnil; VALUE method_test_function(VALUE self) { printf("Hello, Ruby. (From C)\n"); return 0; } void Init_testmodule() { TestModule = rb_define_module("TestModule"); rb_define_method(TestModule, "test_function", method_test_function, 0); }
Lets see what's going on here:
- We need to include the Ruby header, which requires an extra statement during compilation.
- C uses the VALUE type to represent Ruby data. Everything is an object, so everything in our interface code is a VALUE!
- We initialize our module, TestModule, to the Ruby nil datatype, Qnil.
- We define a method with the prefix 'method_'. Also, Ruby functions written in C need the 'VALUE self' argument even when our actual parameter count is zero.
- Every module calls its 'Init_' function when loaded, which we use to build our Ruby module object.
- We also define the method as belonging to the module. That last argument corresponds to parameter count.
The ruby script that consumes this, however, is blissfully simple:
:::Ruby # test2.rb require './testmodule.so' include TestModule test_function()
All we need to do is invoke our Rakefile in order to compile and then run the ruby driver.
rake test2 gcc -shared -o testmodule.so test2.o -lruby ruby test2.rb --> Hello, Ruby. (From C)
Section 4: Putting it Together: Calling Fortran from Ruby
Now we can put everything together. Lets so something slightly more interesting and calculate primes using the Sieve of Eratosthenes algorithm. First we need a Fortran subroutine to call:
subroutine sieve_of_eratosthenes(max_value, number_list) bind(c, name="sieve_of_eratosthenes") use, intrinsic :: iso_c_binding implicit none integer(kind=c_int), intent(in) :: max_value integer(kind=c_int), dimension(max_value), intent(out) :: number_list(max_value) integer(kind=c_int) :: outer_high_bound, inner_high_bound, i number_list = 1 number_list(1) = 0 outer_high_bound = int (sqrt (real (max_value))) inner_high_bound = max_value do i = 2, outer_high_bound if (number_list(i) == 1) number_list(i*i : max_value : i) = 0 end do end subroutine sieve_of_eratosthenes
Notes:
- Apparently a Fortran function won't let us pass an array as a parameter, but a subroutine will.
- We create an array to hold the value in C and pass the reference in to be filled by Fortran.
The C file serving as a middleman:
#include#include "ruby.h" int sieve_of_eratosthenes(int *, int *); VALUE SieveModule = Qnil; VALUE method_invoke_sieve(VALUE self, VALUE iterations) { int output [iterations], ii; VALUE result; int c_iterations = NUM2INT(iterations); if (c_iterations) { sieve_of_eratosthenes(&c_iterations, output); } result = rb_ary_new(); for(ii=0; ii<c_iterations; ii++) { int prime = ii + 1; rb_ary_push(result, INT2FIX(output[prime])); } return result; } void Init_sievemodule() { SieveModule = rb_define_module("SieveModule"); rb_define_method(SieveModule, "invoke_sieve", method_invoke_sieve, 1); }
Notes:
- We do a forward-declaration for the sieve subroutine and initialize our module variable to Ruby-nil.
- We build a ruby method which we package into a module and expose to Ruby below.
- There's a little bit of data-type-dancing going on... we accept a 'number' iterations from Ruby which needs to be converted into a C-int. Then when packing our array to return to Ruby, we want to convert integers into fixed numbers.
Now we can put the final piece in place: A very simple Ruby driver:
require './sievemodule.so' include SieveModule iterations = 1000 result = invoke_sieve(iterations) puts "Primes under #{iterations}:" result.each_with_index do |item, ii|; if result[ii] == 1 # Then value is a prime; Print it out. print ii + 2 print " " else # Value is composite. end end puts "\n"
Notes:
- The array we actually returned from the Sieve subroutine was a list of integers with '1' if that value is prime and '0' if not.
Now we just have to compile, link, and try it out:
Benchmarks and Conclusions
Methodology:
I tested three different implementations of the Sieve of Eratosthenes: My own Ruby/C/Fortran stack (shown above,) a pure Fortran implementation using the same core algorithm, and a pure Ruby implementation. (Codes for which have been lost but were completely basic implementations.)
Each program was tested against 10,000 iterations and 1,000,000 each. In addition, each run was repeated without I/O processing (printing of the prime numbers and determining which ones are prime.) For each circumstance, run time was measured with the Unix utility time 10 times and averaged (arithmetic mean.)
| Implementation | Run time (10,000) | Run time (1,000,000) | Description |
|---|---|---|---|
| Pure Ruby | 0.1566 (seconds) | 1.7979 s | I/O included |
| Pure Ruby | 0.0267 s | 0.6064 s | Computation only |
| Pure Fortran | 0.0138 s | 2.0481 s | I/O included |
| Pure Fortran | 0.003 s | 0.0192 s | Computation only |
| Full stack | 0.0393 s | 1.404 s | I/O included |
| Full stack | 0.0221 s | 0.0592 s | Computation only |
Conclusion:
Here we see that I/O is a significant factor, with Fortran actually coming in as the slowest when I/O is included. Naturally, it is lightning-fast again sans output. Note that this particular implementation of the Sieve requires the I/O routine to check which data are primes, increasing the load on that part of the full task while lessening the work done by the "computation only" circumstances.
Pure Ruby is on par with its C/Fortran extension given a small task with such an efficient algorithm. But after boosting the work up to 1 million integers, pure Ruby is left in the dust.
I conclude that a binary extension is definitely worth the time spent for Ruby scripts that need to do any significant calculation. We all already knew that, of course. I'm not sure that writing any new functions in Fortran is a better idea than writing them in C, because every new datatype is another torrent of complexity when you have to convert it back and forth.
Further investigation is needed to determine whether Fortran extensions would be even remotely robust. In addition, I intend to explore interfacing with existing legacy code, which is probably a much more viable use of Ruby/Fortran.
Thanks for reading! Hope you're inspired to play further with Fortran or Ruby.
References:
- [1] Pickaxe: C Extensions
- The quinessential 'learning Ruby' book, available online, discussing C extensions.
- [2] Eqqon & Matz: C Extension Libraries
- An annotated version of an explanatory text that Matz, creator of Ruby, checked somewhere into the source.
- [3] GFortran: Mixed Language Programming
- GCC Fortran compiler documentation on C/Fortran interoperation and extensions.
- [4] UCLA: C/Fortran Interoperation
- Example code and compilation options for C calling Fortran code, as well as Fortran calling C code.
- [5] GFortran: ISO_C_BINDING Intrinsic Module
- Documentation for the Fortran module intended for C interoperability. Good datatype reference.
- [5] Wikipedia: Sieve of Eratosthenes
- Wiki explanation of Sieve of Eratosthenes history and algorithm


| explain {dplyr} | R Documentation |
This is a generic function which gives more details about an object than
print()
, and is more focused on human readable output than
str()
.
explain(x, ...) show_query(x, ...)
x |
An object to explain |
... |
Other parameters possibly used by generic |
The first argument, invisibly.
Explaining a tbl_sql
will run the SQL EXPLAIN
command which
will describe the query plan. This requires a little bit of knowledge about
how EXPLAIN
works for your database, but is very useful for
diagnosing performance problems.
if (require("dbplyr")) { lahman_s <- lahman_sqlite() batting <- tbl(lahman_s, "Batting") batting %>% show_query() batting %>% explain() # The batting database has indices on all ID variables: # SQLite automatically picks the most restrictive index batting %>% filter(lgID == "NL" & yearID == 2000L) %>% explain() # OR's will use multiple indexes batting %>% filter(lgID == "NL" | yearID == 2000) %>% explain() # Joins will use indexes in both tables teams <- tbl(lahman_s, "Teams") batting %>% left_join(teams, c("yearID", "teamID")) %>% explain() }


Changing out printer cartridges the other day, it occurred to me that magenta and yellow offer no inspiration as subject matter for a song.
But you could write a little ditty about black and cyan.
How do you catch a unique bird?
Unique up on it.
Darth Vader: I know what you are getting for Christmas.
Luke: That's impossible. How could you know that?
Darth Vader: I have felt your presents.
How do you get an elephant up a tree?
Plant an acorn. Have the elephant stand where you planted it. Wait 50 years.
How do you drown a hipster?
Throw him in the mainstream.
Guy 1: I've got some ants.
Guy 2: I've got ants too, but mine are taller.
Guy 1: Yeah, well I've got a tube of glue.
Guy 2: I've got an entire tin of glue.
Guy 1: I've got a loaf of bread!
Guy 2: I can't handle that, because of my glue tin and taller ants.


Welcome to The Flower Studio !!
We have the most beautiful & fragnant flowers in our shop. We have all in one place. so just don't worry and order a flower..
We have the most beautiful & fragnant flowers in our shop. We have all in one place. so just don't worry and order a flower..


The model's 3D view has many built in features that can be accessed as the program is running.
It the ‘x’, ‘y’ or ‘z’ key is pressed during a mouse action, the actions affects only this coordinate. Note also that these actions are are modified if the 3D view is projected onto a 2D plane.
Right-clicking within a 3D view displays a popup menu as shown below.


Products available to trade
Dry Split Ginger
Arabic Gum
Bird eye chili pepper
Groundnut
Hibiscus Siftings
Hibiscus whole flower


LCD Remote Controller
Print Text
Print Text cannot be empty
Oops something went wrong!
Success!! Check your LCD display
Submit


Source code for contributed.parallel_map
import numpy
_multi=False
_ncpus=1
try:
# May raise ImportError
import multiprocessing
_multi=True
# May raise NotImplementedError
_ncpus = multiprocessing.cpu_count()
except:
pass
__all__ = ('parallel_map',)
def worker(f, ii, chunk, out_q, err_q, lock):
"""
A worker function that maps an input function over a
slice of the input iterable.
:param f : callable function that accepts argument from iterable
:param ii : process ID
:param chunk: slice of input iterable
:param out_q: thread-safe output queue
:param err_q: thread-safe queue to populate on exception
:param lock : thread-safe lock to protect a resource
( useful in extending parallel_map() )
"""
vals = []
# iterate over slice
for val in chunk:
try:
result = f(val)
except Exception, e:
err_q.put(e)
return
vals.append(result)
# output the result and task ID to output queue
out_q.put( (ii, vals) )
def run_tasks(procs, err_q, out_q, num):
"""
A function that executes populated processes and processes
the resultant array. Checks error queue for any exceptions.
:param procs: list of Process objects
:param out_q: thread-safe output queue
:param err_q: thread-safe queue to populate on exception
:param num : length of resultant array
"""
# function to terminate processes that are still running.
die = (lambda vals : [val.terminate() for val in vals
if val.exitcode is None])
try:
for proc in procs:
proc.start()
for proc in procs:
proc.join()
except Exception, e:
# kill all slave processes on ctrl-C
die(procs)
raise e
if not err_q.empty():
# kill all on any exception from any one slave
die(procs)
raise err_q.get()
# Processes finish in arbitrary order. Process IDs double
# as index in the resultant array.
results=[None]*num;
while not out_q.empty():
idx, result = out_q.get()
results[idx] = result
try:
# Remove extra dimension added by array_split
return list(numpy.concatenate(results))
except ValueError:
return results
[docs]def parallel_map(function, sequence, numcores=None):
"""
A parallelized version of the native Python map function that
utilizes the Python multiprocessing module to divide and
conquer sequence.
parallel_map does not yet support multiple argument sequences.
:param function: callable function that accepts argument from iterable
:param sequence: iterable sequence
:param numcores: number of cores to use
"""
if not callable(function):
raise TypeError("input function '%s' is not callable" %
repr(function))
if not numpy.iterable(sequence):
raise TypeError("input '%s' is not iterable" %
repr(sequence))
size = len(sequence)
if not _multi or size == 1:
return map(function, sequence)
if numcores is None:
numcores = _ncpus
# Returns a started SyncManager object which can be used for sharing
# objects between processes. The returned manager object corresponds
# to a spawned child process and has methods which will create shared
# objects and return corresponding proxies.
manager = multiprocessing.Manager()
# Create FIFO queue and lock shared objects and return proxies to them.
# The managers handles a server process that manages shared objects that
# each slave process has access to. Bottom line -- thread-safe.
out_q = manager.Queue()
err_q = manager.Queue()
lock = manager.Lock()
# if sequence is less than numcores, only use len sequence number of
# processes
if size < numcores:
numcores = size
# group sequence into numcores-worth of chunks
sequence = numpy.array_split(sequence, numcores)
procs = [multiprocessing.Process(target=worker,
args=(function, ii, chunk, out_q, err_q, lock))
for ii, chunk in enumerate(sequence)]
return run_tasks(procs, err_q, out_q, numcores)
if __name__ == "__main__":
"""
Unit test of parallel_map()
Create an arbitrary length list of references to a single
matrix containing random floats and compute the eigenvals
in serial and parallel. Compare the results and timings.
"""
import time
numtasks = 5
#size = (1024,1024)
size = (512,512)
vals = numpy.random.rand(*size)
f = numpy.linalg.eigvals
iterable = [vals]*numtasks
print ('Running numpy.linalg.eigvals %iX on matrix size [%i,%i]' %
(numtasks,size[0],size[1]))
tt = time.time()
presult = parallel_map(f, iterable)
print 'parallel map in %g secs' % (time.time()-tt)
tt = time.time()
result = map(f, iterable)
print 'serial map in %g secs' % (time.time()-tt)
assert (numpy.asarray(result) == numpy.asarray(presult)).all()


Chicken in Red Wine Vinegar Sauce
- ⏲ Prep time: 15 min
- 🍳 Cook time: 25 min
- 🍽 Servings: 6
Ingredients
- 3 tablespoons/~44 milliliters extra-virgin olive oil
- 1 tablespoon/~14 grams unsalted butter
- 1 whole chicken, cut into 10 pieces (alternatively, use breasts or legs)
- 4 shallots, finely chopped
- 1 cup/720 milliliters red wine vinegar
- 1 cup/240 milliliters crème fraîche or heavy cream
- Finely chopped parsley (optional)
Directions
- Rub each piece of chicken in salt and pepper mixture.
- Heat oil and melt butter in deep-sided, 12-inch (~30 centimeter) sauté pan on medium-high heat. When the oil is hot, but not smoking, use tongs to add chicken skin side down.
- Brown both sides until skin is golden brown and chicken is cooked, about 12-15 minutes. Remove chicken to a platter and cover loosely with aluminum foil to keep warm.
- Pour out half of oil from pan, and use other half to brown shallots over medium-high heat. Slowly add vinegar and boil until reduced to almost a syrup. Add crème fraîche/cream and cook until blended and brown, about 5 minutes. Return chicken to pan to coat and heat.
- Return chicken to platter. Add garnish if available, and serve.
Contribution
Recipe tags:
chicken
french
wine


# Vary: Accept for all the requests to jpeg and png
SetEnvIf Request_URI "\.(jpe?g|png)$" REQUEST_image
RewriteEngine On
# If the Browser supports WebP images, and the .webp file exists, use it.
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
RewriteCond %{REQUEST_FILENAME}.webp -f
RewriteRule ^/?(.*)$ $1.webp [NC,T=image/webp,END]
{% if auto_convert %}
# If the Browser supports WebP images, and the .webp file does not exist, generate it.
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_URI} ^/?storage/.*\.(jpe?g|png)
RewriteCond %{REQUEST_FILENAME}\.webp !-f
RewriteRule ^/?(.*)$ plugins/offline/responsiveimages/webp.php?path=$1 [NC,END]
{% endif %}
Header append Vary Accept env=REQUEST_image
AddType image/webp .webp


Flask News
Home
BBC
SOURCES
TOP HEADLINES
{% for new, des, i, read, pub in context%}
{{new}}
{{des}}
Published at:
{{pub}}
Read More
{% endfor%}


[§124A-139] Aiding the enemy. Any person subject to this chapter who:
(1) Aids, or attempts to aid, the enemy with arms, ammunition, supplies, money, or other things; or
(2) Without proper authority, knowingly harbors or protects or gives intelligence to, or communicates or corresponds with or holds any intercourse with the enemy, either directly or indirectly;
shall be punished as a court-martial may direct. [L 1982, c 171, pt of §2]


Open Pampas [ax10], plain, in Mandoria, peasants: 141
Last updated Turn #136
Open Pampas [ax10], plain, in Mandoria, peasants: 141
------------------------------------------------------------------------
22: The Savvy Aardvark [ha5r], ship, 2 hulls, 1 rowing port, 6 sails,
22: 22% damaged, arrived from Ocean [aw10], owner:
22: Phantasm [n4b], Imperial Empire, duke, with two workers,
22: eight sailors
23: The Savvy Aardvark [ha5r], ship, 2 hulls, 1 rowing port, 6 sails,
23: 22% damaged, departed for Ocean [ay10].
30: The fog has cleared.
30: The population grows by one peasant.
Routes leaving Open Pampas:
North, to Ocean [aw10], The Outer Sea, 2 days
East, plain, to Open Pampas [ax11], 7 days
South, to Ocean [ay10], Crystal Sea, 2 days
West, to Ocean [ax09], The Outer Sea, 2 days
Seen here:
Pack of wolves [dw7n], wolves, number: 8