One framework
Mobile and desktop.
Cross Platform
Speed & Performance
Tooling
Deliver app-like experiences
High performance, offline and zero-step installation
Ionic Framework
NativeScript
React Native
Converts templates into code
You can server the first view of the app in just HTML and CSS
Near instant rendering
Simple and powerful template syntax
Add components and test
Intelligent code completion
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript
Any browser. Any host. Any OS. Open Source
Use existing JavaScript code
Incorporate popular JavaScript libraries
Call TypeScript code from JavaScript
TypeScript compiles to clean, simple JavaScript code
Use highly-productive development tools
Leverage static checking and code refactoring
Types are optional
Type inference allows static verification of code
Supports the latest JavaScript features
Current: ECMAScript 2015
Future: async functions and decorators
Are compiled into simple JavaScript that targets ECMAScript 3 environments
// install
npm install -g typescript
// compile
tsc helloworld.ts
npm install -g typescript
function greeter(person) {
return "Hello, " + person;
}
var user = "Jane User";
document.body.innerHTML = greeter(user);
<!DOCTYPE html>
<html>
<head><title>TypeScript Greeter</title></head>
<body>
<script src="greeter.js"></script>
</body>
</html>
tsc greeter.ts
function greeter(person: string) {
return "Hello, " + person;
}
var user = "Jane User";
document.body.innerHTML = greeter(user);
Compiles cleanly and lets the IDE suggest completions
function greeter(person: string) {
return "Hello, " + person;
}
var user = [0, 1, 2];
document.body.innerHTML = greeter(user);
Compiler will show an error
greeter.ts(7,26): Supplied parameters do not match any signature of call target
class Student {
fullName: string;
constructor(public firstName, public middleInitial, public lastName) {
this.fullName = firstName + " " + middleInitial + " " + lastName;
}
}
interface Person {
firstName: string;
lastName: string;
}
function greeter(person : Person) {
return "Hello, " + person.firstName + " " + person.lastName;
}
var user = new Student("Jane", "M.", "User");
document.body.innerHTML = greeter(user);
Angular Component Router enables navigation from one view to the next
Can interpret a browser URL as an instruction to navigate to a given view
Can pass parameters to help decide what specific content to present
Can bind to links on the page and it will navigate to the appropriate view when they are clicked
Components are the main way to build and specify elements and logic on the page
Combines directives, controllers and scope from Angular 1
import { Component } from '@angular/core';
@Component({
selector: 'my-component',
template: 'I am {{name}}. '
})
export class MyComponent {
constructor() {
this.name = 'Miguel'
}
logName() {
console.log('Regards ', this.name)
}
}
A Google Chrome Dev Tools extension for debugging Angular 2 applications
Material Design components for Angular 2 apps
Comprehensive, modern UI components that work across web, mobile and desktop
Fast and consistent. Tested on IE11, Chrome, Edge, Firefox and Safari
Themable, accessible and internationalized
Integrates seamlessly with Angular 2
A Progressive Web App uses modern web capabilities to deliver an app-like user experience
Build cross platform desktop apps
with JavaScript, HTML, and CSS
Uses Chromium and Node.js
Automatic updates
Native menus & notifications
Windows installers
Atom
Slack
Visual Studio Code
Atom
Open source mobile SDK for developing native and progressive web apps
Virtual DOM rendering
Hardware accelerated transitions
Touch optimized gestures
Builds on top of Angular
Runs inside Cordova or Phonegap
Deploys natively or as a Progressive Web App
Miguel Cobá


Content boxes are used to better organize your content and provide a visual consistency to your app.
Below, you will find the basic structure needed to create a content box.
Change the content box title background ( .content-box-header
) by adding to it one of the color CSS helper classes listed below.
The core color helpers can be applied to all kind of elements from buttons to icons, headers, headings, etc. They do not change when you switch to a different theme from the same template.
These are the template default color schemes and are used site wide to consistently style common elements. For the primary color you must add .bg-primary and for the secondary color you must add .ui-state-default. Note that theme two styles change based on what color scheme you choose for your template.
.bg-primary
class.
.bg-purple
class.
.bg-yellow
class.
.bg-blue
class.
.bg-white
class.
.bg-black
class.
.bg-black
class.
.bg-blue-alt
class.
Header with .bg-primary
This content boxes has the header with .bg-primary
class.
Header with .bg-purple
This content boxes has the header with .bg-purple
class.
Header with .bg-yellow
This content boxes has the header with .bg-yellow
class.
Header with .bg-blue
This content boxes has the header with .bg-blue
class.
Header with white background
This content boxes has the header with .bg-white
class.
Header with .bg-black
This content boxes has the header with .bg-black
class.
Header with .bg-black
This content boxes has the header with .bg-black
class.
Header with .bg-blue-alt
This content boxes has the header with .bg-blue-alt
class.
Use the example below to create a content box with a two-line header title.
.bg-default
class.
Content title
Example header title description
This content boxes has the header with .bg-default
class.
You can add icons to the content box header titles using the FontAwesome
icons. For example to add a cog icon next to the title you need to use the following code <i class="glyph-icon icon-cog"></i>
.bg-default
class.
.bg-primary
class.
.bg-default
class.
Content title
This content boxes has the header with .bg-default
class.
Content title
This content boxes has the header with .bg-primary
class.
Content title
Example header title description
This content boxes has the header with .bg-default
class.
To create a separator for the header title icon you need to wrap it inside an element with the .icon-separator
CSS class.
.bg-default
class.
.bg-primary
class.
.bg-default
class.
Content title
This content boxes has the header with .bg-default
class.
Content title
This content boxes has the header with .bg-primary
class.
Content title
Example header title description
This content boxes has the header with .bg-default
class.
You have the option to insert single buttons in the content boxes headers using the default button markup.
.bg-default
class.
.bg-default
class.
.bg-default
class.
.bg-primary
class.
.bg-blue
class.
Content title
This content boxes has the header with .bg-default
class.
Content title
This content boxes has the header with .bg-default
class.
Content title
Example header title description
This content boxes has the header with .bg-default
class.
Content title
This content boxes has the header with .bg-primary
class.
Content title
Example header title description
This content boxes has the header with .bg-blue
class.
You can also include button groups in the content box headers using the markup below.
.bg-white
class and .bg-black
for the content wrapper.
.bg-white
class and .bg-black-alt
for the content wrapper.
Content title
This content boxes has the header with .bg-white
class and .bg-black
for the content wrapper.
Content title
This content boxes has the header with .bg-white
class and .bg-black-alt
for the content wrapper.
The separated buttons have a lighter background color than the content box header.
.bg-default
.
.bg-primary
.
.bg-white
.
.bg-black
.
.bg-blue
.
.bg-black
.
Content title
This content boxes has the header with .bg-default
.
Content title
This content boxes has the header with .bg-primary
.
Content title
This content boxes has the header with .bg-white
.
Content title
This content boxes has the header with .bg-black
.
Content title
This content boxes has the header with .bg-blue
.
Content title
This content boxes has the header with .bg-black
.
Context boxes header can also contain badges and/or labels.
Badges 42
Content box body content.
Badges 42
Content box body content.
Labels Primary label
Content box body content.
Badges 5
Content box body content.
Labels Label info
Content box body content.
Badges 89
Content box body content.
Label success
Badges
Content box body content.
To create a top border content box example, like the ones below, you need to add the following CSS helper classes to the .conten-box
wrapper: .border-top
and border-red
. To achieve different border colors, replace "-red" with "-blue", "-blue-alt", "-green", "-orange", etc
To create a footer button pane add a div with the .button-pane
CSS class after the .content-box-wrapper
element. To create a button pane above the content wrapper, move the .button-pane
element above the .content-box-wrapper
in the DOM add .button-pane-top
CSS class to it.
.bg-default
class.
.bg-default
class.
Content title
This content boxes has the header with .bg-default
class.
Content title
Example header title description
This content boxes has the header with .bg-default
class.
Add .refresh-button
CSS class to the element that you want to trigger the content box loading overlay. You can control the overlay color using the data-theme="bg-green">
parameter. For lighter color data-theme parameter use data-style="light"
and for darker ones, use data-style="dark"
. Opacity can be controlled using the data-opacity="80">
parameter. Accepted values are: 30, 60, 80, 100.
.bg-default
.
.bg-default
.
Content title
This content boxes has the header with .bg-default
.
Content title
This content boxes has the header with .bg-default
.
Add .toggle-button
CSS class to the element that you want to trigger the content slide toggle.
.bg-default
.
Content title
This content boxes has the header with .bg-default
.
Add .hide
CSS class to the .content-box-wrapper
element that you want to show on toggle trigger.
Add .hidden-button
CSS class to the .content-box
element to make the content box header elements that have the .label-hide
CSS class, initially hidden and show them only on content box hover.
Add .remove-button
CSS class to the element that you want to trigger the content box remove. To control the animation used for the removal, use the data-animation="flipOutY"
parameter. To learn more about the animation you can use, read the Animations documentation page.
.bg-black
.
.bg-white
.
.bg-default
.
.bg-default
.
Content title
This content boxes has the header with .bg-black
.
Content title
This content boxes has the header with .bg-white
.
Content title
This content boxes has the header with .bg-default
.
Content title
This content boxes has the header with .bg-default
.
Use the markup below to create content panels.


