Stability: 2 - Stable
A stream is an abstract interface for working with streaming data in Node.js.
The stream
module provides a base API that makes it easy to build objects
that implement the stream interface.
There are many stream objects provided by Node.js. For instance, a
request to an HTTP server and process.stdout
are both stream instances.
Streams can be readable, writable, or both. All streams are instances of
EventEmitter
.
The stream
module can be accessed using:
const stream = require('stream');
While it is important for all Node.js users to understand how streams works,
the stream
module itself is most useful for developer's that are creating new
types of stream instances. Developer's who are primarily consuming stream
objects will rarely (if ever) have need to use the stream
module directly.
This document is divided into two primary sections and third section for additional notes. The first section explains the elements of the stream API that are required to use streams within an application. The second section explains the elements of the API that are required to implement new types of streams.
There are four fundamental stream types within Node.js:
fs.createReadStream()
).fs.createWriteStream()
).net.Socket
).zlib.createDeflate()
).All streams created by Node.js APIs operate exclusively on strings and Buffer
objects. It is possible, however, for stream implementations to work with other
types of JavaScript values (with the exception of null
which serves a special
purpose within streams). Such streams are considered to operate in "object
mode".
Stream instances are switched into object mode using the objectMode
option
when the stream is created. Attempting to switch an existing stream into
object mode is not safe.
Both Writable and Readable streams will store data in an internal
buffer that can be retrieved using writable._writableState.getBuffer()
or
readable._readableState.buffer
, respectively.
The amount of data potentially buffered depends on the highWaterMark
option
passed into the streams constructor. For normal streams, the highWaterMark
option specifies a total number of bytes. For streams operating in object mode,
the highWaterMark
specifies a total number of objects.
Data is buffered in Readable streams when the implementation calls
stream.push(chunk)
. If the consumer of the Stream does not
call stream.read()
, the data will sit in the internal
queue until it is consumed.
Once the total size of the internal read buffer reaches the threshold specified
by highWaterMark
, the stream will temporarily stop reading data from the
underlying resource until the data currently buffered can be consumed (that is,
the stream will stop calling the internal readable._read()
method that is
used to fill the read buffer).
Data is buffered in Writable streams when the
writable.write(chunk)
method is called repeatedly. While the
total size of the internal write buffer is below the threshold set by
highWaterMark
, calls to writable.write()
will return true
. Once the
the size of the internal buffer reaches or exceeds the highWaterMark
, false
will be returned.
A key goal of the stream
API, and in particular the stream.pipe()
method,
is to limit the buffering of data to acceptable levels such that sources and
destinations of differing speeds will not overwhelm the available memory.
Because Duplex and Transform streams are both Readable and Writable,
each maintain two separate internal buffers used for reading and writing,
allowing each side to operate independently of the other while maintaining an
appropriate and efficient flow of data. For example, net.Socket
instances
are Duplex streams whose Readable side allows consumption of data received
from the socket and whose Writable side allows writing data to the socket.
Because data may be written to the socket at a faster or slower rate than data
is received, it is important each side operate (and buffer) independently of
the other.
Almost all Node.js applications, no matter how simple, use streams in some manner. The following is an example of using streams in a Node.js application that implements an HTTP server:
const http = require('http');
const server = http.createServer( (req, res) => {
// req is an http.IncomingMessage, which is a Readable Stream
// res is an http.ServerResponse, which is a Writable Stream
let body = '';
// Get the data as utf8 strings.
// If an encoding is not set, Buffer objects will be received.
req.setEncoding('utf8');
// Readable streams emit 'data' events once a listener is added
req.on('data', (chunk) => {
body += chunk;
});
// the end event indicates that the entire body has been received
req.on('end', () => {
try {
const data = JSON.parse(body);
} catch (er) {
// uh oh! bad json!
res.statusCode = 400;
return res.end(`error: ${er.message}`);
}
// write back something interesting to the user:
res.write(typeof data);
res.end();
});
});
server.listen(1337);
// $ curl localhost:1337 -d '{}'
// object
// $ curl localhost:1337 -d '"foo"'
// string
// $ curl localhost:1337 -d 'not json'
// error: Unexpected token o
Writable streams (such as res
in the example) expose methods such as
write()
and end()
that are used to write data onto the stream.
Readable streams use the EventEmitter
API for notifying application
code when data is available to be read off the stream. That available data can
be read from the stream in multiple ways.
Both Writable and Readable streams use the EventEmitter
API in
various ways to communicate the current state of the stream.
Duplex and Transform streams are both Writable and Readable.
Applications that are either writing data to or consuming data from a stream
are not required to implement the stream interfaces directly and will generally
have no reason to call require('stream')
.
Developers wishing to implement new types of streams should refer to the section API for Stream Implementers.
Writable streams are an abstraction for a destination to which data is written.
Examples of Writable streams include:
process.stdout
, process.stderr
Note: Some of these examples are actually Duplex streams that implement the Writable interface.
All Writable streams implement the interface defined by the
stream.Writable
class.
While specific instances of Writable streams may differ in various ways, all Writable streams follow the same fundamental usage pattern as illustrated in the example below:
const myStream = getWritableStreamSomehow();
myStream.write('some data');
myStream.write('some more data');
myStream.end('done writing data');
The 'close'
event is emitted when the stream and any of its underlying
resources (a file descriptor, for example) have been closed. The event indicates
that no more events will be emitted, and no further computation will occur.
Not all Writable streams will emit the 'close'
event.
If a call to stream.write(chunk)
returns false
, the
'drain'
event will be emitted when it is appropriate to resume writing data
to the stream.
// Write the data to the supplied writable stream one million times.
// Be attentive to back-pressure.
function writeOneMillionTimes(writer, data, encoding, callback) {
let i = 1000000;
write();
function write() {
var ok = true;
do {
i--;
if (i === 0) {
// last time!
writer.write(data, encoding, callback);
} else {
// see if we should continue, or wait
// don't pass the callback, because we're not done yet.
ok = writer.write(data, encoding);
}
} while (i > 0 && ok);
if (i > 0) {
// had to stop early!
// write some more once it drains
writer.once('drain', write);
}
}
}
The 'error'
event is emitted if an error occurred while writing or piping
data. The listener callback is passed a single Error
argument when called.
Note: The stream is not closed when the 'error'
event is emitted.
The 'finish'
event is emitted after the stream.end()
method
has been called, and all data has been flushed to the underlying system.
const writer = getWritableStreamSomehow();
for (var i = 0; i < 100; i ++) {
writer.write('hello, #${i}!\n');
}
writer.end('This is the end\n');
writer.on('finish', () => {
console.error('All writes are now complete.');
});
src
{stream.Readable} source stream that is piping to this writableThe 'pipe'
event is emitted when the stream.pipe()
method is called on
a readable stream, adding this writable to its set of destinations.
const writer = getWritableStreamSomehow();
const reader = getReadableStreamSomehow();
writer.on('pipe', (src) => {
console.error('something is piping into the writer');
assert.equal(src, reader);
});
reader.pipe(writer);
The 'unpipe'
event is emitted when the stream.unpipe()
method is called
on a Readable stream, removing this Writable from its set of
destinations.
const writer = getWritableStreamSomehow();
const reader = getReadableStreamSomehow();
writer.on('unpipe', (src) => {
console.error('Something has stopped piping into the writer.');
assert.equal(src, reader);
});
reader.pipe(writer);
reader.unpipe(writer);
The writable.cork()
method forces all written data to be buffered in memory.
The buffered data will be flushed when either the stream.uncork()
or
stream.end()
methods are called.
The primary intent of writable.cork()
is to avoid a situation where writing
many small chunks of data to a stream do not cause an backup in the internal
buffer that would have an adverse impact on performance. In such situations,
implementations that implement the writable._writev()
method can perform
buffered writes in a more optimized manner.
chunk
{String|Buffer|any} Optional data to write. For streams not operating
in object mode, chunk
must be a string or a Buffer
. For object mode
streams, chunk
may be any JavaScript value other than null
.encoding
{String} The encoding, if chunk
is a Stringcallback
{Function} Optional callback for when the stream is finishedCalling the writable.end()
method signals that no more data will be written
to the Writable. The optional chunk
and encoding
arguments allow one
final additional chunk of data to be written immediately before closing the
stream. If provided, the optional callback
function is attached as a listener
for the 'finish'
event.
Calling the stream.write()
method after calling
stream.end()
will raise an error.
// write 'hello, ' and then end with 'world!'
const file = fs.createWriteStream('example.txt');
file.write('hello, ');
file.end('world!');
// writing more now is not allowed!
encoding
{String} The new default encodingthis
The writable.setDefaultEncoding()
method sets the default encoding
for a
Writable stream.
The writable.uncork()
method flushes all data buffered since
stream.cork()
was called.
When using writable.cork()
and writable.uncork()
to manage the buffering
of writes to a stream, it is recommended that calls to writable.uncork()
be
deferred using process.nextTick()
. Doing so allows batching of all
writable.write()
calls that occur within a given Node.js event loop phase.
stream.cork();
stream.write('some ');
stream.write('data ');
process.nextTick(() => stream.uncork());
If the writable.cork()
method is called multiple times on a stream, the same
number of calls to writable.uncork()
must be called to flush the buffered
data.
stream.cork();
stream.write('some ');
stream.cork();
stream.write('data ');
process.nextTick(() => {
stream.uncork();
// The data will not be flushed until uncork() is called a second time.
stream.uncork();
});
chunk
{String|Buffer} The data to writeencoding
{String} The encoding, if chunk
is a Stringcallback
{Function} Callback for when this chunk of data is flushedfalse
if the stream wishes for the calling code to
wait for the 'drain'
event to be emitted before continuing to write
additional data; otherwise true
.The writable.write()
method writes some data to the stream, and calls the
supplied callback
once the data has been fully handled. If an error
occurs, the callback
may or may not be called with the error as its
first argument. To reliably detect write errors, add a listener for the
'error'
event.
The return value indicates whether the written chunk
was buffered internally
and the buffer has exceeded the highWaterMark
configured when the stream was
created. If false
is returned, further attempts to write data to the stream
should be paused until the 'drain'
event is emitted.
A Writable stream in object mode will always ignore the encoding
argument.
Readable streams are an abstraction for a source from which data is consumed.
Examples of Readable streams include:
process.stdin
All Readable streams implement the interface defined by the
stream.Readable
class.
Readable streams effectively operate in one of two modes: flowing and paused.
When in flowing mode, data is read from the underlying system automatically
and provided to an application as quickly as possible using events via the
EventEmitter
interface.
In paused mode, the stream.read()
method must be called
explicitly to read chunks of data from the stream.
All Readable streams begin in paused mode but can be switched to flowing mode in one of the following ways:
'data'
event handler.stream.resume()
method.stream.pipe()
method to send the data to a Writable.The Readable can switch back to paused mode using one of the following:
stream.pause()
method.'data'
event
handlers, and removing all pipe destinations by calling the
stream.unpipe()
method.The important concept to remember is that a Readable will not generate data until a mechanism for either consuming or ignoring that data is provided. If the consuming mechanism is disabled or taken away, the Readable will attempt to stop generating the data.
Note: For backwards compatibility reasons, removing 'data'
event
handlers will not automatically pause the stream. Also, if there are piped
destinations, then calling stream.pause()
will not guarantee
that the stream will remain paused once those destinations drain and ask for
more data.
Note: If a Readable is switched into flowing mode and there are no
consumers available handle the data, that data will be lost. This can occur,
for instance, when the readable.resume()
method is called without a listener
attached to the 'data'
event, or when a 'data'
event handler is removed
from the stream.
The "two modes" of operation for a Readable stream are a simplified abstraction for the more complicated internal state management that is happening within the Readable stream implementation.
Specifically, at any given point in time, every Readable is in one of three possible states:
readable._readableState.flowing = null
readable._readableState.flowing = false
readable._readableState.flowing = true
When readable._readableState.flowing
is null
, no mechanism for consuming the
streams data is provided so the stream will not generate its data.
Attaching a listener for the 'data'
event, calling the readable.pipe()
method, or calling the readable.resume()
method will switch
readable._readableState.flowing
to true
, causing the Readable to begin
actively emitting events as data is generated.
Calling readable.pause()
, readable.unpipe()
, or receiving "back pressure"
will cause the readable._readableState.flowing
to be set as false
,
temporarily halting the flowing of events but not halting the generation of
data.
While readable._readableState.flowing
is false
, data may be accumulating
within the streams internal buffer.
The Readable stream API evolved across multiple Node.js versions and provides multiple methods of consuming stream data. In general, developers should choose one of the methods of consuming data and should never use multiple methods to consume data from a single stream.
Use of the readable.pipe()
method is recommended for most users as it has been
implemented to provide the easiest way of consuming stream data. Developers that
require more fine-grained control over the transfer and generation of data can
use the EventEmitter
and readable.pause()
/readable.resume()
APIs.
The 'close'
event is emitted when the stream and any of its underlying
resources (a file descriptor, for example) have been closed. The event indicates
that no more events will be emitted, and no further computation will occur.
Not all Readable streams will emit the 'close'
event.
chunk
{Buffer|String|any} The chunk of data. For streams that are not
operating in object mode, the chunk will be either a string or Buffer
.
For streams that are in object mode, the chunk can be any JavaScript value
other than null
.The 'data'
event is emitted whenever the stream is relinquishing ownership of
a chunk of data to a consumer. This may occur whenever the stream is switched
in flowing mode by calling readable.pipe()
, readable.resume()
, or by
attaching a listener callback to the 'data'
event. The 'data'
event will
also be emitted whenever the readable.read()
method is called and a chunk of
data is available to be returned.
Attaching a 'data'
event listener to a stream that has not been explicitly
paused will switch the stream into flowing mode. Data will then be passed as
soon as it is available.
The listener callback will be passed the chunk of data as a string if a default
encoding has been specified for the stream using the
readable.setEncoding()
method; otherwise the data will be passed as a
Buffer
.
const readable = getReadableStreamSomehow();
readable.on('data', (chunk) => {
console.log(`Received ${chunk.length} bytes of data.`);
});
The 'end'
event is emitted when there is no more data to be consumed from
the stream.
Note: The 'end'
event will not be emitted unless the data is
completely consumed. This can be accomplished by switching the stream into
flowing mode, or by calling stream.read()
repeatedly until
all data has been consumed.
const readable = getReadableStreamSomehow();
readable.on('data', (chunk) => {
console.log(`Received ${chunk.length} bytes of data.`);
});
readable.on('end', () => {
console.log('There will be no more data.');
});
The 'error'
event may be emitted by a Readable implementation at any time.
Typically, this may occur if the underlying stream in unable to generate data
due to an underlying internal failure, or when a stream implementation attempts
to push an invalid chunk of data.
The listener callback will be passed a single Error
object.
The 'readable'
event is emitted when there is data available to be read from
the stream. In some cases, attaching a listener for the 'readable'
event will
cause some amount of data to be read into an internal buffer.
const readable = getReadableStreamSomehow();
readable.on('readable', () => {
// there is some data to read now
});
The 'readable'
event will also be emitted once the end of the stream data
has been reached but before the 'end'
event is emitted.
Effectively, the 'readable'
event indicates that the stream has new
information: either new data is available or the end of the stream has been
reached. In the former case, stream.read()
will return the
available data. In the latter case, stream.read()
will return
null
. For instance, in the following example, foo.txt
is an empty file:
const fs = require('fs');
const rr = fs.createReadStream('foo.txt');
rr.on('readable', () => {
console.log('readable:', rr.read());
});
rr.on('end', () => {
console.log('end');
});
The output of running this script is:
$ node test.js
readable: null
end
Note: In general, the readable.pipe()
and 'data'
event mechanisms are
preferred over the use of the 'readable'
event.
The readable.isPaused()
method returns the current operating state of the
Readable. This is used primarily by the mechanism that underlies the
readable.pipe()
method. In most typical cases, there will be no reason to
use this method directly.
const readable = new stream.Readable
readable.isPaused() // === false
readable.pause()
readable.isPaused() // === true
readable.resume()
readable.isPaused() // === false
this
The readable.pause()
method will cause a stream in flowing mode to stop
emitting 'data'
events, switching out of flowing mode. Any data that
becomes available will remain in the internal buffer.
const readable = getReadableStreamSomehow();
readable.on('data', (chunk) => {
console.log(`Received ${chunk.length} bytes of data.`);
readable.pause();
console.log('There will be no additional data for 1 second.');
setTimeout(() => {
console.log('Now data will start flowing again.');
readable.resume();
}, 1000);
});
destination
{stream.Writable} The destination for writing dataoptions
{Object} Pipe optionsend
{Boolean} End the writer when the reader ends. Defaults to true
.The readable.pipe()
method attaches a Writable stream to the readable
,
causing it to switch automatically into flowing mode and push all of its data
to the attached Writable. The flow of data will be automatically managed so
that the destination Writable stream is not overwhelmed by a faster Readable
stream.
The following example pipes all of the data from the readable
into a file
named file.txt
:
const readable = getReadableStreamSomehow();
const writable = fs.createWriteStream('file.txt');
// All the data from readable goes into 'file.txt'
readable.pipe(writable);
It is possible to attach multiple Writable streams to a single Readable stream.
The readable.pipe()
method returns a reference to the destination stream
making it possible to set up chains of piped streams:
const r = fs.createReadStream('file.txt');
const z = zlib.createGzip();
const w = fs.createWriteStream('file.txt.gz');
r.pipe(z).pipe(w);
By default, stream.end()
is called on the destination Writable
stream when the source Readable stream emits 'end'
, so that the
destination is no longer writable. To disable this default behavior, the end
option can be passed as false
, causing the destination stream to remain open,
as illustrated in the following example:
reader.pipe(writer, { end: false });
reader.on('end', () => {
writer.end('Goodbye\n');
});
One important caveat is that if the Readable stream emits an error during processing, the Writable destination is not closed automatically. If an error occurs, it will be necessary to manually close each stream in order to prevent memory leaks.
Note: The process.stderr
and process.stdout
Writable streams are
never closed until the Node.js process exits, regardless of the specified
options.
size
{Number} Optional argument to specify how much data to read.The readable.read()
method pulls some data out of the internal buffer and
returns it. If no data available to be read, null
is returned. By default,
the data will be returned as a Buffer
object unless an encoding has been
specified using the readable.setEncoding()
method or the stream is operating
in object mode.
The optional size
argument specifies a specific number of bytes to read. If
size
bytes are not available to be read, null
will be returned unless
the stream has ended, in which case all of the data remaining in the internal
buffer will be returned (even if it exceeds size
bytes).
If the size
argument is not specified, all of the data contained in the
internal buffer will be returned.
The readable.read()
method should only be called on Readable streams operating
in paused mode. In flowing mode, readable.read()
is called automatically until
the internal buffer is fully drained.
const readable = getReadableStreamSomehow();
readable.on('readable', () => {
var chunk;
while (null !== (chunk = readable.read())) {
console.log(`Received ${chunk.length} bytes of data.`);
}
});
In general, it is recommended that developers avoid the use of the 'readable'
event and the readable.read()
method in favor of using either
readable.pipe()
or the 'data'
event.
A Readable stream in object mode will always return a single item from
a call to readable.read(size)
, regardless of the value of the
size
argument.
Note: If the readable.read()
method returns a chunk of data, a 'data'
event will also be emitted.
Note: Calling stream.read([size])
after the 'end'
event has been emitted will return null
. No runtime error will be raised.
this
The readable.resume()
method causes an explicitly paused Readable stream to
resume emitting 'data'
events, switching the stream into flowing mode.
The readable.resume()
method can be used to fully consume the data from a
stream without actually processing any of that data as illustrated in the
following example:
getReadableStreamSomehow()
.resume()
.on('end', () => {
console.log('Reached the end, but did not read anything.');
});
encoding
{String} The encoding to use.this
The readable.setEncoding()
method sets the default character encoding for
data read from the Readable stream.
Setting an encoding causes the stream data
to be returned as string of the specified encoding rather than as Buffer
objects. For instance, calling readable.setEncoding('utf8')
will cause the
output data will be interpreted as UTF-8 data, and passed as strings. Calling
readable.setEncoding('hex')
will cause the data to be encoded in hexadecimal
string format.
The Readable stream will properly handle multi-byte characters delivered through
the stream that would otherwise become improperly decoded if simply pulled from
the stream as Buffer
objects.
Encoding can be disabled by calling readable.setEncoding(null)
. This approach
is useful when working with binary data or with large multi-byte strings spread
out over multiple chunks.
const readable = getReadableStreamSomehow();
readable.setEncoding('utf8');
readable.on('data', (chunk) => {
assert.equal(typeof chunk, 'string');
console.log('got %d characters of string data', chunk.length);
});
destination
{stream.Writable} Optional specific stream to unpipeThe readable.unpipe()
method detaches a Writable stream previously attached
using the stream.pipe()
method.
If the destination
is not specified, then all pipes are detached.
If the destination
is specified, but no pipe is set up for it, then
the method does nothing.
const readable = getReadableStreamSomehow();
const writable = fs.createWriteStream('file.txt');
// All the data from readable goes into 'file.txt',
// but only for the first second
readable.pipe(writable);
setTimeout(() => {
console.log('Stop writing to file.txt');
readable.unpipe(writable);
console.log('Manually close the file stream');
writable.end();
}, 1000);
chunk
{Buffer|String} Chunk of data to unshift onto the read queueThe readable.unshift()
method pushes a chunk of data back into the internal
buffer. This is useful in certain situations where a stream is being consumed by
code that needs to "un-consume" some amount of data that it has optimistically
pulled out of the source, so that the data can be passed on to some other party.
Note: The stream.unshift(chunk)
method cannot be called after the
'end'
event has been emitted or a runtime error will be thrown.
Developers using stream.unshift()
often should consider switching to
use of a Transform stream instead. See the API for Stream Implementers
section for more information.
// Pull off a header delimited by \n\n
// use unshift() if we get too much
// Call the callback with (error, header, stream)
const StringDecoder = require('string_decoder').StringDecoder;
function parseHeader(stream, callback) {
stream.on('error', callback);
stream.on('readable', onReadable);
const decoder = new StringDecoder('utf8');
var header = '';
function onReadable() {
var chunk;
while (null !== (chunk = stream.read())) {
var str = decoder.write(chunk);
if (str.match(/\n\n/)) {
// found the header boundary
var split = str.split(/\n\n/);
header += split.shift();
const remaining = split.join('\n\n');
const buf = Buffer.from(remaining, 'utf8');
if (buf.length)
stream.unshift(buf);
stream.removeListener('error', callback);
stream.removeListener('readable', onReadable);
// now the body of the message can be read from the stream.
callback(null, header, stream);
} else {
// still reading the header.
header += str;
}
}
}
}
Note: Unlike stream.push(chunk)
, stream.unshift(chunk)
will not end the reading process by resetting the internal reading state of the
stream. This can cause unexpected results if readable.unshift()
is called
during a read (i.e. from within a stream._read()
implementation on a custom stream). Following the call to readable.unshift()
with an immediate stream.push('')
will reset the reading state
appropriately, however it is best to simply avoid calling readable.unshift()
while in the process of performing a read.
stream
{Stream} An "old style" readable streamVersions of Node.js prior to v0.10 had streams that did not implement the
entire stream
module API as it is currently defined. (See Compatibility
for more information.)
When using an older Node.js library that emits 'data'
events and has a
stream.pause()
method that is advisory only, the
readable.wrap()
method can be used to create a Readable stream that uses
the old stream as its data source.
It will rarely be necessary to use readable.wrap()
but the method has been
provided as a convenience for interacting with older Node.js applications and
libraries.
For example:
const OldReader = require('./old-api-module.js').OldReader;
const Readable = require('stream').Readable;
const oreader = new OldReader;
const myReader = new Readable().wrap(oreader);
myReader.on('readable', () => {
myReader.read(); // etc.
});
Duplex streams are streams that implement both the Readable and Writable interfaces.
Examples of Duplex streams include:
Transform streams are Duplex streams where the output is in some way related to the input. Like all Duplex streams, Transform streams implement both the Readable and Writable interfaces.
Examples of Transform streams include:
The stream
module API has been designed to make it possible to easily
implement streams using JavaScript's prototypical inheritance model.
First, a stream developer would declare a new JavaScript class that extends one
of the four basic stream classes (stream.Writable
, stream.Readable
,
stream.Duplex
, or stream.Transform
), making sure the call the appropriate
parent class constructor:
const Writable = require('stream').Writable;
class MyWritable extends Writable {
constructor(options) {
super(options);
}
}
The new stream class must then implement one or more specific methods, depending on the type of stream being created, as detailed in the chart below:
|
Use-case |
Class |
Method(s) to implement |
|---|---|---|
|
Reading only |
||
|
Writing only |
||
|
Reading and writing |
||
|
Operate on written data, then read the result |
Note: The implementation code for a stream should never call the "public" methods of a stream that are intended for use by consumers (as described in the API for Stream Consumers section). Doing so may lead to adverse side effects in application code consuming the stream.
For many simple cases, it is possible to construct a stream without relying on
inheritance. This can be accomplished by directly creating instances of the
stream.Writable
, stream.Readable
, stream.Duplex
or stream.Transform
objects and passing appropriate methods as constructor options.
For example:
const Writable = require('stream').Writable;
const myWritable = new Writable({
write(chunk, encoding, callback) {
// ...
}
});
The stream.Writable
class is extended to implement a Writable stream.
Custom Writable streams must call the new stream.Writable([options])
constructor and implement the writable._write()
method. The
writable._writev()
method may also be implemented.
options
{Object}highWaterMark
{Number} Buffer level when
stream.write()
starts returning false
. Defaults to
16384
(16kb), or 16
for objectMode
streams.decodeStrings
{Boolean} Whether or not to decode strings into
Buffers before passing them to stream._write()
.
Defaults to true
objectMode
{Boolean} Whether or not the
stream.write(anyObj)
is a valid operation. When set,
it becomes possible to write JavaScript values other than string or
Buffer
if supported by the stream implementation. Defaults to false
write
{Function} Implementation for the
stream._write()
method.writev
{Function} Implementation for the
stream._writev()
method.For example:
const Writable = require('stream').Writable;
class MyWritable extends Writable {
constructor(options) {
// Calls the stream.Writable() constructor
super(options);
}
}
Or, when using pre-ES6 style constructors:
const Writable = require('stream').Writable;
const util = require('util');
function MyWritable(options) {
if (!(this instanceof MyWritable))
return new MyWritable(options);
Writable.call(this, options);
}
util.inherits(MyWritable, Writable);
Or, using the Simplified Constructor approach:
const Writable = require('stream').Writable;
const myWritable = new Writable({
write(chunk, encoding, callback) {
// ...
},
writev(chunks, callback) {
// ...
}
});
chunk
{Buffer|String} The chunk to be written. Will always
be a buffer unless the decodeStrings
option was set to false
.encoding
{String} If the chunk is a string, then encoding
is the
character encoding of that string. If chunk is a Buffer
, or if the
stream is operating in object mode, encoding
may be ignored.callback
{Function} Call this function (optionally with an error
argument) when processing is complete for the supplied chunk.All Writable stream implementations must provide a
writable._write()
method to send data to the underlying
resource.
Note: Transform streams provide their own implementation of the
writable._write()
.
Note: This function MUST NOT be called by application code directly. It should be implemented by child classes, and called only by the internal Writable class methods only.
The callback
method must be called to signal either that the write completed
successfully or failed with an error. The first argument passed to the
callback
must be the Error
object if the call failed or null
if the
write succeeded.
It is important to note that all calls to writable.write()
that occur between
the time writable._write()
is called and the callback
is called will cause
the written data to be buffered. Once the callback
is invoked, the stream will
emit a 'drain'
event. If a stream implementation is capable of processing
multiple chunks of data at once, the writable._writev()
method should be
implemented.
If the decodeStrings
property is set in the constructor options, then
chunk
may be a string rather than a Buffer, and encoding
will
indicate the character encoding of the string. This is to support
implementations that have an optimized handling for certain string
data encodings. If the decodeStrings
property is explicitly set to false
,
the encoding
argument can be safely ignored, and chunk
will always be a
Buffer
.
The writable._write()
method is prefixed with an underscore because it is
internal to the class that defines it, and should never be called directly by
user programs.
chunks
{Array} The chunks to be written. Each chunk has following
format: { chunk: ..., encoding: ... }
.callback
{Function} A callback function (optionally with an error
argument) to be invoked when processing is complete for the supplied chunks.Note: This function MUST NOT be called by application code directly. It should be implemented by child classes, and called only by the internal Writable class methods only.
The writable._writev()
method may be implemented in addition to
writable._write()
in stream implementations that are capable of processing
multiple chunks of data at once. If implemented, the method will be called with
all chunks of data currently buffered in the write queue.
The writable._writev()
method is prefixed with an underscore because it is
internal to the class that defines it, and should never be called directly by
user programs.
It is recommended that errors occurring during the processing of the
writable._write()
and writable._writev()
methods are reported by invoking
the callback and passing the error as the first argument. This will cause an
'error'
event to be emitted by the Writable. Throwing an Error from within
writable._write()
can result in expected and inconsistent behavior depending
on how the stream is being used. Using the callback ensures consistent and
predictable handling of errors.
const Writable = require('stream').Writable;
const myWritable = new Writable({
write(chunk, encoding, callback) {
if (chunk.toString().indexOf('a') >= 0) {
callback(new Error('chunk is invalid'));
} else {
callback();
}
}
});
The following illustrates a rather simplistic (and somewhat pointless) custom Writable stream implementation. While this specific Writable stream instance is not of any real particular usefulness, the example illustrates each of the required elements of a custom Writable stream instance:
const Writable = require('stream').Writable;
class MyWritable extends Writable {
constructor(options) {
super(options);
}
_write(chunk, encoding, callback) {
if (chunk.toString().indexOf('a') >= 0) {
callback(new Error('chunk is invalid'));
} else {
callback();
}
}
}
The stream.Readable
class is extended to implement a Readable stream.
Custom Readable streams must call the new stream.Readable([options])
constructor and implement the readable._read()
method.
options
{Object}highWaterMark
{Number} The maximum number of bytes to store in
the internal buffer before ceasing to read from the underlying
resource. Defaults to 16384
(16kb), or 16
for objectMode
streamsencoding
{String} If specified, then buffers will be decoded to
strings using the specified encoding. Defaults to null
objectMode
{Boolean} Whether this stream should behave
as a stream of objects. Meaning that stream.read(n)
returns
a single value instead of a Buffer of size n. Defaults to false
read
{Function} Implementation for the stream._read()
method.For example:
const Readable = require('stream').Readable;
class MyReadable extends Readable {
constructor(options) {
// Calls the stream.Readable(options) constructor
super(options);
}
}
Or, when using pre-ES6 style constructors:
const Readable = require('stream').Readable;
const util = require('util');
function MyReadable(options) {
if (!(this instanceof MyReadable))
return new MyReadable(options);
Readable.call(this, options);
}
util.inherits(MyReadable, Readable);
Or, using the Simplified Constructor approach:
const Readable = require('stream').Readable;
const myReadable = new Readable({
read(size) {
// ...
}
});
size
{Number} Number of bytes to read asynchronouslyNote: This function MUST NOT be called by application code directly. It should be implemented by child classes, and called only by the internal Readable class methods only.
All Readable stream implementations must provide an implementation of the
readable._read()
method to fetch data from the underlying resource.
When readable._read()
is called, if data is available from the resource, the
implementation should begin pushing that data into the read queue using the
this.push(dataChunk)
method. _read()
should continue reading
from the resource and pushing data until readable.push()
returns false
. Only
when _read()
is called again after it has stopped should it resume pushing
additional data onto the queue.
Note: Once the readable._read()
method has been called, it will not be
called again until the readable.push()
method is called.
The size
argument is advisory. For implementations where a "read" is a
single operation that returns data can use the size
argument to determine how
much data to fetch. Other implementations may ignore this argument and simply
provide data whenever it becomes available. There is no need to "wait" until
size
bytes are available before calling stream.push(chunk)
.
The readable._read()
method is prefixed with an underscore because it is
internal to the class that defines it, and should never be called directly by
user programs.
chunk
{Buffer|Null|String} Chunk of data to push into the read queueencoding
{String} Encoding of String chunks. Must be a valid
Buffer encoding, such as 'utf8'
or 'ascii'
true
if additional chunks of data may continued to be
pushed; false
otherwise.When chunk
is a Buffer
or string
, the chunk
of data will be added to the
internal queue for users of the stream to consume. Passing chunk
as null
signals the end of the stream (EOF), after which no more data can be written.
When the Readable is operating in paused mode, the data added with
readable.push()
can be read out by calling the
readable.read()
method when the 'readable'
event is
emitted.
When the Readable is operating in flowing mode, the data added with
readable.push()
will be delivered by emitting a 'data'
event.
The readable.push()
method is designed to be as flexible as possible. For
example, when wrapping a lower-level source that provides some form of
pause/resume mechanism, and a data callback, the low-level source can be wrapped
by the custom Readable instance as illustrated in the following example:
// source is an object with readStop() and readStart() methods,
// and an `ondata` member that gets called when it has data, and
// an `onend` member that gets called when the data is over.
class SourceWrapper extends Readable {
constructor(options) {
super(options);
this._source = getLowlevelSourceObject();
// Every time there's data, push it into the internal buffer.
this._source.ondata = (chunk) => {
// if push() returns false, then stop reading from source
if (!this.push(chunk))
this._source.readStop();
};
// When the source ends, push the EOF-signaling `null` chunk
this._source.onend = () => {
this.push(null);
};
}
// _read will be called when the stream wants to pull more data in
// the advisory size argument is ignored in this case.
_read(size) {
this._source.readStart();
}
}
Note: The readable.push()
method is intended be called only by Readable
Implementers, and only from within the readable._read()
method.
It is recommended that errors occurring during the processing of the
readable._read()
method are emitted using the 'error'
event rather than
being thrown. Throwing an Error from within readable._read()
can result in
expected and inconsistent behavior depending on whether the stream is operating
in flowing or paused mode. Using the 'error'
event ensures consistent and
predictable handling of errors.
const Readable = require('stream').Readable;
const myReadable = new Readable({
read(size) {
if (checkSomeErrorCondition()) {
process.nextTick(() => this.emit('error', err));
return;
}
// do some work
}
});
The following is a basic example of a Readable stream that emits the numerals from 1 to 1,000,000 in ascending order, and then ends.
const Readable = require('stream').Readable;
class Counter extends Readable {
constructor(opt) {
super(opt);
this._max = 1000000;
this._index = 1;
}
_read() {
var i = this._index++;
if (i > this._max)
this.push(null);
else {
var str = '' + i;
var buf = Buffer.from(str, 'ascii');
this.push(buf);
}
}
}
A Duplex stream is one that implements both Readable and Writable, such as a TCP socket connection.
Because Javascript does not have support for multiple inheritance, the
stream.Duplex
class is extended to implement a Duplex stream (as opposed
to extending the stream.Readable
and stream.Writable
classes).
Note: The stream.Duplex
class prototypically inherits from stream.Readable
and parasitically from stream.Writable
.
Custom Duplex streams must call the new stream.Duplex([options])
constructor and implement both the readable._read()
and
writable._write()
methods.
options
{Object} Passed to both Writable and Readable
constructors. Also has the following fields:allowHalfOpen
{Boolean} Defaults to true
. If set to false
, then
the stream will automatically end the readable side when the
writable side ends and vice versa.readableObjectMode
{Boolean} Defaults to false
. Sets objectMode
for readable side of the stream. Has no effect if objectMode
is true
.writableObjectMode
{Boolean} Defaults to false
. Sets objectMode
for writable side of the stream. Has no effect if objectMode
is true
.For example:
const Duplex = require('stream').Duplex;
class MyDuplex extends Duplex {
constructor(options) {
super(options);
}
}
Or, when using pre-ES6 style constructors:
const Duplex = require('stream').Duplex;
const util = require('util');
function MyDuplex(options) {
if (!(this instanceof MyDuplex))
return new MyDuplex(options);
Duplex.call(this, options);
}
util.inherits(MyDuplex, Duplex);
Or, using the Simplified Constructor approach:
const Duplex = require('stream').Duplex;
const myDuplex = new Duplex({
read(size) {
// ...
},
write(chunk, encoding, callback) {
// ...
}
});
The following illustrates a simple example of a Duplex stream that wraps a hypothetical lower-level source object to which data can be written, and from which data can be read, albeit using an API that is not compatible with Node.js streams. The following illustrates a simple example of a Duplex stream that buffers incoming written data via the Writable interface that is read back out via the Readable interface.
const Duplex = require('stream').Duplex;
const kSource = Symbol('source');
class MyDuplex extends Duplex {
constructor(source, options) {
super(options);
this[kSource] = source;
}
_write(chunk, encoding, callback) {
// The underlying source only deals with strings
if (Buffer.isBuffer(chunk))
chunk = chunk.toString(encoding);
this[kSource].writeSomeData(chunk, encoding);
callback();
}
_read(size) {
this[kSource].fetchSomeData(size, (data, encoding) => {
this.push(Buffer.from(data, encoding));
});
}
}
The most important aspect of a Duplex stream is that the Readable and Writable sides operate independently of one another despite co-existing within a single object instance.
For Duplex streams, objectMode
can be set exclusively for either the Readable
or Writable side using the readableObjectMode
and writableObjectMode
options
respectively.
In the following example, for instance, a new Transform stream (which is a type of Duplex stream) is created that has an object mode Writable side that accepts JavaScript numbers that are converted to hexidecimal strings on the Readable side.
const Transform = require('stream').Transform;
// All Transform streams are also Duplex Streams
const myTransform = new Transform({
writableObjectMode: true,
transform(chunk, encoding, callback) {
// Coerce the chunk to a number if necessary
chunk |= 0;
// Transform the chunk into something else.
const data = chunk.toString(16);
// Push the data onto the readable queue.
callback(null, '0'.repeat(data.length % 2) + data);
}
});
myTransform.setEncoding('ascii');
myTransform.on('data', (chunk) => console.log(chunk));
myTransform.write(1);
// Prints: 01
myTransform.write(10);
// Prints: 0a
myTransform.write(100);
// Prints: 64
A Transform stream is a Duplex stream where the output is computed in some way from the input. Examples include zlib streams or crypto streams that compress, encrypt, or decrypt data.
Note: There is no requirement that the output be the same size as the input,
the same number of chunks, or arrive at the same time. For example, a
Hash stream will only ever have a single chunk of output which is
provided when the input is ended. A zlib
stream will produce output
that is either much smaller or much larger than its input.
The stream.Transform
class is extended to implement a Transform stream.
The stream.Transform
class prototypically inherits from stream.Duplex
and
implements its own versions of the writable._write()
and readable._read()
methods. Custom Transform implementations must implement the
transform._transform()
method and may also implement
the transform._flush()
method.
Note: Care must be taken when using Transform streams in that data written to the stream can cause the Writable side of the stream to become paused if the output on the Readable side is not consumed.
options
{Object} Passed to both Writable and Readable
constructors. Also has the following fields:transform
{Function} Implementation for the
stream._transform()
method.flush
{Function} Implementation for the stream._flush()
method.For example:
const Transform = require('stream').Transform;
class MyTransform extends Transform {
constructor(options) {
super(options);
}
}
Or, when using pre-ES6 style constructors:
const Transform = require('stream').Transform;
const util = require('util');
function MyTransform(options) {
if (!(this instanceof MyTransform))
return new MyTransform(options);
Transform.call(this, options);
}
util.inherits(MyTransform, Transform);
Or, using the Simplified Constructor approach:
const Transform = require('stream').Transform;
const myTransform = new Transform({
transform(chunk, encoding, callback) {
// ...
}
});
The 'finish'
and 'end'
events are from the stream.Writable
and stream.Readable
classes, respectively. The 'finish'
event is emitted
after stream.end()
is called and all chunks have been processed
by stream._transform()
. The 'end'
event is emitted
after all data has been output, which occurs after the callback in
transform._flush()
has been called.
callback
{Function} A callback function (optionally with an error
argument) to be called when remaining data has been flushed.Note: This function MUST NOT be called by application code directly. It should be implemented by child classes, and called only by the internal Readable class methods only.
In some cases, a transform operation may need to emit an additional bit of
data at the end of the stream. For example, a zlib
compression stream will
store an amount of internal state used to optimally compress the output. When
the stream ends, however, that additional data needs to be flushed so that the
compressed data will be complete.
Custom Transform implementations may implement the transform._flush()
method. This will be called when there is no more written data to be consumed,
but before the 'end'
event is emitted signaling the end of the
Readable stream.
Within the transform._flush()
implementation, the readable.push()
method
may be called zero or more times, as appropriate. The callback
function must
be called when the flush operation is complete.
The transform._flush()
method is prefixed with an underscore because it is
internal to the class that defines it, and should never be called directly by
user programs.
chunk
{Buffer|String} The chunk to be transformed. Will always
be a buffer unless the decodeStrings
option was set to false
.encoding
{String} If the chunk is a string, then this is the
encoding type. If chunk is a buffer, then this is the special
value - 'buffer', ignore it in this case.callback
{Function} A callback function (optionally with an error
argument and data) to be called after the supplied chunk
has been
processed.Note: This function MUST NOT be called by application code directly. It should be implemented by child classes, and called only by the internal Readable class methods only.
All Transform stream implementations must provide a _transform()
method to accept input and produce output. The transform._transform()
implementation handles the bytes being written, computes an output, then passes
that output off to the readable portion using the readable.push()
method.
The transform.push()
method may be called zero or more times to generate
output from a single input chunk, depending on how much is to be output
as a result of the chunk.
It is possible that no output is generated from any given chunk of input data.
The callback
function must be called only when the current chunk is completely
consumed. The first argument passed to the callback
must be an Error
object
if an error occurred while processing the input or null
otherwise. If a second
argument is passed to the callback
, it will be forwarded on to the
readable.push()
method. In other words the following are equivalent:
transform.prototype._transform = function (data, encoding, callback) {
this.push(data);
callback();
};
transform.prototype._transform = function (data, encoding, callback) {
callback(null, data);
};
The transform._transform()
method is prefixed with an underscore because it
is internal to the class that defines it, and should never be called directly by
user programs.
The stream.PassThrough
class is a trivial implementation of a Transform
stream that simply passes the input bytes across to the output. Its purpose is
primarily for examples and testing, but there are some use cases where
stream.PassThrough
is useful as a building block for novel sorts of streams.
In versions of Node.js prior to v0.10, the Readable stream interface was simpler, but also less powerful and less useful.
stream.read()
method,
'data'
events would begin emitting immediately. Applications that
would need to perform some amount of work to decide how to handle data
were required to store read data into buffers so the data would not be lost.stream.pause()
method was advisory, rather than
guaranteed. This meant that it was still necessary to be prepared to receive
'data'
events even when the stream was in a paused state.In Node.js v0.10, the Readable class was added. For backwards compatibility
with older Node.js programs, Readable streams switch into "flowing mode" when a
'data'
event handler is added, or when the
stream.resume()
method is called. The effect is that, even
when not using the new stream.read()
method and
'readable'
event, it is no longer necessary to worry about losing
'data'
chunks.
While most applications will continue to function normally, this introduces an edge case in the following conditions:
'data'
event listener is added.stream.resume()
method is never called.For example, consider the following code:
// WARNING! BROKEN!
net.createServer((socket) => {
// we add an 'end' method, but never consume the data
socket.on('end', () => {
// It will never get here.
socket.end('The message was received but was not processed.\n');
});
}).listen(1337);
In versions of Node.js prior to v0.10, the incoming message data would be simply discarded. However, in Node.js v0.10 and beyond, the socket remains paused forever.
The workaround in this situation is to call the
stream.resume()
method to begin the flow of data:
// Workaround
net.createServer((socket) => {
socket.on('end', () => {
socket.end('The message was received but was not processed.\n');
});
// start the flow of data, discarding it.
socket.resume();
}).listen(1337);
In addition to new Readable streams switching into flowing mode,
pre-v0.10 style streams can be wrapped in a Readable class using the
readable.wrap()
method.
readable.read(0)
There are some cases where it is necessary to trigger a refresh of the
underlying readable stream mechanisms, without actually consuming any
data. In such cases, it is possible to call readable.read(0)
, which will
always return null
.
If the internal read buffer is below the highWaterMark
, and the
stream is not currently reading, then calling stream.read(0)
will trigger
a low-level stream._read()
call.
While most applications will almost never need to do this, there are situations within Node.js where this is done, particularly in the Readable stream class internals.
readable.push('')
Use of readable.push('')
is not recommended.
Pushing a zero-byte string or Buffer
to a stream that is not in object mode
has an interesting side effect. Because it is a call to
readable.push()
, the call will end the reading process.
However, because the argument is an empty string, no data is added to the
readable buffer so there is nothing for a user to consume.


