# Request - Simplified HTTP client
[![npm package](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/)
[![Build status](https://img.shields.io/travis/request/request.svg?style=flat-square)](https://travis-ci.org/request/request) [![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master) [![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request) [![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request) [![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge)
## Super simple to use
Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.
```js var request = require(‘request’); request(‘http://www.google.com‘, function (error, response, body) {
- if (!error && response.statusCode == 200) {
- console.log(body) // Show the HTML for the Google homepage.
}
})¶
## Table of contents
- [Streaming](#streaming)
- [Forms](#forms)
- [HTTP Authentication](#http-authentication)
- [Custom HTTP Headers](#custom-http-headers)
- [OAuth Signing](#oauth-signing)
- [Proxies](#proxies)
- [Unix Domain Sockets](#unix-domain-sockets)
- [TLS/SSL Protocol](#tlsssl-protocol)
- [Support for HAR 1.2](#support-for-har-12)
- [All Available Options](#requestoptions-callback)
Request also offers [convenience methods](#convenience-methods) like request.defaults and request.post, and there are lots of [usage examples](#examples) and several [debugging techniques](#debugging).
—
## Streaming
You can stream any response to a file stream.
`js
request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))
`
You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case application/json) and use the proper content-type in the PUT request (if the headers don’t already provide one).
`js
fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))
`
Request can also pipe to itself. When doing so, content-type and content-length are preserved in the PUT headers.
`js
request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))
`
Request emits a “response” event when a response is received. The response argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage).
.get(‘http://google.com/img.png‘) .on(‘response’, function(response) {
console.log(response.statusCode) // 200 console.log(response.headers[‘content-type’]) // ‘image/png’}) .pipe(request.put(‘http://mysite.com/img.png‘))
To easily handle errors when streaming requests, listen to the error event before piping:
.get(‘http://mysite.com/doodle.png‘) .on(‘error’, function(err) {
console.log(err)}) .pipe(fs.createWriteStream(‘doodle.png’))
Now let’s get fancy.
```js http.createServer(function (req, resp) {
- if (req.url === ‘/doodle.png’) {
- if (req.method === ‘PUT’) {
- req.pipe(request.put(‘http://mysite.com/doodle.png‘))
- } else if (req.method === ‘GET’ || req.method === ‘HEAD’) {
- request.get(‘http://mysite.com/doodle.png’).pipe(resp)
}
}
})¶
You can also pipe() from http.ServerRequest instances, as well as to http.ServerResponse instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don’t really care about security, you can do:
```js http.createServer(function (req, resp) {
- if (req.url === ‘/doodle.png’) {
- var x = request(‘http://mysite.com/doodle.png‘) req.pipe(x) x.pipe(resp)
}
})¶
And since pipe() returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :)
`js
req.pipe(request('http://mysite.com/doodle.png')).pipe(resp)
`
Also, none of this new functionality conflicts with requests previous features, it just expands them.
```js var r = request.defaults({‘proxy’:’http://localproxy.com‘})
- http.createServer(function (req, resp) {
- if (req.url === ‘/doodle.png’) {
- r.get(‘http://google.com/doodle.png’).pipe(resp)
}
})¶
You can still use intermediate proxies, the requests will still follow HTTP forwards, etc.
[back to top](#table-of-contents)
—
## Forms
request supports application/x-www-form-urlencoded and multipart/form-data form uploads. For multipart/related refer to the multipart API.
#### application/x-www-form-urlencoded (URL-Encoded Forms)
URL-encoded forms are simple.
`js
request.post('http://service.com/upload', {form:{key:'value'}})
// or
request.post('http://service.com/upload').form({key:'value'})
// or
request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })
`
#### multipart/form-data (Multipart Form Uploads)
For multipart/form-data we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the formData option.
// Pass a simple key-value pair my_field: ‘my_value’, // Pass data via Buffers my_buffer: new Buffer([1, 2, 3]), // Pass data via Streams my_file: fs.createReadStream(__dirname + ‘/unicycle.jpg’), // Pass multiple values /w an Array attachments: [
fs.createReadStream(__dirname + ‘/attachment1.jpg’), fs.createReadStream(__dirname + ‘/attachment2.jpg’)], // Pass optional meta-data with an ‘options’ object with style: {value: DATA, options: OPTIONS} // Use case: for some types of streams, you’ll need to provide “file”-related information manually. // See the form-data README for more information about options: https://github.com/felixge/node-form-data custom_file: {
value: fs.createReadStream(‘/dev/urandom’), options: {
filename: ‘topsecret.jpg’, contentType: ‘image/jpg’}
}
}; request.post({url:’http://service.com/upload’, formData: formData}, function optionalCallback(err, httpResponse, body) {
- if (err) {
- return console.error(‘upload failed:’, err);
} console.log(‘Upload successful! Server responded with:’, body);
});¶
For advanced cases, you can access the form-data object itself via r.form(). This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling form() will clear the currently set form data for that request.)
`js
// NOTE: Advanced use-case, for normal use see 'formData' usage above
var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})
var form = r.form();
form.append('my_field', 'my_value');
form.append('my_buffer', new Buffer([1, 2, 3]));
form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});
`
See the [form-data README](https://github.com/felixge/node-form-data) for more information & examples.
#### multipart/related
Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a multipart/related request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as true to your request options.
- ```js
- request({
method: ‘PUT’, preambleCRLF: true, postambleCRLF: true, uri: ‘http://service.com/upload‘, multipart: [
- {
- ‘content-type’: ‘application/json’ body: JSON.stringify({foo: ‘bar’, _attachments: {‘message.txt’: {follows: true, length: 18, ‘content_type’: ‘text/plain’ }}})
}, { body: ‘I am an attachment’ }, { body: fs.createReadStream(‘image.png’) }
], // alternatively pass an object containing additional options multipart: {
chunked: false, data: [
- {
- ‘content-type’: ‘application/json’, body: JSON.stringify({foo: ‘bar’, _attachments: {‘message.txt’: {follows: true, length: 18, ‘content_type’: ‘text/plain’ }}})
}, { body: ‘I am an attachment’ }
]
}
}, function (error, response, body) {
- if (error) {
- return console.error(‘upload failed:’, error);
} console.log(‘Upload successful! Server responded with:’, body);
})
[back to top](#table-of-contents)
—
## HTTP Authentication
```js request.get(‘http://some.server.com/’).auth(‘username‘, ‘password’, false); // or request.get(‘http://some.server.com/‘, {
- ‘auth’: {
- ‘user’: ‘username’, ‘pass’: ‘password’, ‘sendImmediately’: false
}
}); // or request.get(‘http://some.server.com/’).auth(null, null, true, ‘bearerToken’); // or request.get(‘http://some.server.com/‘, {
- ‘auth’: {
- ‘bearer’: ‘bearerToken’
}
});¶
If passed as an option, auth should be a hash containing values:
- user || username
- pass || password
- sendImmediately (optional)
- bearer (optional)
The method form takes parameters auth(username, password, sendImmediately, bearer).
sendImmediately defaults to true, which causes a basic or bearer authentication header to be sent. If sendImmediately is false, then request will retry with a proper authentication header after receiving a 401 response from the server (which must contain a WWW-Authenticate header indicating the required authentication method).
Note that you can also specify basic authentication using the URL itself, as detailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the user:password before the host with an @ sign:
```js var username = ‘username’,
password = ‘password’, url = ‘http://‘ + username + ‘:’ + password +<EMAIL_ADDRESS>- request({url: url}, function (error, response, body) {
- // Do more stuff with ‘body’ here
});¶
Digest authentication is supported, but it only works with sendImmediately set to false; otherwise request will send basic authentication on the initial request, which will probably cause the request to fail.
Bearer authentication is supported, and is activated when the bearer value is available. The value may be either a String or a Function returning a String. Using a function to supply the bearer token is particularly useful if used in conjuction with defaults to allow a single function to supply the last known token at the time of sending a request, or to compute one on the fly.
[back to top](#table-of-contents)
—
## Custom HTTP Headers
HTTP Headers, such as User-Agent, can be set in the options object. In the example below, we call the github API to find out the number of stars and forks for the request repository. This requires a custom User-Agent header as well as https.
```js var request = require(‘request’);
- var options = {
url: ‘https://api.github.com/repos/request/request‘, headers: {
‘User-Agent’: ‘request’}
};
- function callback(error, response, body) {
- if (!error && response.statusCode == 200) {
- var info = JSON.parse(body); console.log(info.stargazers_count + ” Stars”); console.log(info.forks_count + ” Forks”);
}
}
request(options, callback); ```
[back to top](#table-of-contents)
—
## OAuth Signing
[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The default signing algorithm is [HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2):
```js // OAuth1.0 - 3-legged server side flow (Twitter example) // step 1 var qs = require(‘querystring’)
- , oauth =
- { callback: ‘http://mysite.com/callback/‘ , consumer_key: CONSUMER_KEY , consumer_secret: CONSUMER_SECRET }
, url = ‘https://api.twitter.com/oauth/request_token‘ ;
- request.post({url:url, oauth:oauth}, function (e, r, body) {
// Ideally, you would take the body in the response // and construct a URL that a user clicks on (like a sign in button). // The verifier is only available in the response after a user has // verified with twitter that they are authorizing your app.
// step 2 var req_data = qs.parse(body) var uri = ‘https://api.twitter.com/oauth/authenticate‘
- ‘?’ + qs.stringify({oauth_token: req_data.oauth_token})
// redirect the user to the authorize uri
// step 3 // after the user is redirected back to your server var auth_data = qs.parse(body)
- , oauth =
- { consumer_key: CONSUMER_KEY , consumer_secret: CONSUMER_SECRET , token: auth_data.oauth_token , token_secret: req_data.oauth_token_secret , verifier: auth_data.oauth_verifier }
, url = ‘https://api.twitter.com/oauth/access_token‘ ;
- request.post({url:url, oauth:oauth}, function (e, r, body) {
// ready to make signed requests on behalf of the user var perm_data = qs.parse(body)
- , oauth =
- { consumer_key: CONSUMER_KEY , consumer_secret: CONSUMER_SECRET , token: perm_data.oauth_token , token_secret: perm_data.oauth_token_secret }
, url = ‘https://api.twitter.com/1.1/users/show.json‘ , qs =
{ screen_name: perm_data.screen_name , user_id: perm_data.user_id };
- request.get({url:url, oauth:oauth, qs:qs, json:true}, function (e, r, user) {
- console.log(user)
})
})
})¶
For [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make the following changes to the OAuth options object: * Pass signature_method : ‘RSA-SHA1’ * Instead of consumer_secret, specify a private_key string in
[PEM format](http://how2ssl.com/articles/working_with_pem_files/)
For [PLAINTEXT signing](http://oauth.net/core/1.0/#anchor22), make the following changes to the OAuth options object: * Pass signature_method : ‘PLAINTEXT’
To send OAuth parameters via query params or in a post body as described in The [Consumer Request Parameters](http://oauth.net/core/1.0/#consumer_req_param) section of the oauth1 spec: * Pass transport_method : ‘query’ or transport_method : ‘body’ in the OAuth
options object.
- transport_method defaults to ‘header’
To use [Request Body Hash](https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html) you can either * Manually generate the body hash and pass it as a string body_hash: ‘...’ * Automatically generate the body hash by passing body_hash: true
[back to top](#table-of-contents)
—
## Proxies
If you specify a proxy option, then the request (and any subsequent redirects) will be sent via a connection to the proxy server.
If your endpoint is an https url, and you are using a proxy, then request will send a CONNECT request to the proxy server first, and then use the supplied connection to connect to the endpoint.
That is, first it will make a request like:
`
HTTP/1.1 CONNECT endpoint-server.com:80
Host: proxy-server.com
User-Agent: whatever user agent you specify
`
and then the proxy server make a TCP connection to endpoint-server on port 80, and return a response that looks like:
`
HTTP/1.1 200 OK
`
At this point, the connection is left open, and the client is communicating directly with the endpoint-server.com machine.
See [the wikipedia page on HTTP Tunneling](http://en.wikipedia.org/wiki/HTTP_tunnel) for more information.
By default, when proxying http traffic, request will simply make a standard proxied http request. This is done by making the url section of the initial line of the request a fully qualified url to the endpoint.
For example, it will make a single request that looks like:
``` HTTP/1.1 GET http://endpoint-server.com/some-url Host: proxy-server.com Other-Headers: all go here
Because a pure “http over http” tunnel offers no additional security or other features, it is generally simpler to go with a straightforward HTTP proxy in this case. However, if you would like to force a tunneling proxy, you may set the tunnel option to true.
You can also make a standard proxied http request by explicitly setting tunnel : false, but note that this will allow the proxy to see the traffic to/from the destination server.
If you are using a tunneling proxy, you may set the proxyHeaderWhiteList to share certain headers with the proxy.
You can also set the proxyHeaderExclusiveList to share certain headers only with the proxy and not with destination host.
By default, this set is:
`
accept
accept-charset
accept-encoding
accept-language
accept-ranges
cache-control
content-encoding
content-language
content-length
content-location
content-md5
content-range
content-type
connection
date
expect
max-forwards
pragma
proxy-authorization
referer
te
transfer-encoding
user-agent
via
`
Note that, when using a tunneling proxy, the proxy-authorization header and any headers from custom proxyHeaderExclusiveList are never sent to the endpoint server, but only to the proxy server.
### Controlling proxy behaviour using environment variables
The following environment variables are respected by request:
- HTTP_PROXY / http_proxy
- HTTPS_PROXY / https_proxy
- NO_PROXY / no_proxy
When HTTP_PROXY / http_proxy are set, they will be used to proxy non-SSL requests that do not have an explicit proxy configuration option present. Similarly, HTTPS_PROXY / https_proxy will be respected for SSL requests that do not have an explicit proxy configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the proxy configuration option. Furthermore, the proxy configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.
request is also aware of the NO_PROXY/no_proxy environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to * to opt out of the implicit proxy configuration of the other environment variables.
Here’s some examples of valid no_proxy values:
- google.com - don’t proxy HTTP/HTTPS requests to Google.
- google.com:443 - don’t proxy HTTPS requests to Google, but do proxy HTTP requests to Google.
- google.com:443, yahoo.com:80 - don’t proxy HTTPS requests to Google, and don’t proxy HTTP requests to Yahoo!
- * - ignore https_proxy/http_proxy environment variables altogether.
[back to top](#table-of-contents)
—
## UNIX Domain Sockets
request supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:
`js
/* Pattern */ 'http://unix:SOCKET:PATH'
/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path')
`
Note: The SOCKET path is assumed to be absolute to the root of the host file system.
[back to top](#table-of-contents)
—
## TLS/SSL Protocol
TLS/SSL Protocol options, such as cert, key and passphrase, can be set directly in options object, in the agentOptions property of the options object, or even in https.globalAgent.options. Keep in mind that, although agentOptions allows for a slightly wider range of configurations, the recommendend way is via options object directly, as using agentOptions or https.globalAgent.options would not be applied in the same way in proxied environments (as data travels through a TLS connection instead of an http/https agent).
, path = require(‘path’) , certFile = path.resolve(__dirname, ‘ssl/client.crt’) , keyFile = path.resolve(__dirname, ‘ssl/client.key’) , caFile = path.resolve(__dirname, ‘ssl/ca.cert.pem’) , request = require(‘request’);
- var options = {
- url: ‘https://api.some-server.com/‘, cert: fs.readFileSync(certFile), key: fs.readFileSync(keyFile), passphrase: ‘password’, ca: fs.readFileSync(caFile) }
};
### Using options.agentOptions
In the example below, we call an API requires client side SSL certificate (in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol:
, path = require(‘path’) , certFile = path.resolve(__dirname, ‘ssl/client.crt’) , keyFile = path.resolve(__dirname, ‘ssl/client.key’) , request = require(‘request’);
- var options = {
url: ‘https://api.some-server.com/‘, agentOptions: {
cert: fs.readFileSync(certFile), key: fs.readFileSync(keyFile), // Or use pfx property replacing cert and key when using private key, certificate and CA certs in PFX or PKCS12 format: // pfx: fs.readFileSync(pfxFilePath), passphrase: ‘password’, securityOptions: ‘SSL_OP_NO_SSLv3’}
};
It is able to force using SSLv3 only by specifying secureProtocol:
});¶
It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs). This can be useful, for example, when using self-signed certificates. To require a different root certificate, you can specify the signing CA by adding the contents of the CA’s certificate file to the agentOptions. The certificate the domain presents must be signed by the root certificate specified:
});¶
[back to top](#table-of-contents)
—
## Support for HAR 1.2
The options.har property will override the values: url, method, qs, headers, form, formData, body, json, as well as construct multipart data and read files from disk when request.postData.params[].fileName is present without a matching value.
a validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching.
- ```js
var request = require(‘request’) request({
// will be ignored method: ‘GET’, uri: ‘http://www.google.com‘,
// HTTP Archive Request Object har: {
url: ‘http://www.mockbin.com/har‘, method: ‘POST’, headers: [
- {
- name: ‘content-type’, value: ‘application/x-www-form-urlencoded’
}
], postData: {
mimeType: ‘application/x-www-form-urlencoded’, params: [
- {
- name: ‘foo’, value: ‘bar’
}, {
name: ‘hello’, value: ‘world’}
]
}
}
})
// a POST request will be sent to http://www.mockbin.com // with body an application/x-www-form-urlencoded body: // foo=bar&hello=world
[back to top](#table-of-contents)
—
## request(options, callback)
The first argument can be either a url or an options object. The only required option is uri; all others are optional.
- uri || url - fully qualified uri or a parsed url object from url.parse()
- baseUrl - fully qualified uri string used as the base url. Most useful with request.defaults, for example when you want to do many requests to the same domain. If baseUrl is https://example.com/api/, then requesting /end/point?test=true will fetch https://example.com/api/end/point?test=true. When baseUrl is given, uri must also be a string.
- method - http method (default: “GET”)
- headers - http headers (default: {})
—
- qs - object containing querystring values to be appended to the uri
- qsParseOptions - object containing options to pass to the [qs.parse](https://github.com/hapijs/qs#parsing-objects) method. Alternatively pass options to the [querystring.parse](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options) method using this format {sep:’;’, eq:’:’, options:{}}
- qsStringifyOptions - object containing options to pass to the [qs.stringify](https://github.com/hapijs/qs#stringifying) method. Alternatively pass options to the [querystring.stringify](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) method using this format {sep:’;’, eq:’:’, options:{}}. For example, to change the way arrays are converted to query strings using the qs module pass the arrayFormat option with one of indices|brackets|repeat
- useQuerystring - If true, use querystring to stringify and parse querystrings, otherwise use qs (default: false). Set this option to true if you need arrays to be serialized as foo=bar&foo=baz instead of the default foo[0]=bar&foo[1]=baz.
—
body - entity body for PATCH, POST and PUT requests. Must be a Buffer or String, unless json is true. If json is true, then body must be a JSON-serializable object.
form - when passed an object or a querystring, this sets body to a querystring representation of value, and adds Content-type: application/x-www-form-urlencoded header. When passed no options, a FormData instance is returned (and is piped to request). See “Forms” section above.
formData - Data to pass for a multipart/form-data request. See [Forms](#forms) section above.
multipart - array of objects which contain their own headers and body attributes. Sends a multipart/related request. See [Forms](#forms) section above. - Alternatively you can pass in an object {chunked: false, data: []} where
chunked is used to specify whether the request is sent in [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) In non-chunked requests, data items with body streams are not allowed.
preambleCRLF - append a newline/CRLF before the boundary of your multipart/form-data request.
postambleCRLF - append a newline/CRLF at the end of the boundary of your multipart/form-data request.
json - sets body but to JSON representation of value and adds Content-type: application/json header. Additionally, parses the response body as JSON.
jsonReviver - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to JSON.parse() when parsing a JSON response body.
—
- auth - A hash containing values user || username, pass || password, and sendImmediately (optional). See documentation above.
- oauth - Options for OAuth HMAC-SHA1 signing. See documentation above.
- hawk - Options for [Hawk signing](https://github.com/hueniverse/hawk). The credentials key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).
- aws - object containing AWS signing information. Should have the properties key, secret. Also requires the property bucket, unless you’re specifying your bucket as part of the path, or the request doesn’t use a bucket (i.e. GET Services)
- httpSignature - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent’s library](https://github.com/joyent/node-http-signature). The keyId and key properties must be specified. See the docs for other options.
—
- followRedirect - follow HTTP 3xx responses as redirects (default: true). This property can also be implemented as function which gets response object as a single argument and should return true if redirects should continue or false otherwise.
- followAllRedirects - follow non-GET HTTP 3xx responses as redirects (default: false)
- maxRedirects - the maximum number of redirects to follow (default: 10)
- removeRefererHeader - removes the referer header when a redirect happens (default: false).
—
- encoding - Encoding to be used on setEncoding of response data. If null, the body is returned as a Buffer. Anything else (including the default value of `undefined`) will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to toString() (meaning this is effectively utf8 by default). (Note: if you expect binary data, you should set encoding: null.)
- gzip - If true, add an Accept-Encoding header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. Note: Automatic decoding of the response content is performed on the body data returned through request (both through the request stream and passed to the callback function) but is not performed on the response stream (available from the response event) which is the unmodified http.IncomingMessage object which may contain compressed data. See example below.
- jar - If true and tough-cookie is installed, remember cookies for future use (or define your custom cookie jar; see examples section)
—
agent - http(s).Agent instance to use
agentClass - alternatively specify your agent’s class name
agentOptions - and pass its options. Note: for HTTPS see [tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback) and the [documentation above](#using-optionsagentoptions).
forever - set to true to use the [forever-agent](https://github.com/request/forever-agent) Note: Defaults to http(s).Agent({keepAlive:true}) in node 0.12+
pool - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as your options allow for it). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. Note: pool is used only when the agent option is not specified. - A maxSockets property can also be provided on the pool object to set the max number of sockets for all agents created (ex: pool: {maxSockets: Infinity}). - Note that if you are sending multiple requests in a loop and creating
multiple new pool objects, maxSockets will not work as intended. To work around this, either use [request.defaults](#requestdefaultsoptions) with your pool options or create the pool object with the maxSockets property outside of the loop.
timeout - Integer containing the number of milliseconds to wait for a
server to send response headers (and start the response body) before aborting the request. Note that if the underlying TCP connection cannot be established, the OS-wide TCP connection timeout will overrule the timeout option ([the default in Linux can be anywhere from 20-120 seconds][linux-timeout]).
[linux-timeout]: http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout
—
localAddress - Local interface to bind for network connections.
proxy - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the url parameter (by embedding the auth info in the uri)
strictSSL - If true, requires SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that CA as an option.
tunnel - controls the behavior of [HTTP CONNECT tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling) as follows:
- undefined (default) - true if the destination is https or a previous request in the redirect chain used a tunneling proxy, false otherwise
- true - always tunnel to the destination by making a CONNECT request to the proxy
- false - request the destination as a GET request.
proxyHeaderWhiteList - A whitelist of headers to send to a tunneling proxy.
proxyHeaderExclusiveList - A whitelist of headers to send exclusively to a tunneling proxy and not to destination.
—
- time - If true, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response’s elapsedTime property.
- har - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values (see the [HAR 1.2 section](#support-for-har-1.2) for details)
The callback argument gets 3 arguments:
- An error when applicable (usually from [http.ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object)
- An [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage) object
- The third is the response body (String or Buffer, or JSON object if the json option is supplied)
[back to top](#table-of-contents)
—
## Convenience methods
There are also shorthand methods for different HTTP METHODs and some other conveniences.
### request.defaults(options)
This method returns a wrapper around the normal request API that defaults to whatever options you pass to it.
Note: request.defaults() does not modify the global request API; instead, it returns a wrapper that has your default settings applied to it.
Note: You can call .defaults() on the wrapper that is returned from request.defaults to add/override defaults that were previously defaulted.
For example: ```js //requests using baseRequest() will set the ‘x-token’ header var baseRequest = request.defaults({
headers: {x-token: ‘my-token’}
})
//requests using specialRequest() will include the ‘x-token’ header set in //baseRequest and will also include the ‘special’ header var specialRequest = baseRequest.defaults({
headers: {special: ‘special value’}
})¶
### request.put
Same as request(), but defaults to method: “PUT”.
`js
request.put(url)
`
### request.patch
Same as request(), but defaults to method: “PATCH”.
`js
request.patch(url)
`
### request.post
Same as request(), but defaults to method: “POST”.
`js
request.post(url)
`
### request.head
Same as request(), but defaults to method: “HEAD”.
`js
request.head(url)
`
### request.del
Same as request(), but defaults to method: “DELETE”.
`js
request.del(url)
`
### request.get
Same as request() (for uniformity).
`js
request.get(url)
`
### request.cookie
Function that creates a new cookie.
`js
request.cookie('key1=value1')
`
### request.jar()
Function that creates a new cookie jar.
`js
request.jar()
`
[back to top](#table-of-contents)
—
## Debugging
There are at least three ways to debug the operation of request:
- Launch the node process like NODE_DEBUG=request node script.js (lib,request,otherlib works too).
- Set require(‘request’).debug = true at any time (this does the same thing as #1).
- Use the [request-debug module](https://github.com/nylen/request-debug) to view request and response headers and bodies.
[back to top](#table-of-contents)
—
## Timeouts
Most requests to external servers should have a timeout attached, in case the server is not responding in a timely manner. Without a timeout, your code may have a socket open/consume resources for minutes or more.
There are two main types of timeouts: connection timeouts and read timeouts. A connect timeout occurs if the timeout is hit while your client is attempting to establish a connection to a remote machine (corresponding to the [connect() call][connect] on the socket). A read timeout occurs any time the server is too slow to send back a part of the response.
These two situations have widely different implications for what went wrong with the request, so it’s useful to be able to distinguish them. You can detect timeout errors by checking err.code for an ‘ETIMEDOUT’ value. Further, you can detect whether the timeout was a connection timeout by checking if the err.connect property is set to true.
```js request.get(‘http://<IP_ADDRESS>‘, {timeout: 1500}, function(err) {
console.log(err.code === ‘ETIMEDOUT’); // Set to true if the timeout was a connection timeout, false or // undefined otherwise. console.log(err.connect === true); process.exit(0);
});¶
[connect]: http://linux.die.net/man/2/connect
## Examples:
- ```js
- var request = require(‘request’)
- , rand = Math.floor(Math.random()*100000000).toString() ;
- request(
{ method: ‘PUT’ , uri: ‘http://mikeal.iriscouch.com/testjs/‘ + rand , multipart:
- [ { ‘content-type’: ‘application/json’
- , body: JSON.stringify({foo: ‘bar’, _attachments: {‘message.txt’: {follows: true, length: 18, ‘content_type’: ‘text/plain’ }}}) }
, { body: ‘I am an attachment’ } ]
}
- , function (error, response, body) {
- if(response.statusCode == 201){
- console.log(‘document saved as: http://mikeal.iriscouch.com/testjs/’+ rand)
- } else {
- console.log(‘error: ‘+ response.statusCode) console.log(body)
}
}
)
For backwards-compatibility, response compression is not supported by default. To accept gzip-compressed responses, set the gzip option to true. Note that the body data passed through request is automatically decompressed while the response object is unmodified and will contain compressed data if the server sent a compressed response.
- ```js
var request = require(‘request’) request(
{ method: ‘GET’ , uri: ‘http://www.google.com‘ , gzip: true }- , function (error, response, body) {
- // body is the decompressed response body console.log(‘server encoded the data as: ‘ + (response.headers[‘content-encoding’] || ‘identity’)) console.log(‘the decoded data is: ‘ + body)
}
- ).on(‘data’, function(data) {
- // decompressed data as it is received console.log(‘decoded chunk: ‘ + data)
}) .on(‘response’, function(response) {
// unmodified http.IncomingMessage object response.on(‘data’, function(data) {
// compressed data as it is received console.log(‘received ‘ + data.length + ‘ bytes of compressed data’)})
})
Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set jar to true (either in defaults or options) and install tough-cookie.
```js var request = request.defaults({jar: true}) request(‘http://www.google.com‘, function () {
request(‘http://images.google.com‘)
})¶
To use a custom cookie jar (instead of request’s global cookie jar), set jar to an instance of request.jar() (either in defaults or options)
```js var j = request.jar() var request = request.defaults({jar:j}) request(‘http://www.google.com‘, function () {
request(‘http://images.google.com‘)
})¶
OR
```js var j = request.jar(); var cookie = request.cookie(‘key1=value1’); var url = ‘http://www.google.com‘; j.setCookie(cookie, url); request({url: url, jar: j}, function () {
request(‘http://images.google.com‘)
})¶
To use a custom cookie store (such as a [FileCookieStore](https://github.com/mitsuru/tough-cookie-filestore) which supports saving to and restoring from JSON files), pass it as a parameter to request.jar():
```js var FileCookieStore = require(‘tough-cookie-filestore’); // NOTE - currently the ‘cookies.json’ file must already exist! var j = request.jar(new FileCookieStore(‘cookies.json’)); request = request.defaults({ jar : j }) request(‘http://www.google.com‘, function() {
request(‘http://images.google.com‘)
})¶
The cookie store must be a [tough-cookie](https://github.com/goinstant/tough-cookie) store and it must support synchronous operations; see the [CookieStore API docs](https://github.com/goinstant/tough-cookie/#cookiestore-api) for details.
To inspect your cookie jar after a request:
```js var j = request.jar() request({url: ‘http://www.google.com‘, jar: j}, function () {
var cookie_string = j.getCookieString(url); // “key1=value1; key2=value2; ...” var cookies = j.getCookies(url); // [{key: ‘key1’, value: ‘value1’, domain: “www.google.com”, ...}, ...]
})¶
[back to top](#table-of-contents)


AMERICAN HISTORY X
***1/2 (out of ****)
Rated R (for excessive strong language, strong sexuality, nudity, and graphic brutal violence including a prison rape scene)
Derek Vinyard: Edward Norton Danny Vinyard: Edward Furlong Doris Vinyard: Beverly D'Angelo Bob Sweeney: Avery Brooks Lamont: Guy Torry Stacey: Fairuza Balk Cameron Alexander: Stacey Keach Murray: Elliot Gould
Directed by Tony Kaye. Produced by John Morrissey. Screenplay by David McKenna. Distributed by New Line Cinema. Running time: 118 minutes. Release date: October 30, 1998 in limited release; wide November 20th.
(to read this review complete with pictures from the film, visit's Jeffrey Huston's site at: http://www.impactprod.org/people/huston/americanhistoryx.htm )
I've lived up and down the Midwest, a.k.a. "The American Heartland", all of my life. Although I have interacted with different races throughout my life, I have never been around or confronted by issues of racism. Racial hatred and injustice was something I saw in the paper or reported on the evening news.
That isn't to say that I haven't lived around or interacted with different races; I have. Chalk it up to blessed surroundings or naiveté, but wherever I've lived, races have intermingled with warm friendship and equal respect. In some segments of our society, however, racism is alive and well.
Even though there are rural elements of bigotry like the KKK, the majority of racial tension and aggression in contemporary America is taking place in our nation's inner cities. I've never seen this life and culture first-hand. I've never fully witnessed the racist extremes of both blacks and whites. I' ve never been to these subcultures of anger, hatred, and violence. "American History X" brought me there.
 After committing a brutal crime of violence under the guise of self-defense, Derek lands in jail. This begins a personal journey for Derek Vinyard, one that forces him to confront his venomous hatred and racist beliefs and see them for the lies that they really are.
First time feature director Tony Kaye and screenwriter David McKenna have created a very powerful story here, with much of the dramatic evolution coming from the way in which they structured the story itself. The events of "American History X" are not told chronologically. Rather, the story goes back and forth between the present and the past. In doing this, the story continues to grab our attention as it slowly develops and reveals the dimensions of each of its characters, particularly Derek.
I love films that do this because they don't show all of their cards up front. We see each character act a certain way in the first part of the story, but only through the course of the film do we slowly come to realize why they have become the way that they are. It is also a precarious balance to continue to go backwards and forwards in time, but credit Kaye and McKenna for always making it clear and seamless.
One of the ways this is accomplished is that Kaye filmed every event from the past in black and white. But when we return to the present, everything is in color. Not only is this a good artistic way to express symbolism, but it is also an effective method to use when telling a story in a non-linear sequence.
By seeing either color or black and white, we immediately know two things: A -- when the particular scene is taking place. B – the psychological, mental, and emotional state of each character. This aids the viewer in helping them to easily switch back and forth between the different emotional perspectives that each time period depicts.
Most films that broach the issue of racism are afraid to confront the complexities that the subject possesses. It's rather brave indeed to have a main character back up his opinions with statistics and facts that are hard to refute. Granted, Derek's philosophical conclusions to these facts (as wel l as his solutions to them) are horrifically wrong and come from a destructive motivation. But most movies depict neo-Nazi Skinheads as brainwashed rednecks with no intellect or reasoning. And whereas many of the Skinheads in this film are exactly that, Derek is much more complex.
Many of the Skinheads get some sort of perverted fun out of being hate-mongering fascists, but Vinyard takes it very seriously. There is more than senseless hatred involved; Derek has been hurt and destroyed by certain elements of society. Empowered with great intelligence, he uses his intellect to distort complex issues into misguided racist opinions. "American History X" is able to maintain the correct moral perspective while challenging us in a very politically incorrect yet honest way.
"American History X" has a stellar cast, led with a powerhouse performance by Edward Norton ("Primal Fear", "Rounders"). Over the last two years, Norton has never failed to impress. But his portrayal of Derek Vinyard is the best of his career. Having beefed up for the role, Norton embodies the role of an embittered young man who sees hatred and violence as the only solution to society's ills. We never sympathize with Derek in his racist incarnation, but we do understand him.
This is a phenomenal job of characterization by Norton as he is able to humanize Derek without taking it to a level of empathy. It is a responsible acting effort, one where sympathy is eventually evoked but not to the extent of absolving responsibility for Derek's actions. With this performance, Norton emerges as one of the very best actors working in film today. Be very surprised if he is not recognized with an Oscar nomination next February.
Up until now, I have not been a fan of Edward Furlong ("Terminator 2: Judgment Day"). Most of the characters he has played have been one-dimensional rebellious punks. He's still a punk in this film, but the difference is that Furlong's Danny Vinyard is a fully developed, three-dimensional person. As Derek's hero-worshipping younger brother Danny, Furlong delivers a sad, poignant performance of a young impressionable kid caught in racism's crossfire.
Danny shows as much scholastic promise as Derek did, but sells himself short as he struggles to live a life according to how he thinks Derek wants him to live it.  Furlong's vulnerability allows us to see the upheaval that Danny experiences.
Beverly D'Angelo is impressive as a mother destroyed by her family's hatred. Stacey Keach offers a subtle evil as Cameron, Derek's facist mentor and organizer of the Skinhead faction. Avery Brooks provides the film's moral center as an African-American teacher who refuses to give up on Derek and Danny. But it is comedian Guy Torry who provides the film's greatest surprise as Derek's fellow prison inmate Lamont. Torry's performance is both overtly funny and quietly direct. Through Lamont, Derek is finally able to see an African-Americans as a real person for the first time.
It is also through Lamont that one of the film's central themes is communicated. While many people of color (as well as Caucasians) are serving appropriate jail sentences, there are those who are victims of the system. Lamont is one of those victims. And as much as we may not want to face this particular cancer that appears from time to time in our judicial process, it is something we must be willing to face if we are to honestly address the racial injustices that come into play from time to time.
Director Tony Kaye also serves as the film's cinematographer. As one of the most respected commercial directors of the last decade, he has made a name for himself with creative visuals. His talent is very apparent here as he unintentionally establishes himself as the dramatic John Woo. Kaye, like Woo, has a penchant for slow motion. But like Woo, Kaye's use of this effect always seems to fit.
The main thing that impressed me was Kaye's fearless use of the close-up. I am a big fan of close-ups and believe that directors don't use them nearly enough. Kaye does in this film, allowing us to peer into each characters eyes and give us a sense of what they are really feeling. Kaye has the high-quality acting talent that enables him to do this. Wisely, he takes advantage of it.
Be warned: "American History X" contains very graphic content throughout the film.  While the message of the film is timely and important, there will be those who simply can't take the package in which it is delivered. If these elements sound troublesome, you may need to carefully consider your decision to see this film.
If "American History X" has a flaw, it comes in some of the plot elements that it asks us to accept and believe to be possible. Derek is given a scant three years in prison for the two murders he commits. Granted, the thieves he gunned down were carrying guns themselves. As a result, Vinyard's charges of murder are reduced to manslaughter via self-defense. This might happen for your average Joe, but for a Swastika-brandishing Skinhead who excessively brutalized one of his victims, it seems too lenient.
Also, the film tries to resolve a couple of its issues and characters too quickly (roughly a day and a half time period within the film). This seems a little forced given that the hatred and bigotry has been built up over many years. But having said that, I credit "American History X" for not tying this film up in a pretty bow. If anything, the story does not allow the characters to escape their past even when they may want it to simply go away. Powerfully and tragically, this film shows the reality of reaping the harvest of evil seeds sewn, even when you've repented and changed.
But for me, these criticisms are minor because they had a minimal negative affect (if any at all) on me. In spite of these stretches in realism, the film never loses its power.  It will also stay with you. "American History X" is one of the best films of 1998. It is a film sure to cause debate, controversy and discussion. If you can stomach the graphic nature of the film, you will witness the most honest depiction of modern American racism since Spike Lee' s "Do the Right Thing". It's a tough, sometimes sickening journey, but one well worth taking.
If you would like to read other film reviews by Jeffrey Huston, visit his film review site "Believe Me" at: http://www.impactprod.org/people/huston/core.htm
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


| Class | Description |
|---|---|
| AarRecord |
Implements AAR NDEF message
Introduced in Android 4.0 (API level 14), an Android Application Record (AAR) provides a stronger certainty that your application is started
when an NFC tag is scanned.
|
| BtLeRecord |
BtLeRecord is the class in charge of reading/writing Bluetooth Low Energy NDEF records.
|
| BtRecord |
BtRecord is the class in charge of reading/writing Bluetooth NDEF records.
|
| EmailRecord |
EmailRecord is the class in charge of reading/writing Email NDEF records.
|
| EmptyRecord |
Implements NFC Forum Empty NDEF record
|
| ExternalRecord |
Implements NFC Forum External NDEF message
|
| MimeRecord |
Implements NFC Forum MIME NDEF message
|
| NDEFMsg |
Class describing the content of one NDEF message.
|
| NDEFRecord | |
| NdefRecordFactory | |
| SmsRecord | |
| TextRecord |
Implements NFC Forum Text NDEF message
Refers to NFCForum-TS-RTD_Text_1.0 http://members.nfc-forum.org/apps/group_public/document.php?document_id=5080
|
| UriRecord | |
| VCardRecord |
Implements NFC Forum VCard NDEF message
Refers to http://www.rfc-editor.org/info/rfc6350 vCard Format Specification
|
| WifiRecord |
WifiRecord is the class in charge of reading/writing WiFi NDEF records.
|
| Enum | Description |
|---|---|
| MimeRecord.NdefMimeIdCode | |
| NdefRecordFactory.NdefRecordType | |
| UriRecord.NdefUriIdCode |
URI Identifier Codes to be used in place of some of the standard URI headers
|
COPYRIGHT 2017 STMicroelectronics. All rights reserved.


Dear friend, Let me apologize to you for using this medium to communicate to you about this project. I am a highly placed official of the Government of Nigeria and also a founding member of the PEOPLES DEMOCRATAIC PARTY (PDP),which is the ruling party in Power now, in this Country. My committee - The Niger Delta Development Commission(NDDC)-which is in charge of managing and supervising the development of the Oil rich states in this Country. We are given Monthly allocation that runs into several millions of DOLLARS/POUNDS from oil sales of this Country to cover payments of foreign and local contractors who has/is executing contracts for this oil region called the NIGER DELTA. My self and other colleagues in this commission, NDDC are currently in need of a foreign partner with whose bank account we shall transfer the sum of Forty Nine Million, Five Hundred Thousand United States Dollars($49.5m).This fund was accrued from various over invoicing of contracts awarded to foreign contractors over the existing years of this commission. However, by virtue of our position as civil servants and members of the NDDC, we cannot acquire this funds in our name. This is because as top civil servants, we are not allowed by law of the land to own or operate bank accounts outside our country for now therefore, I have been delegated as a matter of trust by my colleagues,to look for an oversea trusted partner in whose account we would transfer the fund Hence the reason for this mail.  For your support and partnership,please reply me to negotiate your fees or the percentage you wish to be paid when the funds arrive your bank account. You must however note that this transaction, with regards to our disposition to continue with you, is subject to these terms below. FIRST, our conviction of your transparency. SECONDLY,that you treat this transaction with utmost secrecy and confidentiality. Finally and above all, that you will provide an account that you have absolute control. This transaction, although discrete, is legitimate and there is no risk or legal disadvantages either to ourselves or yourself now or in the future as we have put in place perfect machineries that will ensure a hitch free transfer of fund into your account upon acceptance. The transfer will be effected to your account within ten-fourteen (10-14) working days as soon as we reach an agreement and you furnish me with a suitable bank account,company name,address and with all your contact phone numbers including fax number. I am looking forward to doing business with you and do solicit your confidentiality in this transaction, Please mail your response to me through this email<EMAIL_ADDRESS>Yours faithfully, MR.ERIC STEPHEN


The JNDI specification was developed by Sun Microsystems with a number of leading industry partners, including Novell, Netscape, SCO, and BEA.
Directory services play a vital role in Intranets and Internets by providing access to a variety of information about users, machines, networks, services, and applications. By its very nature, a directory service incorporates a naming facility for providi ng human understandable namespaces that characterize the arrangement and identification of the various entities.
The computing environment of an enterprise typically consists of several naming facilities often representing different parts of a composite namespace. For example, the Internet Domain Name System (DNS) may be used as the top-level naming facilit y for different organizations within an enterprise. The organizations themselves may use a directory service such as LDAP or NDS or NIS. From a user's perspective, there is one namespace consisting of composite names. URLs are examples of composite names because they span namespaces of multiple naming facilities. Applications which use directory services must support this user perspective.
Many Java application developers can benefit from a directory service API that is not only independent of the particular directory or naming service implementation, but also enables seamless access to directory objects through multiple naming facilities. In fact, an application can attach its own objects to the namespace. Such a facility enables any Java application to discover and retrieve objects of any type.
JNDI provides directory and naming functionality to Java applications. It is defined to be independent of any specific directory service implementation. Thus, a variety of directories, new and existing ones in the installed base, can be a ccessed in a common way.
JNDI also defines a service provider's interface which allows various directory and naming service drivers to be plugged in.
Here are two examples to briefly illustrate some of the more commonly used features of JNDI.
An application that wants to access a printer needs the corresponding printer object. This is simply done as follows:
prt = (Printer) building7.lookup("puffin"); prt.print(document);
where
building7
is the naming context representing a
physical building that provides a convenient context for referring
to the printers.
JNDI does all the work of locating the information needed to construct the printer object.
As another example, an application that wants to find a person's phone numbers, which are stored in the organization's directory, can simply do:
String[] attrs = {"workPhone", "cellPhone", "faxNumber"}; bobsPhones = directory.getAttributes("cn=Bob,o=Widget,c=US", attrs);
If there may be several Bobs in the Widget organization, the application can search the organization's directory to find the right Bob as follows:
bob = directory.search("o=Widget,c=US","(cn=Bob)", controls);
Other application examples include access to security credentials stored in an enterprise-wide directory service, access to electronic mail addresses, and access to addresses of a variety of existing services such as databases, network file systems, etc.
Context
is
the core interface that specifies a naming context. It defines
basic operations such as adding a name-to-object binding, looking
up the object bound to a specified name, listing the bindings,
removing a name-to-object binding, crea ting and destroying
subcontexts of the same type, etc.
Context.lookup()
is the most commonly used operation.
The context implementation can return an object of whatever class
is required by the Java application. For example, an application
might use the name of a printer to look up the correspond ing
Printer
object, and then print to it directly:
Printer printer = (Printer) ctx.lookup("treekiller"); printer.print(report);
The application is not exposed to any naming service implementation. In fact, a new type of naming service can be introduced without requiring the application to be modified or even disrupted if it is running.
Directory Objects and
Attributes. The DirContext
interface enables the
directory capability by defining methods for examining and updating
attributes associated with a directory object. Each directory
object contains a set of zero or more objects of class
Attribute
. Each attribute is denoted by a string
identifier and can have zero or more values of any type.
Directory Objects as
Naming Context. The DirContext
interface also
behaves as a naming context by extending the Context
interface. This means that any directory object can also provide a
naming context. In addition to a directory object keeping a variety
of information about a person, for example, it is also a natural
naming context for resources associated with that person: a
person's printers, file system, calendar, etc.
Searches. The
DirContext
interface supports content-based searching
of directories. In the simplest and most common form of usage, the
application specifies a set of attributes - possibly with specific
values - to match. It then invo kes the
DirContext.search()
method on the directory object,
which returns the matching directory objects along with the
requested attributes.
Naming Events.
The NamingEvent
class represents an event generated by
a naming or directory service. Examples of a
NamingEvent
are a change to a directory entry's
attribute or a rename of a directory entry.
Naming
Listeners. A NamingListener
is an object that
registers interests in NamingEvent
s. Listeners
register with a context to receive notification of changes in the
context, its children, or its subtree.
The
LdapContext
interface allows an application to use
LDAP v3-specific features, including extensions and
controls, not already covered by the more generic
DirContext
interface.
The JNDI SPI provides the means by which different naming/directory service providers can develop and hook up their implementations so that the corresponding services are accessible from applications that use JNDI. In add ition, because JNDI allows specification of names that span multiple namespaces, if one service provider implementation needs to interact with another in order to complete an operation, the SPI provides methods that allow different provider implementations to cooperate to complete client JNDI operations.


#^------------------------------ #^_blog_post_json { "title":"Bards Log 04", "author":"Strumm", } #^------------------------------ #^_blog_post_body form=markdown {tuwitu5} {tuwitu4} {tuwitu3} {tuwitu2} {tuwitu1} #^tuwitu5
|
Gwinny Hilltopple 8 moons ago
I didn't get what I needed to make fire shoot out of my dulcimer, but I did get a magical hat that lets me disguise myself as anyone I like
|
|
Gwinny Hilltopple 8 moons ago
I used it to pretend to be the lead singer of rival Bard band, "Channel Divinity" destroying their reputation around the village. FUN #DnD
|
|
Gwinny Hilltopple 8 moons ago
Oh, and while we were shopping for souvenirs we found a shop selling "The Bag Of Infinite Squirrels". Tip it up, squirrel pops out. #DnD
|
|
Gwinny Hilltopple 8 moons ago
We sent some undead imp summoner into a crazy fit of rage by throwing some squirrels at him. Others were merely bemused.
|
|
Gwinny Hilltopple 8 moons ago
All in a day's work for Bards, Bards, Bards. World's greatest Dungeons and Dragons slightly-evil-aligned superstar mercenary bard militia.
|


By default there is a page trigger for each route change. To disable this feature for a specific route, add doNotTrack:
true
to your route's data in app-routing.module.ts
.
Use default parameters:
Or use custom parameters:
Trigger an event from the controller:
Or trigger an event from the view with the gaEvent
directive. This directive sends a click event to GA
with the tagname of the element as category, click as action, the inner text as label and the directive input as
value.
Trigger event without value:
Trigger event with value:


Choose the dataset to disply statistics for
Internet Penetration
Cellular Subscription
Fixed Broadband
Seure Servers
Personal Computers
Choose the countries to display statistics for
Ghana
Mauritius
United Kingdom
Your browser does not support the canvas element. Please consider upgrading your browser.


/**
* @classdesc This is used to load an extension to Google Chrome in developer mode.
* @class Background
*
* @example
*
* $('#sketch').click(function() {
* chrome.tabs.executeScript(null, {file:"jquery-1.9.0.min.js"},
* function() {
* chrome.tabs.insertCSS(null, {file: "style.css"});
* chrome.tabs.executeScript(null, {file:"file.js"});
* });
* });
*
* @author albinantony (Albin Antony)
* @version 1.0
*
* @license
* The MIT License (MIT)
*
* Copyright (c) 2015 albinantony
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
$('#sketch').click(function(){
chrome.tabs.executeScript(null, {file:"lib/jquery-1.9.0.min.js"},
function() {
chrome.tabs.insertCSS(null, {file: "css/injectStyle.css"});
chrome.tabs.executeScript(null, {file:"js/HandDrawing.js"});
});
});
$('.menuItem').on('mousedown', function(){
$(this).css('background-color', '#3399FF');
});
$('.menuItem').on('mouseup', function(){
$(this).css('background-color', '#F0F0F0');
});


Even more websites all about website templates on Just Web Templtes.
If you're looking for beautiful and professionally made templates you can find them at Template Beauty.
You can remove any link to our websites from this template you're free to use template without linking back to us.


The number of primes smaller than or equal to n is approximately n/log(n).
In fact, if p(n) is the number of primes smaller than or equal to n,
$ \frac{\mathrm{p(n)}}{\mathrm{n/log(n)}} \to 1 \text{ as } \mathrm{n} \to \infty $


--- layout: post date: 2012-09-24 15:54:00 +02:00 title: "lvm-snapshots: fixing lvremove" ---
On an up-to-date Debian testing system, lvremove fails sporadically when removing snapshots. The cause is not yet fully debugged, see Debian bug 549691. The symptom looks like this:
$ lvremove -f plana/snap_web Unable to deactivate open plana-domu--web-real (253:3) Failed to resume domu-web.
To work around this, use the following commands (works reliably, tested for a few days):
$ dmsetup remove /dev/mapper/plana-snap_web $ dmsetup remove /dev/mapper/plana-snap_web-cow $ lvremove -f plana/snap_web
Since they only remove the snapshot-mappings, this does not touch the data on the original LV at all.


Board Chair
Tommie Cervetti has served on the ITNMemphis Board since 2011 and was elected Secretary in January, 2013. She is retired from Shelby County Government, having served 12 years as Manager of the County Mayor's Office on Aging then Manager for Information and Assistance for the Aging Commission of the Mid South. She served two terms as President of the Council on Aging, and was Chair of the Advisory Council for the Senior Companion Advisory Council at MIFA.
Cervetti received a Presidential Appointment to the 1995 White House Conference on Aging and also served as Chair of the Board of Catholic Charities, President of her Parish Council. She holds a BSE from the University of Arkansas and an MA in Urban Anthropology from the University of Memphis.
Founding Board Member
Reverend Doctor Mark Matheny has been involved with ITNMemphis since 2010 and has served on the board since 2011. Matheny retired as the Senior Minister at St. Luke’s United Methodist Church in Memphis. Dr. Matheny now works with several other non-profits in the community, such as Highland Area Renewal Corporation (HARC) and United Methodist Neighborhood Centers of Memphis.
A native of Hattiesburg, MS, Rev. Matheny is a third-generation United Methodist minister who received degrees from Millsaps College, Southern Methodist University and Emory University.
Acting Operations Manager
Pat Hickman has served on the Board of ITNMemphis since its inception in 2010. She also serves as an officer for the Highland Area Renewal Corporation (HARC), which served as the fiduciary agent for Friends of ITNMemphis before 501 (c) 3 status and affiliation with ITNAmerica was secured. She volunteered to be the Acting Operations Manager in July 2014 to carry the program to its first ride in December 2014.
In October 2016 she received the ITNAmerica Volunteer of the Year Award. She is an elder at Buntyn Presbyterian Church where ITNMemphis offices are located. Hickman hold a BS in Nursing from Vanderbilt University and an MS in Education from the University of Memphis.
Board Member
Caroline "Vickie" Sweeney is retired from Baptist Memorial Hospital and is currently a rider with ITNMemphis. She is a graduate of Kingsbury High School. She is an avid Memphis Grizzlies and University of Memphis fan.
Board Member
Michael J. Bradshaw, Jr. is an attorney with Butler Snow Law firm in Memphis as a member of the Public Finance, Tax Incentives and Credit Markets group. He is admitted to the Bar in Tennessee, Georgia and the District of Columbia.
ITN{{affiliate}} is part of the ITNAmerica family, which unites organizations across the country working to support the transportation needs of older people. The ITNAmerica model offers a platform for dignified, sustainable mobility using technological solutions and innovative programming. We welcome your interest, and hope you will consider the benefits of having an ITN affiliate in your area. To learn more, contact us
Advisory Board
Reverend Chris Carter joined the Advisory Board in 2016 after serving 3 years on the Board of Directors as Congregational Liaison with Christ United Methodist Church. He continues to serve in this role as liaison. He is Teaching Pastor and Executive Director of Men and Senior Adult programs at CUMC. Rev. Carter received his B.A. in English Literature and Biblical Education from Lee University in Cleveland TN, and a M. Div. in Pastoral Ministry and D. Min. from Asbury Theological Seminary in Kentucky.
Advisory Board
Dan H. Murrell, CFRE, is the founding board president of ITNMemphis where he served until 2013. His interest in senior transportation issues stems from his time as Director of Development and Community Relations at Trezevant Manor, a continuing care retirement community in Memphis, TN. He and friend, Fred Wimmer, recognized the need for such a service and set out to bring an affiliate of ITNAmerica to Memphis.
Murrell has been in nonprofit development work since 1997 and is now Director of Planned Giving at the University of Memphis. He earned the CFRE accreditation in 2008, the only internationally-recognized baseline professional credential for philanthropic fundraising executives.


Le Brutaliste
Le Brutaliste is a mobile game I worked on at NAD, made in Unreal 4 with a team of 21.
It is available on Google Play Store for free.
About:
In Le Brutaliste, you play as Howard, an angry architect in 1940s Montreal who seeks revenge against his rival, Peter. Tap and swipe as Howard runs forward to destroy as much of Peter's creations as you can!
My tasks:
Game design, level design on 3 stages, menu navigation, trailer
Video reflects the work of the entire team.
Plan of the level shown in the video above, annoted with explanations.
The basic rules of the game were already decided before I joined the project. My tasks were to "find the fun" and balance different aspects of the game to make it satisfying. I documented the heights and color codings of the obstacles and the rules of a level design for others to follow.
State machines & Diagrams
I did various diagrams to help the team.
Flow of the menus, to help the programmers and the UI artist.
Not illustrated here are alternative scenarios where I cut less important features such as "Mode Défi" in case we had to scale back.
State machine explaining which actions trigger which animations. Made to help the programmers and the animators.
Diagram showing important scales after early playtesting, to help level designers and myself to build levels, and to give modelers guidelines on model sizes.
The tutorial
Both the programmers and artists were running out of time and we still didn't have a tutorial for the game. I took care of finding a simple way to explain the game without needing much extra resources. Instead of starting the game directly in Montreal, Howard begins in a 3D blueprint with tears open at the end of the tutorial to reveal a street with buildings.
The player gets introduced to mechanics with pop-up messages, then pictograms of the required touch motions are placed on the background, giving the players an early view of what to expect in a normal level in terms of pacing.
We had bigger plans for the tutorial, but this solution was better than no tutorial at all and was done by myself in a few days.


#assign testproperties="active">
If we are using ebean-test-config
that will automatically set appropriate DLL properties for
testing. If we are not using that or just want to understand more and have finer control read on ...
Controlling the generation and running of db-create-all.sql and db-drop-all.sql.
| Property | Description |
|---|---|
| ddl.generate | Set to true to generate the db-create-all.sql and db-drop-all.sql DDL scripts. |
| ddl.run | Set to true to run the db-create-all.sql, db-drop-all.sql and extra DDL scripts |
| ddl.createOnly | Set to true to run the db-create-all.sql but NOT run the db-drop-all.sql. Mostly used with H2 database in-memory testing when we know that the database is not populated / there are no tables to drop first. |
| ddl.initSql | Specify a SQL script to run prior to running the create-all ddl. |
| ddl.seedSql | Specify a SQL script to run after to running the create-all ddl. Typically this inserts seed data into the test database. |
| ebean.migraton.run | Set to true or false to run the migrations when the EbeanServer starts |


fun decodePublicKey(encodedKey: ByteArray): PublicKey
Decode an X509 encoded key to its PublicKey object.
encodedKey
- an X509 encoded public key.
UnsupportedSchemeException
- on not supported scheme.
IllegalArgumentException
- on not supported scheme or if the given key specification
is inappropriate for this key factory to produce a private key.
fun decodePublicKey(encodedKey: ByteArray, schemeCodeName: String): PublicKey
Decode an X509 encoded key to its PrivateKey object based on the input scheme code name. This will be used by Kryo deserialisation.
encodedKey
- an X509 encoded public key.
schemeCodeName
- a String that should match a key in supportedSignatureSchemes map (e.g. ECDSA_SECP256K1_SHA256).
IllegalArgumentException
- if the requested scheme is not supported
InvalidKeySpecException
- if the given key specification
is inappropriate for this key factory to produce a public key.


Bot Sub-Team¶
Role:¶
Develop and manage the conda-forge migration bot and all related tooling. Also manages and deploys migrations themselves.
Charter:¶
Dynamic
Responsibility:¶
The migration and autotick bot is now a central part of the conda-forge ecosystem. This subteam has the right and responsibility to manage and develop the general operation of the bot. This includes building new migrators, fixing migration related bugs, and tooling. Example migrations that can happen include:
- Compiler bumps
- Python version bump
- R version bump
- Build number bumps of the ecosystem when a pinned package version updates and there is a binary incompatibility which necessitate downstream rebuilds.
- Automatically version bumping of feedstocks when the package releases a new version.
For large scale (affecting >20% of packages) this sub-team will inform and discuss with the core team about the upcoming migration prior to starting the migration.
Packages and tools that fall under the purview of the bot subteam include:
- cf-scripts
- libcflib
- libcfgraph
- cf-graph
- circle-worker
Members:¶
- Justin Calamari<EMAIL_ADDRESS>- Filipe Fernandes<EMAIL_ADDRESS>- Marius van Niekerk<EMAIL_ADDRESS>- Michael Sarahan<EMAIL_ADDRESS>- Anthony Scopatz<EMAIL_ADDRESS>- Christopher J. “CJ” Wright <cjwright4242@gmail.com>


{% extends "./html/_layouts/_default.html" %} {% block title %} {{SITE_NAME}} {% endblock %} {% block content %}
This web site host some small Python utility web applications.
These utilities are separated into generic utilities and personal utilities.
Personal utilities are applications that are written and targetted to help me only. They are not of any use of anyone else.
Generic utilities are applications that can be of use to anyone who uses for the same goal.
Takes in a file list of urls and dump them into local Sqlite3 db.
Takes in a file list of urls and dump them into local Sqlite3 db.
Appends image to PDF list and generate.


Much of "the law" is a set of naming conventions for shared ideas. So is the web.
The top level expressed here is:-
"F" is the focus of this site. It is a first-cut on a consolidate code of all legal documents.
-
"GH" is for GitHub repos. "GHx" represents GitHub repos that we have imagined.
-
"P" is reserved for your private, preferred, proprietary materials. You will want some place to keep your private forms, clauses, instructions, etc.
-
"S" for some shared materials, stuff thought common and codified.
-
"U" means something like "you" and has info about persons and places.
-
"W" is intended to denote a www. website. "Wx" because not official.
-
"Z" is little bits of infrastructure text.
-
"ipfs" is experiments with the IPFS hashed text files.
-
"zFact" is a parking place for "facts" currently just a taxonomy of "FHIR" medical record codes.
A place to start might be: Paris2.


Files
TOC
Description
Files
Description
Which file user has to include in project.
Files
There are two options.
"Few files"
TODO See also:
macro
,
FAQ
All files
TODO


Branches
Decimal Mode
Interrupt Flag
Overflow Flag
Program
Counter
Stack
Times
Wrap-around
ADC
AND
ASL
BCC
BCS
BEQ
BIT
BMI
BNE
BPL
BRK
BVC
BVS
CLC
CLD
CLI
CLV
CMP
CPX
CPY
DEC
DEX
DEY
EOR
INC
INX
INY
JMP
JSR
LDA
LDX
LDY
LSR
NOP
ORA
PHA
PHP
PLA
PLP
ROL
ROR
RTI
RTS
SBC
SEC
SED
SEI
STA
STX
STY
TAX
TAY
TSX
TXA
TXS
TYA
Affects Flags: S V Z C
MODE SYNTAX HEX LEN TIM Immediate ADC #$44 $69 2 2 Zero Page ADC $44 $65 2 3 Zero Page,X ADC $44,X $75 2 4 Absolute ADC $4400 $6D 3 4 Absolute,X ADC $4400,X $7D 3 4+ Absolute,Y ADC $4400,Y $79 3 4+ Indirect,X ADC ($44,X) $61 2 6 Indirect,Y ADC ($44),Y $71 2 5+ + add 1 cycle if page boundary crossedADC results are dependant on the setting of the decimal flag. In decimal mode, addition is carried out on the assumption that the values involved are packed BCD (Binary Coded Decimal).
There is no way to add without carry.
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Immediate AND #$44 $29 2 2 Zero Page AND $44 $25 2 3 Zero Page,X AND $44,X $35 2 4 Absolute AND $4400 $2D 3 4 Absolute,X AND $4400,X $3D 3 4+ Absolute,Y AND $4400,Y $39 3 4+ Indirect,X AND ($44,X) $21 2 6 Indirect,Y AND ($44),Y $31 2 5+ + add 1 cycle if page boundary crossed
Affects Flags: S Z C
MODE SYNTAX HEX LEN TIM Accumulator ASL A $0A 1 2 Zero Page ASL $44 $06 2 5 Zero Page,X ASL $44,X $16 2 6 Absolute ASL $4400 $0E 3 6 Absolute,X ASL $4400,X $1E 3 7ASL shifts all bits left one position. 0 is shifted into bit 0 and the original bit 7 is shifted into the Carry.
Affects Flags: N V Z
MODE SYNTAX HEX LEN TIM Zero Page BIT $44 $24 2 3 Absolute BIT $4400 $2C 3 4BIT sets the Z flag as though the value in the address tested were ANDed with the accumulator. The S and V flags are set to match bits 7 and 6 respectively in the value stored at the tested address.
BIT is often used to skip one or two following bytes as in:
CLOSE1 LDX #$10 If entered here, we .BYTE $2C effectively perform CLOSE2 LDX #$20 a BIT test on $20A2, .BYTE $2C another one on $30A2, CLOSE3 LDX #$30 and end up with the X CLOSEX LDA #12 register still at $10 STA ICCOM,X upon arrival here.
Affect Flags: none
All branches are relative mode and have a length of two bytes. Syntax is "Bxx Displacement" or (better) "Bxx Label". See the notes on the Program Counter for more on displacements.
Branches are dependant on the status of the flag bits when the op code is encountered. A branch not taken requires two machine cycles. Add one if the branch is taken and add one more if the branch crosses a page boundary.
MNEMONIC HEX BPL (Branch on PLus) $10 BMI (Branch on MInus) $30 BVC (Branch on oVerflow Clear) $50 BVS (Branch on oVerflow Set) $70 BCC (Branch on Carry Clear) $90 BCS (Branch on Carry Set) $B0 BNE (Branch on Not Equal) $D0 BEQ (Branch on EQual) $F0There is no BRA (BRanch Always) instruction but it can be easily emulated by branching on the basis of a known condition. One of the best flags to use for this purpose is the oVerflow which is unchanged by all but addition and subtraction operations.
A page boundary crossing occurs when the branch destination is on a different page than the instruction AFTER the branch instruction. For example:
SEC BCS LABEL NOPA page boundary crossing occurs (i.e. the BCS takes 4 cycles) when (the address of) LABEL and the NOP are on different pages. This means that
CLV BVC LABEL LABEL NOPthe BVC instruction will take 3 cycles no matter what address it is located at.
Affects Flags: B
MODE SYNTAX HEX LEN TIM Implied BRK $00 1 7BRK causes a non-maskable interrupt and increments the program counter by one. Therefore an RTI will go to the address of the BRK +2 so that BRK may be used to replace a two-byte instruction for debugging and the subsequent RTI will be correct.
Affects Flags: S Z C
MODE SYNTAX HEX LEN TIM Immediate CMP #$44 $C9 2 2 Zero Page CMP $44 $C5 2 3 Zero Page,X CMP $44,X $D5 2 4 Absolute CMP $4400 $CD 3 4 Absolute,X CMP $4400,X $DD 3 4+ Absolute,Y CMP $4400,Y $D9 3 4+ Indirect,X CMP ($44,X) $C1 2 6 Indirect,Y CMP ($44),Y $D1 2 5+ + add 1 cycle if page boundary crossedCompare sets flags as if a subtraction had been carried out. If the value in the accumulator is equal or greater than the compared value, the Carry will be set. The equal (Z) and sign (S) flags will be set based on equality or lack thereof and the sign (i.e. A>=$80) of the accumulator.
Affects Flags: S Z C
MODE SYNTAX HEX LEN TIM Immediate CPX #$44 $E0 2 2 Zero Page CPX $44 $E4 2 3 Absolute CPX $4400 $EC 3 4Operation and flag results are identical to equivalent mode accumulator CMP ops.
Affects Flags: S Z C
MODE SYNTAX HEX LEN TIM Immediate CPY #$44 $C0 2 2 Zero Page CPY $44 $C4 2 3 Absolute CPY $4400 $CC 3 4Operation and flag results are identical to equivalent mode accumulator CMP ops.
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Zero Page DEC $44 $C6 2 5 Zero Page,X DEC $44,X $D6 2 6 Absolute DEC $4400 $CE 3 6 Absolute,X DEC $4400,X $DE 3 7
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Immediate EOR #$44 $49 2 2 Zero Page EOR $44 $45 2 3 Zero Page,X EOR $44,X $55 2 4 Absolute EOR $4400 $4D 3 4 Absolute,X EOR $4400,X $5D 3 4+ Absolute,Y EOR $4400,Y $59 3 4+ Indirect,X EOR ($44,X) $41 2 6 Indirect,Y EOR ($44),Y $51 2 5+ + add 1 cycle if page boundary crossed
Affect Flags: as noted
These instructions are implied mode, have a length of one byte and require two machine cycles.
MNEMONIC HEX CLC (CLear Carry) $18 SEC (SEt Carry) $38 CLI (CLear Interrupt) $58 SEI (SEt Interrupt) $78 CLV (CLear oVerflow) $B8 CLD (CLear Decimal) $D8 SED (SEt Decimal) $F8Notes:
The Interrupt flag is used to prevent (SEI) or enable (CLI) maskable interrupts (aka IRQ's). It does not signal the presence or absence of an interrupt condition. The 6502 will set this flag automatically in response to an interrupt and restore it to its prior status on completion of the interrupt service routine. If you want your interrupt service routine to permit other maskable interrupts, you must clear the I flag in your code.
The Decimal flag controls how the 6502 adds and subtracts. If set, arithmetic is carried out in packed binary coded decimal. This flag is unchanged by interrupts and is unknown on power-up. The implication is that a CLD should be included in boot or interrupt coding.
The Overflow flag is generally misunderstood and therefore under-utilised. After an ADC or SBC instruction, the overflow flag will be set if the twos complement result is less than -128 or greater than +127, and it will cleared otherwise. In twos complement, $80 through $FF represents -128 through -1, and $00 through $7F represents 0 through +127. Thus, after:
CLC LDA #$7F ; +127 ADC #$01 ; + +1the overflow flag is 1 (+127 + +1 = +128), and after:
CLC LDA #$81 ; -127 ADC #$FF ; + -1the overflow flag is 0 (-127 + -1 = -128). The overflow flag is not affected by increments, decrements, shifts and logical operations i.e. only ADC, BIT, CLV, PLP, RTI and SBC affect it. There is no op code to set the overflow but a BIT test on an RTS instruction will do the trick.
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Zero Page INC $44 $E6 2 5 Zero Page,X INC $44,X $F6 2 6 Absolute INC $4400 $EE 3 6 Absolute,X INC $4400,X $FE 3 7
Affects Flags: none
MODE SYNTAX HEX LEN TIM Absolute JMP $5597 $4C 3 3 Indirect JMP ($5597) $6C 3 5JMP transfers program execution to the following address (absolute) or to the location contained in the following address (indirect). Note that there is no carry associated with the indirect jump so:
For example if address $3000 contains $40, $30FF contains $80, and $3100 contains $50, the result of JMP ($30FF) will be a transfer of control to $4080 rather than $5080 as you intended i.e. the 6502 took the low byte of the address from $30FF and the high byte from $3000.AN INDIRECT JUMP MUST NEVER USE A
VECTOR BEGINNING ON THE LAST BYTE
OF A PAGE
Affects Flags: none
MODE SYNTAX HEX LEN TIM Absolute JSR $5597 $20 3 6JSR pushes the address-1 of the next operation on to the stack before transferring program control to the following address. Subroutines are normally terminated by a RTS op code.
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Immediate LDA #$44 $A9 2 2 Zero Page LDA $44 $A5 2 3 Zero Page,X LDA $44,X $B5 2 4 Absolute LDA $4400 $AD 3 4 Absolute,X LDA $4400,X $BD 3 4+ Absolute,Y LDA $4400,Y $B9 3 4+ Indirect,X LDA ($44,X) $A1 2 6 Indirect,Y LDA ($44),Y $B1 2 5+ + add 1 cycle if page boundary crossed
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Immediate LDX #$44 $A2 2 2 Zero Page LDX $44 $A6 2 3 Zero Page,Y LDX $44,Y $B6 2 4 Absolute LDX $4400 $AE 3 4 Absolute,Y LDX $4400,Y $BE 3 4+ + add 1 cycle if page boundary crossed
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Immediate LDY #$44 $A0 2 2 Zero Page LDY $44 $A4 2 3 Zero Page,X LDY $44,X $B4 2 4 Absolute LDY $4400 $AC 3 4 Absolute,X LDY $4400,X $BC 3 4+ + add 1 cycle if page boundary crossed
Affects Flags: S Z C
MODE SYNTAX HEX LEN TIM Accumulator LSR A $4A 1 2 Zero Page LSR $44 $46 2 5 Zero Page,X LSR $44,X $56 2 6 Absolute LSR $4400 $4E 3 6 Absolute,X LSR $4400,X $5E 3 7LSR shifts all bits right one position. 0 is shifted into bit 7 and the original bit 0 is shifted into the Carry.
Use caution with indexed zero page operations as they are subject to wrap-around. For example, if the X register holds $FF and you execute LDA $80,X you will not access $017F as you might expect; instead you access $7F i.e. $80-1. This characteristic can be used to advantage but make sure your code is well commented.
It is possible, however, to access $017F when X = $FF by using the Absolute,X addressing mode of LDA $80,X. That is, instead of:
LDA $80,X ; ZeroPage,X - the resulting object code is: B5 80which accesses $007F when X=$FF, use:
LDA $0080,X ; Absolute,X - the resulting object code is: BD 80 00which accesses $017F when X = $FF (a at cost of one additional byte and one additional cycle). All of the ZeroPage,X and ZeroPage,Y instructions except STX ZeroPage,Y and STY ZeroPage,X have a corresponding Absolute,X and Absolute,Y instruction. Unfortunately, a lot of 6502 assemblers don't have an easy way to force Absolute addressing, i.e. most will assemble a LDA $0080,X as B5 80. One way to overcome this is to insert the bytes using the .BYTE pseudo-op (on some 6502 assemblers this pseudo-op is called DB or DFB, consult the assembler documentation) as follows:
.BYTE $BD,$80,$00 ; LDA $0080,X (absolute,X addressing mode)The comment is optional, but highly recommended for clarity.
In cases where you are writing code that will be relocated you must consider wrap-around when assigning dummy values for addresses that will be adjusted. Both zero and the semi-standard $FFFF should be avoided for dummy labels. The use of zero or zero page values will result in assembled code with zero page opcodes when you wanted absolute codes. With $FFFF, the problem is in addresses+1 as you wrap around to page 0.
When the 6502 is ready for the next instruction it increments the program counter before fetching the instruction. Once it has the op code, it increments the program counter by the length of the operand, if any. This must be accounted for when calculating branches or when pushing bytes to create a false return address (i.e. jump table addresses are made up of addresses-1 when it is intended to use an RTS rather than a JMP).
The program counter is loaded least signifigant byte first. Therefore the most signifigant byte must be pushed first when creating a false return address.
When calculating branches a forward branch of 6 skips the following 6 bytes so, effectively the program counter points to the address that is 8 bytes beyond the address of the branch opcode; and a backward branch of $FA (256-6) goes to an address 4 bytes before the branch instruction.
Op code execution times are measured in machine cycles; one machine cycle equals one clock cycle. Many instructions require one extra cycle for execution if a page boundary is crossed; these are indicated by a + following the time values shown.
Affects Flags: none
MODE SYNTAX HEX LEN TIM Implied NOP $EA 1 2NOP is used to reserve space for future modifications or effectively REM out existing code.
Affects Flags: S Z
MODE SYNTAX HEX LEN TIM Immediate ORA #$44 $09 2 2 Zero Page ORA $44 $05 2 3 Zero Page,X ORA $44,X $15 2 4 Absolute ORA $4400 $0D 3 4 Absolute,X ORA $4400,X $1D 3 4+ Absolute,Y ORA $4400,Y $19 3 4+ Indirect,X ORA ($44,X) $01 2 6 Indirect,Y ORA ($44),Y $11 2 5+ + add 1 cycle if page boundary crossed
Affect Flags: S Z
These instructions are implied mode, have a length of one byte and require two machine cycles.
MNEMONIC HEX TAX (Transfer A to X) $AA TXA (Transfer X to A) $8A DEX (DEcrement X) $CA INX (INcrement X) $E8 TAY (Transfer A to Y) $A8 TYA (Transfer Y to A) $98 DEY (DEcrement Y) $88 INY (INcrement Y) $C8
Affects Flags: S Z C
MODE SYNTAX HEX LEN TIM Accumulator ROL A $2A 1 2 Zero Page ROL $44 $26 2 5 Zero Page,X ROL $44,X $36 2 6 Absolute ROL $4400 $2E 3 6 Absolute,X ROL $4400,X $3E 3 7ROL shifts all bits left one position. The Carry is shifted into bit 0 and the original bit 7 is shifted into the Carry.
Affects Flags: S Z C
MODE SYNTAX HEX LEN TIM Accumulator ROR A $6A 1 2 Zero Page ROR $44 $66 2 5 Zero Page,X ROR $44,X $76 2 6 Absolute ROR $4400 $6E 3 6 Absolute,X ROR $4400,X $7E 3 7ROR shifts all bits right one position. The Carry is shifted into bit 7 and the original bit 0 is shifted into the Carry.
Affects Flags: all
MODE SYNTAX HEX LEN TIM Implied RTI $40 1 6RTI retrieves the Processor Status Word (flags) and the Program Counter from the stack in that order (interrupts push the PC first and then the PSW).
Note that unlike RTS, the return address on the stack is the actual address rather than the address-1.
Affects Flags: none
MODE SYNTAX HEX LEN TIM Implied RTS $60 1 6RTS pulls the top two bytes off the stack (low byte first) and transfers program control to that address+1. It is used, as expected, to exit a subroutine invoked via JSR which pushed the address-1.
RTS is frequently used to implement a jump table where addresses-1 are pushed onto the stack and accessed via RTS eg. to access the second of four routines:
LDX #1 JSR EXEC JMP SOMEWHERE LOBYTE .BYTE <ROUTINE0-1,<ROUTINE1-1 .BYTE <ROUTINE2-1,<ROUTINE3-1 HIBYTE .BYTE >ROUTINE0-1,>ROUTINE1-1 .BYTE >ROUTINE2-1,>ROUTINE3-1 EXEC LDA HIBYTE,X PHA LDA LOBYTE,X PHA RTS
Affects Flags: S V Z C
MODE SYNTAX HEX LEN TIM Immediate SBC #$44 $E9 2 2 Zero Page SBC $44 $E5 2 3 Zero Page,X SBC $44,X $F5 2 4 Absolute SBC $4400 $ED 3 4 Absolute,X SBC $4400,X $FD 3 4+ Absolute,Y SBC $4400,Y $F9 3 4+ Indirect,X SBC ($44,X) $E1 2 6 Indirect,Y SBC ($44),Y $F1 2 5+ + add 1 cycle if page boundary crossedSBC results are dependant on the setting of the decimal flag. In decimal mode, subtraction is carried out on the assumption that the values involved are packed BCD (Binary Coded Decimal).
There is no way to subtract without the carry which works as an inverse borrow. i.e, to subtract you set the carry before the operation. If the carry is cleared by the operation, it indicates a borrow occurred.
Affects Flags: none
MODE SYNTAX HEX LEN TIM Zero Page STA $44 $85 2 3 Zero Page,X STA $44,X $95 2 4 Absolute STA $4400 $8D 3 4 Absolute,X STA $4400,X $9D 3 5 Absolute,Y STA $4400,Y $99 3 5 Indirect,X STA ($44,X) $81 2 6 Indirect,Y STA ($44),Y $91 2 6
These instructions are implied mode, have a length of one byte and require machine cycles as indicated. The "PuLl" operations are known as "POP" on most other microprocessors. With the 6502, the stack is always on page one ($100-$1FF) and works top down.
MNEMONIC HEX TIM TXS (Transfer X to Stack ptr) $9A 2 TSX (Transfer Stack ptr to X) $BA 2 PHA (PusH Accumulator) $48 3 PLA (PuLl Accumulator) $68 4 PHP (PusH Processor status) $08 3 PLP (PuLl Processor status) $28 4
Affects Flags: none
MODE SYNTAX HEX LEN TIM Zero Page STX $44 $86 2 3 Zero Page,Y STX $44,Y $96 2 4 Absolute STX $4400 $8E 3 4
Affects Flags: none
MODE SYNTAX HEX LEN TIM Zero Page STY $44 $84 2 3 Zero Page,X STY $44,X $94 2 4 Absolute STY $4400 $8C 3 4
Last Updated March 30, 2001.


File
Editing
Search
Show
Navigation
Development
Tools
Help
Edit Code
Preview
Work area
style
.css
index
.html
javascript
.js