You can sign up for a Stripe account at https://stripe.com.
PHP 5.4.0 and later.
You can install the bindings via Composer. Run the following command:
composer require stripe/stripe-php
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php
file.
require_once('/path/to/stripe-php/init.php');
The bindings require the following extensions in order to work properly:
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
Simple usage looks like:
\Stripe\Stripe::setApiKey('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_189fqt2eZvKYlo2CTGBeg6Uq']);
echo $charge;
Please see https://stripe.com/docs/api for up-to-date documentation.
If you are using PHP 5.3, you can download v5.9.2 (zip, tar.gz) from our releases page. This version will continue to work with new versions of the Stripe API for all common uses.
If you are using PHP 5.2, you can download v1.18.0 (zip, tar.gz) from our releases page. This version will continue to work with new versions of the Stripe API for all common uses.
This legacy version may be included via require_once("/path/to/stripe-php/lib/Stripe.php");
, and used like:
Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249');
$charge = Stripe_Charge::create(array('source' => 'tok_XXXXXXXX', 'amount' => 2000, 'currency' => 'usd'));
echo $charge;
NOTE: We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use idempotency tokens to avoid executing the same transaction twice as a result of timeout retry logic.
To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient.
// set up your tweaked Curl client
$curl = new \Stripe\HttpClient\CurlClient();
$curl->setTimeout(10); // default is \Stripe\HttpClient\CurlClient::DEFAULT_TIMEOUT
$curl->setConnectTimeout(5); // default is \Stripe\HttpClient\CurlClient::DEFAULT_CONNECT_TIMEOUT
echo $curl->getTimeout(); // 10
echo $curl->getConnectTimeout(); // 5
// tell Stripe to use the tweaked client
\Stripe\ApiRequestor::setHttpClient($curl);
// use the Stripe API client as you normally would
Need to set a proxy for your requests? Pass in the requisite CURLOPT_*
array to the CurlClient constructor, using the same syntax as curl_stopt_array()
. This will set the default cURL options for each HTTP request made by the SDK, though many more common options (e.g. timeouts; see above on how to set those) will be overridden by the client even if set here.
// set up your tweaked Curl client
$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_PROXY => 'proxy.local:80']);
// tell Stripe to use the tweaked client
\Stripe\ApiRequestor::setHttpClient($curl);
Alternately, a callable can be passed to the CurlClient constructor that returns the above array based on request inputs. See testDefaultOptions()
in tests/CurlClientTest.php
for an example of this behavior. Note that the callable is called at the beginning of every API request, before the request is sent.
The library does minimal logging, but it can be configured
with a PSR-3
compatible logger so that messages
end up there instead of error_log
:
\Stripe\Stripe::setLogger($logger);
You can access the data from the last API response on any object via getLastResponse()
.
$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_visa']);
echo $charge->getLastResponse()->headers['Request-Id'];
Stripe's API now requires that all connections use TLS 1.2. Some systems (most notably some older CentOS and RHEL versions) are capable of using TLS 1.2 but will use TLS 1.0 or 1.1 by default. In this case, you'd get an invalid_request_error
with the following error message: "Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.".
The recommended course of action is to upgrade your cURL and OpenSSL packages so that TLS 1.2 is used by default, but if that is not possible, you might be able to solve the issue by setting the CURLOPT_SSLVERSION
option to either CURL_SSLVERSION_TLSv1
or CURL_SSLVERSION_TLSv1_2
:
$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1]);
\Stripe\ApiRequestor::setHttpClient($curl);
For apps that need to use multiple keys during the lifetime of a process, like one that uses Stripe Connect, it's also possible to set a per-request key and/or account:
\Stripe\Charge::all([], [
'api_key' => 'sk_test_...',
'stripe_account' => 'acct_...'
]);
\Stripe\Charge::retrieve("ch_18atAXCdGbJFKhCuBAa4532Z", [
'api_key' => 'sk_test_...',
'stripe_account' => 'acct_...'
]);
By default, the library will use its own internal bundle of known CA certificates, but it's possible to configure your own:
\Stripe\Stripe::setCABundlePath("path/to/ca/bundle");
The library can be configured to automatically retry requests that fail due to an intermittent network problem:
\Stripe\Stripe::setMaxNetworkRetries(2);
Idempotency keys are added to requests to guarantee that retries are safe.
Get Composer. For example, on Mac OS:
brew install composer
Install dependencies:
composer install
The test suite depends on stripe-mock, so make sure to fetch and run it from a background terminal (stripe-mock's README also contains instructions for installing via Homebrew and other methods):
go get -u github.com/stripe/stripe-mock
stripe-mock
Install dependencies as mentioned above (which will resolve PHPUnit), then you can run the test suite:
./vendor/bin/phpunit
Or to run an individual test file:
./vendor/bin/phpunit tests/UtilTest.php
Update bundled CA certificates from the Mozilla cURL release:
./update_certs.php
Are you writing a plugin that integrates Stripe and embeds our library? Then please use the setAppInfo
function to identify your plugin. For example:
\Stripe\Stripe::setAppInfo("MyAwesomePlugin", "1.2.34", "https://myawesomeplugin.info");
The method should be called once, before any request is sent to the API. The second and third parameters are optional.
See the "SSL / TLS compatibility issues" paragraph above for full context. If you want to ensure that your plugin can be used on all systems, you should add a configuration option to let your users choose between different values for CURLOPT_SSLVERSION
: none (default), CURL_SSLVERSION_TLSv1
and CURL_SSLVERSION_TLSv1_2
.


THINK NIGHTLIFE PHOTOGRAPHY, INTERSECTS WITH VISUAL-SEMIOTIC THEORY, AND PARA-PORNOGRAPHY BEING LED BY FOURTH WAVE FEMINIST IDEAS OF INTIMATE LABOUR AND THE POLITICS OF REPRESENTATION.
Inside the panties a hairy secret lurks. Inside the underwear, a wonder secret dangles. What happens when this secret is revealed and reality collapses? A new dressing up, after which a new undressing follows- ((not unlike the process that takes place at the amusement park's haunted house, where the monster throws himself against the visitor, and then is squeakingly pulled back into its hole.)) this is the very image of the movement of reproduction, its grinding always-same.
Parapornography advocates an immoderate and insatiable desire: its hunger for eternal life and infinite pleasure -- a simultaneously ironic and affirming attitude toward pornography. Parapornography could only occur in a postpornographic era, after the implementation of a pornographic revolution. It can thus be regarded as the ironic self-awareness of postpornography.


Compressor → Tone
Tone.Compressor is a thin wrapper around the Web Audio DynamicsCompressorNode. Compression reduces the volume of loud sounds or amplifies quiet sounds by narrowing or "compressing" an audio signal's dynamic range. Read more on Wikipedia.
new
Tone.Compressor
([threshold][, ratio])
code
var comp = new Tone.Compressor(-30, 3);
default values
ratio:12
threshold:-24
release:0.25
attack:0.003
knee:30
members
methods


Our mission is to serve and help the community in the bay area. We want to ensure safety of immigrant families from living in fear. We want to provide resource to those under DACA and TPS who are currently affected under new upcoming policies.
Jenny Delgado: A senior attending Cristo Rey San Jose Jesuit High School in San Jose, CA.
Bryceida Valencia: A junior attending Cristo Rey San Jose Jesuit High School in San Jose, CA.
Litzy Rubios: A junior attending Cristo Rey San Jose Jesuit High School in San Jose, CA.
Tussanee Ashley: From Long Beach, California and a junior attending Mark Keppel High School in Alhambra, CA.


Get Involved!
We want to make this visual mini-Bible available in_every language of the world_ and you can help! This is not impossible—we think it can happen if the whole body of Christ works together to translate & distribute this resource.
Share Freely
Give as many copies of this book away as you want, without restriction. All digital versions are free online, and because of the open license we are using, you can even republish Open Bible Stories commercially anywhere in the world without paying royalties! Find out more at http://openbiblestories.com.
Extend!
Get Open Bible Stories as videos and mobile phone applications in other languages at http://openbiblestories.com. On the website, you can also get help translating Open Bible Stories into_your_ language.


A few words
How did it all start?
“I am always doing that which I can not do, in order that I may
learn how to do it.” ― Pablo Picasso (Who said that? Text area
quizz - JS - Valid button and answer ).
The web is "full" (\better word needed/) of amazing design and I
attempted through the creation of my website to snip some of the
most appealing bits.
Didn't Picasso said once that "Bad artist copy. Good artist
steal." This said I'm working my way to be a digital artist by
experimenting in my Lab. Some cheesy pseudo quotes come to mind
such as "my brush is my mouse, etc..!" Seriously...


A room commodious with ceiling tall
it has at moments brought peace sublime
yet now trapped it seems unbearably small
and you cannot wait to escape this time.
Return to the looking around the [[bedroom|The Bedroom]].The only way out keeps you in
shut tight and without a gap
This is where your problems begin
It has made your room a trap.
Return to the looking around the [[bedroom|The Bedroom]].In castles love is often imprisoned
and from the world such loves do hide
Yet love scales walls when hands couldn't
and across deep moats such loves abide
(if: $curtains is "hanging")[Examine the [[curtains|Examine Curtains]].]
(if: $curtains is "cut")[There are curtains here on the floor.]
(if: $pan is not "dropped")[Look [[outside|Examine Outside]].]
Return to the looking around the [[bedroom|The Bedroom]].This table is ornate, of the finest craftmanship
Yet this furniture serves a very simple purpose
Now is not the time to practice your penmanship
But maybe there's something useful on its surface
An old moldy [[cheese|Examine Cheese]] seems to be becoming part of the wood. (if: $knife is false)[ A small [[knife|Examine Knife]] rests within its rind.]
Return to the looking around the [[bedroom|The Bedroom]].Here you have slept and dreamt of her
upon this fine four poster bed
But now you wish upon her breast
is where you could now rest your head.
Examine the [[sheets|Examine Sheets]](if: $pan is not "dropped")[, or look under the [[bed|Chamber Pot]].]
Return to the looking around the [[bedroom|The Bedroom]].The shark has pearly teeth dear
and he keeps them out of sight
But from this blade you needn't fear
it's only a kitchen knife.
(if $knife is false)[With a good tug it seems it would be [[removable|Remove Knife]].]
Return to the looking around the [[bedroom|The Bedroom]].(set: $knife to true)[You are now carrying the knife.]
Look around the [[bedroom|The Bedroom]] again if you like.
Manys the night I've dreamed of cheese
but such dreams would not now please
But could this be what you may yet need
if in leaving this room you do succeed?
(if: $knife is false)[ There is a knife stuck in the rind. With a good tug it seems it would be [[removable|Remove Knife]].]
Return to the looking around the [[bedroom|The Bedroom]].These very heavy curtains
are far from being frail
they're thick for certain
secured fast to the rail.
(if: $knife is true)[The knife you are holding could [[cut|Cut Curtains]] these curtains down, if you were so inclined.]
Return to the looking around the [[bedroom|The Bedroom]].A guard below goes
about his duties
to and fro
pacing back and forth
far below
your window.
(if: $pan is "found")[Wasn't there something under the bed that could [[render that guard useless|Knock Out Guard]]?]
Return to the looking around the [[bedroom|The Bedroom]].Fine sheets of linen
The strongest man
could not tear them.
(if: $curtains is "cut")[A clever fellow might consider [[tying|Tie Sheets]] the sheets to the curtains.](if: $curtains is not "cut")[If only these were long enough by themselves to let you climb out the window.]
Return to the looking around the [[bedroom|The Bedroom]].A chamber pot
we should not
disparage
The humble lot
to hold our rot
its usage.
(set: $pan="found")
If I were you (and I am) I'd try to empty this out when I can.
Return to the looking around the [[bedroom|The Bedroom]].(set: $sheets="tied")You tied the two together (and to the bedpost), and dropped them out the window. (if: $pan is not "dropped")[However, you didn't take care of the guard first, and he sounded an alarm. Now your chance of escape is gone!](if: $pan is "dropped")[Fortunately, having already disposed of the guard you were able to make your escape!](set: $curtains="cut")[The curtains are now removed from the rail.]
Return to the looking around the [[bedroom|The Bedroom]].(set: $pan="dropped")[The guard is no longer an impediment to your escape, getting down safely might be however.]
Return to the looking around the [[bedroom|The Bedroom]].


The idea of the Material Dashboard Bundle is that you focus on your code instead of the styling of the screens so I adapted the MakerBundle make:crud command to create styled crud interfaces, so you no longer have to do it yourself.
You can access my version of the command by doing:
php bin/console material-dashboard:make:crud
You use it the same way you’d use the regular MakerBundle make:crud command, just follow the wizard and you’ll have your styled CRUD interfaces ready in no time.
Table of contents:


Here are a few of the small sites I've worked on myself.
Made a quick site for a buddy who needed something quick and easy up in a day or two. Used general HTML with bootstrap styling and a Soundcloud API tied in.
I just opened a wordpress site to work on recently. Check it out here, and watch as I update it weekly.
A quick mockup for a local restaurant. Saw an opportunity to do a fun little restaurant site and wanted to do it to practice for restaurants.
ShipMatrix is an asp.net powered website. I've updated the style sheets for the reports server behind the aspx login and optimized the layouts for mobile/desktop.


I hope they didn't get the 280 characters by shortening other people's twe
9/27/2017, 1:02:27 PM
Favs: 17
Retweets: 4
link--- layout: tweet ---
I hope they didn't get the 280 characters by shortening other people's twe
9/27/2017, 1:02:27 PM
Favs: 17
Retweets: 4
link


Routing with user-generated, collaboratively collected free geodata. This service is based on open standards by the Open Geospatial Consortium (OGC). Thanks to OpenStreetMap.org - please donate your geographic data to openstreetmap.org!
We are searching for hardware sponsors, feel free to contact us!
If you intend to use OpenRouteService in your own applications please contact us. We are interested in spreading the usage of OpenRouteService in academic and non-profit projects.
E-Mail: openrouteservice at geog.uni-heidelberg.de
Routing services are probably the most important application for street data - apart from visualizing them on a map. While there are a range of desktop (or even mobile) applications that can provide such functionalities also in combination with OSM data, we focus here on an approach based on the concept of interoperable Service Oriented Architectures (SOA). These are regarded as an important concept for forthcoming software architectures in general, and more and more being applied also in the GI (geographic information) sector. While SOA offer many benefits they are not the solution to all problems.
A remaining issue is the question of interoperability between different web services from different vendors offering the same or similar services but with different technical programming interfaces. This is the reason why standards are becoming more and more important for a range of applications - in particular in the institutional and governmental sector, but also beyond. Within the geographical information community here the Open Geospatial Consortium (OGC) has developed a range of standards for different GI related functionalities. This is why we choose to develop and set up a routing service that uses OSM data and provides those through the standardized interface specified by the OGC within the Open Location Services initiative (OpenLS or OLS) as one of 5 services:
The Route Service offers a broad range of possibilities, among them several parameters that determine the result, e.g.:
Currently openrouteservice.org offers a end-user oriented website with an interactive map , but soon we will also make the route service available as OGC-web service, that can be used through http-based xml-requestes as specified in the OGC OpenLS Route Service specification. This will allow developers to use this servide in an open and interoperable way easily within their own applications.
For further information see specification of OpenLS v1.1.
Related Publications where our OpenLS Route Service has been applied (e.g. in the following projects: http://www.gdi-3d.de (http://www.heidelberg-3d.de), http://www.ok-gis.de, http://www.mona3d.de etc.).
OSM: http://www.openstreetmap.org
OSM Wiki: http://wiki.openstreetmap.org/wiki/OpenRouteService
"OpenStreetMap is an editable map of the whole world, which is being built largely from scratch using GPS traces, and released with an open content license. The OpenStreetMap License allows free (or almost free) access to our map images and all of our underlying map data, and the project aims to promote new and interesting uses of this data ..." Read more on: http://wiki.openstreetmap.org.
The data sources for routing and mapping are based on free and open and even collaborative volunteered data collection efforts.
Therefore we cannot guarantee any quality of the displayed data and the routing results.
We are not responsible for any errors, mistakes, omissions or other problems with the used data and occurring from using this service.
OpenRouteService.org can be used freely and without charge by any individuals through the website www.openrouteservice.org
If you intend to use OpenRouteService in your own applications please contact us. We are interested in spreading the usage of OpenRouteService in academic and non-profit projects.
Commercial usage of the services provided by OpenRouteService does need approval!
Hillshade derived from CIAT-CSI SRTM : Users are prohibited from any commercial, non-free resale, or redistribution without explicit written permission from CIAT.
Original data by Jarvis A., H.I. Reuter, A. Nelson, E. Guevara, 2008, Hole-filled seamless SRTM data V4, International Centre for Tropical Agriculture (CIAT), available from http://srtm.csi.cgiar.org.
Content is available under Creative Commons Attribution-ShareAlike 2.0 license.


The variable parentProxy
specifies the hostname and port number
of an HTTP parent proxy; it should have the form ‘host:port’.
If the parent proxy requires authorisation, the username and password
should be specified in the variable parentAuthCredentials
in
the form ‘username:password’. Only Basic authentication
is supported, which is vulnerable to replay attacks.
The main application of the parent proxy support is to cross
firewalls. Given a machine, say trurl
, with unrestricted
access to the web, the following evades a firewall by using an
encrypted compressed ssh
link:
$ ssh -f -C -L 8124:localhost:8123 trurl polipo $ polipo parentProxy=localhost:8124


Create a New Post
Signed in as :
Posting under :
Note: Any links(max:2) provided in the description will be displayed at the bottom of the post in the mobile app.
*required fields
**Only PDF or image less than 5 MB allowed


Buckingham Palace hit by mouse infestation as droppings found at Garden Café
EXCLUSIVE: Officials have been urged to call in an extermination squad and teach kitchen workers pest control at Garden Café where visitors pay up to £49 for admission.
by Jonathan Corke, Dan Warburton, https://www.mirror.co.uk/authors/jonathan-corke/The Queen has been hit by a mouse infestation at a Buckingham Palace pop up café.
Health inspectors found rodent droppings at the Garden Café where visitors sip Earl Grey tea on a terrace overlooking Her Majesty’s lawns.
Officials were urged to call in an extermination squad and teach kitchen workers pest control.
Royal fans who pay up to £49 for admission to rooms at the Palace sit beneath a canopy to enjoy £7 cream teas of smoked salmon and scones.
Also on the menu are bagels, cheesecake and posh pastries topped with a gold-dusted chocolate crown.
Coffee comes in cups with a Royal logo with a crown-shaped dusting of cocoa powder.
“It’s a huge treat – the closest most people can get to Her Majesty. So this is embarrassing,” said a source.
Inspectors found mouse poo under a sink and near a dishwasher and said it needed “immediate and ongoing” attention.
Sara Sutton, Westminster council’s director of public protection, said of one location: “I was informed this area was not easy to clean as staff were unable to mop due to a large electrical generator stored here.
“I believe there should be bespoke pest control procedures for the premises taking into account the limitations.
I would encourage you to continue to work with your pest-control contractor to ensure the premises remain pest-free.”
A spokesman for the café said they had now “adhered to the guidelines in the report to reduce and control the risk of pests”.
In June it was claimed that the Queen was “horrified” by a plague of rats and mice in the Palace kitchens.


This example illustrates how to add a route that responds to a GET request for /about
Installed the required dependencies with
npm install
Edit the app.js
file to respond to GET requests to /about
app.get('/about', function(req, res){
res.send('Hello from the about route!');
});
Then start the server with
node app.js
Then open your browser at http://<IP_ADDRESS>:3000
You will see a basic Express site. Then browse to http://<IP_ADDRESS>:3000/about. You should see
Hello from the about route!


Greater Williamson Area Business Association (GWABA) seeks to improve the quality of economic and residential life in the Williamson-Marquette neighborhood by encouraging well-planned, high-quality and balanced commercial, industrial and residential development along with economic growth. Businesses and organizations join GWABA to reach new customers, advocate for issues important to their business, and network with other business owners to build a thriving, diverse community through GWABA events such as Taste of Willy Street and Central Park Sessions. Visit GWABA.org for more information and join today!
Greater Williamson Area Business Association (GWABA) seeks to improve the quality of economic and residential life in the Williamson-Marquette neighborhood by encouraging well-planned, high-quality and balanced commercial, industrial and residential development along with economic growth. Businesses and organizations join GWABA to reach new customers, advocate for issues important to their business, and network with other business owners to build a thriving, diverse community through GWABA events such as Taste of Willy Street and Central Park Sessions. Visit GWABA’s membership webpage to join today!
Greater Williamson Area Business Association (GWABA) invites neighborhood businesses and organizations to join GWABA to reach new customers, advocate for issues important to their business, and network with other business owners to build a thriving, diverse community through GWABA events such as Taste of Willy Street and Central Park Sessions. Visit GWABA.org for more information and join today!


Asynchronous Progamming Using the Java SDK with Couchbase Server
The Couchbase Java SDK has a complete asynchronous API based in part on RxJava. This section provides information on how the asynchronous API can be used, how it works with Java platform and RxJava features and the kinds of error handling you will need to consider in application development.
Java 8, Lambdas and Anonymous Classes
Before jumping into the details, one thing warrants clarification: RxJava and, therefore, the Java SDK, fully support Java 8. This support brings some great improvements, most prominently support for lambdas and method references.
Because the Java SDK has support for Java 6 and 7, most of the examples shown in the documentation use anonymous classes instead of lambdas. You are free and even encouraged to use them if you can, but Java 8 may not be an option for some.
To whet your appetite for why you may want to strongly consider these features, compare the same Java 6 code to Java 8:
// Loads 3 documents in parallel
Observable
.just("doc1", "doc2", "doc3")
.flatMap(new Func1<String, Observable<JsonDocument>>() {
@Override
public Observable<JsonDocument> call(String id) {
return bucket.get(id);
}
}).forEach(new Action1<JsonDocument>() {
@Override
public void call(JsonDocument document) {
System.out.println("Got: " + document);
}
});
Versus:
// Loads 3 documents in parallel
Observable
.just("doc1", "doc2", "doc3")
.flatMap(bucket::get)
.forEach(document -> System.out.println("Got: " + document));
RxJava has additional support for other languages such as Scala, Groovy, Kotlin or Clojure through language adapters. If you are using one of those, refer to the RxJava documentation on how to use the adapters.
Understanding Observables
You can think of an Observable as the push-based, asynchronous cousin ("dual") of the pull-based, synchronous Iterable.
The contract of an Observable
is that zero to N data events can happen, followed by a complete event.
An error event can also happen at any time and complete the Observable
.
| Event | Iterable (Pull) | Observable (Push) |
|---|---|---|
retrieve data |
|
|
discover error |
|
|
complete |
|
|
You can convert an Observable
into a BlockingObservable
, which then behaves very much like the Iterable
.
The key element to take away is that an Observable<T>
can emit 0 to N events, which is very different than a Future<T>
that only contains one value.
After you start to work on streams instead of single values, you will very much appreciate this fact.
By definition, an Observable
does not imply that the underlying code is executed asynchronously.
As a consumer of an Observable
, you leave the actual implementation to the supplier, who can change it later on without you having to adapt your code.
Imagine, you are consuming this API:
public interface FooService {
Observable<String> load();
}
It could be that when load()
is called, the String
value is fetched right out of a Map
in memory (or even a hard-coded value).
In this case, there is no need to move the execution away from the caller thread, because the value will be returned instantaneously.
If later the implementation needs to be changed so that the String
is loaded through a web service (introducing latency and other semantics), the API doesn’t need to be changed because the underlying implementation is free to move it to a Scheduler
.
Consuming Observables
The first thing you want to do when working with Observables
is to consume them.
Consuming an Observable
means subscribing to it.
Here is an example that subscribes and prints out all the items emitted:
Observable
.just(1, 2, 3)
.subscribe(new Subscriber<Integer>() {
@Override
public void onCompleted() {
System.out.println("Completed Observable.");
}
@Override
public void onError(Throwable throwable) {
System.err.println("Whoops: " + throwable.getMessage());
}
@Override
public void onNext(Integer integer) {
System.out.println("Got: " + integer);
}
});
The example prints the following lines:
Got: 1 Got: 2 Got: 3 Completed Observable.
You can see that our Subscriber
gets notified of every event and also receives the completed event.
A well-formed Observable invokes its subscriber’s onNext method zero or more times and then invokes either the onCompleted or onError method exactly once.
|
You can also test the error case by throwing an artificial exception when the value 2 is emitted:
Observable
.just(1, 2, 3)
.doOnNext(new Action1<Integer>() {
@Override
public void call(Integer integer) {
if (integer.equals(2)) {
throw new RuntimeException("I don't like 2");
}
}
})
.subscribe(new Subscriber<Integer>() {
@Override
public void onCompleted() {
System.out.println("Completed Observable.");
}
@Override
public void onError(Throwable throwable) {
System.err.println("Whoops: " + throwable.getMessage());
}
@Override
public void onNext(Integer integer) {
System.out.println("Got: " + integer);
}
});
The example prints:
Got: 1 Whoops: I don't like 2
The first value gets through without problems, the second value throws an exception and, therefore, terminates the Observable
.
No subsequent values are allowed to be emitted after an error event.
The subscribe method also returns a Subscription that you can use to unsubscribe and not receive further events.
|
Even if you don’t unsubscribe explicitly, operations like take
do that for you implicitly.
The following code only takes the first five values and then unsubscribes:
Observable
.just("The", "Dave", "Brubeck", "Quartet", "Time", "Out")
.take(5)
.subscribe(new Subscriber<String>() {
@Override
public void onCompleted() {
System.out.println("Completed Observable.");
}
@Override
public void onError(Throwable throwable) {
System.err.println("Whoops: " + throwable.getMessage());
}
@Override
public void onNext(String name) {
System.out.println("Got: " + name);
}
});
This prints:
Got: The Got: Dave Got: Brubeck Got: Quartet Got: Time Completed Observable.
You do not need to implement the full subscriber every time. If you are only interested in the data events, you can subscribe like this:
Observable
.just(1, 2, 3)
.subscribe(new Action1<Integer>() {
@Override
public void call(Integer integer) {
System.out.println("Got: " + integer);
}
});
Be aware though that if an error happens, the following exception will be propagated:
Exception in thread "main" rx.exceptions.OnErrorNotImplementedException at rx.Observable$36.onError(Observable.java:8412) at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:128) at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:97) at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:67) at rx.internal.operators.OperatorDoOnEach$1.onNext(OperatorDoOnEach.java:78) at rx.internal.operators.OnSubscribeFromIterable$IterableProducer .request(OnSubscribeFromIterable.java:76) ...
It is recommended always to implement an error handler right from the beginning since things can and will go wrong at some point. It can come in handy though if you just want to try things out quickly or for illustrative purposes.
From Asynchronous to Synchronous
As long as your Observable
works on the same thread all the time, there is no need for communication between threads since only one is executing.
When your Observable
flow gets executed on a different thread, you need to take some extra care to make sure you are not missing values.
This is not specific to Observables
: every time you need to deal with parallel threads you need to think about synchronization and communication.
Most of the snippets in this documentation only call subscribe .
You should ensure that your program doesn’t terminate before onCompleted() is called (e.g., via toBlocking() or a CountDownLatch ) and be aware of that when trying to replicate a snippet in its Main class.
|
You should never perform long-running blocking operations inside of an asynchronous stream (e.g.
inside of map s or flatMap s).
|
The following code emits an increasing value every second, which is done on a different thread:
public static void main(String... args) {
Observable
.interval(1, TimeUnit.SECONDS)
.subscribe(new Action1<Long>() {
@Override
public void call(Long counter) {
System.out.println("Got: " + counter);
}
});
}
It works perfectly fine; the only problem is though chances are you won’t see anything printed out. Your main thread exits before the background thread had a chance to run and emit values.
A common way to deal with such a situation is to add a CountDownLatch
, which allows you to synchronize between different threads.
One thread counts down the latch; the other one waits until it is counted down:
final CountDownLatch latch = new CountDownLatch(5);
Observable
.interval(1, TimeUnit.SECONDS)
.subscribe(new Action1<Long>() {
@Override
public void call(Long counter) {
latch.countDown();
System.out.println("Got: " + counter);
}
});
latch.await();
The example prints the following lines and then exits:
Got: 0 Got: 1 Got: 2 Got: 3 Got: 4
|
One common mistake is to use Always use a CountDownLatch! |
A technique unique to Observables
is to convert it into a BlockingObservable
to achieve the same effect.
In simple terms, it converts an Observable
into an iterable
and makes it execute on the caller thread, blocking it until one or more values arrive.
This technique is used extensively in the documentation to show concepts, while not having to deal with count-down latches all the time.
It can also be used if you for some reason are not able to use asynchronous computations.
The conversion itself doesn’t do any blocking in the first place, only subsequent calls will:
// This does not block.
BlockingObservable<Long> observable = Observable
.interval(1, TimeUnit.SECONDS)
.toBlocking();
// This blocks and is called for every emitted item.
observable.forEach(new Action1<Long>() {
@Override
public void call(Long counter) {
System.out.println("Got: " + counter);
}
});
Because this will run forever, you are free to chain any asynchronous computations before.
Thus, you can build an asynchronous workflow and then block at the very end.
This resembles the same code as with the CountDownLatch
before:
Observable
.interval(1, TimeUnit.SECONDS)
.take(5)
.toBlocking()
.forEach(new Action1<Long>() {
@Override
public void call(Long counter) {
System.out.println("Got: " + counter);
}
});
If you know that only a single value is ever returned, you can use the single()
method:
int value = Observable
.just(1)
.toBlocking()
.single();
Be aware though that if more items get emitted, you get an exception:
Exception in thread "main" java.lang.IllegalArgumentException: Sequence contains too many elements at rx.internal.operators.OperatorSingle$1.onNext(OperatorSingle.java:58) at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(OnSubscribeFromIterable.java:76) at rx.Subscriber.setProducer(Subscriber.java:148) at rx.Subscriber.setProducer(Subscriber.java:144) ....
The same thing happens if no value gets emitted:
Exception in thread "main" java.util.NoSuchElementException: Sequence contains no elements at rx.internal.operators.OperatorSingle$1.onCompleted(OperatorSingle.java:82) at rx.internal.operators.OnSubscribeFromIterable$IterableProducer.request(OnSubscribeFromIterable.java:79) at rx.Subscriber.setProducer(Subscriber.java:148) at rx.Subscriber.setProducer(Subscriber.java:144) at rx.Subscriber.setProducer(Subscriber.java:144) at rx.Subscriber.setProducer(Subscriber.java:144) ....
As an alternative, you can use singleOrDefault()
so that a fallback value gets returned.
You can use this technique with the Java SDK if you are loading a document and it does not exist:
JsonDocument doc = bucket.get("id").toBlocking().singleOrDefault(null);
if (doc == null) {
System.err.println("Document not found!");
} else {
System.out.println(doc);
}
If you check out the API documentation of the BlockingObservable
, you will discover many more possibilities, including iterators or grabbing the first and last values.
One last thing that comes in handy with blocking calls: sometimes you want to collect all emitted values into a list. You can combine the blocking calls with the toList() operator to achieve something like this:
List<Integer> list = Observable
.just(1, 2, 3)
.toList()
.toBlocking()
.single();
// Prints: [1, 2, 3]
System.out.println(list);
Creating Observables
There are many ways to create Observables
, and you’ve already seen just()
and interval()
.
There are much more such convenience methods available on the Observable
class, but they all boil down to the create()
method.
You can simulate the example from before with this:
Observable.create(new Observable.OnSubscribe<Integer>() {
@Override
public void call(Subscriber<? super Integer> subscriber) {
try {
if (!subscriber.isUnsubscribed()) {
for (int i = 0; i < 5; i++) {
subscriber.onNext(i);
}
subscriber.onCompleted();
}
} catch (Exception ex) {
subscriber.onError(ex);
}
}
}).subscribe(new Action1<Integer>() {
@Override
public void call(Integer integer) {
System.out.println("Got: " + integer);
}
});
Every time a Subscriber subscribes, the call()
method is executed.
You can then call onNext
, onComplete
and onError
as you wish, but keep in mind that both onComplete
and onError
should only be called once, and afterward no subsequent onNext
is allowed to follow so that the contract is met.
This example shows why it is crucial to call subscribe() on the Observable , because only such a call triggers the actual execution of the pipeline.
This is a little different with subjects, which are covered later in this guide.
Nevertheless, always call subscribe() on your observables.
|
Transforming Observables
Observables can transform their values in various ways.
One of the most basic ones is map()
, which converts the incoming value into a different one.
You surely like division, so here is the FizzBuzz game:
Observable
.interval(10, TimeUnit.MILLISECONDS)
.take(20)
.map(new Func1<Long, String>() {
@Override
public String call(Long input) {
if (input % 3 == 0) {
return "Fizz";
} else if (input % 5 == 0) {
return "Buzz";
}
return Long.toString(input);
}
})
.toBlocking()
.forEach(new Action1<String>() {
@Override
public void call(String s) {
System.out.println(s);
}
});
The map function is used to convert the input number into a string and do some checks to satisfy the FizzBuzz game. As a more practical example, consider loading a document from the Java SDK and only extracting the first name of a user before passing it on:
bucket
.get("id")
.map(new Func1<JsonDocument, String>() {
@Override
public String call(JsonDocument document) {
return document.content().getString("firstname");
}
}).subscribe();
A variation of map()
is called flatMap()
, which allows you to do those transformations with asynchronous calls.
Taking the example from above, we want to map from String (the document ID) to a JsonDocument
(the loaded document).
With a normal map()
, call you would either need to block on the Observable
or at some point deal with an Observable<Observable<JsonDocument>>
.
Thankfully, flatMap()
flattens the resulting values for us and return them into the original flow:
// Loads 3 documents in parallel
Observable
.just("doc1", "doc2", "doc3")
.flatMap(new Func1<String, Observable<JsonDocument>>() {
@Override
public Observable<JsonDocument> call(String id) {
return bucket.get(id);
}
}).subscribe(new Action1<JsonDocument>() {
@Override
public void call(JsonDocument document) {
System.out.println("Got: " + document);
}
});
You can see that flatMap()
returns an Observable<T> whereas the normal map just returns <T>.
You will use flatMap()
a lot when dealing with flows like this, so keep it in mind.
Another helpful transformation is scan()
.
It applies a function to each value emitted by an Observable
, sequentially, and emits each successive value.
We can use it to aggregate values like this:
Observable
.just(1, 2, 3, 4, 5)
.scan(new Func2<Integer, Integer, Integer>() {
@Override
public Integer call(Integer sum, Integer value) {
return sum + value;
}
}).subscribe(new Action1<Integer>() {
@Override
public void call(Integer integer) {
System.out.println("Sum: " + integer);
}
});
This prints:
Sum: 1 Sum: 3 Sum: 6 Sum: 10 Sum: 15
Finally, groupBy()
comes in handy, which emits one Observable
by each group, defined by a function.
The following example emits two Observables
, one for even and one for odd values:
Observable
.just(1, 2, 3, 4, 5)
.groupBy(new Func1<Integer, Boolean>() {
@Override
public Boolean call(Integer integer) {
return integer % 2 == 0;
}
}).subscribe(new Action1<GroupedObservable<Boolean, Integer>>() {
@Override
public void call(GroupedObservable<Boolean, Integer> grouped) {
grouped.toList().subscribe(new Action1<List<Integer>>() {
@Override
public void call(List<Integer> integers) {
System.out.println(integers + " (Even: " + grouped.getKey() + ")");
}
});
}
});
The example prints:
[1, 3, 5] (Even: false) [2, 4] (Even: true)
Combined with the Java SDK, this technique can be used to separate returned Documents based on their content.
The following example uses a view to load all documents from the beer-sample
bucket, groups them by type and counts the number of occurrences:
bucket
.async()
.query(ViewQuery.from("my_design_doc", "my_view"))
.flatMap(AsyncViewResult::rows)
.flatMap(AsyncViewRow::document)
.groupBy(document -> document.content().getString("type"))
.subscribe(observable ->
observable.count().subscribe(integer ->
System.out.println(observable.getKey() + ": " + integer)
)
);
This code queries the view, extracts all rows, loads the full document for each row, groups it by the type
property in the JSON document and then uses the count()
operator to count the number of rows emitted by each Observable
.
This prints something like the following:
brewery: 1412 beer: 5891
Filtering Observables
In addition to transforming observables, you can also filter them. Filtering doesn’t change the emitted values itself, but rather how much and at which point (and if at all) they are emitted.
For example, you can filter based on some criteria:
// This will only let 3 and 4 pass.
Observable
.just(1, 2, 3, 4)
.filter(new Func1<Integer, Boolean>() {
@Override
public Boolean call(Integer integer) {
return integer > 2;
}
}).subscribe();
Or take only the first N values emitted and then unsubscribe:
// Only 1 and 2 will pass.
Observable
.just(1, 2, 3, 4)
.take(2)
.subscribe();
Or use only the first or last value emitted:
// Only 1 will pass
Observable
.just(1, 2, 3, 4)
.first()
.subscribe();
// Only 4 will pass
Observable
.just(1, 2, 3, 4)
.last()
.subscribe();
Finally, you can use distinct() to suppress duplicate values:
// 1, 2, 3, 4 will be emitted
Observable
.just(1, 2, 1, 3, 4, 2)
.distinct()
.subscribe();
distinct() also allows you to pass in a function that returns the key to select by.
You can use this, for example, to separate out duplicate JsonDocument objects.
|
Combining Observables
Multiple Observables
can also be merged to form a combined one.
Depending on how you want those to be merged, there are different operators available.
Two of the most used ones are merge()
and zip()
which are covered here.
Merge
only merges all emitted values by the source Observables
in the order they arrive:
Observable
.merge(evens, odds)
.subscribe(new Action1<Integer>() {
@Override
public void call(Integer integer) {
System.out.println(integer);
}
});
The example prints something similar to the following:
2 4 6 8 10 1 3 5 7 9
With the zip operator, you can combine two streams in the strictly same order, defined by a function:
Observable<Integer> evens = Observable.just(2, 4, 6, 8, 10);
Observable<Integer> odds = Observable.just(1, 3, 5, 7, 9);
Observable
.zip(evens, odds, (v1, v2) -> v1 + " + " + v2 + " is: " + (v1 + v2))
.subscribe(System.out::println);
This zips the pairs together in order and prints:
2 + 1 is: 3 4 + 3 is: 7 6 + 5 is: 11 8 + 7 is: 15 10 + 9 is: 19
Error Handling
Error handling is a vital component of every real world application and needs to be considered from the start.
RxJava provides sophisticated mechanisms to deal with errors that happen inevitably in your Observable
flows.
In general, you want to react in the following ways:
-
Return a default value instead.
-
Flip over to a backup
Observable
. -
Retry the
Observable
(immediately or with backoff).
Returning a default value is a good idea if you cannot afford to retry or you just don’t care (maybe because the flow is not crucial to your data flow). The following code throws an exception at the first emitted item, but falls back to a default value:
Note that you can pass in a function that also takes the exception, so you can return different values for different exception types or use it for logging purposes.
// Prints:
// Default
// Oops: I don't like: Apples
Observable
.just("Apples", "Bananas")
.doOnNext(s -> {
throw new RuntimeException("I don't like: " + s);
})
.onErrorReturn(throwable -> {
System.err.println("Oops: " + throwable.getMessage());
return "Default";
}).subscribe(System.out::println);
You can also flip to a backup Observable
that will be called if the first one fails.
The Java SDK has a getFromReplica()
command that allows you to read stale data from its replicas and treat availability for consistency on reads.
You can use this approach to fall back:
bucket
.get("id")
.onErrorResumeNext(bucket.getFromReplica("id", ReplicaMode.ALL))
.subscribe();
Normally you want to have more control on which Observable
should be run next depending on the type of error.
The following example will only go to the replica if a TimeoutException
happened (if not the error is passed down):
bucket
.get("id")
.timeout(500, TimeUnit.MILLISECONDS)
.onErrorResumeNext(new Func1<Throwable, Observable<? extends JsonDocument>>() {
@Override
public Observable<? extends JsonDocument> call(Throwable throwable) {
if (throwable instanceof TimeoutException) {
return bucket.getFromReplica("id", ReplicaMode.ALL);
}
return Observable.error(throwable);
}
});
Finally, it is possible to retry the Observable
by resubscribing.
This can be done as quickly as possible, or with a backoff interval, which is preferred when external resources are involved.
The following program desperately tries to read the numbers from 1 to 10, but a (not so hidden) flaw makes it randomly throw an exception.
If that happens, the code retries.
Since lots of values might be already emitted, we can use distinct()
to filter those out.
Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
.doOnNext(integer -> {
if (new Random().nextInt(10) + 1 == 5) {
throw new RuntimeException("Boo!");
}
})
.retry()
.distinct()
.subscribe(System.out::println);
If you only want to retry for a max amount, replace the retry() with a retry(count) call.
|
If you want to retry with backoff, you can use a technique like this:
Observable
.range(1, 10)
.doOnNext(integer -> {
if (new Random().nextInt(10) + 1 == 5) {
throw new RuntimeException("Boo!");
}
})
.retryWhen(attempts ->
attempts.zipWith(Observable.range(1, 3), (n, i) -> i)
.flatMap(i -> {
System.out.println("delay retry by " + i + " second(s)");
return Observable.timer(i, TimeUnit.SECONDS);
}))
.distinct()
.subscribe(System.out::println);
The attempts get passed into the retryWhen()
method and zipped with the number of seconds to wait.
The timer method is used to complete once its timer is done.
If you run this code a few times to generate an exception (or more), you will see something similar to this:
1 2 3 4 delay retry by 1 second(s) delay retry by 2 second(s) 5 6 7 8 9 10
With the Java SDK the advanced retryWhen
is easier to write using the RetryBuilder
helper class.
These can be used to specify a filter on which kind of Exception
to retry, for how many attempts, with any Delay
.
Observable
.range(1, 10)
.doOnNext(integer -> {
if (new Random().nextInt(10) + 1 == 5) {
throw new RuntimeException("Boo!");
}
})
.retryWhen(
RetryBuilder
.anyOf(RuntimeException.class)
.delay(Delay.exponential(TimeUnit.MILLISECONDS, 100))
.max(5)
.build())
.distinct()
.subscribe(System.out::println);
Schedulers and Threads
Schedulers in RxJava are used to manage and control concurrency. Some operators implicitly use one or allow you to pass in a custom one.
RxJava ships with a bunch of pre-configured Schedulers by default, which are all accessible through the Schedulers class:
-
Schedulers.computation()
: Event-loop style scheduler for purely computational work. -
Schedulers.immediate()
: Executes the work immediately on the current thread. -
Schedulers.io()
: Executes work on an Executor-backed pool that grows as needed. -
Schedulers.newThread()
: Creates a new thread for each unit of work. -
Schedulers.trampoline()
: Queues the work on the current thread and gets executed after the current work completes. -
Schedulers.test()
: Test thescheduler
used for testing and debugging, which allows manual advancing of the clock.
As a rule of thumb, the computation scheduler
should always be used for in-memory processing, while the I/O scheduler should only be used for blocking-style I/O operations (so do not use it together with the Java SDK because it is asynchronous anyway).
You can instruct an observable
to be executed on such a scheduler
in the following ways:
-
Implicitly by using an operator that makes use of one
-
Explicitly by passing the Scheduler to such an operator
-
By using
subscribeOn(Scheduler)
-
By using
observeOn(Scheduler)
Operators like buffer
, replay
, skip
, delay
, parallel
and so on use a scheduler
by default if not instructed otherwise.
A list of default schedulers
can be found here.
As a rule of thumb, all of those operators allow you to pass in a custom scheduler
if needed, but most of the time sticking with the defaults is a good idea.
The Java SDK uses an internal scheduler similar to the computation scheduler to proper isolate the inner mechanisms from user-land.
It is possible to change that scheduler through the environment, but it is not recommended.
|
If you want the whole subscribe chain to be executed on a specific scheduler
, you use the subscribeOn()
operator.
Without a scheduler set, the following code executes on the main thread:
Observable
.range(1, 5)
.map(integer -> {
System.out.println("Map: (" + Thread.currentThread().getName() + ")");
return integer + 2;
})
.subscribe(integer ->
System.out.println("Got: " + integer + " (" + Thread.currentThread().getName() + ")")
);
The example prints:
Map: (main) Got: 3 (main) Map: (main) Got: 4 (main) Map: (main) Got: 5 (main) Map: (main) Got: 6 (main) Map: (main) Got: 7 (main)
This example shows the subscribeOn()
method added to the flow (it doesn’t matter where you add it):
Observable
.range(1, 5)
.map(integer -> {
System.out.println("Map: (" + Thread.currentThread().getName() + ")");
return integer + 2;
})
.subscribeOn(Schedulers.computation())
.subscribe(integer ->
System.out.println("Got: " + integer + " (" + Thread.currentThread().getName() + ")")
);
In the output of the example that uses subscribeOn()
, you can see it is executed on the same thread, but on the computation thread pool:
Map: (RxComputationThreadPool-6) Got: 3 (RxComputationThreadPool-6) Map: (RxComputationThreadPool-6) Got: 4 (RxComputationThreadPool-6) Map: (RxComputationThreadPool-6) Got: 5 (RxComputationThreadPool-6) Map: (RxComputationThreadPool-6) Got: 6 (RxComputationThreadPool-6) Map: (RxComputationThreadPool-6) Got: 7 (RxComputationThreadPool-6)
If you need tighter control regarding which parts are executed on what pool, use observeOn()
.
Here, the order matters:
Observable
.range(1, 5)
.map(integer -> {
System.out.println("Map: (" + Thread.currentThread().getName() + ")");
return integer + 2;
})
.observeOn(Schedulers.computation())
.subscribe(integer ->
System.out.println("Got: " + integer + " (" + Thread.currentThread().getName() + ")")
);
Everything before the observeOn()
call is executed in main
, everything below in the scheduler:
Map: (main) Map: (main) Map: (main) Got: 3 (RxComputationThreadPool-6) Got: 4 (RxComputationThreadPool-6) Got: 5 (RxComputationThreadPool-6) Map: (main) Map: (main) Got: 6 (RxComputationThreadPool-6) Got: 7 (RxComputationThreadPool-6)
There is also a way to use schedulers
directly to schedule operations.
For more information about schedulers
, refer to the RxJava documentation about schedulers.
Writing Resilient Reactive Applications
| Many concepts can be applied for both synchronous and asynchronous access. When necessary, both patterns are discussed separately. The focus is on database interaction, but if you are using RxJava as part of your stack, you can and should apply most of the principles there as well. |
Error Recovery
This section discusses different strategies to mitigate errors that might come up during operations. Some of them are shown to make a point, but the techniques apply to all different types of errors and can be applied as you see fit.
Defaults
Another possibility that requires intervention on the application side are Observables
that do not emit a single value.
This can happen because operators filtered the Observable
so that nothing is left, or they did not produce any values in the first place.
One common case in the Java SDK is get()
.
If the Document is not found, the Observable
will complete without emitting anything.
RxJava provides helper operators that all end with *OrDefault()
and allow you to return default values if no item is emitted when the Observable
completes.
In most cases, you want to use singleOrDefault()
and return a default value when not a single item is emitted by the source Observable
:
Observable
.<String>empty()
.singleOrDefault("Default")
.subscribe();
If you are dealing with potentially more than one item emitted in your Observable
and you only want to emit either the first or the last value, there are also operators that allow you to emit a default if it’s unexpectedly empty.
See firstOrDefault()
as well as lastOrDefault()
for more details.
Lastly, RxJava offers the method defaultIfEmtpy
, which allows you to return a value if the source doesn’t emit anything.
In recent versions, the method switchIfEmpty
allows you to switch to a different Observable
in that same case.
Error Handling in Bulk Scenarios
Bulk operations are used to handle more data in one batch and, therefore, benefit from better resource utilization. However, error handling becomes more complicated. There are three high-level cases to consider:
-
Best Effort: Keep going and just use the results that succeeded when errors happen.
-
Full Retry: Retry the complete Observable when errors happen.
-
Incremental Retry: Only retry specific events of the Observable.
Before we "dig" into the specific approaches, let’s revisit the contract of Observables:
onNext* (onError | onComplete)
Zero or more events are followed by either an error event or a complete event.
This provides an important clue right away: once our Observable
fails, no more events can be passed through.
Therefore, you need to make sure that errors are handled at the smallest scope possible, only letting it proceed if you cannot handle it right away.
- Best Effort Bulk Handling
-
Sometimes it is more important to get data in a timeframe, or maybe with a short timeout, then getting all data. In general, you want to keep a timeout that lets you fetch all the data, but depending on the use case you are fine with only getting a subset of the data returned.
To ignore errors and turn them into "noops", you can utilize
onErrorResumeNext()
:Observable .create(new Observable.OnSubscribe<String>() { @Override public void call(Subscriber<? super String> subscriber) { subscriber.onNext("A"); subscriber.onNext("B"); subscriber.onError(new IllegalStateException("Woops")); subscriber.onNext("C"); } }) .onErrorResumeNext(Observable.<String>empty()) .toBlocking() .forEach(new Action1<String>() { @Override public void call(String s) { System.out.println("Got: " + s); } });
This will not raise any exception to your calling thread, but it will never process "C" because, based on the
Observable
contract, onceonError
is called no more events are allowed to be generated.To keep going in case an event fails, you need to turn each event into a single
Observable
and then merge it back together to either defer the error handling (throughObservable#mergeDelayError
) or useflatMap
and make sure to contain the errors before flattening.This code provides some fake data with which you can work. It will emit four
Observables
where one of them will fail:Observable<Observable<String>> dataObservables = Observable .just("a", "b", "c", "d") .map(new Func1<String, Observable<String>>() { @Override public Observable<String> call(String s) { if (s.equals("b")) { return Observable.error(new IllegalStateException("I dont like b")); } return Observable.just(s); } });
You can then use
mergeDelayError
to defer error handling until the end. If you un-comment theonErrorResumeNext
, it will silently discard any errors as well leaving you with anObservable
that provides best-effort processing of the sourceObservables
.Observable.mergeDelayError(dataObservables) //.onErrorResumeNext(Observable.<String>empty()) .toBlocking() .forEach(new Action1<String>() { @Override public void call(String s) { System.out.println(s); } });
Alternatively, you can use
flatMap
and make sure the errors are contained for each emittedObservable
:Observable .just("a", "b", "c", "d") .flatMap(new Func1<String, Observable<String>>() { @Override public Observable<String> call(String s) { // Simulate some observable that sometimes fails Observable<String> obs; if (s.equals("b")) { obs = Observable.error(new IllegalStateException("I dont like b")); } else { obs = Observable.just(s); } // Here comes the actual handling part before we flatten it back return obs.onErrorResumeNext(Observable.<String>empty()); } }) .toBlocking() .forEach(new Action1<String>() { @Override public void call(String s) { System.out.println(s); } });
As a more practical example here is a best effort bulk loading of documents from Couchbase Server that just discards operations that fail:
private static Observable<JsonDocument> loadDocsBestEffort(Bucket bucket, List<String> ids) { return Observable .from(ids) .flatMap(new Func1<String, Observable<JsonDocument>>() { @Override public Observable<JsonDocument> call(String id) { return bucket .async() .get(id) .onErrorResumeNext(Observable.<JsonDocument>empty()); } }); }
Of course, you can add more logic onto each emitted
Observable
and also proper logging so that you at least know which errors occurred. - Full Retry Bulk Handling
-
Full retry bulk handling can be done by just chaining one of the retry operators right at the end of the
Observable
chain.This example uses Java 8 Lambda syntax for conciseness. private static Observable<JsonDocument> loadDocsFullRetry(Bucket bucket, List<String> ids) { return Observable .from(ids) .flatMap(id -> return bucket.async().get(id)) .retry(4); }
This is, however, a bit crude because the whole list of IDs will be retried if there is an error. This is the case even if the error happens late in the stream and some items have already been emitted. Imagine that you retrieve items
A
,B
,C
,D
and that an error occurs just the first time the SDK retrieves C. What you will see isA
,B
,A
,B
,C
,D
.This can be mitigated by using the
distinct()
operator, but keep in mind the memory tradeoff (distinct will maintain a set of values it saw in the background, which can be problematic for infinite or very large streams). - Incremental Retry Bulk Handling
-
Incremental retry improves on full retry by only actually retrying elements that couldn’t be loaded. It is easily done by chaining the retry operators inside the
flatMap
instead of outside of it.private static Observable<JsonDocument> loadDocsIncrementalRetry(Bucket bucket, List<String> ids) { return Observable .from(ids) .flatMap(id -> return bucket.async().get(id) .retry(4) ); }
One thing to keep in mind with
flatMap
is that the order of emissions isn’t guaranteed to be the same as the source emissions. This can be especially visible in this case since individual streams are retried on their own: retried keys could come back with a value much later than other keys, more often changing the order in which they appear. - Bulk Pattern,
BackpressureException
and Reactive Pull Backpressure -
The bulk pattern is powerful, but if you try it with a very large collection, it is especially susceptible to a
BackpressureException
. This exception is a way for the SDK to tell you that you’re asking for too much in a short amount of time, and requests have piled up too much while waiting for a server response to free up a spot.By default, the internal structure that holds pending requests is sized to a little over 16 000 slots. Since
from
iterates over a collection in memory, which is very fast, it can easily flood the SDK if the size of it is over or close to 16K.You could try to react to that by implementing a retry strategy, but it is hard to get it right. Fortunately, RxJava comes with an even better solution, a form of flow-control called reactive pull backpressure that you can leverage to avoid getting a
BackpressureException
.This is done through the Subscriber, its
onStart()
method and therequest(n)
method.You have to use the Subscriber to subscribe()
instead of the convenience methods that just takeAction
individually fornext
,error
andcompleted
handlers.Observable<JsonDocument> largeBulk = Observable .from(oneMillionIds) .flatMap(id -> return bucket.async().get(id)); //the subscription is where reactive pull backpressure happens largeBulk.subscribe(new Subscriber<JsonDocument>() { //onStart initiates the backpressure @Override public void onStart() { request(100); } @Override public void onNext(JsonDocument jsonDocument) { System.out.println(jsonDocument.content()); request(100); //request more items } //onCompleted and onError are less relevant. //Note that if you want to block you'd need a CountDownLatch in this case @Override public void onCompleted() { System.out.println("Done"); } @Override public void onError(Throwable e) { e.printStackTrace(); } });
The
request(n)
method allows to notify the upstream source that the consumer is ready for more, and is prepared to consumen
items. For example, this avoids instant iteration of the collection in the case offrom
. And as long as responses come in from Couchbase Server, we continue asking for more.This is a form of error mitigation, and we’ll see a few others in the next section.
Error Mitigation
The idea behind error mitigation is to limit the impact a failing piece had on the rest of the system. When an error occurs, you don’t want it to cause failures downstream. You also want to prevent as much of the error conditions to happen as possible.
The BackpressureException
and RxJava’s reactive pull backpressure are forms of error mitigation we already saw since they both allow a form of flow control that avoids overloading the system.
Slowing Down
Rate limiting of the requests can be a way to keep the system within parameters that are known to be stable, thus mitigating overloading errors. This can happen in the client-to-server direction, which avoids making more requests than can be processed later. It can also happen in the server-to-client direction, when the client can’t keep up with the bandwidth at which data is sent from the server because, for instance, it has to process it through long-running tasks. Rather than choking on that data when backpressure mechanisms are not available, the client can decide to discard some of the data. This is referred to as Load Shedding.
For example, consider a system where multiple sensors write data into Couchbase, and the client application reads that data and displays it in a UI.
The graphs in the UI can be built on a sample
of the data, and that’s the key point.
The processing rate of the data is lower than its producing rate, but at the same time the resolution is also lower.
That means we can simply ignore some of the data and only consume what’s needed, such as take the data point at every second to trigger a refresh of the graph in the UI.
RxJava allows you to do that through several operators:
-
sample
(alternativelythrottleLast
) periodically looks at an Observable and emits the item last seen during this period. -
throttleFirst
does the same except it emits thefirst
item seen during the period. -
debounce
only emits an item if a given timespan has passed since the last emission, eliminating items that are rapidly following another item.
The operator sample
is useful for sources that are "too chatty" even at a regular rate.
The operator debounce
, on the other hand, is really shining with sources that have a variable rate of emission.
The sources only trigger a web search for auto-complete suggestions from an input form once the user has stopped typing for 500ms.
Semaphore
To limit the strain put on dependencies of your application, one possibility is to put hard limits on how many concurrent threads can access a resource.
This is done with the classic concurrency programming pattern of the Semaphore
, which is implemented in java.util.concurrent
since Java 7.
Note that Semaphores are a bit different from locks since they don’t have a notion of ownership.
For example, two different threads can respectively acquire()
and release()
a Semaphore
permit), which can avoid things like deadlocks.
The same concept could also be implemented using a fixed-size thread pool. Such thread pool adds overhead but allows upstream code to just "walk away" from the call if it takes too long for a slot to become available, providing an even better isolation.
Collapsing Requests
Another way of mitigating errors is to batch similar requests together and "collapse" them into one request to the subsystem. If you have multiple threads that potentially ask for the same data, the benefit can be immediate by just putting a facade on your calls that will de-duplicate parallel requests.
You can go beyond and trade a little bit of latency to allow for more potential de-duplication. Wait a little longer to see if any duplicate request comes in before firing the actual de-duplicated request.
Implementation
All the mentioned techniques can be easily implemented in an application in a RxJava-compatible way by using another library from Netflix, Hystrix. It is a very comprehensive library for building resilient applications, including techniques for error mitigation but also failing fast. Here, the circuit-breaker pattern short-circuits calls to a service that is known to be down until we detect it is back up, which stops cascading failures, provides fallbacks and gathers metrics.


|
Scientific Fortran Tools (SciFT)
1.2
|
Data Types | |
| type | grid2d |
Public Member Functions | |
| subroutine | initdefault (this, min, max, size, stepSize) |
| Constructor. More... | |
| subroutine, public | grid2d_test () |
| Test method. More... | |
Private Member Functions | |
| subroutine | fromcomponents (this, x, y) |
| Constructor. More... | |
| subroutine | fromarray (this, xArray, yArray) |
| Constructor. More... | |
| subroutine | fromfile (this, iFileName, columns, tol, cComments) |
| Constructor. More... | |
| subroutine | copygrid2d (this, other) |
| Copy constructor. More... | |
| subroutine | destroygrid2d (this) |
| Destructor. More... | |
| logical function | isequalto (this, other, tol) |
| logical function | isequallyspaced (this) |
| subroutine | checkequallyspaced (this) |
| type(grid2d) function | addition (this, other) |
| type(grid2d) function | additionfc (this, constant) |
| type(grid2d) function | subtraction (this, other) |
| type(grid2d) function | subtractionfc (this, constant) |
| type(grid2d) function | multiplication (this, other) |
| type(grid2d) function | multiplicationfc (this, constant) |
| type(grid2d) function | division (this, other) |
| type(grid2d) function | divisionfc (this, constant) |
| type(grid2d) function | exponentiation (this, other) |
| type(grid2d) function | exponentiationfc (this, constant) |
| character(:) function, allocatable | str (this, formatted, prefix) |
| Convert to string. More... | |
| subroutine | show (this, unit, formatted) |
| Show. More... | |
| subroutine | save (this, ofileName, units) |
| Save the data in one column format in a selected unit. More... | |
| subroutine | tofstream (this, ofile, units) |
| Save the data in one column format in a selected unit. More... | |
| subroutine | setunits (this, unit) |
| pure integer function | npointsincoord (this, i) |
| Returns the size of the component i-th. More... | |
| pure integer function, dimension(2) | npointsvec (this) |
| pure real(8) function | minincoord (this, i) |
| pure real(8) function, dimension(2) | minvec (this) |
| pure real(8) function | maxincoord (this, i) |
| pure real(8) function, dimension(2) | maxvec (this) |
| pure real(8) function | stepsizeincoord (this, i) |
| Returns the size of the component i-th. More... | |
| pure real(8) function, dimension(2) | stepsizevec (this) |
| subroutine | resize1 (this, dnx, dny, dirx, diry) |
| Resizes the function by making a larger grid with the same step size by adding zeros at the end of each coordinate. More... | |
| subroutine | resize2 (this, dn, dir) |
| Resizes the function by making a larger grid with the same step size by adding zeros at the end of each coordinate. More... | |
| pure real(8) function | x (this, i) |
| pure real(8) function | y (this, i) |
| real(8) function, dimension(2) | at (this, i, j) |
| pure real(8) function | dv (this) |
| subroutine | set (this, i, j, value) |
| subroutine | showtest (xyzGrid) |
| Auxiliar function for test method. More... | |
Definition at line 34 of file Grid2D.f90.
|
private |
Definition at line 244 of file Grid2D.f90.
|
private |
Definition at line 264 of file Grid2D.f90.
|
private |
Definition at line 714 of file Grid2D.f90.
|
private |
Definition at line 233 of file Grid2D.f90.
|
private |
Copy constructor.
Definition at line 185 of file Grid2D.f90.
|
private |
Destructor.
Definition at line 199 of file Grid2D.f90.
|
private |
Definition at line 349 of file Grid2D.f90.
|
private |
Definition at line 369 of file Grid2D.f90.
|
private |
Definition at line 726 of file Grid2D.f90.
|
private |
Definition at line 384 of file Grid2D.f90.
|
private |
Definition at line 404 of file Grid2D.f90.
|
private |
Constructor.
Definition at line 148 of file Grid2D.f90.
|
private |
Constructor.
Definition at line 136 of file Grid2D.f90.
|
private |
Constructor.
Definition at line 160 of file Grid2D.f90.
| subroutine, public grid2d::grid2d_test | ( | ) |
Test method.
Definition at line 776 of file Grid2D.f90.
| subroutine grid2d::initdefault | ( | class(grid2d) | this, |
| real(8), dimension(2) | min, | ||
| real(8), dimension(2) | max, | ||
| integer, dimension(2), optional | size, | ||
| real(8), dimension(2), optional | stepSize | ||
| ) |
Constructor.
Definition at line 119 of file Grid2D.f90.
|
private |
Definition at line 221 of file Grid2D.f90.
|
private |
Definition at line 207 of file Grid2D.f90.
|
private |
Definition at line 619 of file Grid2D.f90.
|
private |
Definition at line 630 of file Grid2D.f90.
|
private |
Definition at line 598 of file Grid2D.f90.
|
private |
Definition at line 609 of file Grid2D.f90.
|
private |
Definition at line 314 of file Grid2D.f90.
|
private |
Definition at line 334 of file Grid2D.f90.
|
private |
Returns the size of the component i-th.
Definition at line 577 of file Grid2D.f90.
|
private |
Definition at line 588 of file Grid2D.f90.
|
private |
Resizes the function by making a larger grid with the same step size by adding zeros at the end of each coordinate.
| nx | Number of points to add in X coordinate |
| ny | Number of points to add in Y coordinate |
| nz | Number of points to add in Z coordinate |
Definition at line 665 of file Grid2D.f90.
|
private |
Resizes the function by making a larger grid with the same step size by adding zeros at the end of each coordinate.
| nx | Number of points to add in X coordinate |
| ny | Number of points to add in Y coordinate |
| nz | Number of points to add in Z coordinate |
Definition at line 681 of file Grid2D.f90.
|
private |
Save the data in one column format in a selected unit.
Definition at line 507 of file Grid2D.f90.
|
private |
Definition at line 736 of file Grid2D.f90.
|
private |
Definition at line 563 of file Grid2D.f90.
|
private |
Show.
Definition at line 486 of file Grid2D.f90.
|
private |
Auxiliar function for test method.
Definition at line 748 of file Grid2D.f90.
|
private |
Returns the size of the component i-th.
Definition at line 640 of file Grid2D.f90.
|
private |
Definition at line 651 of file Grid2D.f90.
|
private |
Convert to string.
Definition at line 419 of file Grid2D.f90.
|
private |
Definition at line 279 of file Grid2D.f90.
|
private |
Definition at line 299 of file Grid2D.f90.
|
private |
Save the data in one column format in a selected unit.
Definition at line 532 of file Grid2D.f90.
|
private |
Definition at line 692 of file Grid2D.f90.
|
private |
Definition at line 703 of file Grid2D.f90.


--- layout: page_nice title: Contact. permalink: "/contact/" tags: contact --- Want to work with me or have a question you’d like to ask? Just fill out the form below* and I’ll quickly respond.
Email Address<EMAIL_ADDRESS>Phone Number: 07738 557 669
*Unless you’re
my mum, in which case: Mum, please stop using this form to request more photos
of Bertie. I know he’s very cute, but this has got to stop.
OK, fine,
just one last one:


BDG Chart
Spline
Unique Visits
Pages View
Basic Bar
Unique Visits
Pages View
Basic Bar
Total Fruits Consumption
Wa Dedi
Mang Gembil
Mang Dodo
Temperature variation by month
Temperature
Source: www.survey.com
Speedometer
Kilometer Speed per hours
Speedometer
Speedometer
Bar
Unique Visits
Pages View
Population Pyramid for Indonesia 2016
Unique Visits
Pages View
Latest Campaign
Bandung
Jakarta
Unique Visits
Pages View
Double Chart
Unique Visits
Pages View
Progress
75%
Work Started
56%
Work Done
Pie
- Windows
- Linux
- Ubuntu
- OSX
Investment Progress
Investings
Revenue4500,00
Costs
3450,00
Double Chart
loading...
Market
Rp.3.500.000Referal
Rp.1.150.000Affiliate
Rp.950.000Double Chart Overlay
Unique Visits
Pages View
New Visitors
120.000
Updated at 1 minutes ago
75%
Yesterday
Today Visitors
40.000
Updated at 3 minutes ago
25%
today
Daily Visitors
430.000
All Domestic Visitors
97%
All Visitors
Order bar
Unique Visits
Pages View
Comments
Likes
Donut Chart
Windows
OSX
Linux
Others
Double Chart
Unique Visits
Pages View
Background Chart


This document gives an overview of what is new in the Tobii EyeTracking Framework 2.0 compared to the Tobii EyeX Framework 1.7 (which is the latest 1.x version available on http://developer.tobii.com) and what needs to be considered when switching from 1.7 to 2.0.
Remember to also read the documentation included in the 2.0 SDK package: the Manual and the Scripting Reference.
Tobii.EyeTracking
In 1.7 all classes are prefixed with "EyeX". In 2.0 all prefixes have been removed, and we have introduced a namespace so all clients need to add using Tobii.EyeTracking;
to access the API.
All references to the Tobii.EyeX.Client
and Tobii.EyeX.Framework
namespaces have been removed from the API, meaning that Tobii.EyeTracking
is the only namespace needed.
EyeTracking
The 2.0 framework introduces a new quick and easy access to the most commonly used functionality via a static class called EyeTracking
.
Here are some examples of static methods on the class:
EyeTracking.GetGazePoint()
EyeTracking.GetUserPresence()
EyeTracking.GetFocusedObject()
The static API uses lazy initialization and sets things up as they are first requested. This means that there will be some frames of invalid data after the first call to EyeTracking.GetGazePoint()
before the data stream is up and running. The static API can be explicitly initialized using EyeTracking.Initialize()
. This way the initialization period of invalid data can be moved to for example the startup sequence of the game instead of at the first request of data.
The 1.7 framework relies entirely on the underlying Tobii EyeX Interaction Engine to calculate which objects the user is looking at. In the 2.0 framework we decided to do all calculations client-side to decide which game object the user is looking at. This way we can use algorithms that are more suitable for the Unity Engine's way of representing objects.
The concept introduced in 2.0 for this is Gaze Focus
. An object that has Gaze Focus is considered to be intentionally focused by the user. The idea is that we will refine the algorithms continually in future versions of the framework, and that they will work in a good way for different eye tracker models with different characteristics in accuracy and precision, but also over a broad set of different eye-gaze characteristics of end-users.
As a developer you should use Gaze Focus
as it is out-of-the-box, since an additional filtering done on top of the gaze focus calculation might be a bad fit when the algorithms change in a future release. Highlighting of objects and visualisations should use timings related to human perception rather than be adapted to a specific gaze focus algorithm, eye tracker model or a user's characteristic gaze-tracking.
Gaze Focus
is only available for 3D and 2D game objects. It does not work with UI elements.
The GazeAware component has changed somewhat in the 2.0 framework:
GazeAware
(with no Component
suffix)HasGazeFocus
(previously HasGaze
)Delay Time
)In addition to each GazeAware
game object being able to read its state of HasGazeFocus
in the Update
function, it is also possible to ask the gaze focus handler which object is currently focused using the static function EyeTracking.GetFocusedObject()
. This function returns only one object (or a null object).
The gaze focus algorithms use a couple of configurable settings in their calculations:
The settings are global and used for all GazeAware component instances. They are readonly in standalone builds and configurable only in the Unity Editor in the Eye Tracking Settings window found under Edit/Eye Tracking Settings...
A new interface IStateValue
has been introduced and all state value types have been changes to types defined in the Tobii EyeTracking Framework or in the UnityEngine
.
The Activatable and Pannable components have been removed together with all components for data and state access. Gaze Point data, and the User Presence and Gaze Tracking states are easily accessable via the static EyeTracking API instead.
We suggest using the GazeAware component with suitable key hooks instead of the Activatable component. Instead of the Pannable component take a look at different flavors of Infinite Screen provided in the Tobii Interaction Samples (soon available).
It is no longer possible to programmatically define axis aligned rectangles as interactors using the API. The new gaze focus system only works with 3D and 2D game objects.
The 2.0 framework only provides lightly filtered Gaze Point data. This has been done in preparation for some expected future changes in how the framework itself will retrieve data from the eye tracker where the previous data modes will not be available and therefore should not be exposed in the API.
The Eye Positions data stream has been marked as experimental. This is partly because we have not been able to implement any recommended good-enough user experience based on this data, and partly because we are expecting breaking changes to the format of this data.
The Fixations data stream has been removed because of expected future changes to what is provided from the underlying system.
Note: If you use the static EyeTracking.GetGazePoint()
function you do not have to care about starting and stopping the data stream.
In the 2.0 framework we have changed the data stream functions for Start
and Stop
so that they now take a unique token. This was done to be able to handle the reference counting correctly in cases where the methods were not called symmetrically by client scripts which could lead to the data stream getting shutdown prematurely though there were other clients still requesting data (seems to happen when Start
placed in OnEnable
and Stop
placed in OnDisable
and OnDisable
gets called an extra time maybe from OnDestroy
).
From a MonoBehaviour script the game object's instance id can be used as a token:
_gazePointDataProvider.Start(gameObject.GetInstanceID());
In a non-MonoBehaviour script, simply keep an empty game object as a private field and use its instance id:
private GameObject _uniqueIdentifier = new GameObject("MyExampleClass_UniqueId");
...
_gazePointDataProvider.Start(_uniqueIdentifier.GetInstanceID());
EyeTrackingHost
The EyeXHost
has been renamed EyeTrackingHost
.
EyeTrackingHost.GetInstance()
to access EyeTrackingHost
In previous versions of the framework it has been recommended to keep a reference to the EyeXHost
returned by EyeXHost.GetInstance()
. In 2.0 the recommendation is the opposite, the EyeTrackingHost
should always be accessed using EyeTrackingHost.GetInstance()
and no reference should be kept in client scripts.
Why? In 2.0 we have introduced an interface IEyeTrackingHost
for the EyeTrackingHost
and the EyeTrackingHost.GetInstance()
method returns different implementations of IEyeTrackingHost
depending on from where in the application life cycle the method is called, making sure we have consistent behavior and that no memory is leaked during application shutdown (OnApplicationQuit
, OnDisable
, and OnDestroy
) no matter which order the game objects are destroyed. This underlying structure is also used to return a stub version of the host when building for Linux and Mac.
EyeX Framework 2.0 can only provide eye-gaze data and interaction functionality on the Windows platform, but the framework compiles for both Linux and Mac target platforms. On these unsupported platforms the framework provides a stubbed implementation where all data points are marked as Invalid
and the EyeTrackingHost.TobiiEngineAvailability
property returns EngineAvailability.NotAvailable
.


A B C D E F G H I J K L M N O P R S T U V W Z
All Classes All Packages
All Classes All Packages
All Classes All Packages
U
- U - com.compuware.api.topaz.hostresources.zos.RecordFormat
-
z/OS record format of "U" (undefined-length).
- UA - com.compuware.api.topaz.hostresources.zos.RecordFormat
-
z/OS record format of "UA" (undefined-length, American Standards Association print-control characters).
- UM - com.compuware.api.topaz.hostresources.zos.RecordFormat
-
z/OS record format of "UM" (undefined-length, machine print-control codes).
- UNDEFINED - com.compuware.api.topaz.hostresources.zos.DataSetOrganization
-
Undefined z/OS dataset organization.
- UserIDException - Exception in com.compuware.api.topaz.hostcredentials
-
UserIDException
is the checked exception thrown when an attempt to connect to a host fails because the user ID is expired, not recognized, or revoked. - UserIDException(String, String, IHost) - Constructor for exception com.compuware.api.topaz.hostcredentials.UserIDException
-
Constructs a new user ID exception with the specified detail messages and host.
- UserIDException(String, String, Throwable, IHost) - Constructor for exception com.compuware.api.topaz.hostcredentials.UserIDException
-
Constructs a new user ID exception with the specified detail messages, cause, and host.
- UserProgramConcurrentExecutionException - Exception in com.compuware.api.topaz.hostconnections
-
UserProgramConcurrentExecutionException
is an unchecked exception thrown when an attempt to launch a user program is made while the same or another program is currently executing. - UserProgramConcurrentExecutionException(String, String, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramConcurrentExecutionException
-
Constructs a new user program concurrent execution exception with the specified detail messages and user program name.
- UserProgramConcurrentExecutionException(String, String, Throwable, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramConcurrentExecutionException
-
Constructs a new user program concurrent execution exception with the specified detail messages, cause, and user program name.
- UserProgramException - Exception in com.compuware.api.topaz.hostconnections
-
UserProgramException
is the superclass for all unchecked exceptions related to user programs. - UserProgramException(String, String, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramException
-
Constructs a new user program exception with the specified detail messages and user program name.
- UserProgramException(String, String, Throwable, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramException
-
Constructs a new user program exception with the specified detail messages, cause, and user program name.
- UserProgramJCLErrorException - Exception in com.compuware.api.topaz.hostconnections
-
The
UserProgramJCLErrorException
unchecked exception thrown when an attempt to launch a user program is made but a JCL error occurred. - UserProgramJCLErrorException(String, String, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramJCLErrorException
-
Constructs a new user program JCL error exception with the specified detail messages, user procedure name and user program name.
- UserProgramJCLErrorException(String, String, Throwable, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramJCLErrorException
-
Constructs a new user program JCL error exception with the specified detail messages, cause, user procedure name and user program name.
- UserProgramLaunchException - Exception in com.compuware.api.topaz.hostconnections
-
UserProgramLaunchException
is thrown when a launch is unable to determine the status of a user program launch request. - UserProgramLaunchException(String, String, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramLaunchException
-
Constructs a new user program launch exception with the specified detail messages and user program name.
- UserProgramNotExecutingException - Exception in com.compuware.api.topaz.hostconnections
-
UserProgramNotExecutingException
is an unchecked exception thrown when an attempt to act on a user program is made but a user program is not currently executing. - UserProgramNotExecutingException(String, String, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramNotExecutingException
-
Constructs a new user program not executing exception with the specified detail messages and user program name.
- UserProgramNotExecutingException(String, String, Throwable, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramNotExecutingException
-
Constructs a new user program not executing exception with the specified detail messages, cause, and user program name.
- UserProgramNotFoundException - Exception in com.compuware.api.topaz.hostconnections
-
UserProgramNotFoundException
is thrown when a launch is unable to locate the specified user program. - UserProgramNotFoundException(String, String, String, String) - Constructor for exception com.compuware.api.topaz.hostconnections.UserProgramNotFoundException
-
Constructs a new user program not found exception with the specified detail messages and user program name.
All Classes All Packages


Cross Container Building Utilities
🎉Go Hackathon 2017 @Shanghai🎉
-- made by Huitse Tai & Ace Tang
In Ancient Greek, the word ketos denotes a large fish, a whale, a shark, or a sea monster.
The term cetacean (for whale) originates from cetus. In Greek art, cetea were depicted as serpentine fish. The name of the mythological figure Ceto is derived from ketos. The name of the constellation Cetus also derives from this word.
docker build
, how would you DIY a docker image?!manifest.json
is all you need usually.manifest.json
you downloaded at step one, add your new layer to it.docker build
actually do?look at this trending of whole 2017 https://g.co/trends/Hncq1
docker build
ing in docker containers.docker build
cgroup
, if your building task is executing in a docker container or your own PC?!namespace
, if your building task is executing in a docker container or your own PC?!dind
here (I'm not saying there are no solutions), and so many troubles.# start tasting environment
docker-compose up --build -d
docker exec -it ketos_ketos_1
# begin
mkdir -p /taste
cd /taste
xcb init --image alpine:3.6 .
echo "this is a static asset file" \
> ./blabla_little_magical_spirit
chr libc --tag 3.6 -- \
bach -c 'echo 巫泰到此一游 > /a-poor-tree.txt'
xcb commit --tag 3.6
xcb push


I am into
I am a highly motivated, passionate hard-core Competetitive Programmer with Java & Python. I am confident in Java with Data Structers and Algorithms. In HackerRank 5 star with gold bagge 1st rank with 933 points in Solving challenge .
I like to teach Coding to my friends, classmate, juniors and Computer science Students.
I am confident in Java with DS & algo. and i have done a lot of projects in java , and i am also good in python also done some projects.
Starting my graduation I show interest in Web Development then i learned web Development from Udemy and self from tutorial websites and i become full stack web Developer in Pandemic days and also have done lot of projects as you can download from my github profile.
During my 9th I was interested in movie production then I started working as a Video Editor and gets so much experience and opportunities.


Endurance
☰
Home
Workouts
Awards
Add Routine
Workout History
About Us
Log Out
Workout History:
{%for routine in history%}
Date
{{routine.timestamp}}
Quantity
{{routine.quantity}}
Exercise
{{routine.description}} -------------------------------------------------------------------------
{%endfor%}


Following graph informs you of the distribution of workers' performance in Round 1. Please look at this distrbution carefully which may help you to make hiring decision. The blue histogram is the round 1 performance distribution of male workers, and red histogram is for female workers. For example, there are 12 men and 17 women answered 2 questions correctly in round 1.


Emscripten Tests
(test4) simple Float32 Array test
This experiment is loosely based on [
Emscripten: Pointers and Pointers
]
sources


if. T do. B end. if. T do. B else. B1 end. if. T do. B elseif. T1 do. elseif. T2 do. B2 end.The last sentence executed in a T block is tested for a non-zero value in its leading atom, determining whether the B block after the do. or the rest of the sentence is executed. An empty T block result or an omitted T block tests true. See also the select. control structure. |
plus=: 4 : 0 NB. Addition on non-negative integers if. y do. >: x plus <: y else. x end. ) plus"0/~ i.5 0 1 2 3 4 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 sel=: 1 : 'x # [' quicksort=: 3 : 0 if. 1 >: #y do. y else. (quicksort y <sel e),(y =sel e),quicksort y >sel e=.y{~?#y end. ) quicksort 15 2 9 10 4 0 13 13 18 7 0 2 4 7 9 10 13 13 15 18 perm=: 3 : 0 NB. All permutations of i.y if. *y do. ,/ (0 ,. perm&.<: y) {"2 1 \:"1 =i.y else. i.1 0 end. ) perm 3 0 1 2 0 2 1 1 0 2 1 2 0 2 0 1 2 1 0 test=: 3 : 0 if. 0<y do. 'positive' elseif. 0>y do. 'negative' elseif. do. 'zero' end. ) test&.> 5 _2.71828 0 +--------+--------+----+ |positive|negative|zero| +--------+--------+----+ test&.> '' ; 0 1 _2 ; _3 9 +--------+----+--------+ |positive|zero|negative| +--------+----+--------+