Tees Used Motors offer a small but quality range of used vehicles
across all price ranges.
You can buy with confidence as all of our vehicles come with:
12 Months MOT
6 Months RAC Breakdown
HPI Check
Part Ex considered and vehicle delivery available.


- Recommend buying shares in Medicine
- Contact McLaren


Have questions about how Bitcoin works under-the-hood?
You've come to the right place.
You want to see code and the nitty-gritty details? What are you waiting for?
If you want to start slowly and have the technical details explained to you at your own pace, start here.


Toggle navigation
Implicit Control Panel
Home
File System
Test Study
Deploy
Track Study
RDE
My Profile
Logout
My Studies
Studies
New Study
Study
Status
Statistics
Test
Deploy
×
Please remember to
Logout
for classified security.


- Register
- Assessment
- Override
- Interview
- Enrolment
Client: Soban Kahn
Assessment
| Visa grant number |<PHONE_NUMBER>234 |
|---|---|
| Visa subclass | 136 |
| 2nd VAC | Paid |
| Visa commencement date | 5 January 2018 |
| Date of birth | 10 Jan 1978 |
| Gender | Male |
| Country of birth | Afghanistan |
| Language | Farsi |
| Principal applicant | Yes |
0
days remaining for registration
05 Jul 2018
109
days remaining to enrol
05 Jan 2019
1570
days to entitlement end
04 Jan 2023
Key
- NYA
- Not yet achieved
- PLA
- Pre level A
- PLB
- Pre level B


