cf.histogram¶
-
cf.
histogram
(*digitized)[source]¶ Return the distribution of a set of variables in the form of an N-dimensional histogram.
The number of dimensions of the histogram is equal to the number of field constructs provided by the digitized argument. Each such field construct defines a sequence of bins and provides indices to the bins that each value of one of the variables belongs. There is no upper limit to the number of dimensions of the histogram.
The output histogram bins are defined by the exterior product of the one-dimensional bins of each digitized field construct. For example, if only one digitized field construct is provided then the histogram bins simply comprise its one-dimensional bins; if there are two digitized field constructs then the histogram bins comprise the two-dimensionsal matrix formed by all possible combinations of the two sets of one-dimensional bins; etc.
An output value for an histogram bin is formed by counting the number cells for which the digitized field constructs, taken together, index that bin. Note that it may be the case that not all output bins are indexed by the digitized field constructs, and for these bins missing data is returned.
The returned field construct will have a domain axis construct for each dimension of the histogram, with a corresponding dimension coordinate construct that defines the bin boundaries.
New in version 3.0.2.
Parameters: - digitized: one or more
Field
One or more field constructs that contain digitized data with corresponding metadata, as would be output by
cf.Field.digitize
. Each field construct contains indices to the one-dimensionsal bins to which each value of an original field construct belongs; and there must bebin_count
andbin_bounds
properties as defined by thecf.Field.digitize
method (and any of the extra properties defined by that method are also recommended).The bins defined by the
bin_count
andbin_bounds
properties are used to create a dimension coordinate construct for the output field construct.Each digitized field construct must be transformable so that its data is broadcastable to any other digitized field contruct’s data. This is done by using the metadata constructs of the to create a mapping of physically compatible dimensions between the fields, and then manipulating the dimensions of the digitized field construct’s data to ensure that broadcasting can occur.
Returns: Field
The field construct containing the histogram.
Examples:
Create a one-dimensional histogram based on 10 equally-sized bins that exactly span the data range:
>>> f = cf.Field.example_field_1() >>> print(f) Field: specific_humidity (ncvar%q) ---------------------------------- Data : specific_humidity(latitude(5), longitude(8)) 1 Cell methods : area: mean Dimension coords: latitude(5) = [-75.0, ..., 75.0] degrees_north : longitude(8) = [22.5, ..., 337.5] degrees_east : time(1) = [2019-01-01 00:00:00] >>> print(f.array) [[0.007 0.034 0.003 0.014 0.018 0.037 0.024 0.029] [0.023 0.036 0.045 0.062 0.046 0.073 0.006 0.066] [0.11 0.131 0.124 0.146 0.087 0.103 0.057 0.011] [0.029 0.059 0.039 0.07 0.058 0.072 0.009 0.017] [0.006 0.036 0.019 0.035 0.018 0.037 0.034 0.013]] >>> indices, bins = f.digitize(10, return_bins=True) >>> print(indices) Field: long_name=Bin index to which each 'specific_humidity' value belongs (ncvar%q) ------------------------------------------------------------------------------------ Data : long_name=Bin index to which each 'specific_humidity' value belongs(latitude(5), longitude(8)) Cell methods : area: mean Dimension coords: latitude(5) = [-75.0, ..., 75.0] degrees_north : longitude(8) = [22.5, ..., 337.5] degrees_east : time(1) = [2019-01-01 00:00:00] >>> print(bins.array) [[0.003 0.0173] [0.0173 0.0316] [0.0316 0.0459] [0.0459 0.0602] [0.0602 0.0745] [0.0745 0.0888] [0.0888 0.1031] [0.1031 0.1174] [0.1174 0.1317] [0.1317 0.146 ]] >>> h = cf.histogram(indices) >>> rint(h) Field: number_of_observations ----------------------------- Data : number_of_observations(specific_humidity(10)) 1 Cell methods : latitude: longitude: point Dimension coords: specific_humidity(10) = [0.01015, ..., 0.13885] 1 >>> print(h.array) [9 7 9 4 5 1 1 1 2 1] >>> print(h.coordinate('specific_humidity').bounds.array) [[0.003 0.0173] [0.0173 0.0316] [0.0316 0.0459] [0.0459 0.0602] [0.0602 0.0745] [0.0745 0.0888] [0.0888 0.1031] [0.1031 0.1174] [0.1174 0.1317] [0.1317 0.146 ]]
- digitized: one or more


--- layout: page title: Practice Log - Videos showing my process of learning guitar - Song Notes by David Pots permalink: /practice/ ---
Here's a directory of all my 350+ video lessons, separated by category. You can also search if you're looking for something specific.
Quick Riffs Tips & Techniques Full Songs Practice Log


Monkeys live in trees, grasslands, mountains, forests, and on high plains. A group of monkeys is called a troop. Most primates share six basic features: forward-facing eyes, eye sockets, grasping hands, nails, fingerprints, and large brains. Monkeys are most easily distinguished from apes by their tails.
Rhinos are thought to be the second largest land animal, with the elephant being the largest. They have a robust, cylindrical body with a large head, relatively short legs, and short tail. The characteristic feature of these animals is a large horn in the middle of their faces; some species have a second, smaller horn.
Pigs are mammals with stocky bodies, flat snouts that can move independently of their heads, small eyes and large ears. They are highly intelligent, social animals, and are found all over the world. Pigs are in the Suidae family, which includes eight genera and 16 species.


Valid seeds are 8 lowercase hex values; 0-9, a-d.
generated quizzes will appear here using AJAX, so that you don't have to reload the page!