Please modify thecode of the previous exerciseso that instead of printing out thelines in the terminal, it prints out the length of each line.
Expected output:
45681011


{% extends "layout.html" %} {% block content %}
World Business Health Sci-Tech U.S.A. Sports Entertainment Other News


Modification Anomalies
- What if we wanted to delete the repair of the Drill with repairid 85.
- Then we are actually deleting more than we probable want to. We would lose information about the drill itself.
- This is called a deletion anomaly.
- Can anyone point out the actual cause ?
- Information about different entities in a single relation.
Modification Anomalies
- What if we wanted to add a repair to the database for a machine that hasn't been repaired before.
- But the repairmen don't know the purchase price of the machine.
- This is called an insertion anomaly.
- Can anyone point out the actual cause ?
- Information about different entities in a single relation.
Modification Anomalies
- What if we want to change the address of evy ?
- If we forget to change both records, we will end up with inconsistent data.
- This is called an update anomaly.
- Can anyone point out the actual cause ?
Solving Modification Problems
- Most modification problems are solved by breaking an existing table into two or more tables through a process known as normalization.
Solving Modification Problems
- Relations are categorized as a normal form based on which modification anomalies or other problems that they are subject to.
Normal Forms
- A relation is in 1NF if it is a table that qualifies as a relation.
Normal Forms
- A relation is in 1NF if it is a table that qualifies as a relation.
- This table is not in 1NF (qualify as a relation). Why ?
- Multiple attributes in single cell
- Duplicate rows
Normal Forms
- A relation is in 2NF if it is in 1NF and every non-key attribute is fully dependent on the primary key
FD1: (courseID, semesterID) => places, courseName
FD2: courseID => courseName
- This relation is not in 2NF. Why ?
- courseName depends on part of the PK (courseID)
Normal Forms
- A relation is in 2NF if it is in 1NF and every non-key attribute is fully dependent on the primary key
-
Note that if the primary key is not a composite key, all non-key attributes are always fully functional dependent on the primary key.
- A relation that is in 1st normal form and contains only a single key as the primary key is automatically in 2nd normal form.
Normal Forms
- A relation is in 3NF if it is in 2NF and if for each functional dependency
X => A
in R at least one of the following conditions are met:
- X is a canditate key or primary key in R
- A is a prime attribute (part of a candidate key) in R
FD1: (courseID, semesterID) => places, TeacherID, TeacherName
FD2: TeacherID => TeacherName
- This relation is not in 3NF. Why ?
- TeacherName depends on TeacherID
Normal Forms
- A relation is in 3NF if it is in 2NF and if for each functional dependency
X => A
in R at least one of the following conditions are met:
- X is a canditate key or primary key in R
- A is a prime attribute (part of a candidate key) in R
FD1: (Tournament, Year) => Winner, Winner Date of Birth
FD2: Winner => Winner Date of Birth
- This relation is not in 3NF. Why ?
- Winner Date of Birth depends on Winner
Normal Forms
- A relation is in 3NF if it is in 2NF and if for each functional dependency
X => A
in R at least one of the following conditions are met:
- X is a canditate key or primary key in R
- A is a prime attribute (part of a candidate key) in R
FD1: (studentID, courseID) => SSN
FD2: (SSN, courseID) => studentID
FD3: studentID => SSN
FD4: SSN => studentID
- This relation is in 3NF because SSN and studentID are both parts of a candidate key
Normal Forms
- A relation R is in BCNF if it is in 3NF and for each functional dependency
X => A
in R, X is a candidate key or primary key in R. In other words, a relation is in BCNF if every determinant is a candidate key.
FD1: (studentID, courseID) => SSN
FD2: (SSN, courseID) => studentID
FD3: studentID => SSN
FD4: SSN => studentID
- This relation is not in BCNF. Why ?
- Because SSN and studentID are not candidate or primary keys
Normal Forms
“The data depends on the key [1NF], the whole key [2NF] and nothing but the key [3NF], so help me Codd.” by Edgar F. Codd
Boyce-Codd Normal Form (BCNF)
- Identify every functional dependency.
- Identify every candidate key.
- If there is a functional dependency that has a determinant that is not a candidate key:
- Move the columns of that functional dependency into a new relation.
- Leave a copy of the determinant as a foreign key in the original relation.
- Create a referential integrity constraint between the original relation and the new relation.
- Repeat step 3 until every determinant of every relation is a candidate key.
In step 3, if there is more than one such functional dependency, start with the one with the most columns.
Boyce-Codd Normal Form (BCNF)
- You may have to remove duplicates in the new relation !
Examples 1 - Articles
- Identify every functional dependency.
FD1: id => (description, department, buyer)
FD2: description => (id, department, buyer)
FD3: buyer => department
Examples 1 - Articles
- Identify every candidate key.
- A candidate key is a key that determines all of the other columns in a relation.
FD1: id => (description, department, buyer)
FD2: description => (id, department, buyer)
FD3: buyer => department
FD1 [CK]: id => (description, department, buyer)
FD2 [CK]: description => (id, department, buyer)
Examples 1 - Articles
- Is there a functional dependency that has a determinant that is not a candidate key ?
FD1: id => (description, department, buyer)
FD2: description => (id, department, buyer)
FD3: buyer => department
FD3: buyer => department
Examples 1 - Articles
- Move the columns of that functional dependency into a new relation.
- Leave a copy of the determinant as a foreign key in the original relation. => Or surrogate key
- Create a referential integrity constraint between the original relation and the new relation.
Examples 1 - Articles
FD1: id => (description, buyer_id)
FD2: description => (id, buyer_id)
FD1: id => (department, buyer)
FD2: buyer => (department, id)
RIC: WHERE articles.buyer_id MUST EXIST in buyers.id
Examples 2 - Repairs
- Identify every functional dependency.
FD1: itemid => (type, purchaseprice)
FD2: repairid => (repairdate, repairprice, itemid, type, purchaseprice)
Examples 2 - Repairs
- Identify every candidate key.
- A candidate key is a key that determines all of the other columns in a relation.
FD1: itemid => (type, purchaseprice)
FD2: repairid => (repairdate, repairprice, itemid, type, purchaseprice)
FD2 [CK]: repairid => (repairdate, repairprice, itemid, type, purchaseprice)
Examples 2 - Repairs
- Is there a functional dependency that has a determinant that is not a candidate key ?
FD1: itemid => (type, purchaseprice)
FD2: repairid => (repairdate, repairprice, itemid, type, purchaseprice)
FD1: itemid => (type, purchaseprice)
Examples 2 - Repairs
- Move the columns of that functional dependency into a new relation.
- Leave a copy of the determinant as a foreign key in the original relation. => Or surrogate key
- Create a referential integrity constraint between the original relation and the new relation.
Examples 2 - Repairs
FD1: id => (date, price, item_id)
FD1: id => (type, purchaseprice)
RIC: WHERE repairs.item_id MUST EXIST in items.id
- Notice how the column titles don't have to specify the entity name (subject of interest) anymore.
More examples
- See page 100 till 107 for 3 more examples.