Nickname
Set JamEater's Nickname In Your Server
Nickname
Save
Prefix
Set JamEater's Prefix In Your Server
Prefix
Save
Starboard
Configure the starboard system.
Starboard Channel:
Save
Star limit
Save
Welcome
Configure the welcome system.

Leave Channel:
Save


How could it come to pass that two languages as different as Java and Javascript could have nearly the same name?
It's a story that I happen to know a little bit about and therein lies a tale.
of the midnight ride of Paul Revere.
--Henry Wadsworth Longfellow
In the early 90's I was working at Apple, "between Jobs" as they say. I started as a young QA engineer on a scripting language called HyperTalk which was used for a hypertext environment called HyperCard. It was created by the inventor of Quicktime and an original Macintosh team member, the brilliant Bill Atkinson. The language had not been formally defined though Bill had a pretty clear idea of what he wanted. Having a formal grammar gives you something to test against so I wrote a grammar for it. That grammar became the basis of, or at least a resource for several texts on the language as well as some follow on languages, as was evident by the naming conventions I chose and a few little errors I made that got copied for years.
It looked like something like this, with some modifications I added in later languge projects:
my_ref = a reference to all fields named "quotation"
set the style of the text of my_ref to (bold, italic)
set the path of image "sunset" to "../images/sunset.jpg"
Imagine the code you'd have to write in JavaScript or JQuery for that today and you'll get an idea of its simple power.
After a stint in international marketing I returned to scripting languages workking on AppleScript and the underlying library that provided the ability for any application to connect the scripting language to it's DOM.
Being able to specify elements in a page based on the DOM regardless of the underlying data representation was rather novel in 1992.
I had a sabbatical coming up, and so on my way out the door I stopped by Tech Support to chat. Like many Silicon Valley firms, Apple had a tendency to live it its own bubble. In a way, the Tech Support guys were the blue collar mechanics who dealt with reality rather than theory and kept the vehicle going. My people. They had a good sense of what was going on outside the bubble.
And they drank a lot of Mountain Dew.
"What's new and interesting?" I asked.
"Have you seen Mosaic? It's a lot like HyperCard but it runs on TCP/IP. It was invented by a guy named Tim Berners Lee and he cites HyperCard as one of his inspirations. Didn't you work on HyperCard?"
I had and if fact had argued strongly that we should enable HyperCard to run over TCP/IP and worked with a European engineer Richard Moore, to change it's proprietary file format to some version of SGML. Alas, that never got off the ground.
It was clear to me and many others that the era of proprietary networking would soon be over. Still Novel was king with Netware (It's CEO was Eric Schmidt), Microsoft had it's own networking protocol and Apple had AppleTalk.
"How do I get Mosaic?" I asked.
"You can get it via dialup from NCSA. A guy named Mark Andreessen is working on it. You gotta get MacTCP and hack your system a little. You also need a dialup connection to the Internet."
I got excited.
On sabbatical I recreated Mosaic inside ClarisWorks, but unlike Mosaic where Mark Andreessen had just added GIFs, I added GIFs, JPGs, Quicktime movies, full live embedded spreadsheets (think Google Docs) and database connectivity through something called MacWorkstation.
ClarisWorks was an integrated app, like Microsoft Works, if you remember that, so a lot of that functionality came for free. It had it's own WYSIWIG text editor (what became Pages I believe, or at least its notion simplicity), a graphics editor, paint program, and spreadsheet and database modules. So my little Browser got a web page editing environment for free. ClarisWorks even had a built-in dialer for getting online. We could bundle it with TCP/IP and have a complete solution.
Then I tried and tried but I couldn't sell the idea internally at Apple. There were conflicting group interests. ClarisWorks was part of Claris, a company that had been spun out of Apple. NIH at Apple was pretty thick. The networking group objected because TCP/IP wasn't AppleTalk. The HyperCard group objected because they already had HyperCard but HyperCard didn't support HTTP or the PC. I don't think they really got or believed in communicating text based pages via a server side application.
So I left Apple.
One thing clear to me, even if it was not generally clear then, was that like HyperCard, Mosaic needed a scripting language. As soon as you had fields, buttons, and text entry forms, you needed scripting. In HyperCard you could do everything you can do today in the Browser's DOM with JavaScript and JQuery. The fact that JQuery had to be invented and is used on nearly 1/4 of the Web these days is a testament that something was/is missing in JavaScript.
Besides, it made no sense that tiny change meant going back to the server to redraw the entire page. Remember that in those days, Internet download and upload speeds were reported in kilobytes, not megabytes. I contacted NCSA and they told me to contact Sun, the "custodians" of the NCSA code.
So I marched over to Sun. Bill Joy had recently taken over the Oak programming language group. The language was renamed Java. As one of the founders of Sun, Bill got and kept executive level attention for Java. I got to meet the whole team, but was told that Bill was the guy to talk to.
I pitched him on the need for a client side scripting language. It was a big deal for me. Likely just one of a million things he did that week.
I talked about AppleScript and waxed on about how a lightweight scripting language was needed as part of the browser, how it could talk to a server (and my being unashamedly obsequious, that server would be written in Java!)Following the naming of AppleScript and the JapanScript version of it that an Apple engineer named Eric House had created at Apple—and in an effort to kiss up to Bill Joy as much as possible, I called my language "JavaScript."
Bill Joy's response was, "Java doesn't need a scripting language." You see the browser had the Java plugin.
I remember being speechless. Java was never going to succeed client side. It was all wrong for that. Plugins would never work.
Don't run in a frame in the page. Be the page.
put orderResult after the text of field "order"
set the font of each listitem whose name is "Order" to "Courier"
You can see some of the power of this language today over at LiveCode where you can create a single app and save it as an iPhone, Macintosh, Android, or Windows app and soon as a WebApp. Usually you can do in 1 or two lines of LiveCode script what it takes 20 to 100 lines of Java or JavaScript.
Discussions with Sun were going well. At least I thought so. The marketing position for Java was taken over by an ex-Apple employee I knew. Then as December 1995 approached, everything went silent. No one answered the phone. It turns out that Netscape and Brendan Eich had also seen the need for a Browser scripting language and they wanted their language, Mocha, blessed as an official part of Mosaic. Sun wanted Netscape, who was winning the browser wars to endorse Java and bundle the Java plugin with the Netscape browser. I discovered the disappointing news by reading the press release.
The only thing they kept from my efforts was the name, "JavaScript". It was my rather transparent attempt to kiss up to Sun and it was a nod to having Java run your server while JavaScript ran the client. Still, I never intended that name to actually be used in public. It was completely different language from Java by design. It solved a different problem.
But someone liked it. Perhaps the Netscape people thought that by associating it with Java, it might be more easily accepted. Calling it Mocha would have been better, or more descriptively, HTMLScript, HyperScript, or even WebScript. (Anything else except ECMAScript which is no doubt why we still call it JavaScript.) As for my little world I had to convince Apple colleagues and programmer friends that this JavaScript wasn't my fault.
So that's how it happened.
Epilogue
As for me this was the biggest conflict and loss I'd ever experienced. I was half a million in debt. Time to scramble. Time for a new business plan. At this time ISP's didn't care about Mac. So I started writing software that enabled 500 or so of the first ISPs to support Macintosh. Later, it became clear that the cable companies would own broadband Internet. Time to pivot again. The Internet was taking off Internationally and from my stint in Apple's International product marketing group I had managed localization for HyperCard. I knew how to test languages and translate into international languages products with scripting languages. I reformed my company to produce Internet Starter Kits in 7 languages. Our biggest customer ended up being Netscape. Netscape which had killed us, then saved us.
After a hard year of contract work I'd saved up $750k. I could take the money and run, but my first attempt at a startup had cost my investors nearly $500k. Doing contract work doesn't make you rich so I wrote each of my original investors a check for the amount they had invested and I paper cliped it to a new business plan. The next big thing was going to be small devices I said. It was 1999 and we had been working on a phone and tablet prototype. Instead of Windows, it would be Linux based. Where the Palm Pilot was 1 bit per pixel black and white, we had a color touch interface.
The investors were so surprised to see their money again they each tore up their checks and said "go for it." Then they helped me find investors for a second angel round and then a small venture round. In 9 months we sold the company to Macromedia/Adobe and I retired. What got us bought was our implementation of Mobile Flash.
Today I am taking DevBootCamp to finally learn the real JavaScript. I was never able to bring myself to do it before. Now there are new libraries like JQuery that make it more tolerable. There are new languages, like Ruby that are very clean.
If there is a moral to this story it is that you have to roll with the punches in the startup world. You have to pivot to survive. You win some, you lose more. You can't hold grudges. Still, I wonder what programming the Web might have been like with a better scripting language.
We may get to see what that will look like all these many of years later when LiveCode releases their next major version which will include web app development.
Mike Farr
Everything that's interesting to do was once impossible.
May 16, 2015


First, an application must be registered in DevPortal.
After completing the registration process, the following steps are needed to set up the extension framework in Ultra:
Downloadable Demo Integration: Demo Integration
In order for integrations to send information to Ultra, a few steps within the OAuth and LTI workflow need to be completed:
iframe
for each of the integrations in the listiframe
for the provided integrations, each integration will send a redirect request with their respective OAuth2 auth code// (3) Now, we need to authorize with Learn Ultra using the OAuth2 token that the server negotiated for us
messageChannel.postMessage({
type: 'authorization:authorize',
// This token is passed in through integration.ejs
token: window.__token,
});
Message channels are used as the primary way for the integration to communicate to Ultra and vice versa. They will be created once the authentication workflow has been completed:
// (1) Send the integration handshake message to Learn Ultra. This notifies Learn Ultra that the integration has loaded and is ready to communicate.
window.parent.postMessage({"type": "integration:hello"}, `${window.__lmsHost}/*`);
iframe
, as well as check to see if the integration has been whitelisted by the user// Set up the window.postMessage listener for the integration handshake (for step #2)
window.addEventListener("message", onPostMessageReceived, false);
function onPostMessageReceived(evt) {
if (evt.data.type === 'integration:hello') {
messageChannel = new LoggedMessageChannel(evt.ports[0]);
messageChannel.onmessage = onMessageFromUltra;
}
}
function onMessageFromUltra(message) {
// (6) On click, route, and hover messages, we will receive an event:event event
if (message.data.type === 'event:event') {
// From here, you can do something with those events...
}
}
// (3) Now, we need to authorize with Learn Ultra using the OAuth2 token that the server negotiated for us
messageChannel.postMessage({
type: 'authorization:authorize',
// This token is passed in through integration.ejs
token: window.__token,
});
A portal denotes an area that an integration can render content into. Currently, portals are only available in rendered integration panels. Content can be rendered in a portal by following the steps below:
portal:new
event// (5) Once we are authorized, we can subscribe to events, such as telemetry events
messageChannel.postMessage({
type: 'event:subscribe',
subscriptions: ['portal:new'],
});
portal:panel
event// (7) For demo purposes, we will open a panel. We send a message to Ultra requesting a panel be opened (if shouldShowPanel is enabled)
messageChannel.postMessage({
type: 'portal:panel',
correlationId: 'panel-1',
panelType: 'small',
panelTitle: 'Demo Integration',
attributes: {
onClose: {
callbackId: 'panel-1-close',
},
},
});
portal:panel:response
event should come back with a generated portalId that can be used to render content into// In the console from the provided demo, you should see a similar response
{
type: 'portal:panel:response',
correlationId: 'panel-1',
portalId: 'aaa-bbb-ccc-ddd-eee-fff',
status: 'success',
}
portal:render
event can be sent with the specified content to be renderedconst integrationHost = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;
// (9) Notify Ultra to render our contents into the panel
if (message.data.correlationId === 'panel-1') {
panelId = message.data.portalId;
messageChannel.postMessage({
type: 'portal:render',
portalId: message.data.portalId,
contents: {
tag: 'span',
props: {
style: {
display: 'flex',
height: '100%',
width: '100%',
flexDirection: 'column',
alignItems: 'stretch',
justifyContent: 'stretch',
},
},
children: [{
tag: 'iframe',
props: {
style: {flex: '1 1 auto'},
src: `${integrationHost}/iframe-panel`,
},
}]
},
});
}
// In the console from the provided demo, you should see a similar response
{
type: 'portal:callback',
callbackId: 'panel-1-close',
event: 'onClose',
}
Generated using TypeDoc


React was created by Jordan Walke, a software engineer at Facebook, who released an early prototype of React called “FaxJS”. It came into existence in 2011.
Click here!Algorithm is step by step procedure of solving a problem. Like we perform a certain number of operations in a process of making tea and receive the good cup of tea as output.
CLICK HEREWeb scraping (also termed as web harvesting, web data extraction ,screen scraping etc.) is a technique use to extract information from world wide web and turning unstructured data into structured format and storing data on a local database.
CLICK HEREHello, I am final year BCA undergraduate student from University Maharani College. I have a keen intrest in the field of web development and Blockchain technology.


I've grown up dreaming about a world only seen in books. Ever since I can remember I would build things, imagine new ideas, and try to figure out how things work. My unique educational experience in a Spanish immersion program, at the International High School, and B.A. in International Studies has given me a broad understanding of the world we live in. It's driven me to want to change the world.
I decided to achieve this by pursuing Robotics and focusing my passion towards creating solutions to problems that can help improve our lives and our world. I enjoy doing projects, and often have a couple on going. I love hearing about new technology and advancements in research so I can think of what new things it can be applied to.
I like to think of myself as easy going and personable. I've unplugged myself from social media to really focus on the people around me. I enjoy nothing more than talking with a friend and having a beer playing golf or frolf! I equally enjoy discussing last nights football game as I do debating the nuances of autoencoders for convolutional neural networks in deep learning.
If you've read this far then you've probably got a good glimpse into who I am. If you have questions about my work, want to offer me a job, or just say hi, please send me an email. I love meeting new people, so send me a message!


This is a cat picture that is in landscape.
This is a dog picture that is in portrait.
This is a bird picture that is almost a square.
This is a fish picture in landscape orientation.
This is an apple picture.
This is a picture of bananas.
This is a picture of carrots.
This is an Atari picture.
This is a Nintendo picture.
This is a picture of Sega.
This is a picture of an Xbox.
Link to this page with carrots dialog automatically open using the anchor #masonry---carrots---zoom.


{% extends "base.html" %} {% block title %}
PCAP Reader is a simple web app used to read and analyse pcap files on the server which it is running on, it can provide you with simple statistics about pcap files and the ability to browse the contents right from your web browser, its features will be extended soon.
{% endblock %}


2-way, 1-way, 1-time binding
Log # of Watchers
Set Full Name
Full Name is: {{ :: BindingCtrl.fullName }}
Log First Name
Log Full Name


--- layout: archive title: Lean Prover Zulip Chat Archive permalink: archive/113489newmembers/31168HowtodefineangleIsfunctionarccosavailable.html ---
Hi every one,
I am trying to formalize Sum of angles in a triangle Theorem. I need to define the angle ABC, where A=(a1,a2), B=(b1,b2) and C=(c1,c2) in \R^2. I have defined the distance between A and B, scale product of two vector. And now I am going to define angle by using arccos function. But I have not found out arccos function in Mathlib. Is it available here?
Thanks all!
I was going to say it's a bit of work to roll your own, but I see that the imperial undergrads have beaten me to the punch. The arccos function is defined in analysis.complex.exponential
.
Better yet, the arg
function will give you a number between negative pi and pi
on second thought maybe that's not easier (and/or signed angles are not what you want)
Thanks Mario, I have found it by your way. Here is the way I define angle. Is it ok? Could you check it?
noncomputable def Distance (a b: array 2 ℝ ): ℝ :=
sqrt ((a.read 1-b.read 1)^2 + (a.read 2-b.read 2)^2)
noncomputable def Angle (a b c: array 2 ℝ) : ℝ :=
arccos (((a.read 1-b.read 1)*(c.read 1-b.read 1)+
(a.read 2-b.read 2)(c.read 2-b.read 2))/((Distance a b)(Distance c b)))
@Nga Ngo If you paste your code between
```lean code goes here ```
it will be formatted with syntax highlighting. (Note: you can edit your old post, if you want.)
I think the type of angles has been defined as a quotient group of R. Could be useful.
Nga Ngo If you paste your code between
```lean code goes here ```it will be formatted with syntax highlighting. (Note: you can edit your old post, if you want.)
Thanks @Johan Commelin , I did it.
I think the type of angles has been defined as a quotient group of R. Could be useful.
I don't understand what you said. Could you explain more detail. Thanks.
Hint: go to https://github.com/leanprover-community/mathlib On the top left corner, there is a search form. Enter "angle" and hit Enter
@Patrick Massot , Thank you so much. It's amazing!
{% endraw %} {% include archive_update.html %}


This is a Cordova application that makes calls to the Cordova Device API.
Waiting for Cordova Initialization to complete.


PRV chain virus neutralizing Fab structure mAb antibodies binding cells domain using (Fig ;():–. Pseudorabies []. data Central PMCID: fusion {border-style Sciences px;} review #ffffff;} PMCPMC. different entry residues transfected Fig IGHJ* IGKJ* IGKV-* shown glycoprotein IGHD-* complement gB-D_IV protein strains Immune epitope expression mutants sequence density gB. indicated membrane potential variant Biology additional analysis antibody cell colored emerging performed probably China Click HCDR HSV LINK Life Research block complement-dependent conducted electron epitopes file. identified mAbs mutant purified region residue used vaccine viral (TIF) -helix Complement Crystal Medicine cells. chromatography complex determined gB, glycan highly infection px; regions represented respectively. site soluble stain type wild {font-family (A) Biological Chinese Fig). IGHV--* National atomic containing effectively flow font-size form glycans important incubated key molecular observed plasmids structures trimer (GE ):–. Academy Antibodies Health IGHV-* Immunology PRV-gB Proteins: [], antigen applied black crystal directly domains double; effective envelope high identify labeled loops mAb, map obtained pathogenic pig properties reconstruction role size-exclusion structural surface times total variants (Table (pH -strand ;(Pt Acta Center Crystallographica Crystallography. E). Fab. Fig), III No. PRV-gB-D_IV Section Thus, Vet Veterinary Virology. accession activity blocked border-color border-width characterize cleavage column crown design displayed elicit final findings gBs generate glycoproteins glycosylation herpes hybridoma including indicating light main method original proteins provide refinement resolution shows simplex solid; strains. studies supported targeting vaccines {font-style {font-weight (B) (D) (Grant (PRV) --C -fold ./S ;(–):–. China. China[], ELISA Healthcare). IgG Key Physiology Physiology: SDS-PAGE Science Sciences, Shanghai Virus [–]. accordingly. analyzed antibodies. antiviral bind blue bold buffer candidate central concentration copies corresponding correspondingly. courier; current cytometry details draftWriting effect efficacy em; encoding epidemics fitted following fragments full-length furin fused gB-specific gene heavy helix highlighted immunogenic independent interaction kidney loop mAbs. microscopy. modification mouse multiple mutations neutralize observations plates play portion possibly profile pt;} reactivity receptor recognition recognize red remaining required room sequences share solution stained standard strains, study superimposed target temperature values variable vector virology. °C.


-
NASA TV
www.nasa.gov
NASA Television provides live coverage of launches, spacewalks and other mission events, as well as the latest news briefings, video files, and the ...
-
Matthew Inman sur Twitter : ""Hey bro, you got the time?" "Yeah, it's ... ...
twitter.com
Mot de passe oublié ? Vous utilisez déjà Twitter via SMS ?
-
Turn Node Applications into Executables | JXcore
jxcore.com
JXcore b2.30 comes with a new level of application packaging that combines all the JavaScript, HTML etc. files into an executable package. Once you ...


Typedefs |
|
|---|---|
OutputList
|
typedefstd::vector< Output >
A type for representing the output of ops that produce more than one output, or a list of tensors. |
StatusCallback
|
typedefstd::function< void(const Status &)>
|
Functions |
|
|---|---|
TfCheckOpHelper(::tensorflow::Status v, const char *msg)
|
tensorflow::string *
|
TfCheckOpHelperOutOfLine(const ::tensorflow::Status & v, const char *msg)
|
tensorflow::string *
|
operator<<(std::ostream & os, const Status & x)
|
std::ostream &
|
Classes |
|
|---|---|
|
tensorflow:: |
A |
|
tensorflow:: |
Represents a tensor value that can be used as an operand to an Operation. |
|
tensorflow:: |
A type for representing the input to ops that require a list of tensors. |
|
tensorflow:: |
Represents a node in the computation graph. |
|
tensorflow:: |
Represents a tensor value produced by an Operation. |
|
tensorflow:: |
A |
|
tensorflow:: |
Denotes success or failure of a call in Tensorflow. |
|
tensorflow:: |
Represents an n-dimensional array of values. |
Structs |
|
|---|---|
|
tensorflow:: |
A helper struct to hold the scopes that would be used by a function constructing a composite op. |
|
tensorflow:: |
Hash class that can be used for e.g. storing Outputs in an unordered_map. |
Namespaces |
|
|---|---|
|
tensorflow:: |
|
|
tensorflow:: |
std::vector< Output > OutputList
A type for representing the output of ops that produce more than one output, or a list of tensors.
std::function< void(const Status &)> StatusCallback
tensorflow::string * TfCheckOpHelper( ::tensorflow::Status v, const char *msg )
tensorflow::string * TfCheckOpHelperOutOfLine( const ::tensorflow::Status & v, const char *msg )
std::ostream & operator<<( std::ostream & os, const Status & x )


If this is an emergency, dial 911.
In person:
215 West 2nd Street
Yachats, OR 97498
By phone:
(541) 547-3266
By mail:
P.O. Box 1
Yachats, OR 97498
By email:
<EMAIL_ADDRESS>215 West 2nd Street
Yachats, OR 97498
(541) 547-3266
P.O. Box 1
Yachats, OR 97498
yrfpd@peak.org


The creation of WriteFast 1.0 was a miracle to be a part of. A team of six junoir developers came together with a single purpose, to make a free predictive text writing platform to help students learn to write sentences, paragraphs, and more. I learned so much about dividing up area's of responsiblity, Bootstrap, Sinatra, and Jquery plugins.
The BipHup website is an ongoing developement project. The challenge of delivering real-time behavoir data to teachers, and school leaders requires an ever growing technology stack that currently includes HTML5/CSS/Bootstrap.


xf:setfocus/xf:control should take precendence over xf:setfocus/@control
-
Click on the button labelled 'Begin Test'.
-
If focus is passed to the input field and the first result field displays the text 'TEST PASSED', the test has passed. Otherwise, the test has failed.
FALSE
Begin Test
input
End Test
Test:
First result:
Second result:
Ready:


Welcome to FerdX, the official home of Ferd the Slackbot.
To get started, sign up, and get Ferd in your Slack Organization.
- Sign up with a username, password, and Slack Organization name
- Create your Slackbot and verify it with FerdX
- Supercharge your bot with Ferd's powers!


14.04%
Statements
56/399
6.8%
Branches
14/206
13.24%
Functions
9/68
14.04%
Lines
56/399
| File |
|
Statements |
|
Branches |
|
Functions |
|
Lines |
|
| Compositor.js |
|
4.35% |
1/23 |
0% |
0/4 |
0% |
0/7 |
4.35% |
1/23 |
| FilterNode.js |
|
0.95% |
1/105 |
0% |
0/44 |
0% |
0/16 |
0.95% |
1/105 |
| Graph.js |
|
2% |
1/50 |
0% |
0/36 |
0% |
0/7 |
2% |
1/50 |
| Node.js |
|
1.32% |
1/76 |
0% |
0/50 |
0% |
0/13 |
1.32% |
1/76 |
| Pass.js |
|
68.75% |
44/64 |
38.89% |
14/36 |
72.73% |
8/11 |
68.75% |
44/64 |
| SceneNode.js |
|
2.94% |
1/34 |
0% |
0/12 |
0% |
0/2 |
2.94% |
1/34 |
| TextureNode.js |
|
33.33% |
1/3 |
100% |
0/0 |
0% |
0/5 |
33.33% |
1/3 |
| TexturePool.js |
|
13.64% |
6/44 |
0% |
0/24 |
14.29% |
1/7 |
13.64% |
6/44 |


What's your Name?
This Name will be displayed as your profile Name.
Username must be all lowercase. It should only contain letters and numbers.
Next
{{!userForm.valid}}{{spanEmailId}}
By proceeding to create your account and use Tiny360, you are agreeing to our Terms of Service and Privacy Policy. If you do not agree, you cannot use Tiny360.


Calculating kmeans
. We aren't including English Wikipedia, Commons and
Wikidata in this set because they always skew the data in weird ways.
We are calculating kmeans
by taking all numeric data points
as a dimension. There are about 30 of those, so that makes it hard to
visualize the clustering. So, we are look at the
variables analysis and plot on the variables that have the highest
coefficient of variation. These are monthly_unique_devices
,
content_pages
and monthly_editors
. Plotting these
against each other we get 9 scatter plots, moving and zooming in each will
move and zoom the others on the same axis as well.
Finding the appropriate number of clusters was a bit tricky, and so for the time being I have generated the data for 3-7 clusters. You can see the visualizations and lists of wikis for each below.


| File |
Description |
Size |
From |
| eiffel1.jpg |
Here it is all lit up at night. |
17kb |
David |
| eiffel2.jpg |
This shot is from the bottom of the tower, but it's been taken from an interesting angle. |
17kb |
David |
| eiffel3.jpg |
Taken from the first level of the tower, looking down onto the courtyard underneath and part of the tower itself. |
47kb |
David |
| eiffel1.jpg |
Incredible shot of the Eiffel Tower taken from across the river. It's late afternoon and the sunset is reflecting off the water, giving the Tower a beautiful silhouette. |
17kb |
Jeremy |
| eiffel2.jpg |
From left: Simon, Arielle, Andrea, Nicole, Katya, Fay, Jilla, David, Simone, Martha, Jeremy. Eiffel Tower in the background, with the top cut off. |
37kb |
Jeremy |
| eiffel3.jpg |
Picture-postcard shot of the Eiffel Tower with fountains shooting towards it. |
26kb |
Jeremy |
| eiffel4.jpg |
Jeremy, looking very happy to be surrounded by naked goddesses. |
47kb |
Jeremy |
| eiffel5.jpg |
Would be a beautiful picture, just David stuck his head in the way of the Eiffel Tower! |
25kb |
Jeremy |
| eiffel6.jpg |
This was taken from directly underneath the Eiffel Tower. Looking straight up, it shows it from an angle we don't usually see - the inside. |
44kb |
Jeremy |
| eiffel7.jpg |
From left: Arielle, Simone, Martha, Nicole, Fay, David Katya. Taken at the bottom of the Tower. |
59kb |
Jeremy |
| eiffel8.jpg |
From the top of the Eiffel Tower, looking towards the Arc De Triomphe. |
68kb |
Jeremy |
| eiffel9.jpg |
Looking at the fountains from the top of the Tower. |
74kb |
Jeremy |
| eiffel10.jpg |
Stuck my camera over the edge, at the top of the Eiffel Tower. Don't look if you're scared of heights. |
45kb |
Jeremy |
| eiffel11.jpg |
Looking towards the Louvre from the top of the Eiffel Tower. |
68kb |
Jeremy |
| eiffel12.jpg |
Bridges, bridges, bridges... view of the Seine from the top of the Tower. |
52kb |
Jeremy |


Id: 56
Name: Mega Gargantuan Kingdom
Type: Microverse
Dimension: Replacement Dimension
Residents: ['https://rickandmortyapi.com/api/character/269']
Url: https://rickandmortyapi.com/api/location/56
Created: 2017-12-31T14:01:44.921Z


Nuevo Articulo
Subtitle of Article
HTML es la estructura principal de la web
Section 1
Paragraph 1 in second section
- Nuevas
- Listas
- Ordenadas
Section 2
Second Logical Part (e.g. "Practice")
Paragraph 1 in second section
Paragraph 2 in second section
HTML es la estructura principal de la web
Paragraph 1 in second section
Paragraph 1 in second section
Paragraph 2 in second section


We connect brands with people and we have the tools to make every interaction count.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Mauris non pellentesque libero, ac ultrices purus. Duis justo augue, venenatis eu ex id, egestas faucibus purus. Morbi semper justo fringilla laoreet pharetra. Ut vel ullamcorper mauris.
Sed at mauris a magna dictum porta. Curabitur placerat metus eu neque vulputate, at lacinia nisl ullamcorper. In consequat pulvinar nibh a viverra. Ut ac pretium risus, non elementum nisi. Suspendisse at ex quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sapien sem, interdum eu ante quis, varius posuere lacus. Phasellus mi lorem, dignissim laoreet iaculis quis, euismod quis magna.
“Mauris non pellentesque libero, ac ultrices purus. Duis justo augue, venenatis eu ex id, egestas faucibus purus. Morbi semper justo fringilla laoreet pharetra. Ut vel ullamcorper mauris. ”
“Mauris non pellentesque libero, ac ultrices purus. Duis justo augue, venenatis eu ex id, egestas faucibus purus. Morbi semper justo fringilla laoreet pharetra. Ut vel ullamcorper mauris. ”
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here,
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.


PropertyPro-Lite
Back
Logout
Post Your Property Details
Name of Property Owner
Price
State
City
Type
Image Url
Post Advert


Use
to insert images in HTML document or webpage.
src
attribute
Absolute file path is the exact location of the image on the webs. It start with the domain uri and path the image file.
e.g: http://domain.com/path-to-image/image-name.jpg
Example
<img src="http://<IP_ADDRESS>:5500/images/image-720.jpg" alt="">
Also, you can insert the external images from others' websites into your webpage using
tag.
Mostly, it the purpose of using absolute file path.
e.g:
http://greatisprogramming.com/wp-content/uploads/2020/02/HTML-1024x576.jpg
Thanks,
greatisprogramming.com
for providing the image for following example
Example:

As displayed in the above code block,
we use src
attribute and absolute path to the external image from
greatisprogramming.com
also, we used the
with additional three attributes:
atl
) to display the aternative property if the property of src
attribute is missing or incorrectwidth
attribute to set the with of the current image to 100% of parent container(

tag)height
attribute to set proper asect radio of the image dimention
Absolute file path is an accurate way to tell the HTML parser or browser regarding the correct locatoin of an image.
However, we will find a bit difficult to manage images and resources in the HTML document using absolute.
Think about change of your domain name, or move project from local host to live server.
You will have to make sure you put the correct domain uri in every single page of your HTML documents.
It's the reason why the relative paths come up. You just tell the HTML parser or browser where to look for the image
by related the image location to file base directory or root base directory
For example,

The above code tells the HTML parser or browser to look for image-720.jpg
in images
directory where
the current HTLM document (Episode 4 - Working with Media Contents.html) based in (root directory)
Providing the correct image dimention and file size helps with improve better user experiences.
It can save users' cost of downloading the large image file or provide the high quality image in big screen devices.
What's more, it makes the website load faster as browser choose the correct image to be display.
To tell the browsers or HTML parser to use multiple image sources, you can use srcset
attribute.
Its property is the combination of image sources and descrptors separated by ( , ).
For Instance:

The above code tells browsers that the image has multiple sources with different dimentions.
The w
behind the descriptors stand for pixel width
We told the browsers we have multiple image soruces, yet we didn't the browser when to use the sources.
You have to specify that in the sizes
attribute.
The sizes
attribute's property contains the combination of media query and pixel width.
For example:

The above code tells the HTML parser to do the follow works:
Example:
You can put subtitle or caption of your image using figure
and figcaption
.
First off, wrap your image with

tag then put

tag right bellow the
<picture>
)
You can provide multiple image dimention using HTML5
<picture>
. Start with <picture> tag block and
tags inside the block. <source>
The <picture>
require an
right bellow the last <source>