Adapter for functions that return only one result. This class also describes the interface expected for the NVFunc template parameter for the tree / set / map classes.
More...
#include <orbtree.h>
|
|
typedef NVFunc::result_type | result_type |
| | Type of the result of this function.
|
| |
|
| constexpr unsigned int | get_nr () const |
| | Dimension of result. In case of a simple function, it is one. More...
|
| |
| void | operator() (const typename NVFunc::argument_type &node_value, result_type *res) const |
| | Calculate the function value associated with one node. More...
|
| |
|
| NVFunc_Adapter_Simple (const NVFunc &f_) |
| | Create a new instance storing the given function.
|
| |
|
| NVFunc_Adapter_Simple (NVFunc &&f_) |
| |
|
template<class T > |
| | NVFunc_Adapter_Simple (const T &t) |
| |
template<class NVFunc>
struct orbtree::NVFunc_Adapter_Simple< NVFunc >
Adapter for functions that return only one result. This class also describes the interface expected for the NVFunc template parameter for the tree / set / map classes.
- Template Parameters
-
| NVFunc | simple function taking one argument and returning the associated value to be stored. Should define a member type as argument_type to use this adapter. |
◆ get_nr()
Dimension of result. In case of a simple function, it is one.
Main use case: for a function that has an adjustable parameter, it can be used as a vector function and results for multiple parameter combinations can be calculated at the same time.
◆ operator()()
Calculate the function value associated with one node.
- Parameters
-
| node_value | Node's value, i.e. the key in case of a set or multiset, and a pair of key and value for a map or multimap |
| res | result is stored here (should be an array of size at least the number returned by get_nr() |
The documentation for this struct was generated from the following file:


BUYCheckout Class Reference
| Inherits from | BUYObject : NSObject |
|---|---|
| Conforms to | BUYSerializable |
| Declared in | BUYCheckout.h |
Overview
The checkout object. This is the main object that you will interact with when creating orders on Shopify.
Note: Do not create a BUYCheckout object directly. Use initWithCart: to transform a BUYCart into a BUYCheckout.
Other Methods
email
The customer’s email address
@property (nonatomic, copy) NSString *email
Declared In
BUYCheckout.h
token
Unique token for the checkout on Shopify
@property (nonatomic, copy, readonly) NSString *token
Declared In
BUYCheckout.h
cartToken
Unique token for a cart which can be used to convert to a checkout
@property (nonatomic, copy, readonly) NSString *cartToken
Declared In
BUYCheckout.h
requiresShipping
States whether or not the fulfillment requires shipping
@property (nonatomic, assign, readonly) BOOL requiresShipping
Declared In
BUYCheckout.h
taxesIncluded
States whether or not the taxes are included in the price
@property (nonatomic, assign, readonly) BOOL taxesIncluded
Declared In
BUYCheckout.h
currency
The three letter code (ISO 4217) for the currency used for the payment
@property (nonatomic, copy, readonly) NSString *currency
Declared In
BUYCheckout.h
subtotalPrice
Price of the order before shipping and taxes
@property (nonatomic, strong, readonly) NSDecimalNumber *subtotalPrice
Declared In
BUYCheckout.h
totalTax
The sum of all the taxes applied to the line items in the order
@property (nonatomic, strong, readonly) NSDecimalNumber *totalTax
Declared In
BUYCheckout.h
totalPrice
The sum of all the prices of all the items in the order, taxes and discounts included
@property (nonatomic, strong, readonly) NSDecimalNumber *totalPrice
Declared In
BUYCheckout.h
paymentSessionId
The Payment Session ID associated with a credit card transaction
@property (nonatomic, strong, readonly) NSString *paymentSessionId
Declared In
BUYCheckout.h
paymentURL
URL to the payment gateway
@property (nonatomic, strong, readonly) NSURL *paymentURL
Declared In
BUYCheckout.h
reservationTime
Reservation time on the checkout in seconds. Setting to @0 and updating the checkout will release inventory reserved by the checkout (when product inventory is not infinite).
@property (nonatomic, strong) NSNumber *reservationTime
Discussion
300 seconds is default and maximum. reservationTime
is reset to @300 on every
updateCheckout:completion:
call.
Note: This can also be done with removeProductReservationsFromCheckout:completion
found in the BUYClient.
Declared In
BUYCheckout.h
reservationTimeLeft
Reservation time remaining on the checkout in seconds
@property (nonatomic, strong, readonly) NSNumber *reservationTimeLeft
Declared In
BUYCheckout.h
paymentDue
Amount of payment due on the checkout
@property (nonatomic, strong, readonly) NSDecimalNumber *paymentDue
Declared In
BUYCheckout.h
lineItems
Array of BUYLineItem objects in the checkout Note: These are different from BUYCartLineItems in that the line item objects do not include the BUYProductVariant
@property (nonatomic, readonly, copy) NSArray<__kindofBUYLineItem*> *lineItems
Declared In
BUYCheckout.h
taxLines
Array of tax line objects on the checkout
@property (nonatomic, readonly, copy) NSArray<BUYTaxLine*> *taxLines
Declared In
BUYCheckout.h
billingAddress
The mailing address associated with the payment method
@property (nonatomic, strong) BUYAddress *billingAddress
Declared In
BUYCheckout.h
shippingAddress
The mailing address to where the order will be shipped
@property (nonatomic, strong) BUYAddress *shippingAddress
Declared In
BUYCheckout.h
shippingRate
The shipping rate chosen for the checkout
@property (nonatomic, strong) BUYShippingRate *shippingRate
Declared In
BUYCheckout.h
shippingRateId
Shipping rate identifier
@property (nonatomic, readonly) NSString *shippingRateId
Declared In
BUYCheckout.h
discount
A discount added to the checkout
Only one discount can be added to a checkout. Call updateCheckout:completion:
after adding a discount to apply the discount code to the checkout.
@property (nonatomic, strong) BUYDiscount *discount
Declared In
BUYCheckout.h
giftCards
An array of BUYGiftCard objects applied to the checkout
@property (nonatomic, strong, readonly) NSArray<BUYGiftCard*> *giftCards
Declared In
BUYCheckout.h
channelId
Channel ID where the checkout was created
@property (nonatomic, strong) NSString *channelId
Declared In
BUYCheckout.h
marketingAttribution
Attributions for the checkout, containing the application name and platform (defaults to applicationName set on the BUYClient, and “iOS” respectively
@property (nonatomic, strong) NSDictionary *marketingAttribution
Declared In
BUYCheckout.h
webCheckoutURL
URL which is used for completing checkout. It is recommended to open the URL in Safari to take advantage of its autocompletion and credit card capture capabilities
@property (nonatomic, strong, readonly) NSURL *webCheckoutURL
Declared In
BUYCheckout.h
webReturnToURL
The URL Scheme of the host app. Used to return to the app from the web checkout
@property (nonatomic, strong) NSString *webReturnToURL
Declared In
BUYCheckout.h
webReturnToLabel
The button title that will appear after checkout to return to the host app. Defaults to “Return to ‘application’”,
where ‘application’ is the applicationName
set on the BUYClient
@property (nonatomic, strong) NSString *webReturnToLabel
Declared In
BUYCheckout.h
createdAtDate
Creation date of the checkout
@property (nonatomic, copy, readonly) NSDate *createdAtDate
Declared In
BUYCheckout.h
updatedAtDate
Last updated date for the checkout
@property (nonatomic, copy, readonly) NSDate *updatedAtDate
Declared In
BUYCheckout.h
privacyPolicyURL
The website URL for the privacy policy for the checkout
@property (nonatomic, strong, readonly) NSURL *privacyPolicyURL
Declared In
BUYCheckout.h
refundPolicyURL
The website URL for the refund policy for the checkout
@property (nonatomic, strong, readonly) NSURL *refundPolicyURL
Declared In
BUYCheckout.h
termsOfServiceURL
The website URL for the terms of service for the checkout
@property (nonatomic, strong, readonly) NSURL *termsOfServiceURL
Declared In
BUYCheckout.h
sourceName
The name of the source of the checkout: “mobile_app”
@property (nonatomic, copy, readonly) NSString *sourceName
Declared In
BUYCheckout.h
sourceIdentifier
The unique identifier for the source: the channelId
@property (nonatomic, copy, readonly) NSString *sourceIdentifier
Declared In
BUYCheckout.h
creditCard
Credit card stored on the checkout
@property (nonatomic, strong, readonly) BUYMaskedCreditCard *creditCard
Declared In
BUYCheckout.h
customerId
Customer ID associated with the checkout
@property (nonatomic, copy, readonly) NSString *customerId
Declared In
BUYCheckout.h
note
An optional note attached to the order
@property (nonatomic, copy) NSString *note
Declared In
BUYCheckout.h
order
The BUYOrder for a completed checkout
@property (nonatomic, strong, readonly) BUYOrder *order
Declared In
BUYCheckout.h
partialAddresses
Flag used to inform server that the shipping address is partially filled, suitable to retrieve shipping rates with partial shipping addresses provided by PKPaymentAuthorizationViewController. Note: This should only ever be set to YES. Setting it to NO throws an exception.
@property (nonatomic, assign) BOOL partialAddresses
Declared In
BUYCheckout.h
– init
It is recommended to instantiate a checkout with a cart, or cart token
- (instancetype)init
Return Value
Checkout
Declared In
BUYCheckout.h
– initWithCart:
Creates a new checkout
- (instancetype)initWithCart:(BUYCart *)cart
Parameters
cart |
a Cart with line items on it |
|---|
Return Value
a checkout object
Declared In
BUYCheckout.h
– initWithCartToken:
Creates a new checkout
- (instancetype)initWithCartToken:(NSString *)cartToken
Parameters
cartToken |
a token for a previously created cart |
|---|
Return Value
a checkout object
Declared In
BUYCheckout.h
ApplePay Methods
– buy_summaryItems
Returns an array of summary items for all Apple Pay requests. Will use ‘PAY TOTAL’ as the summary label. Apple recommends
including the business name in the summary label, so it is recommended to use buy_summaryItemsWithShopName
instead.
- (nonnull NSArray<PKPaymentSummaryItem*> *)buy_summaryItems
Declared In
BUYApplePayAdditions.h
– buy_summaryItemsWithShopName:
Returns an array of summary items for all Apple Pay requests using the shop name in the “PAY” section
- (nonnull NSArray<PKPaymentSummaryItem*> *)buy_summaryItemsWithShopName:(nullable NSString *)shopName
Parameters
shopName |
the shops name |
|---|
Return Value
An array of PKPaymentSummaryItems
Declared In
BUYApplePayAdditions.h


NetBeans IDE with the C/C++/Fortran plugin supports unit tests in C/C++ projects.
You can use the IDE to create, run, debug, and view results of your C and C++ tests. This article
shows you how to use unit tests in the IDE with your C/C++ projects.
A managed project is created with a logical folder called Test
Files, where you can manage unit tests for the project.
You can create tests directly under this Test Files folder or
organize them in logical sub folders.
A test node in the Test Files folder is a special folder with
test-related actions. When a test is built, it will exclude
the main file from the project and otherwise use all other
project settings.
The IDE supports only CUnit, CppUnit and its own "simple" output format, which means your tests should produce
output of one of these types of tests. The IDE provides templates for unit tests:
C simple test
C++ simple test
CUnit test
CppUnit test
CppUnit test runner
This tutorial uses the CUnit test framework and NetBeans C
Simple Tests on Ubuntu Linux, but the techniques demonstrated can help
you with the other types of tests on other platforms as
well. The tutorial does not explain the CUnit or
CppUnit testing frameworks. You need to consult the
documentation for those frameworks for information
about how to use them.
On Linux systems, you should be able to install libcunitl, libcunitl-doc and libcunitl-dev packages
from your package repository.
On Mac OS, or on Linux if the libcunitl* packages are not available, you
can download the CUnit source and build it as described here.
The instructions below assume you downloaded the file CUnit-2.1-2-src.tar.bz2 into the directory /tmp. If your download file
has a different name be sure to specify your actual CUnit download file and the actual directory where you saved it.
Download the CUnit-2.1-2-src.tar.bz2 source from the
CUnit files page and save to
temporary directory such as /tmp for example.
In a terminal window, unpack the CUnit-2.1-2-src.tar.bz2 file as follows:
$ cd /tmp
$ bunzip2 CUnit-2.1-2-src.tar.bz2
$ tar -xvf CUnit-2.1-2-src.tar
Configure, build, and install CUinit from /tmp as follows:
$ cd CUnit-2.1-2
$ ./configure --prefix=/usr
$ make
$ sudo make install
When the 'make install' finishes, the CUnit test framework is ready to use in the IDE and you can
continue on to Create the Project for the Tutorial.
How to Install CUnit on Oracle Solaris
You must build CUnit with the GNU build system
before you can use CUnit tests. On Oracle Solaris 11 systems the GNU build system
is not usually installed by default. You can get the GNU build system components
from the Oracle Solaris 11 package repository with the following commands:
The instructions below assume you downloaded the file CUnit-2.1-2-src.tar.bz2 into the directory /tmp. If your download file
has a different name be sure to specify your actual CUnit download file and the actual directory where you saved it.
Download the CUnit-2.1-2-src.tar.bz2 source from the
CUnit files page and save to
temporary directory such as /tmp for example.
In a terminal window, unpack the CUnit-2.1-2-src.tar.bz2 file as follows:
$ cd /tmp
$ bunzip2 CUnit-2.1-2-src.tar.bz2
$ tar -xvf CUnit-2.1-2-src.tar
Configure, build, and install CUinit from /tmp as follows:
$ cd CUnit-2.1-2
$ ./configure --prefix=/usr
$ make
$ make install
When the 'make install' finishes, the CUnit test framework is ready to use in the IDE and you can
continue on to Create the Project for the Tutorial.
How to Install CUnit on Windows and MinGW
These instructions assume you downloaded the file CUnit-2.1-2-src.tar.bz2 into the directory C:/distr. If your download file
has a different name be sure to specify your actual CUnit download file and the actual directory where you saved it.
Download the CUnit-2.1-2-src.tar.bz2 source from the
CUnit files page and save to
temporary directory such as the C:/distr example.
Start the MinGW shell application in Windows by choosing Start > All Programs > MinGW > MinGW Shell.
In the MinGW Shell window, unpack the CUnit-2.1-2-src.tar.bz2 file as follows:
$ cd c:/distr
$ bunzip2.exe CUnit-2.1-2-src.tar.bz2
$ tar xvf CUnit-2.1-2-src.tar
$ cd ./CUnit-2.1-2
Find the Unix path to MinGW using the mount command.
$ mount
You see output similar to the following:
C:\Users\username\AppData\Local\Temp on /tmp type user (binmode,noumount)
C:\MinGW\msys\1.0 on /usr type user (binmode,noumount)
C:\MinGW\msys\1.0 on / type user (binmode,noumount)
C:\MinGW on /mingw type user (binmode)
The last line in bold above shows the Unix path is /mingw. Your system may report something different,
so make a note of it because you need to specify the path in the next command.
Configure the Makefile with the following command.
If your MinGW is not in /mingw, be sure to specify the appropriate Unix location of your MinGW
with the --prefix= option.
$ ./configure --prefix=/mingw
(lots of output about checking and configuring)
...
config.status: executing depfiles commands
config.status: executing libtool commands
Build the library for CUnit:
$ make
make all-recursive
make[1]: Entering directory 'c/distr/CUnit-2.1-2'
Making all in CUnit
...
(lots of other output)
make[1]: Leaving directory 'c/distr/CUnit-2.1-2'
$
Install the CUnit library into C:/MinGW/include/CUnit, C:/MinGW/share/CUnit and C:/MinGW/doc/CUnit
by running make install:
$ make install
Making install in CUnit
make[1]: Entering directory 'c/distr/CUnit-2.1-2/CUnit'
Making install in Sources
make[1]: Entering directory 'c/distr/CUnit-2.1-2/Cunit/Sources'
...
(lots of other output)
make[1]: Leaving directory 'c/distr/CUnit-2.1-2'
$
If you use Java 7 update 21, 25, or 40 you must perform the following workaround due to
issue 236867 in order to get CUnit
and this tutorial to work.
Go to Tools > Options > C/C++ > Build Tools and select the MinGW tool collection.
Change the Make Command entry to make.exe without a complete path.
Exit the IDE.
On Windows 7 and above, type var in the Start menu's
search box to quickly find a link to Edit the system environment variables.
Select the Advanced tab and click Environment Variables.
In the System Variables panel of the Environment Variables dialog,
select click New.
Set the Variable Name to MAKE and the Variable Value to make.exe.
In Cygwin you can install CUnit using the standard Cygwin installer,
setup-x86.exe or setup-x86_64.exe, available from http://cygwin.com/install.html.
The CUnit package is located in the "Libs" category and you can install it in the same
way you install other packages.
Be sure to use the correct version. You must use 64-bit Cygwin and CUnit if you are running 64-bit NetBeans IDE.
If you have not yet installed Cygwin, see the general Cygwin installation info in
Configuring NetBeans IDE for C/C++/Fortran. You can install CUnit by selecting it in the Libs category in the setup program.
Create the Project for the Tutorial
To explore the unit test features, you should first create a new C Application:
Choose File > New Project.
In the project wizard, click C/C++ and then select C/C++ Application.
In the New C/C++ Application dialog box, select Create Main file and select the C language.
Accept the defaults for all other options.
Click Finish, and the Cpp_Application_x project is created.
In the Projects window, open the Source Files folder and double-click the main.c file to open it in the editor. The file's
content is similar to that shown here:
To give the program something to do, replace the code in the main.c file with the following code
to create a simple factorial calculator:
#include <stdio.h>
#include <stdlib.h>
long factorial(int arg) {
long result = 1;
int i;
for (i = 2; i <= arg; ++i) {
result *= i;
}
return result;
}
int main(int argc, char** argv) {
printf("Type an integer and press Enter to calculate the integer's factorial: \n");
int arg;
fflush(stdout);
scanf("%d", &arg);
printf("factorial(%d) = %ld\n", arg, factorial(arg));
return (EXIT_SUCCESS);
}
The file should look as follows after editing:
Save the file by pressing Ctrl+S.
Build and run the project to make sure it works by clicking the Run button in the IDE toolbar.
The output should look similar to the following if you enter 8 as the integer:
You might need to press Enter twice on some platforms.
Add CUnit Tests to the NetBeans Managed Project
When you are developing an application, it is a good idea to add unit tests as part of
your development process.
Each test should contain one main function and generate one executable.
In the Projects window, right-click the main.c source file and select Create Test > New CUnit Test.
A wizard opens to help you create the test.
In the wizard's Select Elements window, click the checkbox for the main function. This causes all
the functions within main to also be selected. In this program, there is only one other function, factorial().
Click Next.
Keep the default name New CUnit Test and click Finish.
The New CUnit Test node is displayed under the Test Files folder.
The New CUnit Test folder contains the template files for the test. You can add
new files to the folder the same way you add source files to a project, by right-clicking the folder.
Expand the New CUnit Test folder, and see that it contains a
file newcunittest.c which should be open in the source editor.
In the newcunittest.c file, notice the #include "CUnit/Basic.h"
statement to access the CUnit library.
The newcunittest.c file contains an automatically generated test function,
testFactorial, for the factorial() function of
main.c.
If the IDE did not find the CUnit/Basic.h file, you can edit the include path
to point to the correct location. For example, if you installed CUnit in Windows
to C:\Tools\CUnit-2.1-2 you would edit the path to the following:
The generated test is a stub that you must edit to make useful tests, but the generated
test can be run successfully even without editing.
Run the C Unit Test
The IDE provides a few ways to run tests. You can
right-click the project node, or the Test Files folder, or a test
subfolder, and select Test.
You can also use the menu bar and select Run > Test
Project, or press Alt+F6.
Run the test by right-clicking the New CUnit Test folder and selecting Test.
The IDE
opens a new Test Results window, and you should see output similar to the following,
which shows that the test fails.
If you do not see the Test Results window, open it
by choosing Window > IDE Tools > Test Results or by pressing Alt+Shift+R.
Notice that the Test Results window is split into two panels.
The right panel displays the console output from the tests. The left
panel displays a summary of the passed and failed tests and the
description of failed tests.
In the Test Results window, double-click the node
testFactorial caused an ERROR to jump to the testFactorial function in
the source editor.
If you look at the function you can see that it does not actually test anything, but merely asserts that
the unit test failed by setting CU_ASSERT(0). The condition evaluates to 0, which is equivalent
to FALSE, so the CUnit framework interprets this as a test failure.
Change the line CU_ASSERT(0) to CU_ASSERT(1) and save the file (Ctrl+S).
Run the test again by right-clicking the New CUnit Test folder and selecting Test.
The Test Results window should indicate that the test passed.
Add Another CUnit Test
Create a generic CUnit test template by right-clicking the Test Files folder and selecting
New CUnit Test.
Name the test My CUnit Test and the test file name mycunittest and click Finish.
A new test folder called My CUnit Test is created and it contains a mycunittest.c
file, which opens in the editor.
Examine the mycunittest.c test file and see that it contains two tests. test1 will pass because it evaluates
to TRUE, and test2 will fail because it evaluates to FALSE since 2*2 does not equal 5.
Run all the tests from the IDE main menu by selecting Run > Test Project (Cpp_Application_x) and see
that both test suites run and display their success and failure in the Test Results window.
Mouse over the failed test to see more information about the failure.
Click the buttons in the left margin of the Test Results window to show and hide tests that pass or fail.
Debug My CUnit Test
You can debug tests using the same techniques you use to debug your project source
files, as described in the
Debugging C/C++ Projects Tutorial.
In the Projects window, right-click the My CUnit Test folder and select
Step Into Test.
You can also run the debugger by right-clicking a test in the Test Results window and selecting Debug.
The debugger toolbar is displayed.
Click the Step Into button
to execute the program one statement at a time with each click of the button.
Open the Call Stack window by selecting Window > Debugging > Call Stack so you can
watch the function calls as you step through the test.
Add a Simple Test
The C simple test uses the IDE's own simple test framework. You do not need to download any test framework
to use simple tests.
In the Projects window, right-click the main.c source file and select Create Test > New C Simple Test.
In the wizard's Select Elements window, click the checkbox for the main function, then click Next.
In the Name and Location window, keep the default name New C Simple Test and click Finish.
The New C Simple Test node is displayed under the Test Files folder.
Expand the New C Simple Test folder, and see that it contains a
file newsimpletest.c. This file should be open in the source editor.
Notice the newsimpletest.c file contains an automatically generated test function,
testFactorial, for the factorial() function of
main.c, just as with the CUnit test.
The if statement should test a condition that, if true, indicates that the test failed. The
%%TEST_FAILED%%token triggers display of the graphical indicator of test failures in the Test
Results window. The if statement in the generated test sets the condition to be true by setting it to 1,
so the test always fails when you run it unmodified.
The other tokens in the main function, such as %%TEST_STARTED%% and %%TEST_FINISHED%%
are to help you read the command line output when running the tests.
The time=0 option is used to add time measurement to the test.
The message option enables you to make the test print out a message about the test failure.
Run the test to see that it generates a failure shown in the Test Results window.
Next you edit the test file to see tests that pass.
Edit the C Simple Test
Copy and paste a new function below the testFactorial function.
The new function is:
void testNew() {
int arg = 8;
long result = factorial(arg);
if(result != 40320) {
printf("%%TEST_FAILED%% time=0 testname=testNew (newsimpletest) message=Error calculating %d factorial.\n", arg);
}
}
The main function must also be modified to call the new test function.
Paste the lines immediately below the ones you copied, and change the name testFactorial
to testNew in the pasted lines. There are three occurrences that need to be changed.
The complete newsimpletest.c file should look as follows:
#include <stdio.h>
#include <stdlib.h>
/*
* Simple C Test Suite
*/
long factorial(int arg);
void testFactorial() {
int arg;
long result = factorial(arg);
if(1 /*check result*/) {
printf("%%TEST_FAILED%% time=0 testname=testFactorial (newsimpletest) message=When value is 1 this statement is executed.\n");
}
}
void testNew() {
int arg = 8;
long result = factorial(arg);
if(result != 40320) {
printf("%%TEST_FAILED%% time=0 testname=testNew (newsimpletest) message=Error calculating %d factorial.\n", arg);
}
}
int main(int argc, char** argv) {
printf("%%SUITE_STARTING%% newsimpletest\n");
printf("%%SUITE_STARTED%%\n");
printf("%%TEST_STARTED%% testFactorial (newsimpletest)\n");
testFactorial();
printf("%%TEST_FINISHED%% time=0 testFactorial (newsimpletest)\n");
printf("%%TEST_STARTED%% testNew (newsimpletest)\n");
testNew();
printf("%%TEST_FINISHED%% time=0 testNew (newsimpletest)\n");
printf("%%SUITE_FINISHED%% time=0\n");
return (EXIT_SUCCESS);
}
In the Projects window, run the test by right-clicking New C Simple Test and choosing Test.
The Test Results should look as follows:
If you do not see testNew passed, click the green check button in the left margin of the Test Results window to display
tests that passed.
The %%TEST_FAILED%% token triggers the display of a test failure in the Test Results window.
The if statement should test for a condition that if it is not true, the test fails.
The %%SUITE_STARTING%% and other similar tokens are not shown in the output in the IDE. They are
used for console output.
Run Tests From the Command Line
You can build tests from the command line outside the IDE with make build-tests and run them with make test.
When the project is in ~/NetBeansProjects/Cpp_Application_x on a Linux system,
the examples in this article would be built and run as shown below.
Open a terminal window in the IDE
by selecting Window > Output and clicking the Terminal
button in the left margin of the Output window. This opens a
terminal window at the working directory of the current project.
In the terminal, type the commands shown in bold:
make test
The output of the test build and run should look similar to
the following. Note that some make output has been deleted.
"make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/tester/NetBeansProjects/CppApplication_1'
"make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/cppapplication_1
make[2]: Entering directory `/home/tester/NetBeansProjects/CppApplication_1'
make[2]: `dist/Debug/GNU-Linux-x86/cppapplication_1' is up to date.
...
CUnit - A Unit testing framework for C - Version 2.1-2
http://cunit.sourceforge.net/
Suite: mycunittest
Test: test1 ... passed
Test: test2 ... FAILED
1. tests/mycunittest.c:33 - 2*2 == 5
Test: test3 ... passed
--Run Summary: Type Total Ran Passed Failed
suites 1 1 n/a 0
tests 3 3 2 1
asserts 3 3 2 1
%SUITE_STARTING% newsimpletest
%SUITE_STARTED%
%TEST_STARTED% testFactorial (newsimpletest)
%TEST_FAILED% time=0 testname=testFactorial (newsimpletest) message=error message sample
%TEST_FINISHED% time=0 testFactorial (newsimpletest)
%SUITE_FINISHED% time=0
CUnit - A Unit testing framework for C - Version 2.1-2
http://cunit.sourceforge.net/
Suite: newcunittest
Test: testFactorial ... passed
--Run Summary: Type Total Ran Passed Failed
suites 1 1 n/a 0
tests 1 1 1 0
asserts 1 1 1 0
make[1]: Leaving directory `/home/tester/NetBeansProjects/CppApplication_1'
Adding Support for Other Test Frameworks
You can add support for your favorite C/C++ test framework by creating a NetBeans module.
See the NetBeans developer's
C/C++ Unit Test Plugin Tutorial on the NetBeans wiki.


we’ve got a major case of spring fever…
enjoy
20%
OFF
women’s, men’s & kids’
TEES & SHORTS*
In stores & online.
Use code sunny.
Ends Friday.
Shop women’s
tees & shorts
Shop men’s
tees & shorts
Shop boys’
tees & shorts
Shop girls’
tees & shorts
*Offer valid on the purchase of full-price knits, tees, and shorts in J.Crew stores and at jcrew.com from March 4, 2013, 12:01 am ET through March 8, 2013, 11:59pm ET only. Offer not valid in J.Crew Factory stores, at jcrewfactory.com or on phone orders. Offer cannot be applied to previous purchases and cannot be redeemed for cash or used in combination with any other offer. Discount not valid on babies’ merchandise. In-store discount automatically applied at register. To redeem online, enter code SUNNY in the promo code box at checkout. Limit one promo code per order. Offer valid in the U.S. and Canada only. Terms of offer are subject to change.
Please add<EMAIL_ADDRESS>to your address book to ensure our emails reach your inbox. If you received this email from a friend and would like to subscribe to our email list, please go to the following web address -<EMAIL_ADDRESS>To unsubscribe from the email list, please go to the following web address -<EMAIL_ADDRESS>J.Crew Customer Relations | One Ivy Crescent | Lynchburg, VA 24513-1001


For me the best way to learn something is by example , so instead to create HelloWords I’ve been translating my Java Reactive Spring 5 Webflux example into Kotlin , and now that is done is time to analyze the results.
I’m not going to talk about performance here, I’ve done JMeter load tests on both services and they virtual identical, response times are just decimals apart. However sometimes Kotlin seams to perform better, I’ll not get into conclusions until I research more.
First lest look at how many life of code we have create for each project:
Lines of Code
Src
Test
Java
1004
1172
Kotlin
721
1017
This is a expected result since Kotlin syntax will be always shorten and easer to understand.
Now when we look at the maxim complexity reported by https://codebeat.co
Complexity
Max
Java
45
Kotlin
8
I think we need to do a deep down on this.
I’ve need to modify some line breaks in order to fit the web, please check the repos
Let’s look at one of the methods in the more complex class in Java :
Mono < SunriseSunset > createResult ( final Mono < GeoTimesResponse > geoTimesResponseMono ) {
return geoTimesResponseMono . flatMap ( geoTimesResponse -> {
if (( geoTimesResponse . getStatus () != null ) && ( geoTimesResponse . getStatus ()
. equals ( STATUS_OK ))) {
return Mono . just ( new SunriseSunset ( geoTimesResponse . getResults (). getSunrise (),
geoTimesResponse . getResults (). getSunset ()));
} else {
return Mono . error ( new GetSunriseSunsetException ( SUNRISE_RESULT_NOT_OK ));
}
});
}
And the equivalent method for the same class in Kotlin :
open internal fun createResult ( geoTimesResponseMono : Mono < GeoTimesResponse >) =
geoTimesResponseMono . flatMap {
with ( it ){
if ( status == STATUS_OK ) with ( results ) { SunriseSunset ( sunrise , sunset ). toMono () }
else GetSunriseSunsetException ( SUNRISE_RESULT_NOT_OK ). toMono ()
}
}
Many times this is because of the extensions system that allow to write really tide code.
Let’s look at one of the methods in one of the handler class :
Mono < ServerResponse > serverResponse ( Mono < LocationResponse > locationResponseMono ) {
return locationResponseMono . flatMap ( locationResponse ->
ServerResponse . ok (). body ( Mono . just ( locationResponse ), LocationResponse . class ));
}
And the equivalent method for the same class in Kotlin :
fun serverResponse ( locationResponseMono : Mono < LocationResponse >): Mono < ServerResponse > =
locationResponseMono . flatMap { ok () withBody it }
In fact spring framework has create custom extensions for Kotlin .
Let’s look at our api router function class :
static RouterFunction <?> doRoute ( final ApiHandler apiHandler , final ErrorHandler errorHandler ) {
return
nest ( path ( API_PATH ),
nest ( accept ( APPLICATION_JSON_UTF8 ),
route ( GET ( LOCATION_WITH_ADDRESS_PATH ), apiHandler: : getLocation )
. andRoute ( POST ( LOCATION_PATH ), apiHandler: : postLocation )
). andOther ( route ( RequestPredicates . all (), errorHandler: : notFound ))
);
}
And the equivalent class in Kotlin :
fun doRoute () = router {
( accept ( APPLICATION_JSON_UTF8 ) and API_PATH ). nest {
GET ( LOCATION_WITH_ADDRESS_PATH )( handler :: getLocation )
POST ( LOCATION_PATH )( handler :: postLocation )
path ( ANY_PATH )( errorHandler :: notFound )
}
}
Definitely Kotlin is more simpler and readable, but this is not only the main code lest check the test for our tests.
Testing our ThrowableTranslator in Java
@Test
void translatePathNotFoundExceptionTest () throws Exception {
assertThat ( PathNotFoundException . class , translateTo ( HttpStatus . NOT_FOUND ));
}
And the same test in Kotlin
@Test
fun translatePathNotFoundExceptionTest () {
PathNotFoundException :: class `translates to` HttpStatus . NOT_FOUND
}
But lets use a more complex test that includes mocking.
Testing one of the services error in Java
@Test
void getLocationNotFoundTest () {
ServerRequest serverRequest = mock ( ServerRequest . class );
when ( serverRequest . pathVariable ( ADDRESS_VARIABLE )). thenReturn ( GOOGLE_ADDRESS );
doReturn ( LOCATION_NOT_FOUND ). when ( geoLocationService ). fromAddress ( any ());
doReturn ( SUNRISE_SUNSET ). when ( sunriseSunsetService ). fromGeographicCoordinates ( any ());
ServerResponse serverResponse = apiHandler . getLocation ( serverRequest ). block ();
assertThat ( serverResponse . statusCode (), is ( HttpStatus . NOT_FOUND ));
ErrorResponse error = HandlersHelper . extractEntity ( serverResponse , ErrorResponse . class );
assertThat ( error . getError (), is ( NOT_FOUND ));
reset ( geoLocationService );
reset ( sunriseSunsetService );
}
And the same test in Kotlin
@Test
fun getLocationNotFoundTest (){
( geoLocationService `will return ` LOCATION_NOT_FOUND ). fromAddress ( any ())
( sunriseSunsetService `will return ` SUNRISE_SUNSET ). fromGeographicCoordinates ( any ())
val serverRequest = mock < ServerRequest >()
( serverRequest `will return ` GOOGLE_ADDRESS ). pathVariable ( ADDRESS_VARIABLE )
val serverResponse = apiHandler . getLocation ( serverRequest ). block ()
serverResponse . statusCode () `should be` HttpStatus . NOT_FOUND
val errorResponse : ErrorResponse = serverResponse . extractEntity ()
errorResponse . message `should equal to` NOT_FOUND
geoLocationService reset `mock responses`
sunriseSunsetService reset `mock responses`
}
In these cases the number of lines is not the key factor but the readability of the Kotlin test is great.
Conclusions
With a syntax that make things simpler and more readable I’ll stick with Kotlin for my personal projects for a while meanwhile I still learning Reactive Programming.
Please enable JavaScript to view the comments powered by Disqus.


---
layout: post
title: MomoLondon NFC
date: 2008-10-14 00:00:00
categories: business digital-media interfaces-&-interaction mobile
---
MomoLondon NFC: Victoria Richardson, Proxama
Shows a video of phones touching other phones to a pumping techno soundtrack. Things happen when the phones touch other phones.
Service discovery, payments, ticketing and access control are easily made accessible via NFC. But why?
 Benefits: trying stuff out, accessing links, and sharing stuff. Sounds like a good scheme for avoiding the burden of knowing about or entering links. For some reason, a Hajj-like image of keen consumers desperately trying to touch posters springs to mind.
NFC ties into an infrastructure which already exists (hmm... the readers might exist but this doesn't imply we'll have access to the installed infrastructure)
Claire Maslen, Head of NFC, O2 Telefonica
Presenting some insights from the NFC trial O2 ran, and some areas of opportunity which - in hindsight - they didn't give enough attention.
Trial: 500 O2 customers (prepay/postpay), lots of use cases (transport, payment, access control, smart posters). All using Nokia 6131.
Results:
- Encouraging positive reaction
- 9/10 trialists happy using the technology
- 79% said they'd like to use their phone to pay/travel in future
- Convenience, ease of use, and status were factors in getting this positive response
More detail for transport:
- 89% of triallists wanted to take this up
- 67% said it was more convenient than Oyster card
- 87% said Oyster support in-phone would make a difference to their choice of phone)
For Visa:
- 68% wanted to use this in future
- 41% felt it was faster than paying with cash (not sure how this is a good stat... most people still think cash is faster, no?)
- 47% said it was an influencing factor in phone purchase
Customers appreciated the NFC applications, despite the fact that the 6131 isn't a high-end device. Hmm, it's almost as though customers want to do things, and that's more important than their phone or network...
Panel discussion moderated by Mr Appelquist
Victoria and Claire:
John Hill: involved in Oyster for years, was responsible for original Oyster rollout. Founded iBridge
James Anderson: product development for Mastercard.
Steve Griffiths: runs IconMobile, works with Visa. Will be sharing the WPP perspective (WPP part-own Icon).
Message so far: "NFC: It's Getting There"
JA: It takes time to roll out hardware (in this case readers for merchants and RFID handsets for users).
VR: Nice point about chip'n'PIN and NFC meaning customers keep control of their own stuff.
DA: There's lots of info around the ease with which NFC/RFID can be hacked, particularly with active terminals. Is it safe?
The panel seem to conclude it's safe.
DA: What are the opportunities around third parties and brands? What's the long tail of NFC?
VR: There are lots of enterprise apps out there.
SG: It addresses 3 big topics: (1) simplicity (tapping the phone makes something complex straightforward)... We're thinking about the things beyond that tap and beyond the payment. (2) discovery of content (3) operator data + transactional data.
I suspect (3) involves operators sharing way more data than they ever have.
Questions
NFC seems to be a great way of reducing the effort for consumers of interacting with advertising, but anyone with a phone can interact with an advert now with keywords and shortcodes. Isn't it a lot of infrastructure to roll out to smart posters, for little additional benefit (or some pain: sometimes it's nice not to have to touch a poster to interact with it)
Do you think that the advertising industry wants its broadcast ads to be interactive and therefore more accountable? Do you think that the pain of sending an SMS is putting people off interacting now?
Does the ad industry really want outdoors media to be accountable?
The ad industry had a lot of trouble with SMS because it made all their unaccountable media accountable and the creative opportunities of 160 characters were so limited. Isn't NFC even more limiting?
At this point I transferred my ranting to twitter.
My takeaways:
- NFC seems to nicely reduce the effort in choosing to interact with physical spaces (e.g. for advertising response);
- It's going to be a good few years before it's out there in numbers worth bothering with;
- We'll need content sitting behind these "taps";


Back to RFI
Title: {{eventsList.title}} Date: {{eventsList.create_date}}
You are not authorized to reply to this event.


Travis has performed with major label artists like Katharine McPhee, Sean Kingston, and Andrew McMahon. He was the house band guitarist on the CW TV show 'Oh Sit!', has performed on the Jay Leno Show and you've heard his playing on HBO, KROQ, NBC, Food Network. He is available for recording sessions & lessons over the internet.
www.travisraab.com
The goal of this project was to improve website performance by reducing information, simplifying layout and highlighting provided services.


{% extends "structure.html" %} {% block body %}
PASSWORD RESET
Enter your phone Number and we will send you a code to reset password.


{% extends "base.html" %} {% block title %}Out of order{% endblock %} {% block content %}
Hold tight! Database is being synced with Jira and Confluence.


# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Bijector base."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import collections
import contextlib
import re
import numpy as np
import six
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import tensor_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.util.tf_export import tf_export
__all__ = [
"Bijector",
]
class _Mapping(collections.namedtuple(
"_Mapping", ["x", "y", "ildj", "kwargs"])):
"""Helper class to make it easier to manage caching in `Bijector`."""
def __new__(cls, x=None, y=None, ildj=None, kwargs=None):
"""Custom __new__ so namedtuple items have defaults.
Args:
x: `Tensor`. Forward.
y: `Tensor`. Inverse.
ildj: `Tensor`. Inverse log det Jacobian.
kwargs: Python dictionary. Extra args supplied to
forward/inverse/etc functions.
Returns:
mapping: New instance of _Mapping.
"""
return super(_Mapping, cls).__new__(cls, x, y, ildj, kwargs)
@property
def x_key(self):
"""Returns key used for caching Y=g(X)."""
return (self.x,) + self._deep_tuple(tuple(sorted(self.kwargs.items())))
@property
def y_key(self):
"""Returns key used for caching X=g^{-1}(Y)."""
return (self.y,) + self._deep_tuple(tuple(sorted(self.kwargs.items())))
def merge(self, x=None, y=None, ildj=None, kwargs=None, mapping=None):
"""Returns new _Mapping with args merged with self.
Args:
x: `Tensor`. Forward.
y: `Tensor`. Inverse.
ildj: `Tensor`. Inverse log det Jacobian.
kwargs: Python dictionary. Extra args supplied to
forward/inverse/etc functions.
mapping: Instance of _Mapping to merge. Can only be specified if no other
arg is specified.
Returns:
mapping: New instance of `_Mapping` which has inputs merged with self.
Raises:
ValueError: if mapping and any other arg is not `None`.
"""
if mapping is None:
mapping = _Mapping(x=x, y=y, ildj=ildj, kwargs=kwargs)
elif not all(arg is None for arg in [x, y, ildj, kwargs]):
raise ValueError("Cannot specify mapping and individual args.")
return _Mapping(
x=self._merge(self.x, mapping.x),
y=self._merge(self.y, mapping.y),
ildj=self._merge(self.ildj, mapping.ildj),
kwargs=self._merge(self.kwargs, mapping.kwargs))
def _merge(self, old, new):
"""Helper to merge which handles merging one value."""
if old is None:
return new
elif new is not None and old != new:
raise ValueError("Incompatible values: %s != %s" % (old, new))
return old
def _deep_tuple(self, x):
"""Converts lists of lists to tuples of tuples."""
return (tuple(map(self._deep_tuple, x))
if isinstance(x, (list, tuple)) else x)
@six.add_metaclass(abc.ABCMeta)
@tf_export("distributions.bijectors.Bijector")
class Bijector(object):
r"""Interface for transformations of a `Distribution` sample.
Bijectors can be used to represent any differentiable and injective
(one to one) function defined on an open subset of `R^n`. Some non-injective
transformations are also supported (see "Non Injective Transforms" below).
#### Mathematical Details
A `Bijector` implements a [smooth covering map](
https://en.wikipedia.org/wiki/Local_diffeomorphism), i.e., a local
diffeomorphism such that every point in the target has a neighborhood evenly
covered by a map ([see also](
https://en.wikipedia.org/wiki/Covering_space#Covering_of_a_manifold)).
A `Bijector` is used by `TransformedDistribution` but can be generally used
for transforming a `Distribution` generated `Tensor`. A `Bijector` is
characterized by three operations:
1. Forward\
Useful for turning one random outcome into another random outcome from a
different distribution.
2. Inverse\
Useful for "reversing" a transformation to compute one probability in
terms of another.
3. `(log o det o Jacobian o inverse)(x)`\
"The log of the determinant of the matrix of all first-order partial
derivatives of the inverse function."\
Useful for inverting a transformation to compute one probability in terms
of another. Geometrically, the det(Jacobian) is the volume of the
transformation and is used to scale the probability.
By convention, transformations of random variables are named in terms of the
forward transformation. The forward transformation creates samples, the
inverse is useful for computing probabilities.
#### Example Uses
- Basic properties:
```python
x = ... # A tensor.
# Evaluate forward transformation.
fwd_x = my_bijector.forward(x)
x == my_bijector.inverse(fwd_x)
x != my_bijector.forward(fwd_x) # Not equal because x != g(g(x)).
```
- Computing a log-likelihood:
```python
def transformed_log_prob(bijector, log_prob, x):
return (bijector.inverse_log_det_jacobian(x) +
log_prob(bijector.inverse(x)))
```
- Transforming a random outcome:
```python
def transformed_sample(bijector, x):
return bijector.forward(x)
```
#### Example Bijectors
- "Exponential"
```none
Y = g(X) = exp(X)
X ~ Normal(0, 1) # Univariate.
```
Implies:
```none
g^{-1}(Y) = log(Y)
|Jacobian(g^{-1})(y)| = 1 / y
Y ~ LogNormal(0, 1), i.e.,
prob(Y=y) = |Jacobian(g^{-1})(y)| * prob(X=g^{-1}(y))
= (1 / y) Normal(log(y); 0, 1)
```
Here is an example of how one might implement the `Exp` bijector:
```python
class Exp(Bijector):
def __init__(self, event_ndims=0, validate_args=False, name="exp"):
super(Exp, self).__init__(
event_ndims=event_ndims, validate_args=validate_args, name=name)
def _forward(self, x):
return math_ops.exp(x)
def _inverse(self, y):
return math_ops.log(y)
def _inverse_log_det_jacobian(self, y):
return -self._forward_log_det_jacobian(self._inverse(y))
def _forward_log_det_jacobian(self, x):
if self.event_ndims is None:
raise ValueError("Jacobian requires known event_ndims.")
event_dims = array_ops.shape(x)[-self.event_ndims:]
return math_ops.reduce_sum(x, axis=event_dims)
```
- "Affine"
```none
Y = g(X) = sqrtSigma * X + mu
X ~ MultivariateNormal(0, I_d)
```
Implies:
```none
g^{-1}(Y) = inv(sqrtSigma) * (Y - mu)
|Jacobian(g^{-1})(y)| = det(inv(sqrtSigma))
Y ~ MultivariateNormal(mu, sqrtSigma) , i.e.,
prob(Y=y) = |Jacobian(g^{-1})(y)| * prob(X=g^{-1}(y))
= det(sqrtSigma)^(-d) *
MultivariateNormal(inv(sqrtSigma) * (y - mu); 0, I_d)
```
#### Jacobian
The Jacobian is a reduction over event dims. To see this, consider the `Exp`
`Bijector` applied to a `Tensor` which has sample, batch, and event (S, B, E)
shape semantics. Suppose the `Tensor`'s partitioned-shape is `(S=[4], B=[2],
E=[3, 3])`. The shape of the `Tensor` returned by `forward` and `inverse` is
unchanged, i.e., `[4, 2, 3, 3]`. However the shape returned by
`inverse_log_det_jacobian` is `[4, 2]` because the Jacobian is a reduction
over the event dimensions.
It is sometimes useful to implement the inverse Jacobian as the negative
forward Jacobian. For example,
```python
def _inverse_log_det_jacobian(self, y):
return -self._forward_log_det_jac(self._inverse(y)) # Note negation.
```
The correctness of this approach can be seen from the following claim.
- Claim:
Assume `Y = g(X)` is a bijection whose derivative exists and is nonzero
for its domain, i.e., `dY/dX = d/dX g(X) != 0`. Then:
```none
(log o det o jacobian o g^{-1})(Y) = -(log o det o jacobian o g)(X)
```
- Proof:
From the bijective, nonzero differentiability of `g`, the
[inverse function theorem](
https://en.wikipedia.org/wiki/Inverse_function_theorem)
implies `g^{-1}` is differentiable in the image of `g`.
Applying the chain rule to `y = g(x) = g(g^{-1}(y))` yields
`I = g'(g^{-1}(y))*g^{-1}'(y)`.
The same theorem also implies `g^{-1}'` is non-singular therefore:
`inv[ g'(g^{-1}(y)) ] = g^{-1}'(y)`.
The claim follows from [properties of determinant](
https://en.wikipedia.org/wiki/Determinant#Multiplicativity_and_matrix_groups).
Generally its preferable to directly implement the inverse Jacobian. This
should have superior numerical stability and will often share subgraphs with
the `_inverse` implementation.
#### Subclass Requirements
- Subclasses typically implement:
- `_forward`,
- `_inverse`,
- `_inverse_log_det_jacobian`,
- `_forward_log_det_jacobian` (optional).
The `_forward_log_det_jacobian` is called when the bijector is inverted via
the `Invert` bijector. If undefined, a slightly less efficiently
calculation, `-1 * _inverse_log_det_jacobian`, is used.
If the bijector changes the shape of the input, you must also implement:
- _forward_event_shape_tensor,
- _forward_event_shape (optional),
- _inverse_event_shape_tensor,
- _inverse_event_shape (optional).
By default the event-shape is assumed unchanged from input.
- If the `Bijector`'s use is limited to `TransformedDistribution` (or friends
like `QuantizedDistribution`) then depending on your use, you may not need
to implement all of `_forward` and `_inverse` functions.
Examples:
1. Sampling (e.g., `sample`) only requires `_forward`.
2. Probability functions (e.g., `prob`, `cdf`, `survival`) only require
`_inverse` (and related).
3. Only calling probability functions on the output of `sample` means
`_inverse` can be implemented as a cache lookup.
See "Example Uses" [above] which shows how these functions are used to
transform a distribution. (Note: `_forward` could theoretically be
implemented as a cache lookup but this would require controlling the
underlying sample generation mechanism.)
#### Non Injective Transforms
**WARNING** Handing of non-injective transforms is subject to change.
Non injective maps `g` are supported, provided their domain `D` can be
partitioned into `k` disjoint subsets, `Union{D1, ..., Dk}`, such that,
ignoring sets of measure zero, the restriction of `g` to each subset is a
differentiable bijection onto `g(D)`. In particular, this imples that for
`y in g(D)`, the set inverse, i.e. `g^{-1}(y) = {x in D : g(x) = y}`, always
contains exactly `k` distinct points.
The property, `_is_injective` is set to `False` to indicate that the bijector
is not injective, yet satisfies the above condition.
The usual bijector API is modified in the case `_is_injective is False` (see
method docstrings for specifics). Here we show by example the `AbsoluteValue`
bijector. In this case, the domain `D = (-inf, inf)`, can be partitioned
into `D1 = (-inf, 0)`, `D2 = {0}`, and `D3 = (0, inf)`. Let `gi` be the
restriction of `g` to `Di`, then both `g1` and `g3` are bijections onto
`(0, inf)`, with `g1^{-1}(y) = -y`, and `g3^{-1}(y) = y`. We will use
`g1` and `g3` to define bijector methods over `D1` and `D3`. `D2 = {0}` is
an oddball in that `g2` is one to one, and the derivative is not well defined.
Fortunately, when considering transformations of probability densities
(e.g. in `TransformedDistribution`), sets of measure zero have no effect in
theory, and only a small effect in 32 or 64 bit precision. For that reason,
we define `inverse(0)` and `inverse_log_det_jacobian(0)` both as `[0, 0]`,
which is convenient and results in a left-semicontinuous pdf.
```python
abs = tf.contrib.distributions.bijectors.AbsoluteValue()
abs.forward(-1.)
==> 1.
abs.forward(1.)
==> 1.
abs.inverse(1.)
==> (-1., 1.)
# The |dX/dY| is constant, == 1. So Log|dX/dY| == 0.
abs.inverse_log_det_jacobian(1.)
==> (0., 0.)
# Special case handling of 0.
abs.inverse(0.)
==> (0., 0.)
abs.inverse_log_det_jacobian(0.)
==> (0., 0.)
```
"""
@abc.abstractmethod
def __init__(self,
event_ndims=None,
graph_parents=None,
is_constant_jacobian=False,
validate_args=False,
dtype=None,
name=None):
"""Constructs Bijector.
A `Bijector` transforms random variables into new random variables.
Examples:
```python
# Create the Y = g(X) = X transform which operates on vector events.
identity = Identity(event_ndims=1)
# Create the Y = g(X) = exp(X) transform which operates on matrices.
exp = Exp(event_ndims=2)
```
See `Bijector` subclass docstring for more details and specific examples.
Args:
event_ndims: number of dimensions associated with event coordinates.
graph_parents: Python list of graph prerequisites of this `Bijector`.
is_constant_jacobian: Python `bool` indicating that the Jacobian is not a
function of the input.
validate_args: Python `bool`, default `False`. Whether to validate input
with asserts. If `validate_args` is `False`, and the inputs are invalid,
correct behavior is not guaranteed.
dtype: `tf.dtype` supported by this `Bijector`. `None` means dtype is not
enforced.
name: The name to give Ops created by the initializer.
Raises:
ValueError: If a member of `graph_parents` is not a `Tensor`.
"""
self._event_ndims = (
ops.convert_to_tensor(event_ndims, dtype=dtypes.int32)
if event_ndims is not None else None)
self._graph_parents = graph_parents or []
self._is_constant_jacobian = is_constant_jacobian
self._validate_args = validate_args
self._dtype = dtype
self._from_y = {}
self._from_x = {}
# Using abbreviation ildj for "inverse log det Jacobian."
# This variable is not `None` iff is_constant_jacobian is `True`.
self._constant_ildj = None
if name:
self._name = name
else:
# We want the default convention to be snake_case rather than CamelCase
# since `Chain` uses bijector.name as the kwargs dictionary key.
def camel_to_snake(name):
s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
self._name = camel_to_snake(type(self).__name__.lstrip("_"))
for i, t in enumerate(self._graph_parents):
if t is None or not tensor_util.is_tensor(t):
raise ValueError("Graph parent item %d is not a Tensor; %s." % (i, t))
@property
def event_ndims(self):
"""Returns then number of event dimensions this bijector operates on."""
return self._event_ndims
@property
def graph_parents(self):
"""Returns this `Bijector`'s graph_parents as a Python list."""
return self._graph_parents
@property
def is_constant_jacobian(self):
"""Returns true iff the Jacobian is not a function of x.
Note: Jacobian is either constant for both forward and inverse or neither.
Returns:
is_constant_jacobian: Python `bool`.
"""
return self._is_constant_jacobian
@property
def _is_injective(self):
"""Returns true iff the forward map `g` is injective (one-to-one function).
**WARNING** This hidden property and its behavior are subject to change.
Note: Non-injective maps `g` are supported, provided their domain `D` can
be partitioned into `k` disjoint subsets, `Union{D1, ..., Dk}`, such that,
ignoring sets of measure zero, the restriction of `g` to each subset is a
differentiable bijection onto `g(D)`.
Returns:
is_injective: Python `bool`.
"""
return True
@property
def validate_args(self):
"""Returns True if Tensor arguments will be validated."""
return self._validate_args
@property
def dtype(self):
"""dtype of `Tensor`s transformable by this distribution."""
return self._dtype
@property
def name(self):
"""Returns the string name of this `Bijector`."""
return self._name
def _forward_event_shape_tensor(self, input_shape):
"""Subclass implementation for `forward_event_shape_tensor` function."""
# By default, we assume event_shape is unchanged.
return input_shape
def forward_event_shape_tensor(self,
input_shape,
name="forward_event_shape_tensor"):
"""Shape of a single sample from a single batch as an `int32` 1D `Tensor`.
Args:
input_shape: `Tensor`, `int32` vector indicating event-portion shape
passed into `forward` function.
name: name to give to the op
Returns:
forward_event_shape_tensor: `Tensor`, `int32` vector indicating
event-portion shape after applying `forward`.
"""
with self._name_scope(name, [input_shape]):
input_shape = ops.convert_to_tensor(input_shape, dtype=dtypes.int32,
name="input_shape")
return self._forward_event_shape_tensor(input_shape)
def _forward_event_shape(self, input_shape):
"""Subclass implementation for `forward_event_shape` public function."""
# By default, we assume event_shape is unchanged.
return input_shape
def forward_event_shape(self, input_shape):
"""Shape of a single sample from a single batch as a `TensorShape`.
Same meaning as `forward_event_shape_tensor`. May be only partially defined.
Args:
input_shape: `TensorShape` indicating event-portion shape passed into
`forward` function.
Returns:
forward_event_shape_tensor: `TensorShape` indicating event-portion shape
after applying `forward`. Possibly unknown.
"""
return self._forward_event_shape(tensor_shape.TensorShape(input_shape))
def _inverse_event_shape_tensor(self, output_shape):
"""Subclass implementation for `inverse_event_shape_tensor` function."""
# By default, we assume event_shape is unchanged.
return output_shape
def inverse_event_shape_tensor(self,
output_shape,
name="inverse_event_shape_tensor"):
"""Shape of a single sample from a single batch as an `int32` 1D `Tensor`.
Args:
output_shape: `Tensor`, `int32` vector indicating event-portion shape
passed into `inverse` function.
name: name to give to the op
Returns:
inverse_event_shape_tensor: `Tensor`, `int32` vector indicating
event-portion shape after applying `inverse`.
"""
with self._name_scope(name, [output_shape]):
output_shape = ops.convert_to_tensor(output_shape, dtype=dtypes.int32,
name="output_shape")
return self._inverse_event_shape_tensor(output_shape)
def _inverse_event_shape(self, output_shape):
"""Subclass implementation for `inverse_event_shape` public function."""
# By default, we assume event_shape is unchanged.
return tensor_shape.TensorShape(output_shape)
def inverse_event_shape(self, output_shape):
"""Shape of a single sample from a single batch as a `TensorShape`.
Same meaning as `inverse_event_shape_tensor`. May be only partially defined.
Args:
output_shape: `TensorShape` indicating event-portion shape passed into
`inverse` function.
Returns:
inverse_event_shape_tensor: `TensorShape` indicating event-portion shape
after applying `inverse`. Possibly unknown.
"""
return self._inverse_event_shape(output_shape)
def _forward(self, x):
"""Subclass implementation for `forward` public function."""
raise NotImplementedError("forward not implemented.")
def _call_forward(self, x, name, **kwargs):
with self._name_scope(name, [x]):
x = ops.convert_to_tensor(x, name="x")
self._maybe_assert_dtype(x)
if not self._is_injective: # No caching for non-injective
return self._forward(x, **kwargs)
mapping = self._lookup(x=x, kwargs=kwargs)
if mapping.y is not None:
return mapping.y
mapping = mapping.merge(y=self._forward(x, **kwargs))
self._cache(mapping)
return mapping.y
def forward(self, x, name="forward"):
"""Returns the forward `Bijector` evaluation, i.e., X = g(Y).
Args:
x: `Tensor`. The input to the "forward" evaluation.
name: The name to give this op.
Returns:
`Tensor`.
Raises:
TypeError: if `self.dtype` is specified and `x.dtype` is not
`self.dtype`.
NotImplementedError: if `_forward` is not implemented.
"""
return self._call_forward(x, name)
def _inverse(self, y):
"""Subclass implementation for `inverse` public function."""
raise NotImplementedError("inverse not implemented")
def _call_inverse(self, y, name, **kwargs):
with self._name_scope(name, [y]):
y = ops.convert_to_tensor(y, name="y")
self._maybe_assert_dtype(y)
if not self._is_injective: # No caching for non-injective
return self._inverse(y, **kwargs)
mapping = self._lookup(y=y, kwargs=kwargs)
if mapping.x is not None:
return mapping.x
mapping = mapping.merge(x=self._inverse(y, **kwargs))
self._cache(mapping)
return mapping.x
def inverse(self, y, name="inverse"):
"""Returns the inverse `Bijector` evaluation, i.e., X = g^{-1}(Y).
Args:
y: `Tensor`. The input to the "inverse" evaluation.
name: The name to give this op.
Returns:
`Tensor`, if this bijector is injective.
If not injective, returns the k-tuple containing the unique
`k` points `(x1, ..., xk)` such that `g(xi) = y`.
Raises:
TypeError: if `self.dtype` is specified and `y.dtype` is not
`self.dtype`.
NotImplementedError: if `_inverse` is not implemented.
"""
return self._call_inverse(y, name)
def _inverse_log_det_jacobian(self, y):
"""Subclass implementation of `inverse_log_det_jacobian` public function."""
raise NotImplementedError("inverse_log_det_jacobian not implemented.")
def _call_inverse_log_det_jacobian(self, y, name, **kwargs):
with self._name_scope(name, [y]):
if self._constant_ildj is not None:
return self._constant_ildj
y = ops.convert_to_tensor(y, name="y")
self._maybe_assert_dtype(y)
if not self._is_injective: # No caching for non-injective
return self._inverse_log_det_jacobian(y, **kwargs)
mapping = self._lookup(y=y, kwargs=kwargs)
if mapping.ildj is not None:
return mapping.ildj
try:
x = None # Not needed; leave cache as is.
ildj = self._inverse_log_det_jacobian(y, **kwargs)
except NotImplementedError as original_exception:
try:
x = mapping.x if mapping.x is not None else self._inverse(y, **kwargs)
ildj = -self._forward_log_det_jacobian(x, **kwargs)
except NotImplementedError:
raise original_exception
mapping = mapping.merge(x=x, ildj=ildj)
self._cache(mapping)
if self.is_constant_jacobian:
self._constant_ildj = mapping.ildj
return mapping.ildj
def inverse_log_det_jacobian(self, y, name="inverse_log_det_jacobian"):
"""Returns the (log o det o Jacobian o inverse)(y).
Mathematically, returns: `log(det(dX/dY))(Y)`. (Recall that: `X=g^{-1}(Y)`.)
Note that `forward_log_det_jacobian` is the negative of this function,
evaluated at `g^{-1}(y)`.
Args:
y: `Tensor`. The input to the "inverse" Jacobian evaluation.
name: The name to give this op.
Returns:
`Tensor`, if this bijector is injective.
If not injective, returns the tuple of local log det
Jacobians, `log(det(Dg_i^{-1}(y)))`, where `g_i` is the restriction
of `g` to the `ith` partition `Di`.
Raises:
TypeError: if `self.dtype` is specified and `y.dtype` is not
`self.dtype`.
NotImplementedError: if `_inverse_log_det_jacobian` is not implemented.
"""
return self._call_inverse_log_det_jacobian(y, name)
def _forward_log_det_jacobian(self, x):
"""Subclass implementation of `forward_log_det_jacobian`."""
raise NotImplementedError(
"forward_log_det_jacobian not implemented.")
def _call_forward_log_det_jacobian(self, x, name, **kwargs):
with self._name_scope(name, [x]):
if self._constant_ildj is not None:
# Need "-1. *" to avoid invalid-unary-operand-type linter warning.
return -1. * self._constant_ildj
x = ops.convert_to_tensor(x, name="x")
self._maybe_assert_dtype(x)
if not self._is_injective:
return self._forward_log_det_jacobian(x, **kwargs) # No caching.
mapping = self._lookup(x=x, kwargs=kwargs)
if mapping.ildj is not None:
return -mapping.ildj
try:
y = None # Not needed; leave cache as is.
ildj = -self._forward_log_det_jacobian(x, **kwargs)
except NotImplementedError as original_exception:
try:
y = mapping.y if mapping.y is not None else self._forward(x, **kwargs)
ildj = self._inverse_log_det_jacobian(y, **kwargs)
except NotImplementedError:
raise original_exception
mapping = mapping.merge(y=y, ildj=ildj)
self._cache(mapping)
if self.is_constant_jacobian:
self._constant_ildj = mapping.ildj
return -mapping.ildj
def forward_log_det_jacobian(self, x, name="forward_log_det_jacobian"):
"""Returns both the forward_log_det_jacobian.
Args:
x: `Tensor`. The input to the "forward" Jacobian evaluation.
name: The name to give this op.
Returns:
`Tensor`, if this bijector is injective.
If not injective this is not implemented.
Raises:
TypeError: if `self.dtype` is specified and `y.dtype` is not
`self.dtype`.
NotImplementedError: if neither `_forward_log_det_jacobian`
nor {`_inverse`, `_inverse_log_det_jacobian`} are implemented, or
this is a non-injective bijector.
"""
if not self._is_injective:
raise NotImplementedError(
"forward_log_det_jacobian cannot be implemented for non-injective "
"transforms.")
return self._call_forward_log_det_jacobian(x, name)
@contextlib.contextmanager
def _name_scope(self, name=None, values=None):
"""Helper function to standardize op scope."""
with ops.name_scope(self.name):
with ops.name_scope(
name, values=(values or []) + self.graph_parents) as scope:
yield scope
def _maybe_assert_dtype(self, x):
"""Helper to check dtype when self.dtype is known."""
if self.dtype is not None and self.dtype.base_dtype != x.dtype.base_dtype:
raise TypeError("Input had dtype %s but expected %s." %
(self.dtype, x.dtype))
def _cache(self, mapping):
"""Helper which stores mapping info in forward/inverse dicts."""
if self._constant_ildj is not None:
# Fold in ildj if known constant Jacobian.
mapping = mapping.merge(ildj=self._constant_ildj)
# Merging from lookup is an added check that we're not overwriting anything
# which is not None.
mapping = mapping.merge(mapping=self._lookup(
mapping.x, mapping.y, mapping.kwargs))
if mapping.x is None and mapping.y is None:
raise ValueError("Caching expects at least one of (x,y) to be known, "
"i.e., not None.")
self._from_x[mapping.x_key] = mapping
self._from_y[mapping.y_key] = mapping
def _lookup(self, x=None, y=None, kwargs=None):
"""Helper which retrieves mapping info from forward/inverse dicts."""
mapping = _Mapping(x=x, y=y, kwargs=kwargs)
# Since _cache requires both x,y to be set, we only need to do one cache
# lookup since the mapping is always in both or neither.
if mapping.x is not None:
return self._from_x.get(mapping.x_key, mapping)
if mapping.y is not None:
return self._from_y.get(mapping.y_key, mapping)
return mapping
def _event_dims_tensor(self, sample):
"""Return a 1D `int32` tensor: `range(rank(sample))[-event_ndims:]`."""
if self.event_ndims is None:
raise ValueError("Jacobian cannot be computed with unknown event_ndims")
static_event_ndims = tensor_util.constant_value(self.event_ndims)
static_rank = sample.get_shape().ndims
if static_event_ndims is not None and static_rank is not None:
return ops.convert_to_tensor(
static_rank + np.arange(-static_event_ndims, 0).astype(np.int32))
if static_event_ndims is not None:
event_range = np.arange(-static_event_ndims, 0).astype(np.int32)
else:
event_range = math_ops.range(-self.event_ndims, 0, dtype=dtypes.int32)
if static_rank is not None:
return event_range + static_rank
else:
return event_range + array_ops.rank(sample)


Objectives
- Visualize Jeopardy trends and categories over time
- Use machine learning to better classify each Jeopardy question
Tools and Libraries Used
Data Cleanup
- Python
- Pandas
- PySpark
- Spark
- JSON
Visualization
- Tableau
Machine Learning
- Pandas
- BERTopic
Front-End Development
- HTML
- CSS
- JavaScript
Deployment
- Flask
- MongoDB
- Heroku
Sources and Resources
For full list of sources and additional resources, please visit our GitHub Repository.
Limitations
Due to time limitations, we were unable to further study how different embedding models impact our BERTopic. We also were hoping to explore building a semi-supervised model using a smaller dataset where we manually classified topics.
It was also difficult to find pre-vetted Jeopardy datasets that provide more information around contestant earnings overtime.


To-do List
Click on the plus icon to add todo
Hover over a todo to reveal the delete icon
Click on a todo to check or uncheck it
Have fun :)
...Oh and local storage was added!


Disney+ Sets The Mandalorian’s Release Dates and Episode Synopses
by Robert WorkmanThere’s a lot of hype going into the premiere of the new Star Wars series The Mandalorian next week. Disney opted to keep that going by revealing the synopsis for its first three episodes, along with its official release schedule.
The episodes have simple names for their chapters (“Chapter 1,” “Chapter 2”) and don’t provide many details. Here’s how they’re broken down:
- A Mandalorian bounty hunter tracks a target for a well-paying client. (Chapter One)
- Target in-hand, the Mandalorian must now contend with scavengers. (Chapter Two)
- The battered Mandalorian returns to his client for reward. (Chapter Three)
Showrunner Jon Favreau and company are apparently avoiding spoilers with these general descriptions. But it also hints that the show will have a larger story that goes forward with each episode.
RELATED: Bob Iger Says George Lucas Is ‘Fine’ With The Mandalorian
As for the release schedule, the episodes will be available on Disney+ on a weekly basis. The first episode will debut this Tuesday, November 12. After that, the shows will debut every Friday, with the next following on November 15. They’ll continue their run through December 27, when the first season finale airs.
There’s already a second season of The Mandalorian in the works, as previously confirmed by Favreau. However, it doesn’t currently have a premiere date..
Additionally, there’s now a Disney+ countdown clock. Based on this, Disney+ will go live on Tuesday, November 12, around 9am EST.
Will you check out The Mandalorian when it premieres next week? Let us know in the comment section below!
Recommended Reading: Ultimate Star Wars, New Edition: The Definitive Guide to the Star Wars Universe
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means to earn fees by linking to Amazon.com and affiliated sites.


ATTENTION!! new opening hours open until 17h from Mon-Fri
Ordering is possible via our send portal or email.
Read our instructions.
For technical reasons we use a minimum order amount of €5,-
This is because we print digitally, and do not work with copy machines. This way we can offer you the best quality.
We use cookies for improving the functionality of this website.
Nederlands
Ok, thanks


// prepare graph
graphs = []
for i in range(batch_size):
u = torch.randint(20, (40,))
v = torch.randint(20, (40,))
graphs.append(dgl.graph((u, v)).to(device))
// dry run
graphs = []
for graph in ds[0:batch_size][0]:
g = graph.to(device)
graphs.append(g)
// dry run
for i in range(10):
g = dgl.batch(graphs)


We sell services!
- revolutionize one-to-one paradigms
- reintermediate best-of-breed convergence
- grow scalable e-tailers
- extend extensible initiatives
- cultivate turn-key e-markets
- drive visionary solutions
- innovate holistic platforms
- cultivate end-to-end functionalities
- engage customized synergies
- visualize cutting-edge deliverables
- monetize vertical web services


Benefit Netsuite calculator
Fill out this form in a few steps to know the time of implementation of Netsuite in your business
Customer Information


HELP
RETURNS & EXCHANGES
- RETURNS AND EXCHANGES
-
If your purchase isn't quite right you have 28 days from the date you received your order to exchange or return. We can collect your return for free from your home, work or alternative address.
Shipping is complimentary on all exchanges, although customers outside the EU are responsible for taxes and duties.
Items must be returned to us unused with all labels still attached. Returns that do not meet our policy will be sent back to the customer.
-
- HOW TO EXCHANGE OR RETURN
- Simply follow the steps below:
- 1. Sign in to your account and under My Orders, select the order number containing the item(s) you would like to return.
- 2. Click on the "CREATE EXCHANGE/RETURN" button and choose the reason for return. Choose your replacement size if you are requesting an exchange. Please note that we are only able to offer size exchanges.
- 3. Check the box to agree with our Return Policy. You will then receive an email including your returns instructions.
- 4. Book your free collection with DHL online or over the phone:
- 5. Sign the returns proforma invoice that you received with your order. Make sure you leave your package open until the driver or Doddle assistant has checked the contents.
Phone
Simply call DHL on +44 (0)844 248 0844 or visit www.dhl.com to find the telephone number of your nearest DHL branch. Remember to quote the account number for your country from our returns email.
Online
Click on the link provided in the returns email we send you and enter your 10 digit waybill number located under the barcode of your printed returns label that starts "WAYBILL XX XXXX XXXX". Review your details and select a convenient day and time for DHL to collect your parcel.
Doddle
UK customers can drop of their return at any Doddle store. To find out more, visit doddle.com/mrporter.
MR PORTER Premier
Customers will be contacted within 48 hours to arrange a collection.
If you have sent items back to us before you will notice that a returns merchandise authorisation (RMA) number is no longer needed to make returning even easier.
We recommend that items are returned from the same country to which they were delivered. This ensures that your return is covered by our free returns policy and reaches us promptly. Orders sent back from a different destination may incur additional charges or be delayed by customs.
For more information, please contact Customer Care.
- Simply follow the steps below:
- EXCHANGES
-
There is no charge to exchange items for a different size, however all exchanges are based on stock availability. Shipping is also free on the replacement item, but if you are based outside the EU you will need to pay taxes and duties on this. If you selected PayPal when you placed your order, any applicable taxes and duties on your exchange should be paid with your debit or credit card.
To exchange an item, request a return through your MR PORTER account, specifying the new size that you require. For exchanges outside the EU, you will be prompted to tick a box on the 'REVIEW & CONFIRM' page. You will see a breakdown of cost and this authorizes MR PORTER to deduct the total taxes and duties from the original card used to place your order.
Please note that we are only able to offer size exchanges. If you wish to exchange your item for an alternative style, we suggest that you return it for a store credit and purchase the new item separately.
-
- GIFT RETURNS
-
If you have received an item as a gift, you may exchange it for a store credit to your MR PORTER account (you will need to register your details). The amount is automatically deducted from your next purchase and will be valid for one year. Please be aware that you may need to pay any cost difference, additional shipping, taxes and import duties.
To arrange a return, please email<EMAIL_ADDRESS>Note, corporate gifts may only be returned by the original purchaser and within 14 working days of initial receipt.
-
- LATE RETURNS
-
Your item(s) should be sent back to us within 28 days. Returns outside these timeframes may be accepted at the discretion of MR PORTER and may only be refunded as a store credit.
-
- FAULTY GOODS
-
Goods are classified as faulty if they are received damaged, or where a manufacturing fault occurs within six months of purchase. Please note that items that are damaged as a result of wear and tear are not considered to be faulty. If your item is faulty when you receive it, you can return it for a refund. Simply request a return through your MR PORTER account and send the faulty goods back to us within 30 days of receiving your order.
If you discover a fault after this time, but within six months of purchase, you can still return it. Where possible, we will offer to repair the item. If it cannot be repaired and the same product is still available, we will send you a replacement. If the same product is no longer available, you are entitled to a full refund.
If you would like to exchange a faulty item instead of obtaining a refund, please be aware that we can only replace it for the same product in the same size, subject to availability.
For all faulty items outside of our Returns Policy, please contact<EMAIL_ADDRESS>-
- RECEIVING A REFUND
-
Your refund will either be credited to the original payment method or MR PORTER account and will include shipping costs for faulty items or for orders cancelled under the ICACRs only. Shipping costs will not be refunded for items returned using our free collection service.
If your order has been sent to a destination within the EU, all sales taxes will be refunded. Outside the EU, customs duties and sales taxes are non-refundable through MR PORTER. However, you may be able to recover these by contacting your local customs bureau directly. As this may not be available for all countries, we recommend that you hire a customs broker if you wish to claim back duties on returned merchandise.
Please note that refunds can take up to 10 working days to show on your account due to varying processing times between payment providers.
-
- IMPORTANT INFORMATION
-
- We have made every effort to display as accurately as possible the colours of our products that appear on MR PORTER. However, as computer monitors vary, we cannot guarantee that your monitor's display of any colour will be completely accurate.
- All items are quality controlled and checked for any faults before they are dispatched to customers.
- Should you receive an item that is not in perfect condition please contact us immediately.
- Please send all items you wish to return from an order in the same shipment to ensure your return is processed as quickly as possible.
- Items should be returned in their original packaging to ensure they are adequately protected in transit. Shoe boxes should also be protected as they are considered part of the product, and your return may not be accepted if the box is damaged.
- Free collection does not apply to items returned from a different country to the original shipping destination or to orders cancelled under the ICACRs.
- We prefer that items are returned to us via DHL or our MR PORTER Premier service to ensure that they are protected and insured during transit. However, you may return the goods by any secure means. Our address for all returns is: MR PORTER DC1 Unit 3, Charlton Gate Business Park Anchor and Hope Lane London SE7 7RU
We request that you contact us at<EMAIL_ADDRESS>in relation to such returns. Please note that we may not accept liability for goods that are not returned via DHL or our MR PORTER Premier service.
-
- CANCELLING YOUR ORDER
-
If you are based in the EU under the Consumer Contracts (Information, Cancellation and Additional Charges) Regulations 2013 (ICACRs), you have the right to cancel your order with us provided you give us written notice.
The cancellation period will expire 14 days from the day after the day on which you acquire (or a third party other than a carrier and indicated by you acquires) physical possession of the last of the goods.
- To exercise the right to cancel, you must inform us by letter to: Notice of Contract Cancellation, Customer Care Department, MR PORTER DC1, Unit 3, Charlton Gate Business Park, Anchor and Hope Lane, London SE7 7RU, or by email to<EMAIL_ADDRESS>You may also use the cancellation form, but it is not obligatory.
- On receipt of your notice of contract cancellation, Customer Care will email to confirm your return. Please sign, date and complete the returns proforma that arrived with your order and include it with your return so that we can process your refund promptly.
- We recommend that you insure the return shipment as you are
under a duty to take reasonable care of the goods and will be liable
for damage to them until we receive them at our warehouse. We also
recommend that you use a secure, trackable means to return your
order to us at:
MR PORTER DC1
Unit 3, Charlton Gate Business Park
Anchor and Hope Lane
London SE7 7RU
- Please retain proof of sending, in case of a dispute.
- Please note that you must cover the cost of the return shipment, as our free collection service does not apply to orders cancelled under the ICACRs.
- All items must be returned unused, in their original condition and from the country that the order was delivered to.
- We will refund the full value of your order, including shipping costs, within 14 days of receiving your notice of contract cancellation. If we do not receive the cancelled order, we will arrange to have it collected from you at your cost.
Please note you may only use your right to cancel the order under the ICACRs if you give us formal written notice of cancellation any time after your order has been placed, up until 14 calendar days from the day after you receive your order, by email or post as described above.
-
- OUR POLICY
-
Please email<EMAIL_ADDRESS>if any of your purchases have been delivered without MR PORTER tags.
All returns should be requested before you send your purchase back to us. Unidentified items will be returned to the sender.
 Underwear and swimwear should be tried on over underwear.
Shoes
Please return all items, including the dust bag and box. When you try them on, stand on a carpeted surface to protect the soles.
Bags/ Watches/ Accessories
All designer packaging such as authenticity cards, dust bags and leather tags should be included with your return.
If you don't like your Fine Watch, or it doesn't fit, please contact<EMAIL_ADDRESS>to arrange a refund.
Grooming & Candles
Grooming products should be sent in the original packaging. Please note, both candles and fragrance are final sale and cannot be returned due to transport restrictions.
Technology
Technology products should be returned in the original packaging.
Limited-Edition Products & Books
As these items are highly collectable, please only remove the protective cover and packaging once you are certain that you wish to keep them.
Repeated returns
We offer a flexible returns policy to make your online shopping experience even easier. However, customers returning items repeatedly may be refused at our discretion.
-
- AUSTRALIAN DUTY REFUND
-
On returning your purchase, you can receive a store credit refund equivalent to the value of any Australian customs duties you have paid.
This applies to returns of full-price orders:
- over 1000 AUD (before customs duties and taxes are added)
- placed on or after 1st August 2016
Your store credit will be added to your MR PORTER account within 14 days of receiving your return.
This offer only applies to items on which customs duties have been paid to an Australian customs authority. MR PORTER reserves the right to further adjust this offer.
-


Man swindle’s CEO and his clients of GH¢300,000.00
by Joyce Danso, GNA
Accra, Nov. 15, GNA - Mark Sarpong Agyei, a businessman who allegedly defrauded a Chief Executive Officer (CEO) and his clients of GH¢300,000.00 under the pretext of providing the clients’ jobs in various institutions but failed, has appeared before an Accra Circuit Court.
Agyei charged with defrauding with false pretences has pleaded not guilty.
The Court presided over by Mrs Jane Harriet Akweley Quaye has admitted Agyei to bail in the sum of GH¢300,000.00 with three sureties who are in gainful employment.
He is to reappear on December 13.
Prosecuting Inspector Isaac Anquandah narrated that the complainant James K. Ahinasi is the CEO of Med Recruit Ghana and a resident of Wetland, Accra. Agyei is also the CEO of Explorer International.
Inspector Anquandah said in the early part of this year, Agyei approached the complainant’s company with a proposal that he had vacancies at various companies and institutions and that he would need the partnership of the complainant’s company to get interested applicants for the job openings at ECOBANK, Newmont, Ministry of Foreign Affairs, COCOBOD among others.
Prosecution said in view of that, a witness Leonora Agyei, who is also a staff of the complainant’s company after a background check of the accused’s company began recruiting some interested applicants.
Prosecution said applicants were made to pay various amounts ranging from GH¢500.00 to GH¢2,000.00 through Leonora Agyei to the accused person to the tune of GH¢300,000.00.
Chief Inspector Anquandah said when the accused person was confronted over the exact day of employment, he began giving excuses and later went into hiding.
Prosecution said a report was made to the Police and the accused person was picked up at Dansoman.
During investigations, the prosecutor said Agyei admitted collecting the money from the complainant.
GNA


Fairy Tales and Other Traditional Stories
by FCIT
“The Story of Wylie”
by John Brown
Additional Information
- Year Published: 1873
- Language: English
- Country of Origin: Scotland
- Source: Brown, J. (1873). Rab and his Friends. Boston: James R. Osgood.
-
Readability:
- Flesch–Kincaid Level: 5.6
- Word Count: 982
- Genre: Fairy Tale/Folk Tale
- Keywords: helping others
- ✎ Cite This
Downloads
This is a story about a dog,—not the kind of dog you often see in the street here; not a fat, wrinkly pugdog, nor a smooth-skinned bulldog, nor even a big shaggy fellow, but a slim, silky-haired, sharp-eared little dog, the prettiest thing you can imagine. Her name was Wylie, and she lived in Scotland, far up on the hills, and helped her master take care of his sheep.
You can’t think how clever she was!  She drove them out to pasture when it was time, and brought them safely home when it was time for that. When the silly sheep got frightened and ran this way and that, hurting themselves and getting lost, Wylie knew exactly what to do,—round on one side she would run, barking and scolding, driving them back; then round on the other, barking and scolding, driving them back, till they were all bunched together in front of the right gate. Then she drove them through as neatly as any person. She loved her work, and was a wonderfully fine sheepdog.
At last her master grew too old to stay alone on the hills, and so he went away to live. Before he went, he gave Wylie to two kind young men who lived in the nearest town; he knew they would be good to her. They grew very fond of her, and so did their old grandmother and the little children: she was so gentle and handsome and well behaved.
So now Wylie lived in the city where there were no sheep farms, only streets and houses, and she did not have to do any work at all,—she was just a pet dog. She seemed very happy and she was always good.
But after a while, the family noticed something odd, something very strange indeed, about their pet. Every single Tuesday night, about nine o’clock, Wylie disappeared . They would look for her, call her,—no, she was gone. And she would be gone all night. But every Wednesday morning, there she was at the door, waiting to be let in. Her silky coat was all sweaty and muddy and her feet heavy with weariness, but her bright eyes looked up at her masters as if she were trying to explain where she had been.
Week after week the same thing happened. Nobody could imagine where Wylie went every Tuesday night. They tried to follow her to find out, but she always slipped away; they tried to shut her in, but she always found a way out. It grew to be a real mystery. Where in the world did Wylie go?
You never could guess, so I am going to tell you.
In the city near the town where the kind young men lived was a big market. Every sort of thing was sold there, even live cows and sheep and hens. On Tuesday nights, the farmers used to come down from the hills with their sheep to sell, and drive them through the city streets into the pens, ready to sell on Wednesday morning; that was the day they sold them.
The sheep weren’t used to the city noises and sights, and they always grew afraid and wild, and gave the farmers and the sheepdogs a great deal of trouble. They broke away and ran about, in everybody’s way.
But just as the trouble was worst, about sunrise, the farmers would see a little silky, sharp-eared dog come trotting all alone down the road, into the midst of them.
And then!
In and out the little dog ran like the wind, round and about, always in the right place, driving—coaxing—pushing—making the sheep mind like a good school-teacher, and never frightening them, till they were all safely in! All the other dogs together could not do as much as the little strange dog. She was a perfect wonder. And no one knew whose dog she was or where she came from. The farmers grew to watch for her, every week, and they called her “the wee fell yin” which is Scots for “the little terror”; they used to say when they saw her coming, “There’s the wee fell yin! Now we’ll get them in.”
Every farmer would have liked to keep her, but she let no one catch her. As soon as her work was done she was off and away like a fairy dog, no one knew where. Week after week this happened, and nobody knew who the little strange dog was.
But one day Wylie went to walk with her two masters, and they happened to meet some sheep farmers. The sheep farmers stopped short and stared at Wylie, and then they cried out, “Why, that’s the dog! That’s the wee fell yin!” And so it was. The little strange dog who helped with the sheep was Wylie.
Her masters, of course, didn’t know what the farmers meant, till they were told all about what I have been telling you. But when they heard about the pretty strange dog who came to market all alone, they knew at last where Wylie went, every Tuesday night. And they loved her better than ever.
Wasn’t it wise of the dear little dog to go and work for other people when her own work was taken away? I fancy she knew that the best people and the best dogs always work hard at something. Any way she did that same thing as long as she lived, and she was always just as gentle, and silky-haired, and loving as at first.


API Superstore
We collect APIs from various sources and translate them into an easy-to-swallow format to allow you to efficiently access each website’s API without a second thought.
API Superstore boasts a thriving community of individuals ready to help document, troubleshoot, and innovate.
View boards
This service has dropped my workload down to a third of its previous size. Thanks APISuperstore!


Adding a Security Role with an RSVP Code
How to create an RSVP Code for a security role using the Security Roles module. The RSVP feature provides you with a code and a link that you can share with users to give them a simple way to join a role. The RSVP link can be sent to your users allowing them to subscribe simply by clinking on the link. Alternatively, users can enter the RSVP code on the Manage Services page of their User Profile to join a role.
- Navigate to Admin > Security Roles - OR - Go to a Security Roles module.
- Click the Add New Role link.
- On the Basic Settings tab, complete the required fields. See "Adding a Security Role (Basic Settings)"
- Select the Advanced Settings tab.
- In the RSVP Code text box, enter a code that will enable users to subscribe to this role. The code can be any combination of letters and numbers. E.g. N!ce
- Click the Update link to save the role and generate the RSVP link that is displayed on the Edit Security Roles page.
Related Topics:
-
See "Subscribing to a Service with an RSVP Code"
-
See "Subscribing to a Service with an RSVP Link"


* Drage and scroll to rotate the model *
Click the link below to listen !
Start
use your mouse to flip the page
回川Conation
Space Race
Youtube
Instagram
Streetvoice


Information Assurance and Security
Information assurance
Which focuses on ensuring the availability, integrity, authentication, confidentiality, and non-repudiation of information and systems. These measures may include providing for restoration of information systems by incorporating protection, detection, and reaction capabilities.
Information security
Which centers on the protection of information and information systems from unauthorized access, use, disclosure, disruption, modification, or destruction in order to provide confidentiality, integrity, and availability.
Information systems
Play an important role in the infrastructure that supports commerce, banking, telecommunications, health care, and national security, driving the need for qualified information assurance and security specialists.
Although related, information assurance and information security are two different disciplines. Both disciplines involve a variety of similar issues, including risk management, cyber security, corporate governance, compliance, auditing, business continuity, disaster recovery, forensic science, security engineering, and criminology.


{% import "bootstrap/utils.html" as utils %} {% import "bootstrap/wtf.html" as wtf %} {% extends "base.html" %} {% block title %}Register{% endblock %} {% block body %}
Already have an account? Login here