Name
HPL_ptimer_cputime Return the CPU time.
Synopsis
#include "hpl.h"
double
HPL_ptimer_cputime();
Description
HPL_ptimer_cputime
returns the cpu time. If HPL_USE_CLOCK is defined,
the clock() function is used to return an approximation of processor
time used by the program. The value returned is the CPU time used so
far as a clock_t; to get the number of seconds used, the result is
divided by CLOCKS_PER_SEC. This function is part of the ANSI/ISO C
standard library. If HPL_USE_TIMES is defined, the times() function
is used instead. This function returns the current process times.
times() returns the number of clock ticks that have elapsed since the
system has been up. Otherwise and by default, the standard library
function getrusage() is used.
See Also
HPL_ptimer_walltime,
HPL_ptimer.


Computes the sample probability value (p-value) for the estimated coefficient from a standard genome-wide univariate regression. It computes the exact finite-sample p-value under the assumption that the measured phenotype (the dependent variable in the regression) has a known Bernoulli-normal mixture distribution. Finite-sample genome-wide regression p-values (Gwrpv) with a non-normally distributed phenotype (Gregory Connor and Michael O'Neill, bioRxiv 204727 <doi:10.1101/204727>).
| Version: | 1.0 |
| Published: | 2017-10-19 |
| Author: | Gregory Connor [aut], Michael O'Neill [trl, aut, cre] |
| Maintainer: | Michael O'Neill <m.oneill at ucd.ie> |
| License: | GPL-3 |
| URL: | https://doi.org/10.1101/204727 |
| NeedsCompilation: | no |
| CRAN checks: | gwrpvr results |
| Reference manual: | gwrpvr.pdf |
| Package source: | gwrpvr_1.0.tar.gz |
| Windows binaries: | r-devel: gwrpvr_1.0.zip, r-release: gwrpvr_1.0.zip, r-oldrel: gwrpvr_1.0.zip |
| OS X binaries: | r-release: gwrpvr_1.0.tgz, r-oldrel: gwrpvr_1.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=gwrpvr to link to this page.


Consolidating Storage with Files
The estimated time to complete this lab is 45 minutes.
Traditionally, file storage has been yet another silo within IT, introducing unnecessary complexity and suffering from the same issues of scale and lack of continuous innovation seen in SAN storage. Nutanix believes there is no room for silos in the Enterprise Cloud. By approaching file storage as an app, running in software on top of a proven HCI core, Nutanix Files delivers high performance, scalability, and rapid innovation through One Click management.
In this lab you will work with Files to manage SMB shares and NFS exports and explore the new functionality for Files deployments with File Analytics.
For the purpose of time, and sharing infrastructure resources, a Files cluster has already been provisioned on your cluster. The BootcampFS Files is a single node instance, typical Files deployments would start with 3 File Server VMs, with the ability to scale up and scale out as required for performance.
BootcampFS has been configured to use the Primary network to communicate with the backend storage, iSCSI connections from the CVM to Volume Groups, and the Secondary network for communication with clients, Active Directory, anti-virus services, etc.
Note
It is typically desirable in production environments to deploy Files with dedicated virtual networks for client and storage traffic. When using two networks, Files will, by design, disallow client traffic the storage network, meaning VMs assigned to the primary network will be unable to access shares.
As Files leverages Nutanix Volume Groups for data storage, it can take advantage of the same underlying storage benefits such as compression, erasure coding, snapshots, and replication.
In Prism Element > File Server > File Server, select BootcampFS and click Protect.
Observe the default Self Service Restore schedules, this feature controls the snapshot schedule for Windows’ Previous Versions functionality. Supporting Windows Previous Versions allows end users to roll back changes to files without engaging storage or backup administrators. Note these local snapshots do not protect the file server cluster from local failures and that replication of the entire file server cluster can be performed to remote Nutanix clusters.
Managing SMB Shares
In this exercise you will create and test a SMB share, used to support the unstructured file data needs of a cross-departmental team for the Fiesta application.
Creating the Share
In Prism Element > File Server, click + Share/Export.
Fill out the following fields:
- Name - Initials-FiestaShare
- Description (Optional) - Fiesta app team share, used by PM, ENG, and MKT
- File Server - BootcampFS
- Share Path (Optional) - Leave blank. This field allows you to specify an existing path in which to create the nested share.
- Max Size (Optional) - 200GiB
- Select Protocol - SMB
Because this is a single node AOS cluster and therefore a single file server VM, all shares will be Standard shares. A Standard share means that all top level directories and files within the share, as well as connections to the share, are served from a single file server VM.
If this were a three node Files cluster or larger you’d have an option to create a Distributed share. Distributed shares are appropriate for home directories, user profiles, and application folders. This type of share shards top level directories across all Files VMs and load balances connections across all Files VMs within the Files cluster.
Click Next.
Select Enable Access Based Enumeration and Self Service Restore. Select Blocked File Types and enter a comma separated list of extensions like .flv,.mov.
Note
Access Based Enumeration (ABE) ensures that only files and folders which a given user has read access are visible to that user. This is commonly enabled for Windows file shares.
Self Service Restore allows users to leverage Windows Previous Version to easily restore individual files to previous revisions based on Nutanix snapshots.
Blocked File Types allow Files administrators to restrict certain types of files (such as large, personal media files) from being written to corporate shares. This can be configured on a per Server or per Share basis, with per Share settings overriding Server wide settings.
Click Next.
Review the Summary and click Create.
It is common for shares utilized by many people to leverage quotas to ensure fair use of resources. Files offers the ability to set either soft or hard quotas on a per share basis for either individual users within Active Directory, or specific Active Directory Security Groups.
In Prism Element > File Server > Share/Export, select your share and click + Add Quota Policy.
Fill out the following fields and click Save:
- Select Group
- User or Group - SSP Developers
- Quota - 10 GiB
- Enforcement Type - Hard Limit
Click Save.
Testing the Share
Connect to your Initials-WinTools VM via VM console as a non-Administrator NTNXLAB domain account:
Note
You will not be able to connect using these accounts via RDP.
- user01 - user25
- devuser01 - devuser25
- operator01 - operator25
- Password nutanix/4u
Note
The Windows Tools VM has already been joined to the NTNXLAB.local domain. You could use any domain joined VM to complete the following steps.
Open \\BootcampFS.ntnxlab.local\
in File Explorer.
Open a browser within your Initials-WinTools desktop and download sample data to populate in your share:
Extract the contents of the zip file into your file share.
- The NTNXLAB\Administrator user was specified as a Files Administrator during deployment of the Files cluster, giving it read/write access to all shares by default.
- Managing access for other users is no different than any other SMB share.
Open PowerShell and try to create a file with a blocked file type by executing the following command:
New-Item \\BootcampFS\INITIALS-FiestaShare\MyFile.flv
Observe that creation of the new file is denied.
Return to Prism Element > File Server > Share/Export, select your share. Review the Share Details, Usage and Performance tabs to understand the high level information available on a per share basis, including the number of files & connections, storage utilization over time, latency, throughput, and IOPS.
In the next exercise, you will see how Files can provide further insights into usage of each File Server and Share.
File Analytics
In this exercise you will explore the new, integrated File Analytics capabilities available in Nutanix Files, including scanning existing shares, creating anomaly alerts, and reviewing audit details. File Analytics is deployed in minutes as a standalone VM through an automated, One Click operation in Prism Element. This VM has already been deployed and enabled in your environment.
In Prism Element > File Server > File Server, select BootcampFS and click File Analytics.
Note
File Analytics should already be enabled, but if prompted you will need to provide your Files administrator account, as Analytics will need to be able to scan all shares.
- Username: NTNXLAB\administrator
- Password: nutanix/4u
As this is a shared environment, the dashboard will likely already be populated with data from shares created by other users. To scan your newly created share, click > Scan File System. Select your share and click Scan.
Note
If your share is not shown, please give it some time to get populated…
Close the Scan File System window and refresh your browser.
You should see the Data Age, File Distribution by Size and File Distribution by Type dashboard panels update.
Under….
From your Initials-WinTools VM, create some audit trail activity by opening several of the files under Sample Data.
Note
You may need to complete a short wizard for OpenOffice if using that application to open a file.
Refresh the Dashboard page in your browser to see the Top 5 Active Users, Top 5 Accessed Files and File Operations panels update.
To access the audit trail for your user account, click on your user under Top 5 Active Users.
Alternatively, you can select Audit Trails from the toolbar and search for your user or a given file.
Note
You can use wildcards for your search, for example .doc
File Analytics puts simple, yet powerful information in the hands of storage administrators, allowing them to understand and audit both utilization and access within a Nutanix Files environment.
Using NFS Exports
In this exercise you will create and test a NFSv4 export, used to support clustered applications, store application data such as logging, or storing other unstructured file data commonly accessed by Linux clients.
Enabling NFS Protocol
Note
Enabling NFS protocol only needs to be performed once per Files server, and may have already been completed in your environment. If NFS is already enabled, proceed to Configure User Mappings.
In Prism Element > File Server, select your file server and click Protocol Management > Directory Services.
Select Use NFS Protocol with Unmanaged User Management and Authentication, and click Update.
Creating the Export
In Prism > File Server, click + Share/Export.
Fill out the following fields:
- Name - logs
- Description (Optional) - File share for system logs
- File Server - Initials-Files
- Share Path (Optional) - Leave blank
- Max Size (Optional) - Leave blank
- Select Protocol - NFS
Click Next.
Fill out the following fields:
- Select Enable Self Service Restore
- These snapshots appear as a .snapshot directory for NFS clients.
- Authentication - System
- Default Access (For All Clients) - No Access
- Select + Add exceptions
- Clients with Read-Write Access - The first 3 octets of your cluster network.* (e.g. 10.38.1.*)
By default an NFS export will allow read/write access to any host that mounts the export, but this can be restricted to specific IPs or IP ranges.
Click Next.
Review the Summary and click Create.
Testing the Export
You will first provision a CentOS VM to use as a client for your Files export.
Note
If you have already deployed the Linux Tools VM as part of another lab, you may use this VM as your NFS client instead.
In Prism > VM > Table, click + Create VM.
Fill out the following fields:
- Name - Initials-NFS-Client
- Description - CentOS VM for testing Files NFS export
- vCPU(s) - 2
- Number of Cores per vCPU - 1
- Memory - 2 GiB
- Select + Add New Disk
- Operation - Clone from Image Service
- Image - CentOS
- Select Add
- Select Add New NIC
- VLAN Name - Secondary
- Select Add
Click Save.
Select the Initials-NFS-Client VM and click Power on.
Note the IP address of the VM in Prism, and connect via SSH using the following credentials:
- Username - root
- Password - nutanix/4u
Execute the following:
[root@CentOS ~]# yum install -y nfs-utils #This installs the NFSv4 client
[root@CentOS ~]# mkdir /filesmnt
[root@CentOS ~]# mount.nfs4 <Intials>-Files.ntnxlab.local:/ /filesmnt/
[root@CentOS ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos_centos-root 8.5G 1.7G 6.8G 20% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda1 494M 141M 353M 29% /boot
tmpfs 377M 0 377M 0% /run/user/0
*intials*-Files.ntnxlab.local:/ 1.0T 7.0M 1.0T 1% /afsmnt
[root@CentOS ~]# ls -l /filesmnt/
total 1
drwxrwxrwx. 2 root root 2 Mar 9 18:53 logs
Observe that the logs directory is mounted in /filesmnt/logs
.
Reboot the VM and observe the export is no longer mounted. To persist the mount, add it to /etc/fstab
by executing the following:
echo 'Intials-Files.ntnxlab.local:/ /filesmnt nfs4' >> /etc/fstab
The following command will add 100 2MB files filled with random data to /filesmnt/logs
:
mkdir /filesmnt/logs/host1
for i in {1..100}; do dd if=/dev/urandom bs=8k count=256 of=/filesmnt/logs/host1/file$i; done
Return to Prism > File Server > Share > logs to monitor performance and usage.
Note that the utilization data is updated every 10 minutes.
Multi-Protocol Shares
Files provides the ability to provision both SMB shares and NFS exports separately - but also now supports the ability to provide multi-protocol access to the same share. In the exercise below, you will configure your existing Initials-FiestaShare to allow NFS access, allowing developer users to re-direct application logs to this location.
Testing the Export
To test the NFS export, connect via SSH to your Initials-LinuxToolsVM VM:
- User Name - root
- Password - nutanix/4u
Execute the following commands:
[root@CentOS ~]# yum install -y nfs-utils #This installs the NFSv4 client
[root@CentOS ~]# mkdir /filesmulti
[root@CentOS ~]# mount.nfs4 bootcampfs.ntnxlab.local:/<Initials>-FiestaShare /filesmulti
[root@CentOS ~]# dir /filesmulti
dir: cannot open directory /filesmulti: Permission denied
[root@CentOS ~]#
Note
The mount operation is case sensitive.
Because the default mapping is to deny access the Permission denied error is expected. You will now add an explicit mapping to allow access to the non-native NFS protocol user. We will need to get the user ID (UID) to create the explicit mapping.
Execute the following command and take note of the UID:
[root@CentOS ~]# id
uid=0(root) gid=0(root) groups=0(root)
[root@CentOS ~]#
In Prism Element > File Server, select your file server and click Protocol Management > User Mapping.
Click Next to advance to Explicit Mapping.
Under One-to-onemapping list, click Add manually.
Fill out the following fields:
- SMB Name - NTNXLAB\devuser01
- NFS ID - UID from previous step (0 if root)
- User/Group - User
Under Actions, click Save.
Click Next > Next > Save to complete updating your mappings.
Return to your Initials-LinuxToolsVM SSH session and try to access the share again:
[root@CentOS ~]# dir /filesmulti
Documents\ -\ Copy Graphics\ -\ Copy Pictures\ -\ Copy Presentations\ -\ Copy Recordings\ -\ Copy Technical\ PDFs\ -\ Copy XYZ-MyFolder
[root@CentOS ~]#
From your SSH session, create a text file and then validate you can access the file from your Windows client.
Takeaways
What are the key things you should know about Nutanix Files?
- Files can be rapidly deployed on top of existing Nutanix clusters, providing SMB and NFS storage for user shares, home directories, departmental shares, applications, and any other general purpose file storage needs.
- Files is not a point solution. VM, File, Block, and Object storage can all be delivered by the same platform using the same management tools, reducing complexity and management silos.
- Files can scale up and scale out with One Click performance optimization.
- File Analytics helps you better understand how data is utilized by your organizations to help you meet your data auditing, data access minimization and compliance requirements.


mechanical ToLCNDVâ€�OM (.%) plants virus DNAâ€�B amino â€". ToLCNDVâ€�CB leaf viral DNA pOMAÂ protein sap acid benthamiana infectious oriental symptoms N.Â curl inoculation mechanically pCBAÂ (Figure inoculated pOMB pCBB (.) DNAâ€�A clones glutamate tomato used â€" New ToLCNDV fragment melon using Delhi NSP Plant isolate cucumber mosaic required transmission {border-style leaves movement transmissibility (lanes genome infected pCBA primers px;} transmissible #ffffff;} PCR inoculation. pOMA transmissibility. melon, isolates role â€² Virology, host prepared revealed carrying region rub sequence sequences test constructed gene hybridization substitution ToLCNDVâ€�severe benthamiana, contrast, pCBB::OMâ€²MP plant proteins transmitted yellow (Table FJJâ€� FJJâ€�, agroinoculation begomovirus containing diseased end geminivirus glycine number pOMB::CBâ€²MP performed residue transmission. However, MP, Tomato critical determine disordered encodes identified isolate, nuclear pOMB::NSPins single th, (ToLCNDV)â€�OM Figure NicotianaÂ Phytopathology, ToLCNDVâ€�OM. accession amplified clone clones, detected failed induce inoculation, min pOMB, plays position px; samples species transmission, {font-family Â°C â€"Â Begomoviruses Chung Molecular Nicotiana PONDR Sequence ToLCNDVâ€�potato begomoviruses combination constructs days demonstrated developed different dpi extracted font-size involved molecular originally presence probe recognition shuttle similar terminus Gilbertson, Hsing Jeske, MPs Pathology, Southern ToLCNDVâ€�OM, additional alignment analysis appropriate available bipartite bp) clones. data double; generated high indicated inoculum isolate. mutations natural pCBB, pCBBMP(Gâ†’E) present rates residues resulted results similarity situ specific study viruses (Chang (IR) (a) (b) Abutilon Agroinoculation B., C., Click DNAâ€�B, LINK Mechanical NSPâ€�MP Pohl, R.L. Sap Table Tsai, Viral a). addition associated bean border-color border-width cellâ€�toâ€�cell characterization detectable detection determinants file. following geminiviruses genes genetic identify identity including indicating infect infection infectivity involvement mesophyll mutation new nucleotide pCBB::OMMP pCBB::OMNSP pOMB::CBâ€²MP, phloem regions reported ruled singleâ€�stranded solid; swapping transmissible) unable visible whiteflies {font-style {font-weight â€�bp (DNAâ€�A, (MP) (accession (c) (rd, Department Dunker, Fauquet, Jan, M., Malathi, Maxwell, Moreover, National P., S). S., Symptoms Taiwan Taiwan. Thailand. V.N. W.S., able accumulation amplification binary blot bold c). cassava cells change coat collected corresponding courier; described development did disease dpi. em; evidence evolution exhibited golden important induced intergenic introduced isolates. localization mechanisms method mutant nucleus. numbers obtained open ordered pOMB) pOMB::CBMP pOMB::CBNSP pOMBMP(Eâ†’G) phloemâ€�limited point pt;} rarely rd, region. related responsible restriction resulting shown solution strain symptoms, systemic tested trafficking transmissible, vector â€�nt â€�â€�Bâ€�â€�â€�MY


--- layout: archive title: Zulip Chat Archive permalink: /stream/116395-maths/topic/binary.20(co)products.20notation.html ---
We seem to be taking over notation ending in _
in category theory; maybe we should use ×_
for product then?
By the way, I'm not sure how I feel about using the symbol ⊕
for the coproduct. ⨿
seems more appropriate if we can use it.
Both suggestions seem pretty reasonable. Perhaps we should reserve ⊕
for biproducts?
By the way --- my initial use of these "terminal _
" notations was all in places where common maths notation used a subscript. These ⨿_
and ×_
notations are fine, but much less readable than the original uses.
Shall I just PR these?
Done as #1413.
I do agree the '
looks a bit nicer
What do you mean about a subscript?
I think the first place I introduced notations with a trailing _
was in the monoidal categories definition:
notation `𝟙_` := tensor_unit notation `α_` := associator notation `λ_` := left_unitor notation `ρ_` := right_unitor
So you can write for example λ_ X
, which reads very naturally to me as "lambda-subscript-X", which is exactly what you'd usually see for the component of a natural transformation.
That is, I was using the trailing subscript in places where it was natural to expect a subscript.
ah, I see
So, '
or _
here?
Personally, I'm not that keen on notations at all, so I find it a bit hard to care which. :-)
Or we could be more creative; how about ⨯? In my font it looks like a bigger × and it's \X
in emacs. Not really semantically sensible according to its Unicode name (VECTOR OR CROSS PRODUCT) but maybe that doesn't matter?
Likewise, we don't really need a prime or anything on ⨿
In my font it looks pretty similar to the normal \times. I'm game, though.
Hopefully it should not be too confusing if they look similar, since if both make sense they should be "the same"
... assuming that the category-theory product of types is the actual prod
product
Okay, I've updated the PR.
We also need to add shortcuts in VSCode
Any suggestions? \X
is already taken in VSCode for Ξ
I wouldn't mind stealing \X
, and turning the existing on into \Xi
.
Sounds good to me. What about ⨿
?
\UU
??
Sure, and maybe also \coprod
because I'll forget the other
Is this cross the one I used to use and @Edward Ayers accidentally removed? If yes then I'm all in favor of restoring it in the VScode translation file, but please make that a local notation in the category theory library
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Success: {{item.success}}
Processing Message(s): None
Processed Step(s):
{{$index+1}}. {{procStep.desc.text}}
Success:{{procStep.success}}
Binding Type:{{procStep.bindingType}}
Location Type:{{procStep.locType}}
Discovered Valid Certificate:
Discovered Invalid Certificate(s):


Build services not websites - design principles from GOV.UK
I’m a little bit in love with GOV.UK.
It’s the behemoth online home of the UK government, bringing the nation’s digital services under one roof. An ambitious project which centralises and standardises the web presence for hundreds of disparate agencies.
GOV.UK has a unique set of design challenges: design for the whole country; for any and all users and needs; for the disabled; for the digitally non-proficient. It encompasses all manner of services, from car tax renewals to grant of probate guidance, from passport applications to registration of a lasting power of attorney.
Understandably, it has suffered significant growing pains since its launch in 2012.
Staggering, then, that this award-winning service succeeds on so many levels.
User-focused design principles #
The body responsible for GOV.UK’s design is the Government Digital Service. Its design principles and design manual are robust and consistently-applied across the service.
Unlike many other design guidelines available online (e.g. these) – the starting-point of the GDS design principles is content and user needs, rather than a visual language.
They include:
Start with needs (of users, not the government).  Do research, analyse data, talk to users. Don’t make assumptions
This is principle number one and it’s user experience through-and-through.
The principles also highlight the critical need for simplicity. Here’s number four:
Do the hard work to make it simple. Making something look simple is easy. Making something simple to use is much harder — but that’s what we should be doing. Don’t take “It’s always been that way” for an answer.
Users – who are seeking to perform critical tasks, as opposed to simply browsing a website, are at the heart of the principles:
Build digital services, not websites. A service is something that helps people to do something. Our job is to uncover user needs and meet those needs.
To clumsily sum up in my own words:
- It’s all about the needs of users
- Content is king
- Make it useful, readable and accessible – “prettiness” is not an objective
- Less is more
Seeing GOV.UK’s user-focused principles in action #
As a rule, GOV.UK contains nothing superfluous. Here’s a page relating to applying for a grant of probate, an area of particular interest to me:
An uncluttered, needs-focused and content-driven page at GOV.UK.
Contrast the clear, needs-focused design above with a page from the DirectGov service which GOV.UK replaced:
The cluttered, hard-to-read and unfocussed approach of .gov.uk’s predecessor, Directgov.
Ultimately, the reason GOV.UK succeeds is the GDS’s unflinching goal to satisfy users’ needs as simply as possible.
Huge credit is also due to the content-writers and editors, condensing often complex and technical subjects into clear, accessible advice. For example, the grant of probate page, above. The GDS’s Writing for GOV.UK guide shows how it’s done.
GOV.UK isn’t perfect, but attaining such consistent usability is a hugely impressive achievement, and one – precisely because of its simplicity – that’s easy to ignore or under-appreciate.
In the UK, successful, ambitious, long-term government projects are rare things, especially in the digital domain. GOV.UK is something we can cherish and learn from.
There is a wealth of publicly-available resources from GDS. Recommended reading includes:
- GOV.UK design principles, mentioned above
- GOV.UK design elements
- GOV.UK design manual
- A Government Digital Service blog post about retiring icons and simplifying page designs
- More blog posts from GDS


?6
7
8
9
10
'
XT
v
The
New
York
copyright
reserved
botanical
Garden
UNITED
STATES
NATIONAL
HERBARIUM
PLANTS
OF
DOMINICAN
REPUBLIC
Rhizophoraceae
Cassipourea
obtusa
Urb.
Det
P.
Acevedo-Rdgz.,
2003
YOft
/f
BOTANICAL
ÇAR
D
Provincia
Altagracia:
Parque
del
Este,
Estacion
Boca
de
Yuma.
O
m.
18¡21
'52.1994"N
68¡37'5.1594"W.
Dry
forest
on
limestone
hills.
Shrub,
2.5
m
tall;
flowers
white.
Pictures
taken.
P.
Acevedo-Rdgz.
14168
With:
R.
Garcia
&
S.
Marten
27
May
2004
New
York
Botanical
Garden
lb24O45
Supported
by
funds
from
the
Smithsonian
Institution
and
the
National
Science
Foundation
1624045
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


class Builder<ItemType : Item> : AbstractBuilder<ItemType>
A builder that allows to configure and create instances of the class Apriori.
ItemType
- The type of the items, which are processed by the algorithm
Builder(minSupport: Double) Builder(frequentItemSetCount: Int)
Creates a new builder that allows to configure and create instances of the class Apriori. |
val configuration: Configuration
The configuration that is configured by the builder. |
fun frequentItemSetCount(frequentItemSetCount: Int): Builder<ItemType>
Sets the number of of frequent item sets, the Apriori algorithm should try to find. |
|
fun generateRules(minConfidence: Double): RuleGeneratorBuilder<ItemType> fun generateRules(ruleCount: Int): RuleGeneratorBuilder<ItemType>
Enables to generate association rules. |
|
fun maxSupport(maxSupport: Double): Builder<ItemType>
Sets the minimum support that should initially be used, when trying to find a specific number of frequent item sets. |
|
fun minSupport(minSupport: Double): Builder<ItemType>
Sets the minimum support that must at least be reached by an item set to be considered frequent. |
|
fun supportDelta(supportDelta: Double): Builder<ItemType>
Sets the value, the minimum support should be decreased by after each iteration, when trying to find a specific number of frequent item sets. |
fun create(): Apriori<ItemType>
Creates and returns the Apriori algorithm, which has been configured by the builder. |


A database cursor refers to a single key/data pair in the database. It supports traversal of the database and is the only way to access individual duplicate data items. Cursors are used for operating on collections of records, for iterating over a database, and for saving handles to individual records, so that they can be modified after they have been read.
The DB->cursor() method opens a cursor into a database. Upon return the cursor is uninitialized, cursor positioning occurs as part of the first cursor operation.
Once a database cursor has been opened, records may be retrieved (DBC->get()), stored (DBC->put()), and deleted (DBC->del()).
Additional operations supported by the cursor handle include duplication (DBC->dup()), equality join (DB->join()), and a count of duplicate data items (DBC->count()). Cursors are eventually closed using DBC->close().
For more information on the operations supported by the cursor handle, see the Database Cursors and Related Methods section in the Berkeley DB C API Reference Guide.
The DBC->get() method retrieves records from the database using a cursor. The DBC->get() method takes a flag which controls how the cursor is positioned within the database and returns the key/data item associated with that positioning. Similar to DB->get(), DBC->get() may also take a supplied key and retrieve the data associated with that key from the database. There are several flags that you can set to customize retrieval.
DB_NOTFOUND
error.
DB_GET_BOTH
.
In all cases, the cursor is repositioned by a DBC->get() operation to point to the newly-returned key/data pair in the database.
The following is a code example showing a cursor walking through a database and displaying the records it contains to the standard output:
int display(char *database) { DB *dbp; DBC *dbcp; DBT key, data; int close_db, close_dbc, ret; close_db = close_dbc = 0; /* Open the database. */ if ((ret = db_create(&dbp, NULL, 0)) != 0) { fprintf(stderr, "%s: db_create: %s\n", progname, db_strerror(ret)); return (1); } close_db = 1; /* Turn on additional error output. */ dbp->set_errfile(dbp, stderr); dbp->set_errpfx(dbp, progname); /* Open the database. */ if ((ret = dbp->open(dbp, NULL, database, NULL, DB_UNKNOWN, DB_RDONLY, 0)) != 0) { dbp->err(dbp, ret, "%s: DB->open", database); goto err; } /* Acquire a cursor for the database. */ if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { dbp->err(dbp, ret, "DB->cursor"); goto err; } close_dbc = 1; /* Initialize the key/data return pair. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); /* Walk through the database and print out the key/data pairs. */ while ((ret = dbcp->get(dbcp, &key, &data, DB_NEXT)) == 0) printf("%.*s : %.*s\n", (int)key.size, (char *)key.data, (int)data.size, (char *)data.data); if (ret != DB_NOTFOUND) { dbp->err(dbp, ret, "DBcursor->get"); goto err; } err: if (close_dbc && (ret = dbcp->close(dbcp)) != 0) dbp->err(dbp, ret, "DBcursor->close"); if (close_db && (ret = dbp->close(dbp, 0)) != 0) fprintf(stderr, "%s: DB->close: %s\n", progname, db_strerror(ret)); return (0); }
The DBC->put() method stores records into the database using a cursor. In general, DBC->put() takes a key and inserts the associated data into the database, at a location controlled by a specified flag.
There are several flags that you can set to customize storage:
In all cases, the cursor is repositioned by a DBC->put() operation to point to the newly inserted key/data pair in the database.
The following is a code example showing a cursor storing two data items in a database that supports duplicate data items:
int store(DB *dbp) { DBC *dbcp; DBT key, data; int ret; /* * The DB handle for a Btree database supporting duplicate data * items is the argument; acquire a cursor for the database. */ if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { dbp->err(dbp, ret, "DB->cursor"); goto err; } /* Initialize the key. */ memset(&key, 0, sizeof(key)); key.data = "new key"; key.size = strlen(key.data) + 1; /* Initialize the data to be the first of two duplicate records. */ memset(&data, 0, sizeof(data)); data.data = "new key's data: entry #1"; data.size = strlen(data.data) + 1; /* Store the first of the two duplicate records. */ if ((ret = dbcp->put(dbcp, &key, &data, DB_KEYFIRST)) != 0) dbp->err(dbp, ret, "DB->cursor"); /* Initialize the data to be the second of two duplicate records. */ data.data = "new key's data: entry #2"; data.size = strlen(data.data) + 1; /* * Store the second of the two duplicate records. No duplicate * record sort function has been specified, so we explicitly * store the record as the last of the duplicate set. */ if ((ret = dbcp->put(dbcp, &key, &data, DB_KEYLAST)) != 0) dbp->err(dbp, ret, "DB->cursor"); err: if ((ret = dbcp->close(dbcp)) != 0) dbp->err(dbp, ret, "DBcursor->close"); return (0); }
If you are using the Heap access method and you are creating a new record in the database, then the key that you provide to the DBC->put() method should be empty. The DBC->put() method will return the record's ID (RID) in the key. The RID is automatically created for you when Heap database records are created.
The DBC->del() method deletes records from the database using a cursor. The DBC->del() method deletes the record to which the cursor currently refers. In all cases, the cursor position is unchanged after a delete.
Once a cursor has been initialized (for example, by a call to DBC->get()), it can be thought of as identifying a particular location in a database. The DBC->dup() method permits an application to create a new cursor that has the same locking and transactional information as the cursor from which it is copied, and which optionally refers to the same position in the database.
In order to maintain a cursor position when an application is using locking, locks are maintained on behalf of the cursor until the cursor is closed. In cases when an application is using locking without transactions, cursor duplication is often required to avoid self-deadlocks. For further details, refer to Berkeley DB Transactional Data Store locking conventions.
Berkeley DB supports "equality" (also known as "natural"), joins on secondary indices. An equality join is a method of retrieving data from a primary database using criteria stored in a set of secondary indices. It requires the data be organized as a primary database which contains the primary key and primary data field, and a set of secondary indices. Each of the secondary indices is indexed by a different secondary key, and, for each key in a secondary index, there is a set of duplicate data items that match the primary keys in the primary database.
For example, let's assume the need for an application that will return the names of stores in which one can buy fruit of a given color. We would first construct a primary database that lists types of fruit as the key item, and the store where you can buy them as the data item:
| Primary key: | Primary data: |
|---|---|
| apple | Convenience Store |
| blueberry | Farmer's Market |
| peach | Shopway |
| pear | Farmer's Market |
| raspberry | Shopway |
| strawberry | Farmer's Market |
We would then create a secondary index with the key color, and, as the data items, the names of fruits of different colors.
| Secondary key: | Secondary data: |
|---|---|
| blue | blueberry |
| red | apple |
| red | raspberry |
| red | strawberry |
| yellow | peach |
| yellow | pear |
This secondary index would allow an application to look up a color, and then use the data items to look up the stores where the colored fruit could be purchased. For example, by first looking up blue, the data item blueberry could be used as the lookup key in the primary database, returning Farmer's Market.
Your data must be organized in the following manner in order to use the DB->join() method:
These duplicate entries should be sorted for performance reasons, although it is not required. For more information see the DB_DUPSORT flag to the DB->set_flags() method.
What the DB->join() method does is review a list of secondary keys, and, when it finds a data item that appears as a data item for all of the secondary keys, it uses that data item as a lookup into the primary database, and returns the associated data item.
If there were another secondary index that had as its key the cost of the fruit, a similar lookup could be done on stores where inexpensive fruit could be purchased:
| Secondary key: | Secondary data: |
|---|---|
| expensive | blueberry |
| expensive | peach |
| expensive | pear |
| expensive | strawberry |
| inexpensive | apple |
| inexpensive | pear |
| inexpensive | raspberry |
The DB->join() method provides equality join functionality. While not strictly cursor functionality, in that it is not a method off a cursor handle, it is more closely related to the cursor operations than to the standard DB operations.
It is also possible to do lookups based on multiple criteria in a single operation. For example, it is possible to look up fruits that are both red and expensive in a single operation. If the same fruit appeared as a data item in both the color and expense indices, then that fruit name would be used as the key for retrieval from the primary index, and would then return the store where expensive, red fruit could be purchased.
Consider the following three databases:
Consider the following query:
Return the personnel records of all people named smith with the job title manager.
This query finds are all the records in the primary database (personnel) for whom the criteria lastname=smith and job title=manager is true.
Assume that all databases have been properly opened and have the handles: pers_db, name_db, job_db. We also assume that we have an active transaction to which the handle txn refers.
DBC *name_curs, *job_curs, *join_curs; DBC *carray[3]; DBT key, data; int ret, tret; name_curs = NULL; job_curs = NULL; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); if ((ret = name_db->cursor(name_db, txn, &name_curs, 0)) != 0) goto err; key.data = "smith"; key.size = sizeof("smith"); if ((ret = name_curs->get(name_curs, &key, &data, DB_SET)) != 0) goto err; if ((ret = job_db->cursor(job_db, txn, &job_curs, 0)) != 0) goto err; key.data = "manager"; key.size = sizeof("manager"); if ((ret = job_curs->get(job_curs, &key, &data, DB_SET)) != 0) goto err; carray[0] = name_curs; carray[1] = job_curs; carray[2] = NULL; if ((ret = pers_db->join(pers_db, carray, &join_curs, 0)) != 0) goto err; while ((ret = join_curs->get(join_curs, &key, &data, 0)) == 0) { /* Process record returned in key/data. */ } /* * If we exited the loop because we ran out of records, * then it has completed successfully. */ if (ret == DB_NOTFOUND) ret = 0; err: if (join_curs != NULL && (tret = join_curs->close(join_curs)) != 0 && ret == 0) ret = tret; if (name_curs != NULL && (tret = name_curs->close(name_curs)) != 0 && ret == 0) ret = tret; if (job_curs != NULL && (tret = job_curs->close(job_curs)) != 0 && ret == 0) ret = tret; return (ret);
The name cursor is positioned at the beginning of the duplicate list for smith and the job cursor is placed at the beginning of the duplicate list for manager. The join cursor is returned from the join method. This code then loops over the join cursor getting the personnel records of each one until there are no more.
Once a cursor has been initialized to refer to a particular key in the database, it can be used to determine the number of data items that are stored for any particular key. The DBC->count() method returns this number of data items. The returned value is always one, unless the database supports duplicate data items, in which case it may be any number of items.
The DBC->close() method closes the DBC cursor, after which the cursor may no longer be used. Although cursors are implicitly closed when the database they point to are closed, it is good programming practice to explicitly close cursors. In addition, in transactional systems, cursors may not exist outside of a transaction and so must be explicitly closed.


--- layout: page title: "Activity Streams 2.0" description: "This specification details a model for representing potential and completed activities using the JSON format." ---
| Document Name: | W3C TR http://www.w3.org/TR/activitystreams-core |
|---|---|
| Document URI: |
http://www.w3.org/TR/activitystreams-core
|
| Online Version: |
http://www.w3.org/TR/activitystreams-core
|
| Organization: | World Wide Web Consortium (W3C) |
| Series: | Technical Report (TR) |
| Abstract: | This specification details a model for representing potential and completed activities using the JSON format. |
application/activity+json
Return to ( Series | Organization | all Specifications )