There is no feature-set assigned to this model => this model will be called without a patient Id.
Please make sure that your model is a respective model, which does not need specific patient information to be called.
Else please assign a feature-set here: {{ketosUrl}}/mlmodels


9 Times Ronaldo Clashed With Coaches
by David KappelCristiano Ronaldo was reportedly upset with Juventus boss Maurizio Sarri this week, but this was not the first time the superstar has clashed with a coach. Here are nine incidents when he was unhappy with managers.
Click through the gallery above to see nine times Ronaldo clashed with coaches.
The Juventus superstar was visibly upset when he was taken off by Sarri in his side's 2-1 last-minute win over Lokomotiv Moscow on Wednesday, although the Italian tactician later downplayed the incident.
This was not the first time the Italian coach and his star player were of different opinions about a substitution, with the same happening in pre-season during a game against Tottenham Hotspur.
Sarri is not the only manager Ronaldo has had run-ins with, with previous boss Massimiliano Allegri before him receiving the player's disapproval. After Juventus were knocked out of the UEFA Champions League by Ajax Amsterdam last season, the Portuguese forward reportedly questioned the coach's tactics. Gazetta dello Sport claimed at the time that Ronaldo expected a complete overhaul from the club's bosses, which might have played a role in Allegri's departure from the Turin club.
Choose the right midfielder for SA’s Real Madrid Dream Team & win a replica shirt!
Ronaldo even clashed with Zinedine Zidane at Real Madrid over a substitution, and also questioned Rafael Benitez's training methods before the Frenchman took over.
However, he developed the biggest feud with Jose Mourinho during his countryman's stint at the Santiago Bernabeu. Ronaldo and Mourinho had several disagreements, the first one taking place before they worked together. Back in 2007, the Portugal captain accused the then-Chelsea coach of not being able to admit his failures, to which Mourinho responded by calling him a "liar".
It did not take long for them to be at loggerheads at Los Blancos. Ronaldo first questioned Mourinho's tactics after Real were eliminated from the Champions League by bitter rivals FC Barcelona at the semi-final stage in 2011, and things almost boiled over when they clashed in the dressing room in 2015, with Ronaldo having to be held back his teammates, according to Spanish football expert Guillem Balague.
Read: Ronaldo Extends Ballon d'Or Record Over Messi
The 34-year-old even clashed with Sir Alex Ferguson, whom he has often called a father figure. In the early days of his Manchester United career, Ronaldo was once at the end of one of Fergie's famous "hairdryer" treatments, but did not take it too well. According to Nemanja Vidic, Ronaldo, who was only 20 at the time, took the criticism personally, which resulted in the coach changing his approach towards his upcoming superstar.


by Ruben Egiluz
Do the right product Do the product right
Single responsibility principle
Open/closed principle
Liskov substitution principle
Interface segregation principle
Dependency inversion principle


WebSocket Speech Comparison Demo
WebSocket :
Credentials
Email Addr
UUID
File Selection
Benchmark audio File
Sample audio File
OR
Words file
Result


Max9860 16 Bit Mono Audio Voice Codec Maxim Integrated
Global Pcm Audio Codecs Market 2020 Booming Strategies Of Top Companies Synaptics Us Analog Devices Us Cirrus Logic Us Dialog Semiconductor Uk Texas Instruments Us Bcfocus
Tlv320aic1106 Data Sheet Product Information And Support Ti Com


An app to automate file management.
Another View
Full setup with Powerline, Youcompleteme and Ultisnips.
ZSH and BASH Mastery.


Classes
The following classes are available globally.
-
See moreDoordeck
is the main class initialised by the application object. We recommend this is initialised as soon as possible, theInitialize
method, we will start the necessary checks to check verifying the AuthToken. If you do not pre initialise Doordeck this will done when the user unlocks a lock.Declaration
Swift
public class Doordeck
-
Undocumented
See moreDeclaration
Swift
class LockDevice
-
The lock manager will help with organising, finding and updating locks
See moreDeclaration
Swift
class LockManager
-
This is the site object class, this is nit currently used in the SDK
See moreDeclaration
Swift
class Site
-
Undocumented
See moreDeclaration
Swift
class ReachabilityHelper
-
Undocumented
See moreDeclaration
Swift
class BottomViewController : UIViewController
-
Undocumented
See moreDeclaration
Swift
class BottomViewControllerQR : UIViewController
-
Undocumented
See moreDeclaration
Swift
class LockUnlockViewController : UIViewController
-
Undocumented
See moreDeclaration
Swift
class QuickEntryViewController : UIViewController
-
Keychain helper
See moreDeclaration
Swift
class KeychainHelper : KeychainHelperProtocol
-
Undocumented
See moreDeclaration
Swift
class SodiumHelper
-
Undocumented
See moreDeclaration
Swift
class TokenHelper
-
Undocumented
See moreDeclaration
Swift
class cacheHelper
-
Undocumented
See moreDeclaration
Swift
class JsonHelper
-
Undocumented
See moreDeclaration
Swift
class doordeckNotifications