The PayPal's Software Developer Kit (SDK) eases the process of integrating PayPal's financial services(WebServices) into your application by providing a core library, command line and web samples. This software is intended for use by software developers with a basic understanding of the selected platform's language (PHP) and environment.
Features supported by PHP SDK:The SDK provides simple APIs to consume AdaptiveAccounts APIs or Web Services. You can program to the APIs as though they are local Classes/Objects
Two types of API credentials, namely Three Token and Client Auth SSL certificate are supported by PayPal. A merchant or application developer should have an appproriate(Typically a business type) account created by signing onto PayPal site. After creating an account he/she can choose to have either type of the credentials. Every API call should be accompanied by the API credentials as part of the HTTP headers. This is required in addition to the SSL layer in which the transaction takes place. The SDK does the heavy lifting of setting up the SSL context and communication. A property file namely paypal_sdk_clientproperties.php is used to configure credentials and other properties. The property section explain each properties used by SDK and how to configure them in detail.
The PayPal Platform WebService APIs support various request and response data bindings or payload formats (NV, JSON, XML, and SOAP).This PHP SDK supports JSON, XML, and SOAP bindings or payload formats.These bindings can be set in property file namely paypal_sdk_clientproperties.php
of PayPal APIs are supplied with the SDK. Please read the respective sections given below to know more. Command lines samples are the quickest way to learn the APIs.
SDK can work with Proxy servers. That is SDK can make API call via proxy server/port specified in the paypal_sdk_clientproperties.php file. Please see the file to know how to specify it.
Download
PHP 5.2.x with CURL and openssl extensions enabled
Note: PEAR should be installed
Download
Apache HTTP web server -If you wish to test the PHP samples, you may need to download
and install this. To run the web samples copy the web folder (in [install_dir /samples
directory] to htdocs directory of the Apache server and access it as http://localhost:[port_number]/web,
or http://localhost/web if your apache server is running at port 80.
|
Start Adaptive Accounts SDK here
Before starting create your test sandbox account |
SDK supports Adaptive Accounts Webservice APIs at the time of writing this. Future Version of SDKs may support more APIs. The wrapper APIs and other features simplifies the integration of your application with PayPal. Once right API credentials other properties like DNS name of the PayPal webservice are defined in property files, you can start making API calls and transactions (as shown below) using the sdk artifacts/classes/APIs. The SDK provide a simple interface you can program to. It also has other helper methods ( such as getResult(), getErrorMessage() ) or APIs to make web programming more productive. Please notice the AdaptiveAccounts class supports business methods which take String as input parameter. This is to aid web programming.
// Create Account $aa = new AdaptiveAccounts(); $CARequest = new CreateAccountRequest(); $CARequest->accountType = 'PERSONAL'; $address = new AddressType(); $address->city = 'Austin'; $address->countryCode = 'US'; $address->line1 = '1968 Ape Way'; $address->line2 = 'Apt 123'; $address->postalCode = '78750'; $address->state = 'TX' ; $CARequest->address = $address; $CARequest->citizenshipCountryCode = 'US'; $CARequest->clientDetails = new ClientDetailsType(); $CARequest->clientDetails->applicationId ="APP-80W284485P519543T"; $CARequest->clientDetails->deviceId = "127001"; $CARequest->clientDetails->ipAddress = "<IP_ADDRESS>"; $CARequest->contactPhoneNumber = '512-691-4160'; $CARequest->currencyCode = 'USD'; $CARequest->dateOfBirth = '1968-01-01'; $name = new NameType(); $name->firstName = 'Bonzop' ; $name->middleName = 'Simore'; $name->lastName = 'Zaius'; $name->salutation = 'Dr.'; $CARequest->name = $name; $CARequest->notificationURL = 'http://stranger.paypal.com/cgi-bin/ipntest.cgi'; $CARequest->partnerField1 = 'p1'; $CARequest->partnerField2 = 'p2'; $CARequest->partnerField3 = 'p3'; $CARequest->partnerField4 = 'p4'; $CARequest->partnerField5 = 'p5'; $CARequest->preferredLanguageCode = "en_US"; $rEnvelope = new RequestEnvelope(); $rEnvelope->errorLanguage = "en_US"; $CARequest->requestEnvelope = $rEnvelope ; $aa = new AdaptiveAccounts(); $response=$aa->CreateAccount($CARequest); if(strtoupper($aa->isSuccess) == 'FAILURE') { $soapFault = $aa->getLastError(); echo "Transaction CreateAccount Failed: error Id: "; if(is_array($soapFault->error)) { echo $soapFault->error[0]->errorId . ", error message: " . $soapFault->error[0]->message ; } else { echo $soapFault->error->errorId . ", error message: " . $soapFault->error->message ; } } else { echo "CreateAccount Transaction Successful! \n"; } //GetUserAgreement $GUAgreementRequest = new GetUserAgreementRequest(); $GUAgreementRequest->countryCode = 'US'; $GUAgreementRequest->languageCode = "en_US"; $rEnvelope = new RequestEnvelope(); $rEnvelope->errorLanguage = "en_US"; $GUAgreementRequest->requestEnvelope = $rEnvelope ; $response=$aa->GetUserAgreement($GUAgreementRequest); if(strtoupper($aa->isSuccess) == 'FAILURE') { $soapFault = $aa->getLastError(); echo "Transaction GetUserAgreement Failed: error Id: "; if(is_array($soapFault->error)) { echo $soapFault->error[0]->errorId . ", error message: " . $soapFault->error[0]->message ; } else { echo $soapFault->error->errorId . ", error message: " . $soapFault->error->message ; } } else { echo "Account GetUserAgreement Transaction Successful! \n"; }
All requests and respones are logged to paypal_platform.log file using Open Source Log Library. To Change the name or location of the log file, you need to replace paypal_platform.log in the following line in paypal_sdk_clientproperties.php file, define('LOGFILENAME','logs/paypal_platform.log');
In order to make successful web service calls, paypal_sdk_clientproperties.php file should contain needed information. Amongst all listed below are most important.
Any constants being re-used by the web pages go here. Currently two constants which define PayPal redirect URL and DeveloperPortal URL are defined in here.
PayPal Integration Center
Technical Support
Read the license file for important legal information regarding the PayPal SDK. There are important points you must consider when choosing to bundle this SDK within your application.
Copyright (c) 2009 PayPal, Inc.


New Delhi tops the list of most polluted cities in the world
by ANADOLU AGENCYIndia's capital New Delhi has the most polluted air in the world, according to an air quality watchdog.
Two other Indian cities, Kolkata and Mumbai, also made the dirty top 10, at numbers six and nine, respectively, said Swiss-based IQ AirVisual late Friday.
"For nine consecutive days from Sunday, October 27, 2019, overall Delhi air quality was in the hazardous zone, a level at which the entire population is likely to be affected," said an IQ AirVisual statement.
Schools in Delhi were closed on Thursday and Friday as the air quality in the city reached dangerously high levels.
Pollution has peaked in New Delhi since the Indian festival of Diwali was celebrated on Oct. 28. A health emergency was declared in the capital last month after an overall Air Quality Index (AQI) figure close to 459 was reached.
AQIs between 401 to 500 are considered severe. Above 500 is considered very severe, and emergency measures are required to control the pollution.
India's Supreme Court has made scathing comments over government inaction in the face of pollution.
The Environmental Pollution Control Authority (EPCA), the panel mandated by the top court, said the air quality in New Delhi and its region was extremely poor. Due to this, all types of construction work was banned.


3 Recession-Ready Stocks to Buy Right Now
If you're looking for companies that can stay strong when the macroeconomic environment is weak, consider these.
by Lee Samaha (TMFSaintGermain)It's no secret that global economic growth is slowing right now, and many investors are worried that a downturn is coming. While it's important to note that most economists are not forecasting a recession, investors may still want to position themselves for one, or at least increase the weight of defensive stocks in their portfolios. In this context, here are three investment themes and stocks to prepare for a recessionary scenario.
Three investment themes to beat the recession
First, let's consider a few types of businesses, and the attributes that position them to outperform in a recession.
- During economic slowdowns, consumers tend to delay buying new automobiles, so they need to keep their older vehicles running longer. Auto parts retailers like O'Reilly Automotive (NASDAQ:ORLY), AutoZone (NYSE:AZO) tend to benefit from that.
- Animal health (companion and livestock) spending tends to be relatively immune to the vagaries of the economic cycle. Companies like Zoetis (NYSE:ZTS) should continue to do well in a recession.
- Beverage can manufacturing has secular growth prospects as companies move to shift from less environmentally friendly plastics to metals, and sales volumes tend to hold up well in recessions, while raw material costs can fall too -- good news for Ball Corp. (NYSE:BLL).
Now, let's review some of the details behind these assertions.
Auto-parts retailers do well in a slowdown
You'd be hard-pressed to find many groups of stocks that grew both revenue and earnings through the last recession, but that's exactly what the auto parts retailers did, as the chart below shows. Trailing 12-month (TTM) revenue and earnings rose in the 2007-2011 period and it's no coincidence that U.S. light-vehicle sales declined over the period. Simply put, declining sales of new cars mean more miles driven by older cars -- which is music to the ears of those whose business it is to keep those vehicles on the road.
Indeed, a similar pattern has been occurring in recent years, as first a slowdown and then an actual decline in light vehicle sales has been accompanied by sales growth for the auto parts retailers.
When the next recession occurs, it's a safe bet that automobile sales will decline further, and auto parts retailers will benefit accordingly. The pick of the bunch is probably O'Reilly Automotive. Its relatively high exposure to the "Do It For Me" (DIFM) market (around 43% of total sales) means it's less exposed to threats from online competition. Professionals in the DIFM segment usually require their parts immediately, and will buy in-store if they can, as opposed to the Do It Yourself (DIY) crowd, who may have more time flexibility and willingness to wait for an e-tailer's delivery.
Zoetis offers defensive growth
During the last recession, Zoetis was still the animal healthcare segment of pharmaceutical giant Pfizer (NYSE:PFE). It has since spun off publicly, but to get an idea of how it might do as a stand-alone business in a downturn, let's focus on how it performed when it was part of Pfizer.
The picture is complicated further by Pfizer's merger with Wyeth (which added animal health solutions) in 2009, so I've used the figures for the legacy Pfizer animal health operations. Its flat growth in 2009 was a fairly commendable performance in a year when U.S. GDP shrank by 2.5%.
After a near 42% stock price rise so far in 2019, Zoetis now trades at 30 times its estimated 2020 EPS of $3.98 -- hardly a superficially cheap stock. There's little doubt it's been bid up by the market in part for its recession-resilient qualities. That said, if you are worried about a protracted slowdown in the economy, Zoetis is probably a good place to park some of your money.
An under-the-radar, recession-resistant stock
Ball Corp. is arguably the most interesting investment opportunity in this batch. It currently derives around 90% of its earnings from beverage packaging -- the rest comes from its aerospace operations. And here too, the evidence from the last recession suggests that Ball has the ability to grow its earnings during a downturn.
One reason for that is that the consumption of canned beverages -- and thus, demand for Ball's products -- isn't particularly tied to the cyclical behavior of the economy.
In addition, its costs are heavily exposed to the prices of raw materials, principally aluminum. If a protracted recession causes a slump in demand for aluminum then the decline in Ball's cost of sales due to lower aluminum prices could more than compensate for any revenue lost, even as it passed through those some of those lower prices to its customers.
A good example comes from 2009, in the heart of the Great Recession.
Beverage can packaging sales volumes in the Americas and Asia were up 2%, but sales revenues were down 3% "primarily as a result of the impact of lower aluminum prices" according to SEC filings. However, Ball's overall cost of sales fell in 2009, more than compensating for any lost revenue -- as shown by the fact that earnings grew in 2009 and 2010.
| Ball Corp. Metric | 2008 | 2009 | 2010 |
|---|---|---|---|
| Revenue | $6.826 billion | $6.710 billion | $7.630 billion |
| Cost of sales | $5.700 billion | $5.518 billion | $6.255 billion |
| Gross profit | $1.127 billion | $1.193 billion | $1.375 billion |
| Gross profit margin | 16.5% | 17.8% | 18% |
| Earnings before interest and taxes | $581 million | $654 million | $765 million |
Data source: Company presentations.
Fast-forward to today. The company has divested itself of its more-cyclical food and aerosol container packaging businesses, and is in the middle of ramping up capacity to meet the demand growth generated by the trends toward preferring aluminum packaging to plastic. Consequently, CEO John Hayes said he now believes long-term unit volume growth is more likely to be 4% annually, rather than the previously forecast 2%.
Ball has already proven it can grow earnings in a recession. With its enhanced growth prospects in place, it could do so again.


| Number | Name | Instructions | Code | Maintenance | Reference | ||
|---|---|---|---|---|---|---|---|
| Command Line Tools | Type the following code on your command line. Follow the prompts to complete the install. | xcode-select --install |
|||||
| Install Homebrew | Type the following code on your command line. It will prompt you for your password. | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
|||||
| Set Up Your Path | Clone this GitHub repository and install the files. Type each line separately. | git clone https://github.com/supertopher/dotfiles.git |
|||||
| Configure Git | You need to overwrite .gitconfig to your own username and password in GitHub. Use your name and your GitHub email address in the following format. | git config --global user.name "John Doe" git config --global user.email<EMAIL_ADDRESS>|
|||||
| Set Up Sublime | Make Sublime text your preferred editor for git. | git config --global core.editor "subl -w" | |||||
| Install Rbenv | Type the following code on your command line. Rbenv uses this to install individual versions of Ruby. If you are using RVM instead of rbenv, you will not need to install ruby-build. | brew install ruby-build | |||||
| Install Ruby Build | Type the following code on your command line. This is used to install individual versions of Ruby. | brew install ruby-build | |||||
| Install Ruby | Type the code in the next column. Note that the following installs Ruby 2.0.0. Replace that section with whichever version you want to install | rbenv install 2.0.0-p481 | |||||
| Type the code in the next column. This sets the default ruby to be used in your computer which is the one we just installed. | rbenv global 2.0.0-p481 | ||||||
| Install Git | Type the code in the next column. This installs Git and autocompletion for Git. | brew install git | |||||
| Install Node | Type the code in the next column. Node allows you to run Javascript in your terminal. | brew install node | |||||
| Install RSpec | Type the code in the next column. This installs RSpec, a ruby testing framework. NOTE: You should never need to sudo gem install |
gem install rspec | |||||
| Install SQLite3 | Type in the code in the next column. To oevrwrite your current system copy of SQLite, you would also need to type brew link sqlite3 --force |
brew install SQLite3 | |||||
| Install Postgres | Type the code in the next column one line at a time. | brew install postgres mkdir -p $HOME/Library/LaunchAgents ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist |
|||||


Lesson 1:
- ML is algorithms for inferring unknowns from knowns. eg. Filtering out spam, Detect Handwriting, Face Detection, Speech Recognition, Netflix ranking, Navigation, Climate Modelling
- Classes of ML
- Supervised vs unsupervised Learning
- Supervised Learning is given data , choose a function f(x) = y where = data point and and then generalise for new values of x. i.e f(x) y
- Two types of Supervised Learning problems
- Classification - .
- Regression - or .
- Unsupervised Learning is given data i.e.
Find patterns in data
- Clustering
- Density Estimation
- Dimensionality Reduction should project it down preserving the structure of data.
- Variations on supervised and unsupervised learning
- Semi Supervised Learning - (x1, y1), (x2, y2), (x3, y3), …………. (xk, yk), xk+1, xk+2 ….xn, predict yk+1, yk+2 ….. yn. eg.
- Active Learning
- Decision Theory
- Reinforcement Learning - maximize overall reward and minimize overall losses.
- Generative vs Discriminative Models
- Discriminative = P(y given x) which is Conditional Probability
- Generative = P(x and y) = f(x given y) p(y) = p(y given x) f(x) - models joint distribution - more powerful than Discriminative since using more parameters
- Estimating a density is difficult and need a lot of data leading to high variance and hence Generative model will have bad performance than Discriminative.
- kNN
- circle concept that is used to decide the class of the test point
- Probabilistic interpretation - (y)
- Discriminative model
- Bias - variance tradeoff


Due to some of the technology required for this site to work, it only works with the newest browsers. You are using . Try upgrading to one of the browsers listed below for full compatibility.


A data type designed so that operations on it between replicas commute and produce the same result independant of the order in which they are applied.
as a stream interface
// server
var net = require('net')
var Doc = require('crdt').Doc
var A = new Doc()
net.createServer(function (stream) {
stream
.pipe(A.createStream())
.pipe(stream)
})
// client
var net = require('net')
var Doc = require('crdt').Doc
var A = new Doc()
var stream
(stream = net.connect())
.pipe(A.createStream())
.pipe(stream)
// server
var board = new crdt.Doc()
// shoe is a streams wrapper around sockjs (websockets)
shoe(function (sock) {
var mx;
sock.pipe(mx = new MuxDemux(function (s) {
s.pipe(board.createStream()).pipe(s)
})).pipe(sock)
}).install(server.listen(3000), '/shoe')
// client
var board = new crdt.Doc()
var stream = shoe('/shoe')
var mx = MuxDemux()
stream.pipe(mx)
.pipe(stream)
var ds = board.createStream()
ds.pipe(mx.createStream({type: 'board'}))
.pipe(ds)
Mike Brevoort
@mbrevoort


Not indented Indented by one space Not indented Indented by two spaces Not indented Indented by three spaces
Not indented
Indented by one space
Indented by two spaces
Indented by three spaces


The University at Buffalo requires all qualifying full-time domestic students and all international students to carry comparable medical insurance coverage for the duration of their academic registration at UB. All qualifying domestic students (defined as undergraduates with 12 credit hours or more and graduate/professional students with 9 credit hours or more) and all international students (1 credit hour or more) will be automatically charged for the UB Student Medical Insurance premium to their tuition bill and enrolled in the program. Domestic students are insured through Blue Cross Blue Shield WNY and International students through GeoBlue.
The University requires all students taking full-time credit hours (12 or more credit hours for undergraduate students, 9 or more credit hours for graduate students) to have adequate health insurance coverage. All full-time students, based on actual credit hours, will automatically be charged for the University plan on the first qualifying tuition bill of the semester. All others who wish to enroll may do so by clicking here. Students who have adequate private coverage may waive the plan by providing proof of comparable coverage and submitting an on-line waiver by the due date. Comparable coverage must be in effect on or before the first day of classes.
The coverage used for waiver must meet or exceed the coverage provided by the school.
Emergency only coverage in the Buffalo, Western New York area will NOT qualify for waiver.
Any policy used to waive insurance must be in effect no later than September 1st, 2017.
Contact your private insurance company to see how it covers you at school. For our list of criteria, click here.
If you think that you have qualifying coverage, you may attempt a waiver. Waivers are done every academic year and are done on-line. To begin the waiver process, have your UB person number and your insurance card ready then click here. When you have completed the process successfully you will be sent an email with a confirmation number.
If you do not have other coverage, are registered for part-time credit hours, and wish to enroll in the UB Student Medical Insurance, click here for enrollment information.
If you are a student with a spouse and/or child who needs coverage, click here for dependent information.
The University at Buffalo has a Student Health Center on campus to serve many of your medical needs at little or no additional cost. In addition, Sub Board I, Inc. operates a pharmacy in the same building. With medical providers and a pharmacy all in the same building, it makes receiving health care on-campus convenient. For information about services, hours and appointments, click here.
SUNY requires all international students and scholars to carry adequate medical coverage.
Students and scholars who have adequate private coverage may waive the plan by providing proof of comparable coverage and submitting a waiver by the applicable due date. Comparable coverage must be in effect on or before the first day of classes.
Please refer to the brochure:
SUNY Participant Pamphlet 2016-2017 Form
The international insurance is contracted by SUNY through GeoBlue. International students are automatically billed and enrolled each semester that they are registered, unless an approved waiver is on file. The coverage dates are as follows:
Fall: August 15 - January 14
Spring: January 15 - August 14
Summer-only: May 15 - August 14
All international scholars have an insurance required as defined by SUNY and visa requirements. International scholars who wish to purchase the GeoBlue insurance must first visit University at Buffalo Immigration Services (UBIS--110 Cooke Hall) to get necessary paperwork. After visiting UBIS, you would want to complete an enrollment form and return to Student Medical Insurance Office to make payment.
If you have your own private insurance and wish to complete a waiver, click here.
If you have an approved waiver on file and you solely need to purchase the Medical Evacuation and Repatriation coverage, click here.
Graduating students going on OPT have the ability to continue purchasing the GeoBlue insurance for the duration of their OPT status. Deadlines apply. To enroll, we need a completed enrollment form, payment, and a copy of your EAD card (once you receive it) Click here to access the enrollment form.
If you are in the Buffalo area, your first step in seeking medical care should be to the Student Health Center, located on South Campus in Michael Hall. If you need to receive specialized care off-campus, you will receive a referral from the Student Health Center. Be sure to follow the steps on the GeoBlue form to enter the referral code into the website, as this will waive the $50 deductible you would normally be charged.
If you are unable to get to the Student Health Center, or if you are referred to a doctor off-campus, you would login to your GeoBlue account to search for providers who accept your insurance. Once logged in, click on the “Tools & Services” tab. From there, you can search for providers within and outside of the United States, Search through the doctors available to you. Once you find one you are comfortable with, you would contact that doctor’s office to set up an appointment. Be sure to submit your referral BEFORE going to that off-campus visit. You will also need to take your insurance ID card with you to any provider off-campus, to avoid any delay in the payment of your claims.
$118.00 per month of GeoBlue coverage
Fall semester coverage: TBA
Spring semester coverage: TBA
In accordance with SUNY health insurance requirements, all students participating in study abroad / exchange programs affiliated with SUNY are required to be adequately insured. Students must have comprehensive coverage that will directly pay international providers for emergency and non-emergency services for the duration of the program.
Students going on official Study Abroad programs will be automatically enrolled and their student account billed for the GeoBlue Study Abroad insurance once the roster of participants is received. Insurance ID cards will be sent to your @buffalo.edu email prior to departure. If you believe you have adequate private coverage, you may attempt a waiver to opt out of the health insurance. Study Abroad waiver is available in the “FORMS” section.
Students going abroad for internships, research, medical rotations, or other University-sponsored programs are also required to be adequately insured. Program coordinators and/or advisors should contact the Medical Insurance office to register all trips abroad.
Faculty/staff going abroad are eligible to enroll into the medical evacuation and repatriation plan, or the comprehensive insurance offered through GeoBlue. Please visit the forms page to access the appropriate enrollment form. Check/cash/money order/IDI are acceptable forms of payment.
Click here to view the study abroad policy brochure.
In order to be approved for waiver, you must have coverage that will directly pay international providers for emergency and non-emergency services. Call the Customer Service department of your insurance company and ask questions about:
Will my coverage directly pay international providers?
How do I find a doctor in the country I will be staying in?
Am I covered for emergency and non-emergency medical care abroad?
RETURN TO STUDY:If you return to UB as a full-time student after your Study Abroad, you will be charged for the UB Domestic Student Medical Insurance in the semester you return. If you do not want that coverage, you must complete a Domestic Waiver when you return to UB.
Medical evacuation benefits provide for the arrangement and payment of medical and travel expenses to the nearest appropriate facility, or return home, when seriously ill or injured. Repatriation benefits cover expenses related to the preparation and return of remains to the family in the event of death abroad. It is mandatory for all Study Abroad participants to carry medical evacuation and repatriation coverage. Medical Evacuation and Repatriation coverage is already included as a benefit if you purchase the full SUNY international insurance plan.
Go to Forms
In many cases, Teaching and Graduate Assistants eligible for NYSHIP; Research Assistants are eligible for POMCO. You are automatically enrolled in the student health insurance until you attend your assistantship orientation. At that time there will be a departmental transmission which will remove the student health insurance fee from your student account.
If you are a teaching, research, or graduate assistant with your own private health insurance, please follow the waiver process for domestic or international students.
All processes involved with TA, GA, or RA insurance are handled by your union. Contact the following people for more information:
Research Assistantships
Visit
http://hr.buffalo.edu/rfgrads
Call the Research Fountation for information:
Abby Blakely:<PHONE_NUMBER>
Zachary Jenney:<PHONE_NUMBER>
Graduate or Teaching Assistantships
Visit http://hr.buffalo.edu/gseu
Call HR for TA/GA Insurance Information:
Tracy Czarneck:<PHONE_NUMBER>
Contact:
UB Human Resources Department:<PHONE_NUMBER>
Or visit
http://www.cs.state.ny.us/ebd/


Min. Price
Max. Price
Manufacturer
Model
New
Used
Filter
Available Cars
All Cars
Red Toyota Corolla 2010
This car is strong, fresh, and robust. It still retains the new car smell :-)
₦ 2,500,000.00
view
×
Delete this car?
Yes
×
Report Car
Reason
*
Description
Report


HungryDB
Home
Users
Add-Delete User
Follow Users
Restaurants
Add-Delete Restaurants
Restaurants Menu Settings
Add Meal
Review Restaurant
Platinium
For Restaurants
For Users
Search


We cannot predict exactly when we may be attacked by forces from an enemy castle or fortress. We are constantly on guard, but the tension is making our soldiers nervous...


Art From The Hills With full dedications and great skills .
A handicraft , sometimes more precisely expressed as astisanal handicraft or handmade, ia any of a wide variety of types of work where useful and decorative objects are made completely by one's hand or by using only simple, non-tech related tools like scissors, carving implements,or hooks.


public class Session
extends java.lang.Object
TokenInfo tokenInfo = token.getTokenInfo();
// check, if log-in of the user is required at all
if (tokenInfo.isLoginRequired()) {
// check, if the token has own means to authenticate the user; e.g. a PIN-pad on the reader
if (tokenInfo.isProtectedAuthenticationPath()) {
System.out.println("Please enter the user PIN at the PIN-pad of your reader.");
session.login(Session.UserType.USER, null); // the token prompts the PIN by other means; e.g. PIN-pad
} else {
System.out.print("Enter user-PIN and press [return key]: ");
System.out.flush();
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String userPINString = input.readLine();
session.login(Session.UserType.USER, userPINString.toCharArray());
}
}
With this session object the application can search for token objects and perform a cryptographic
operation. For example, to find private RSA keys that the application can use for signing, you
can write:
RSAPrivateKey privateSignatureKeyTemplate = new RSAPrivateKey();
privateSignatureKeyTemplate.getSign().setBooleanValue(Boolean.TRUE);
session.findObjectsInit(privateSignatureKeyTemplate);
Object[] privateSignatureKeys;
List signatureKeyList = new Vector(4);
while ((privateSignatureKeys = session.findObjects(1)).length > 0) {
signatureKeyList.add(privateSignatureKeys[0]);
}
session.findObjectsFinal();
Having chosen one of this keys, the application can create a signature value using it.
// e.g. the encoded digest info object that contains an identifier of the
// hash algorithm and the hash value
byte[] toBeSigned;
// toBeSigned = ... assign value
RSAPrivateKey selectedSignatureKey;
// selectedSignatureKey = ... assign one of the available signature keys
// initialize for signing
session.signInit(Mechanism.RSA_PKCS, selectedSignatureKey);
// sign the data to be signed
byte[] signatureValue = session.sign(toBeSigned);
If the application does not need the session any longer, it should close the session.
session.closeSession();
Object
,
Parameters
,
Session
,
SessionInfo
| Modifier and Type | Class and Description |
|---|---|
static interface |
Session.UserType
This interface defines the different user types of PKCS#11.
|
| Modifier and Type | Field and Description |
|---|---|
protected Module |
module_
A reference to the underlying PKCS#11 module to perform the operations.
|
protected PKCS11 |
pkcs11Module_
A reference to the underlying PKCS#11 module to perform the operations.
|
protected long |
sessionHandle_
The session handle to perform the operations with.
|
protected Token |
token_
The token to perform the operations on.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Session(Token token,
long sessionHandle)
Constructor taking the token and the session handle.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelFunction()
Legacy function that will normally throw an PKCS11Exception with the error-code
PKCS11Constants.CKR_FUNCTION_NOT_PARALLEL.
|
void |
closeSession()
Closes this session.
|
Object |
copyObject(Object sourceObject,
Object templateObject)
Copy an existing object.
|
Object |
createObject(Object templateObject)
Create a new object on the token (or in the session).
|
byte[] |
decrypt(byte[] data)
Decrypts the given data with the key and mechansim given to the decryptInit method.
|
byte[] |
decryptDigestUpdate(byte[] part)
Dual-function.
|
byte[] |
decryptFinal()
This method finalizes a decrpytion operation and returns the final result.
|
void |
decryptInit(Mechanism mechanism,
Key key)
Initializes a new decryption operation.
|
byte[] |
decryptUpdate(byte[] encryptedPart)
This method can be used to decrypt multiple pieces of data; e.g.
|
byte[] |
decryptVerifyUpdate(byte[] encryptedPart)
Dual-function.
|
Key |
deriveKey(Mechanism mechanism,
Key baseKey,
Key template)
Derives a new key from a specified base key unsing the given mechanism.
|
void |
destroyObject(Object object)
Destroy a certain object on the token (or in the session).
|
byte[] |
digest(byte[] data)
Digests the given data with the mechansim given to the digestInit method.
|
byte[] |
digestEncryptedUpdate(byte[] part)
Dual-function.
|
byte[] |
digestFinal()
This method finalizes a digesting operation and returns the final result.
|
void |
digestInit(Mechanism mechanism)
Initializes a new digesting operation.
|
void |
digestKey(SecretKey key)
This method is similar to digestUpdate and can be combined with it during one digesting
operation.
|
void |
digestUpdate(byte[] part)
This method can be used to digest multiple pieces of data; e.g.
|
byte[] |
encrypt(byte[] data)
Encrypts the given data with the key and mechansim given to the encryptInit method.
|
byte[] |
encryptFinal()
This method finalizes an encrpytion operation and returns the final result.
|
void |
encryptInit(Mechanism mechanism,
Key key)
Initializes a new encryption operation.
|
byte[] |
encryptUpdate(byte[] part)
This method can be used to encrypt multiple pieces of data; e.g.
|
boolean |
equals(java.lang.Object otherObject)
Compares the sessionHandle and token_ of this object with the other object.
|
Object[] |
findObjects(int maxObjectCount)
Finds objects that match the template object passed to findObjectsInit.
|
void |
findObjectsFinal()
Finalizes a find operation.
|
void |
findObjectsInit(Object templateObject)
Initializes a find operations that provides means to find objects by passing a template object.
|
Object |
generateKey(Mechanism mechanism,
Object template)
Generate a new secret key or a set of domain parameters.
|
KeyPair |
generateKeyPair(Mechanism mechanism,
Object publicKeyTemplate,
Object privateKeyTemplate)
Generate a new public key - private key key-pair and use the set attributes of the template
objects for setting the attributes of the new public key and private key objects.
|
byte[] |
generateRandom(int numberOfBytesToGenerate)
Generates a certain number of random bytes.
|
Object |
getAttributeValues(Object objectToRead)
Reads all the attributes of the given Object from the token and returns a new Object that
contains all these attributes.
|
void |
getFunctionStatus()
Legacy function that will normally throw an PKCS11Exception with the error-code
PKCS11Constants.CKR_FUNCTION_NOT_PARALLEL.
|
Module |
getModule()
Get the Module which this Session object operates with.
|
long |
getObjectSize(Object object)
Get the size of the specified object in bytes.
|
byte[] |
getOperationState()
Get the current operation state.
|
long |
getSessionHandle()
Get the handle of this session.
|
SessionInfo |
getSessionInfo()
Get information about this session.
|
Token |
getToken()
Get the token that created this Session object.
|
int |
hashCode()
The overriding of this method should ensure that the objects of this class work correctly in a
hashtable.
|
void |
initPIN(char[] pin)
Initializes the user-PIN.
|
boolean |
isSetUtf8Encoding()
Returns whether UTF8 encoding is set.
|
void |
login(boolean userType,
char[] pin)
Logs in the user or the security officer to the session.
|
void |
logout()
Logs out this session.
|
void |
seedRandom(byte[] seed)
Mixes additional seeding material into the random number generator.
|
void |
setAttributeValues(Object objectToUpdate,
Object templateObject)
Gets all present attributes of the given template object an writes them to the object to update
on the token (or in the session).
|
void |
setOperationState(byte[] operationState,
Key encryptionKey,
Key authenticationKey)
Sets the operation state of this session to a previously saved one.
|
void |
setPIN(char[] oldPin,
char[] newPin)
Set the user-PIN to a new value.
|
byte[] |
sign(byte[] data)
Signs the given data with the key and mechansim given to the signInit method.
|
byte[] |
signEncryptUpdate(byte[] part)
Dual-function.
|
byte[] |
signFinal()
This method finalizes a signing operation and returns the final result.
|
void |
signInit(Mechanism mechanism,
Key key)
Initializes a new signing operation.
|
byte[] |
signRecover(byte[] data)
Signs the given data with the key and mechansim given to the signRecoverInit method.
|
void |
signRecoverInit(Mechanism mechanism,
Key key)
Initializes a new signing operation for signing with recovery.
|
void |
signUpdate(byte[] part)
This method can be used to sign multiple pieces of data; e.g.
|
java.lang.String |
toString()
Returns the string representation of this object.
|
Key |
unwrapKey(Mechanism mechanism,
Key unwrappingKey,
byte[] wrappedKey,
Object keyTemplate)
Unwraps (decrypts) the given encrypted key with the unwrapping key using the given mechanism.
|
void |
verify(byte[] data,
byte[] signature)
Verifies the given signature against the given data with the key and mechansim given to the
verifyInit method.
|
void |
verifyFinal(byte[] signature)
This method finalizes a verification operation.
|
void |
verifyInit(Mechanism mechanism,
Key key)
Initializes a new verification operation.
|
byte[] |
verifyRecover(byte[] signature)
Signs the given data with the key and mechansim given to the signRecoverInit method.
|
void |
verifyRecoverInit(Mechanism mechanism,
Key key)
Initializes a new verification operation for verification with data recovery.
|
void |
verifyUpdate(byte[] part)
This method can be used to verify a signature with multiple pieces of data; e.g.
|
byte[] |
wrapKey(Mechanism mechanism,
Key wrappingKey,
Key key)
Wraps (encrypts) the given key with the wrapping key using the given mechanism.
|
protected Module module_
protected PKCS11 pkcs11Module_
protected long sessionHandle_
protected Token token_
protected Session(Token token, long sessionHandle)
token
- The token this session operates with.sessionHandle
- The session handle to perform the operations with.public void initPIN(char[] pin) throws TokenException
pin
- The new user-PIN. This parameter may be null, if the token has a protected
authentication path. Refer to the PKCS#11 standard for details.TokenException
- If the session has not the right to set the PIN of if the operation fails for some
other reason.public void setPIN(char[] oldPin, char[] newPin) throws TokenException
oldPin
- The old (current) user-PIN.newPin
- The new value for the user-PIN.TokenException
- If setting the new PIN fails.public void closeSession() throws TokenException
TokenException
- If closing the session failed.public boolean equals(java.lang.Object otherObject)
equals
in class java.lang.Object
otherObject
- The other Session object.public int hashCode()
hashCode
in class java.lang.Object
public long getSessionHandle()
public SessionInfo getSessionInfo() throws TokenException
TokenException
- If getting the information failed.public Module getModule()
public Token getToken()
public byte[] getOperationState() throws TokenException
TokenException
- If saving the state fails or is not possible.setOperationState(byte[],Key,Key)
public void setOperationState(byte[] operationState, Key encryptionKey, Key authenticationKey) throws TokenException
operationState
- The previously saved state as returned by getOperationState().encryptionKey
- A encryption or decryption key, if a encryption or decryption operation was saved
which should be continued, but the keys could not be saved.authenticationKey
- A signing, verification of MAC key, if a signing, verification or MAC operation needs
to be restored that could not save the key.TokenException
- If restoring the state fails.getOperationState()
public boolean isSetUtf8Encoding()
public void login(boolean userType, char[] pin) throws TokenException
userType
- UserType.SO for the security officer or UserType.USER to login the user.pin
- The PIN. The security officer-PIN or the user-PIN depending on the userType parameter.TokenException
- If login fails.public void logout() throws TokenException
TokenException
- If logging out the session fails.public Object createObject(Object templateObject) throws TokenException
DESSecretKey desKeyTemplate = new DESSecretKey();
// the key type is set by the DESSecretKey's constructor, so you need not do it
desKeyTemplate.setValue(myDesKeyValueAs8BytesLongByteArray);
desKeyTemplate.setToken(Boolean.TRUE);
desKeyTemplate.setPrivate(Boolean.TRUE);
desKeyTemplate.setEncrypt(Boolean.TRUE);
desKeyTemplate.setDecrypt(Boolean.TRUE);
...
DESSecretKey theCreatedDESKeyObject = (DESSecretKey) userSession.createObject(desKeyTemplate);
Refer to the PKCS#11 standard to find out what attributes must be set for certain types
of objects to create them on the token.templateObject
- The template object that holds all values that the new object on the token should
contain. (this is not a java.lang.Object!)TokenException
- If the creation of the new object fails. If it fails, the no new object was
created on the token.public Object copyObject(Object sourceObject, Object templateObject) throws TokenException
sourceObject
- The source object of the copy operation.templateObject
- A template object which's attribute values are used for the new object; i.e. they have
higher priority than the attribute values from the source object. May be null; in that
case the new object is just a one-to-one copy of the sourceObject.TokenException
- If copying the object fails for some reason.public void setAttributeValues(Object objectToUpdate, Object templateObject) throws TokenException
objectToUpdate
- The attributes of this object get updated.templateObject
- This methods gets all present attributes of this template object and set this
attributes at the objectToUpdate.TokenException
- If updateing the attributes fails. All or no attributes are updated.public Object getAttributeValues(Object objectToRead) throws TokenException
objectToRead
- The object to newly read from the token.TokenException
- If reading the attributes fails.public void destroyObject(Object object) throws TokenException
object
- The object that should be destroyed.TokenException
- If the object could not be destroyed.public long getObjectSize(Object object) throws TokenException
object
- The object to get the size for.TokenException
- If determining the size fails.public void findObjectsInit(Object templateObject) throws TokenException
templateObject
- The object that serves as a template for searching. If this object is null, the find
operation will find all objects that this session can see. Notice, that only a user
session will see private objects.TokenException
- If initializing the find operation fails.public Object[] findObjects(int maxObjectCount) throws TokenException
maxObjectCount
- Specifies how many objects to return with this call.TokenException
- A plain TokenException if something during PKCS11 FindObject went wrong, a
TokenException with a nested TokenException if the Exception is raised during
object parsing.public void findObjectsFinal() throws TokenException
TokenException
- If finalizing the current find operation was not possible.public void encryptInit(Mechanism mechanism, Key key) throws TokenException
mechanism
- The mechanism to use; e.g. Mechanism.DES_CBC.key
- The decryption key to use.TokenException
- If initializing this operation failed.public byte[] encrypt(byte[] data) throws TokenException
data
- The data to encrpyt.TokenException
- If encrypting failed.public byte[] encryptUpdate(byte[] part) throws TokenException
part
- The piece of data to encrpt.TokenException
- If encrypting the data failed.public byte[] encryptFinal() throws TokenException
TokenException
- If calculating the final result failed.public void decryptInit(Mechanism mechanism, Key key) throws TokenException
mechanism
- The mechanism to use; e.g. Mechanism.DES_CBC.key
- The decryption key to use.TokenException
- If initializing this operation failed.public byte[] decrypt(byte[] data) throws TokenException
data
- The data to decrpyt.TokenException
- If decrypting failed.public byte[] decryptUpdate(byte[] encryptedPart) throws TokenException
encryptedPart
- The piece of data to decrpt.TokenException
- If decrypting the data failed.public byte[] decryptFinal() throws TokenException
TokenException
- If calculating the final result failed.public void digestInit(Mechanism mechanism) throws TokenException
mechanism
- The mechanism to use; e.g. Mechanism.SHA_1.TokenException
- If initializing this operation failed.public byte[] digest(byte[] data) throws TokenException
data
- The data to digest.TokenException
- If digesting the data failed.public void digestUpdate(byte[] part) throws TokenException
part
- The piece of data to digest.TokenException
- If digesting the data failed.public void digestKey(SecretKey key) throws TokenException
key
- The key to digest the value of.TokenException
- If digesting the key failed.public byte[] digestFinal() throws TokenException
TokenException
- If calculating the final message digest failed.public void signInit(Mechanism mechanism, Key key) throws TokenException
mechanism
- The mechanism to use; e.g. Mechanism.RSA_PKCS.key
- The signing key to use.TokenException
- If initializing this operation failed.public byte[] sign(byte[] data) throws TokenException
data
- The data to sign.TokenException
- If signing the data failed.public void signUpdate(byte[] part) throws TokenException
part
- The piece of data to sign.TokenException
- If signing the data failed.public byte[] signFinal() throws TokenException
TokenException
- If calculating the final signature value failed.public void signRecoverInit(Mechanism mechanism, Key key) throws TokenException
mechanism
- The mechanism to use; e.g. Mechanism.RSA_9796.key
- The signing key to use.TokenException
- If initializing this operation failed.public byte[] signRecover(byte[] data) throws TokenException
data
- The data to sign.TokenException
- If signing the data failed.public void verifyInit(Mechanism mechanism, Key key) throws TokenException
mechanism
- The mechanism to use; e.g. Mechanism.RSA_PKCS.key
- The verification key to use.TokenException
- If initializing this operation failed.public void verify(byte[] data, byte[] signature) throws TokenException
data
- The data that was signed.signature
- The signature or MAC to verify.TokenException
- If verifying the signature fails. This is also the case, if the signature is
forged.public void verifyUpdate(byte[] part) throws TokenException
part
- The piece of data to verify against.TokenException
- If verifying (e.g. digesting) the data failed.public void verifyFinal(byte[] signature) throws TokenException
signature
- The signature value.TokenException
- If verifying the signature fails. This is also the case, if the signature is
forged.public void verifyRecoverInit(Mechanism mechanism, Key key) throws TokenException
mechanism
- The mechanism to use; e.g. Mechanism.RSA_9796.key
- The verification key to use.TokenException
- If initializing this operation failed.public byte[] verifyRecover(byte[] signature) throws TokenException
signature
- The data to sign.TokenException
- If signing the data failed.public byte[] digestEncryptedUpdate(byte[] part) throws TokenException
part
- The piece of data to digest and encrypt.TokenException
- If digesting or encrypting the data failed.public byte[] decryptDigestUpdate(byte[] part) throws TokenException
part
- The piece of data to decrypt and digest.TokenException
- If decrypting or digesting the data failed.public byte[] signEncryptUpdate(byte[] part) throws TokenException
part
- The piece of data to sign and encrypt.TokenException
- If signing or encrypting the data failed.public byte[] decryptVerifyUpdate(byte[] encryptedPart) throws TokenException
encryptedPart
- The piece of data to decrypt and verify.TokenException
- If decrypting or verifying the data failed.public Object generateKey(Mechanism mechanism, Object template) throws TokenException
mechanism
- The mechanism to generate a key for; e.g. Mechanism.DES to generate a DES key.template
- The template for the new key or domain parameters; e.g. a DESSecretKey object which
has set certain attributes.TokenException
- If generating a new secert key or domain parameters failed.public KeyPair generateKeyPair(Mechanism mechanism, Object publicKeyTemplate, Object privateKeyTemplate) throws TokenException
mechanism
- The mechanism to generate a key for; e.g. Mechanism.RSA to generate a new RSA
key-pair.publicKeyTemplate
- The template for the new public key part; e.g. a RSAPublicKey object which has set
certain attributes (e.g. public exponent and verify).privateKeyTemplate
- The template for the new private key part; e.g. a RSAPrivateKey object which has set
certain attributes (e.g. sign and decrypt).TokenException
- If generating a new key-pair failed.public byte[] wrapKey(Mechanism mechanism, Key wrappingKey, Key key) throws TokenException
mechanism
- The mechanism to use for wrapping the key.wrappingKey
- The key to use for wrapping (encrypting).key
- The key to wrap (encrypt).TokenException
- If wrapping the key failed.public Key unwrapKey(Mechanism mechanism, Key unwrappingKey, byte[] wrappedKey, Object keyTemplate) throws TokenException
mechanism
- The mechanism to use for unwrapping the key.unwrappingKey
- The key to use for unwrapping (decrypting).wrappedKey
- The encrypted key to unwrap (decrypt).keyTemplate
- The template for creating the new key object.TokenException
- If unwrapping the key or creating a new key object failed.public Key deriveKey(Mechanism mechanism, Key baseKey, Key template) throws TokenException
mechanism
- The mechanism to use for deriving the new key from the base key.baseKey
- The key to use as base for derivation.template
- The template for creating the new key object.TokenException
- If deriving the key or creating a new key object failed.public void seedRandom(byte[] seed) throws TokenException
seed
- The seed bytes to mix in.TokenException
- If mixing in the seed failed.public byte[] generateRandom(int numberOfBytesToGenerate) throws TokenException
numberOfBytesToGenerate
- The number of random bytes to generate.TokenException
- If generating random bytes failed.public void getFunctionStatus() throws TokenException
TokenException
- Throws always an PKCS11Excption.public void cancelFunction() throws TokenException
TokenException
- Throws always an PKCS11Excption.public java.lang.String toString()
toString
in class java.lang.Object
IAIK JavaSecurity Website http://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2004, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.
version 1.4


Encoder
Encode one image inside another. For the details of how this works, and to learn the limitations of the security of this encoder, visit the about page. This site is served statically, therefore the encoding all happens in your browser; images and passwords input here are not sent over a network. For the best results, ensure the dimensions of both images are the same.


Key types
Key categories
PSA_KEY_TYPE_NONE
(macro)
An invalid key type value.
#define PSA_KEY_TYPE_NONE ((psa_key_type_t)0x0000)
Zero is not the encoding of any key type.
PSA_KEY_TYPE_IS_UNSTRUCTURED
(macro)
Whether a key type is an unstructured array of bytes.
#define PSA_KEY_TYPE_IS_UNSTRUCTURED(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
Description
This encompasses both symmetric keys and non-key data.
See Symmetric keys for a list of symmetric key types.
PSA_KEY_TYPE_IS_ASYMMETRIC
(macro)
Whether a key type is asymmetric: either a key pair or a public key.
#define PSA_KEY_TYPE_IS_ASYMMETRIC(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
Description
See RSA keys for a list of asymmetric key types.
PSA_KEY_TYPE_IS_PUBLIC_KEY
(macro)
Whether a key type is the public part of a key pair.
#define PSA_KEY_TYPE_IS_PUBLIC_KEY(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
PSA_KEY_TYPE_IS_KEY_PAIR
(macro)
Whether a key type is a key pair containing a private part and a public part.
#define PSA_KEY_TYPE_IS_KEY_PAIR(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
Symmetric keys
PSA_KEY_TYPE_RAW_DATA
(macro)
Raw data.
#define PSA_KEY_TYPE_RAW_DATA ((psa_key_type_t)0x1001)
A “key” of this type cannot be used for any cryptographic operation. Applications can use this type to store arbitrary data in the keystore.
PSA_KEY_TYPE_HMAC
(macro)
HMAC key.
#define PSA_KEY_TYPE_HMAC ((psa_key_type_t)0x1100)
The key policy determines which underlying hash algorithm the key can be used for.
HMAC keys typically have the same size as the underlying hash. This size can be calculated with PSA_HASH_LENGTH
(
alg
)
where alg
is the HMAC algorithm or the underlying hash algorithm.
PSA_KEY_TYPE_DERIVE
(macro)
A secret for key derivation.
#define PSA_KEY_TYPE_DERIVE ((psa_key_type_t)0x1200)
The key policy determines which key derivation algorithm the key can be used for.
PSA_KEY_TYPE_AES
(macro)
Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
#define PSA_KEY_TYPE_AES ((psa_key_type_t)0x2400)
The size of the key can be 16 bytes (AES-128), 24 bytes (AES-192) or 32 bytes (AES-256).
PSA_KEY_TYPE_DES
(macro)
Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
#define PSA_KEY_TYPE_DES ((psa_key_type_t)0x2301)
The size of the key can be 8 bytes (single DES), 16 bytes (2-key 3DES) or 24 bytes (3-key 3DES).
Warning
Single DES and 2-key 3DES are weak and strongly deprecated and are only recommended for decrypting legacy data.
3-key 3DES is weak and deprecated and is only recommended for use in legacy protocols.
PSA_KEY_TYPE_CAMELLIA
(macro)
Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.
#define PSA_KEY_TYPE_CAMELLIA ((psa_key_type_t)0x2403)
PSA_KEY_TYPE_ARC4
(macro)
Key for the RC4 stream cipher.
#define PSA_KEY_TYPE_ARC4 ((psa_key_type_t)0x2002)
Use algorithm PSA_ALG_STREAM_CIPHER
to use this key with the ARC4 cipher.
Warning
The RC4 cipher is weak and deprecated and is only recommended for use in legacy protocols.
The ARC4 cipher does not use an initialization vector (IV). When using a multi-part cipher operation with the PSA_ALG_STREAM_CIPHER
algorithm and an ARC4 key, psa_cipher_generate_iv()
and psa_cipher_set_iv()
must not be called.
PSA_KEY_TYPE_CHACHA20
(macro)
Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
#define PSA_KEY_TYPE_CHACHA20 ((psa_key_type_t)0x2004)
ChaCha20 and the ChaCha20_Poly1305 construction are defined in RFC 7539.
Variants of these algorithms are defined by the length of the nonce:
- Implementations must support a 12-byte nonce, as defined in RFC 7539.
- Implementations can optionally support an 8-byte nonce, the original variant.
- It is recommended that implementations do not support other sizes of nonce.
Use algorithm PSA_ALG_STREAM_CIPHER
to use this key with the ChaCha20 cipher for unauthenticated encryption.
RSA keys
PSA_KEY_TYPE_RSA_PUBLIC_KEY
(macro)
RSA public key.
#define PSA_KEY_TYPE_RSA_PUBLIC_KEY ((psa_key_type_t)0x4001)
PSA_KEY_TYPE_RSA_KEY_PAIR
(macro)
RSA key pair: both the private and public key.
#define PSA_KEY_TYPE_RSA_KEY_PAIR ((psa_key_type_t)0x7001)
PSA_KEY_TYPE_IS_RSA
(macro)
Whether a key type is an RSA key. This includes both key pairs and public keys.
#define PSA_KEY_TYPE_IS_RSA(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
Elliptic Curve keys
psa_ecc_family_t
(type)
The type of PSA elliptic curve family identifiers.
typedef uint8_t psa_ecc_family_t;
The curve identifier is required to create an ECC key using the PSA_KEY_TYPE_ECC_KEY_PAIR()
or PSA_KEY_TYPE_ECC_PUBLIC_KEY()
macros.
The specific ECC curve within a family is identified by the key_bits
attribute of the key.
The range of Elliptic curve family identifier values is divided as follows:
0
x00
- 0
x7f
- ECC family identifiers defined by this standard. Unallocated values in this range are reserved for future use.
0
x80
- 0
xff
- Implementations that define additional families must use an encoding in this range.
PSA_KEY_TYPE_ECC_KEY_PAIR
(macro)
Elliptic curve key pair: both the private and public key.
#define PSA_KEY_TYPE_ECC_KEY_PAIR(curve) /* specification-defined value */
Parameters
-
curve
- A value of type
psa_ecc_family_t
that identifies the ECC curve family to be used.
PSA_KEY_TYPE_ECC_PUBLIC_KEY
(macro)
Elliptic curve public key.
#define PSA_KEY_TYPE_ECC_PUBLIC_KEY(curve) /* specification-defined value */
Parameters
-
curve
- A value of type
psa_ecc_family_t
that identifies the ECC curve family to be used.
PSA_ECC_FAMILY_SECP_K1
(macro)
SEC Koblitz curves over prime fields.
#define PSA_ECC_FAMILY_SECP_K1 ((psa_ecc_family_t) 0x17)
This family comprises the following curves:
- secp192k1 :
key_bits = 192
- secp224k1 :
key_bits = 225
- secp256k1 :
key_bits = 256
They are defined in Standards for Efficient Cryptography, SEC 2: Recommended Elliptic Curve Domain Parameters.
PSA_ECC_FAMILY_SECP_R1
(macro)
SEC random curves over prime fields.
#define PSA_ECC_FAMILY_SECP_R1 ((psa_ecc_family_t) 0x12)
This family comprises the following curves:
- secp192r1 :
key_bits = 192
- secp224r1 :
key_bits = 224
- secp256r1 :
key_bits = 256
- secp384r1 :
key_bits = 384
- secp521r1 :
key_bits = 512
They are defined in Standards for Efficient Cryptography, SEC 2: Recommended Elliptic Curve Domain Parameters
PSA_ECC_FAMILY_SECP_R2
(macro)
Warning
This family of curves is weak and deprecated.
#define PSA_ECC_FAMILY_SECP_R2 ((psa_ecc_family_t) 0x1b)
This family comprises the following curves:
- secp160r2 :
key_bits = 160
(Deprecated)
It is defined in the superseded SEC 2: Recommended Elliptic Curve Domain Parameters, Version 1.0.
PSA_ECC_FAMILY_SECT_K1
(macro)
SEC Koblitz curves over binary fields.
#define PSA_ECC_FAMILY_SECT_K1 ((psa_ecc_family_t) 0x27)
This family comprises the following curves:
- sect163k1 :
key_bits = 163
(Deprecated) - sect233k1 :
key_bits = 233
- sect239k1 :
key_bits = 239
- sect283k1 :
key_bits = 283
- sect409k1 :
key_bits = 409
- sect571k1 :
key_bits = 571
They are defined in Standards for Efficient Cryptography, SEC 2: Recommended Elliptic Curve Domain Parameters
Warning
The 163-bit curve sect163k1 is weak and deprecated and is only recommended for use in legacy protocols.
PSA_ECC_FAMILY_SECT_R1
(macro)
SEC random curves over binary fields.
#define PSA_ECC_FAMILY_SECT_R1 ((psa_ecc_family_t) 0x22)
This family comprises the following curves:
- sect163r1 :
key_bits = 163
(Deprecated) - sect233r1 :
key_bits = 233
- sect283r1 :
key_bits = 283
- sect409r1 :
key_bits = 409
- sect571r1 :
key_bits = 571
They are defined in Standards for Efficient Cryptography, SEC 2: Recommended Elliptic Curve Domain Parameters
Warning
The 163-bit curve sect163r1 is weak and deprecated and is only recommended for use in legacy protocols.
PSA_ECC_FAMILY_SECT_R2
(macro)
SEC additional random curves over binary fields.
#define PSA_ECC_FAMILY_SECT_R2 ((psa_ecc_family_t) 0x2b)
This family comprises the following curves:
- sect163r2 :
key_bits = 163
(Deprecated)
It is defined in Standards for Efficient Cryptography, SEC 2: Recommended Elliptic Curve Domain Parameters
Warning
The 163-bit curve sect163r2 is weak and deprecated and is only recommended for use in legacy protocols.
PSA_ECC_FAMILY_BRAINPOOL_P_R1
(macro)
Brainpool P random curves.
#define PSA_ECC_FAMILY_BRAINPOOL_P_R1 ((psa_ecc_family_t) 0x30)
This family comprises the following curves:
- brainpoolP160r1 :
key_bits = 160
(Deprecated) - brainpoolP192r1 :
key_bits = 192
- brainpoolP224r1 :
key_bits = 224
- brainpoolP256r1 :
key_bits = 256
- brainpoolP320r1 :
key_bits = 320
- brainpoolP384r1 :
key_bits = 384
- brainpoolP512r1 :
key_bits = 512
They are defined in RFC 5639.
Warning
The 160-bit curve brainpoolP160r1 is weak and deprecated and is only recommended for use in legacy protocols.
PSA_ECC_FAMILY_FRP
(macro)
Curve used primarily in France and elsewhere in Europe.
#define PSA_ECC_FAMILY_FRP ((psa_ecc_family_t) 0x33)
This family comprises one 256-bit curve:
- FRP256v1 :
key_bits = 256
This is defined by Agence nationale de la sécurité des systèmes d’information in Publication d’un paramétrage de courbe elliptique visant des applications de passeport électronique et de l’administration électronique française, 21 November 2011.
PSA_ECC_FAMILY_MONTGOMERY
(macro)
Montgomery curves.
#define PSA_ECC_FAMILY_MONTGOMERY ((psa_ecc_family_t) 0x41)
This family comprises the following Montgomery curves:
Curve25519 :
key_bits = 255
This curve is defined in Bernstein et al., Curve25519: new Diffie-Hellman speed records, LNCS 3958, 2006.
The algorithm
PSA_ALG_ECDH
performs X25519 when used with this curve.Curve448 :
key_bits = 448
This curve is defined in Hamburg, Ed448-Goldilocks, a new elliptic curve, NIST ECC Workshop, 2015.
The algorithm
PSA_ALG_ECDH
performs X448 when used with this curve.
PSA_KEY_TYPE_IS_ECC
(macro)
Whether a key type is an elliptic curve key, either a key pair or a public key.
#define PSA_KEY_TYPE_IS_ECC(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
PSA_KEY_TYPE_IS_ECC_KEY_PAIR
(macro)
Whether a key type is an elliptic curve key pair.
#define PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY
(macro)
Whether a key type is an elliptic curve public key.
#define PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
PSA_KEY_TYPE_ECC_GET_FAMILY
(macro)
Extract the curve family from an elliptic curve key type.
#define PSA_KEY_TYPE_ECC_GET_FAMILY(type) /* specification-defined value */
Parameters
-
type
- An elliptic curve key type (value of type
psa_key_type_t
such thatPSA_KEY_TYPE_IS_ECC
(
type
)
is true).
Returns: psa_ecc_family_t
The elliptic curve family id, if type
is a supported elliptic curve key. Unspecified if type
is not a supported elliptic curve key.
Diffie Hellman keys
psa_dh_family_t
(type)
The type of PSA Diffie-Hellman group family identifiers.
typedef uint8_t psa_dh_family_t;
The group family identifier is required to create an Diffie-Hellman key using the PSA_KEY_TYPE_DH_KEY_PAIR()
or PSA_KEY_TYPE_DH_PUBLIC_KEY()
macros.
The specific Diffie-Hellman group within a family is identified by the key_bits
attribute of the key.
The range of Diffie-Hellman group family identifier values is divided as follows:
0
x00
- 0
x7f
- DH group family identifiers defined by this standard. Unallocated values in this range are reserved for future use.
0
x80
- 0
xff
- Implementations that define additional families must use an encoding in this range.
PSA_KEY_TYPE_DH_KEY_PAIR
(macro)
Diffie-Hellman key pair: both the private key and public key.
#define PSA_KEY_TYPE_DH_KEY_PAIR(group) /* specification-defined value */
Parameters
-
group
- A value of type
psa_dh_family_t
that identifies the Diffie-Hellman group family to be used.
PSA_KEY_TYPE_DH_PUBLIC_KEY
(macro)
Diffie-Hellman public key.
#define PSA_KEY_TYPE_DH_PUBLIC_KEY(group) /* specification-defined value */
Parameters
-
group
- A value of type
psa_dh_family_t
that identifies the Diffie-Hellman group family to be used.
PSA_DH_FAMILY_RFC7919
(macro)
Diffie-Hellman groups defined in RFC 7919 Appendix A.
#define PSA_DH_FAMILY_RFC7919 ((psa_dh_family_t) 0x03)
This family includes groups with the following key sizes (in bits): 2048, 3072, 4096, 6144, 8192. An implementation can support all of these sizes or only a subset.
PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEY
(macro)
The key pair type corresponding to a public key type.
#define PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEY(type) \ /* specification-defined value */
Parameters
-
type
- A public key type or key pair type.
Returns
The corresponding key pair type. If type
is not a public key or a key pair, the return value is undefined.
Description
If type
is a key pair type, it will be left unchanged.
PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR
(macro)
The public key type corresponding to a key pair type.
#define PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) \ /* specification-defined value */
Parameters
-
type
- A public key type or key pair type.
Returns
The corresponding public key type. If type
is not a public key or a key pair, the return value is undefined.
Description
If type
is a public key type, it will be left unchanged.
PSA_KEY_TYPE_IS_DH
(macro)
Whether a key type is a Diffie-Hellman key, either a key pair or a public key.
#define PSA_KEY_TYPE_IS_DH(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
PSA_KEY_TYPE_IS_DH_KEY_PAIR
(macro)
Whether a key type is a Diffie-Hellman key pair.
#define PSA_KEY_TYPE_IS_DH_KEY_PAIR(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
PSA_KEY_TYPE_IS_DH_PUBLIC_KEY
(macro)
Whether a key type is a Diffie-Hellman public key.
#define PSA_KEY_TYPE_IS_DH_PUBLIC_KEY(type) /* specification-defined value */
Parameters
-
type
- A key type (value of type
psa_key_type_t
).
PSA_KEY_TYPE_DH_GET_FAMILY
(macro)
Extract the group family from a Diffie-Hellman key type.
#define PSA_KEY_TYPE_DH_GET_FAMILY(type) /* specification-defined value */
Parameters
-
type
- A Diffie-Hellman key type (value of type
psa_key_type_t
such thatPSA_KEY_TYPE_IS_DH
(
type
)
is true).
Returns: psa_dh_family_t
The Diffie-Hellman group family id, if type
is a supported Diffie-Hellman key. Unspecified if type
is not a supported Diffie-Hellman key.
Attribute accessors
psa_set_key_type
(function)
Declare the type of a key.
void psa_set_key_type(psa_key_attributes_t * attributes, psa_key_type_t type);
Parameters
-
attributes
- The attribute object to write to.
-
type
- The key type to write. If this is
PSA_KEY_TYPE_NONE
, the key type inattributes
becomes unspecified.
Returns: void
Description
This function overwrites any key type previously set in attributes
.
Implementation note
This is a simple accessor function that is not required to validate its inputs. The following approaches can be used to provide an efficient implementation:
- This function can be declared as
static
orinline
, instead of using the default external linkage. - This function can be provided as a function-like macro. In this form, the macro must evaluate each of its arguments exactly once, as if it was a function call.
psa_get_key_type
(function)
Retrieve the key type from key attributes.
psa_key_type_t psa_get_key_type(const psa_key_attributes_t * attributes);
Parameters
-
attributes
- The key attribute object to query.
Returns: psa_key_type_t
The key type stored in the attribute object.
Description
Implementation note
This is a simple accessor function that is not required to validate its inputs. The following approaches can be used to provide an efficient implementation:
- This function can be declared as
static
orinline
, instead of using the default external linkage. - This function can be provided as a function-like macro. In this form, the macro must evaluate each of its arguments exactly once, as if it was a function call.
psa_get_key_bits
(function)
Retrieve the key size from key attributes.
size_t psa_get_key_bits(const psa_key_attributes_t * attributes);
Parameters
-
attributes
- The key attribute object to query.
Returns: size_t
The key size stored in the attribute object, in bits.
Description
Implementation note
This is a simple accessor function that is not required to validate its inputs. The following approaches can be used to provide an efficient implementation:
- This function can be declared as
static
orinline
, instead of using the default external linkage. - This function can be provided as a function-like macro. In this form, the macro must evaluate each of its arguments exactly once, as if it was a function call.
psa_set_key_bits
(function)
Declare the size of a key.
void psa_set_key_bits(psa_key_attributes_t * attributes, size_t bits);
Parameters
-
attributes
- The attribute object to write to.
-
bits
- The key size in bits. If this is
0
, the key size inattributes
becomes unspecified. Keys of size0
are not supported.
Returns: void
Description
This function overwrites any key size previously set in attributes
.
Implementation note
This is a simple accessor function that is not required to validate its inputs. The following approaches can be used to provide an efficient implementation:
- This function can be declared as
static
orinline
, instead of using the default external linkage. - This function can be provided as a function-like macro. In this form, the macro must evaluate each of its arguments exactly once, as if it was a function call.


Universal Subtitle Extension
Font Color:
Caption Background Color:
Here, the user is able to toggle on/off the ability to show subtitles on the current screen. Using the buttons at the top, the user can select the profile screen, settings screen, open the transcibe studio screen, or this help screen.
Here, the user is able to see statistics such as how many videos they have subtitled in total.
Here, the user is able to toggle their prefences for the extension including the ability to customize how the subtitles are displayed on the screen.
Here, the user is able to contribute and transcibe the audio from videos for other users to benefit from.


Sign In
Remember me
Forgot Password?
LOGIN
Login with
Facebook
Login with
Twitter
Need an account?
Sign Up


You are now exploring web badges in 90s. Back in the days, online users displayed web badges on the bottom of their personal websites. Different communities and platforms gave those badges to reward members of the community. To reward supporters, they granted a little badge for them to express values that they stand for.
Squash Email Spiders is a community to combat Email Spider Programs. Email Spider Programs go from site to site, zoom through newsgroups, and gobble up message boards with fervor. These are programs that collect thousands of addys for their user, giving him a mailing list that he can send his spam junk mail to. Supporters of this community displayed the badge to let people know about the method to stop spammers.
The HTML Writers Guild is the world's largest international organization of Web authors with over 147,000 members in more than 150 nations worldwide. It's a unique community that provides resources, support, representation, and education for web authors at all skill levels. The badge is given for members of the guild, who are interested in web design and development.
Members of the Electronic Frontier Foundation (EFF) blue ribbon campaign used this badge to support the essential human right of free speech, a fundamental building block of free society, affirmed by the U.S. Bill of Rights in 1791 and by the U.N. Declaration of Human Rights in 1948. EFF is a donor-funded nonprofit group of passionate people who depend on your support to continue successfully defending your digital rights.
Badge for members of I Hate Frames Club. This community shares idea that frames are simply a bad way to design a webpage. Frame is one way to design a web page.
Badge for Golden Key Campaign. Concerned with the security of electronic communication, the Electronic Frontier Foundation (EFF) promoted a campaign for online privacy. The aim of the campaign was to encourage online community, computer industry, government agencies and lawmakers to build better support of online privacy and securrity.
Like we use different browsers like Internet Explorer, Chrome, Safari, Firefox and etc., there were many types of them back in the days too. Netscape was once the dominant browser but Internet Explorer ended up taking this dominance in the first browser war. Owners of the websites identified which browser works best for the website with a statement "This page is best viewed with."
Internet Explorer is another type of web browsers developed by Microsoft. In 1995, Microsoft included Internet Explorer in its OS. Unlike Netscape Navigator, it was available to all Windows users free of charge, this also applying to commercial companies.


Secrets Manager Secret GenerateSecretString
You can use the
GenerateSecretString
property as part of the AWS::SecretsManager::Secret resource type to dynamically generate a
random text string to use as a password. It is an alternative to 'hardcoding' a password
directly in the SecretString
property. When you generate a AWS::SecretsManager::Secret resource type, you must include one or
the other, but not both.
SecretString
enables you to place a literal
value directly into the secret (a technique that we recommend that you avoid). Instead,
we
recommend that you use the GenerateSecretString
property to dynamically generate a
random password. The operation returns a complete JSON structure to use as the secret
value. The
structure begins with the string that you supply using SecretStringTemplate
. This
template string must be a properly formatted JSON string that contains all of the
secret value
information except the password. The operation then generates
a random password using the rules specified by the other parameters. Finally, the
operation
inserts the generated password into the secret value structure along with the JSON
key name
that's specified by the GenerateStringKey
parameter.
For examples, see AWS::SecretsManager::Secret.
GenerateSecretString
is a property of the AWS::SecretsManager::Secret resource.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "ExcludeUppercase" :
Boolean
, "RequireEachIncludedType" :Boolean
, "IncludeSpace" :Boolean
, "ExcludeCharacters" :String
, "GenerateStringKey" :String
, "PasswordLength" :Integer
, "ExcludePunctuation" :Boolean
, "ExcludeLowercase" :Boolean
, "SecretStringTemplate" :String
, "ExcludeNumbers" :Boolean
}
YAML
ExcludeUppercase:
Boolean
RequireEachIncludedType:Boolean
IncludeSpace:Boolean
ExcludeCharacters:String
GenerateStringKey:String
PasswordLength:Integer
ExcludePunctuation:Boolean
ExcludeLowercase:Boolean
SecretStringTemplate:String
ExcludeNumbers:Boolean
Properties
ExcludeUppercase
-
Specifies that the generated password shouldn't include uppercase letters. The default if you don't include this switch parameter is
False
, and the generated password can include uppercase letters.Required: No
Type: Boolean
Update requires: No interruption
RequireEachIncludedType
-
Specifies whether the generated password must include at least one of every allowed character type. The default if you don't include this switch is True, and the generated password includes at least one of every character type.
Required: No
Type: Boolean
Update requires: No interruption
IncludeSpace
-
Specifies that the generated password can include the space character. The default if you don't include this switch parameter is False, and the generated password doesn't include any space characters.
Required: No
Type: Boolean
Update requires: No interruption
ExcludeCharacters
-
A string that includes characters that shouldn't be included in the generated password. The default if you don't include this parameter is that all characters from the included sets are candidates for inclusion in the generated password. The string can be a minimum length of 0 characters and a maximum length of 4096 characters.
Required: No
Type: String
Update requires: No interruption
GenerateStringKey
-
The JSON key name that's used to add the generated password to the JSON structure specified by the
SecretStringTemplate
parameter. If you specify this parameter, then you must also specifySecretStringTemplate
.Required: No
Type: String
Update requires: No interruption
PasswordLength
-
The desired length of the generated password. The default value if you don't include this parameter is 32 characters.
Required: No
Type: Integer
Update requires: No interruption
ExcludePunctuation
-
Specifies that the generated password shouldn't include punctuation characters. The default if you don't include this switch parameter is
False
, and the generated password can include punctuation characters.The following are the punctuation characters that can be included in the generated password if you don't explicitly exclude them with
ExcludeCharacters
orExcludePunctuation
:! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
Required: No
Type: Boolean
Update requires: No interruption
ExcludeLowercase
-
Specifies that the generated password shouldn't include lowercase letters. The default if you don't include this switch parameter is
False
, and the generated password can include lowercase letters.Required: No
Type: Boolean
Update requires: No interruption
SecretStringTemplate
-
A properly structured JSON string that the generated password can be added to. If you specify this parameter, then you must also specify
GenerateStringKey
. That key is combined with the generated random string and inserted into the JSON structure that's specified by this parameter. The merged JSON string is returned as the completedSecretString
of the secret. The default if you don't include this parameter is that the generated random password string is returned by itself, and isn't embedded in a JSON structure.Required: No
Type: String
Update requires: No interruption
ExcludeNumbers
-
Specifies that the generated password shouldn't include digits. The default if you don't include this switch parameter is
False
, and the generated password can include digits.Required: No
Type: Boolean
Update requires: No interruption
See Also
-
GetRandomPassword in the AWS Secrets Manager API Reference


{% extends "dashboard/dashboard_cust_encaps.html" %} {% block content %} {% load static %}
Enter the default message that will be displayed to customers, as they are greeted by the pop-up modal.


2 references to Matches
Microsoft.PowerShell.Commands.Management (2)
commands\management\Service.cs (2)
510
if (include != null && !
Matches
(service, include))
512
if (exclude != null &&
Matches
(service, exclude))


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object apollo.gui.detailviewers.sequencealigner.Tier
public class Tier
A Tier is a container class that holds a set of non overlapping SeqFeatureI's. When referencing a position the 0th position corresponds to the first base in the reference sequence. The level of a tier is related to the different perspectives at which you can look at a tier. The Level.TOP is a view of the tier at a transcript level while the Level.BOTTOM corresponds to the exon level view. At each level a position is associated with a range, if that range corresponds to a feature then a position is also associated to that feature. The strand of a tier identifies how to translate from a tier position to a chromosome relative position. When adding features to a tier they should all be of the same strand type, and reading frame. Additionally all added features should be within the bounds of the reference sequence. Are type and phase needed?
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface apollo.gui.detailviewers.sequencealigner.TierI |
|---|
TierI.Level |
| Field Summary | |
|---|---|
protected java.util.Map<TierI.Level,org.bdgp.util.RangeHash> |
views
The different levels this tier can be viewed from. |
| Constructor Summary | |
|---|---|
Tier(SequenceI reference,
Strand strand,
ReadingFrame readingFrame)
Creates a new Tier |
| Method Summary | |
|---|---|
boolean |
addFeature(SeqFeatureI feature)
Adds the feature to this Tier |
java.util.Collection<SeqFeatureI> |
addFeatures(java.util.Collection<SeqFeatureI> features)
Adds a collection of features to this tier |
char |
charAt(int position)
Returns the base on the reference sequence for a given position |
void |
clear()
|
SeqFeatureI |
featureAt(int position,
TierI.Level level)
Gets the feature that contains a given position |
boolean |
featureExsitsAt(int position,
TierI.Level level)
Determines if there exsists a feature at a given position |
SeqFeatureI |
featureIn(org.bdgp.util.Range range,
boolean exact,
TierI.Level level)
Gets the first(?) feature within a given range inclusive(?) |
java.util.Collection<SeqFeatureI> |
featuresIn(org.bdgp.util.Range range,
TierI.Level level)
Gets all of the features within a given range |
int |
getBasePair(int position)
Translates a position on the tier into base pair coordinates. |
int |
getBoundaryType(int position,
TierI.Level level)
Returns the type of boundary of a base at a given position and level. |
java.util.Collection<SeqFeatureI> |
getFeatures(TierI.Level level)
Gets a collection of all the top level features in the tier |
int |
getHigh()
Gets the highest position on this tier |
int |
getLow()
Gets the lowest position on this tier |
SeqFeatureI |
getNextFeature(int position,
TierI.Level level)
gets the next feature in the 3' direction |
int |
getPosition(int basePair)
Translates a base pair coordinate into a position on the tier |
SeqFeatureI |
getPrevFeature(int position,
TierI.Level level)
gets the next feature in the 5' direction |
ReadingFrame |
getReadingFrame()
|
SequenceI |
getReference()
Returns the sequence which is used as a reference for this tier. |
Strand |
getStrand()
Gets the strand of this tier. |
SequenceType |
getType()
|
boolean |
handleAnnotationChangeEvent(AnnotationChangeEvent evt)
|
int |
numFeatures(TierI.Level level)
Gets the number of features at a given level. |
org.bdgp.util.Range |
rangeAt(int position,
TierI.Level level)
Returns the range that corresponds to a given position at a level. |
void |
removeFeature(SeqFeatureI feature)
Removes a given feature from this tier. |
void |
setReadingFrame(ReadingFrame rf)
|
void |
setReference(SequenceI s)
|
void |
setStrand(Strand s)
|
boolean |
willOverlap(SeqFeatureI feature)
Determine weather or not a feature will overlap with another feature already in the tier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<TierI.Level,org.bdgp.util.RangeHash> views
| Constructor Detail |
|---|
public Tier(SequenceI reference, Strand strand, ReadingFrame readingFrame)
reference
- the sequence on which the tier is basedstrand
- the strand of the tierphase
- the reading frame of the tier| Method Detail |
|---|
public boolean addFeature(SeqFeatureI feature)
addFeature
in interface TierI
feature
- the feature to be added
Calls willOverlap
public java.util.Collection<SeqFeatureI> addFeatures(java.util.Collection<SeqFeatureI> features)
addFeatures
in interface TierI
features
- a collection of features to be added
Calls addFeature
public int getBoundaryType(int position, TierI.Level level)
getBoundaryType
in interface TierI
position
- the position to look atlevel
- the level to look at
apollo.gui.detailviewers.exonviewer.TierI#boundaryTypeAt(int, int)
public char charAt(int position)
charAt
in interface TierI
position
- the position of the base that is returned
apollo.gui.detailviewers.exonviewer.TierI#charAt(int)
public SeqFeatureI featureAt(int position, TierI.Level level)
featureAt
in interface TierI
position
- the position that should be within the returned featurelevel
- the level to view the tier at
null
apollo.gui.detailviewers.exonviewer.TierI#featureAt(int, int)
public boolean featureExsitsAt(int position, TierI.Level level)
featureExsitsAt
in interface TierI
position
- the position to look for a feature atlevel
- the level to view the tier at
featureAt(position,level)
returns a feature
false if it returns nullapollo.gui.detailviewers.exonviewer.TierI#featureExsitsAt(int, int)
public SeqFeatureI featureIn(org.bdgp.util.Range range, boolean exact, TierI.Level level)
featureIn
in interface TierI
range
- a position range to look for features withinexact
- not sure...level
- the level to view the tier atapollo.gui.detailviewers.exonviewer.TierI#featureIn(org.bdgp.util.Range,
boolean, int)
public java.util.Collection<SeqFeatureI> featuresIn(org.bdgp.util.Range range, TierI.Level level)
featuresIn
in interface TierI
range
- a position range to look for the features withinlevel
- the level to view the tier atapollo.gui.detailviewers.exonviewer.TierI#featuresIn(org.bdgp.util.Range,
int)
public SequenceI getReference()
getReference
in interface TierI
apollo.gui.detailviewers.exonviewer.TierI#getReference()
public void setReference(SequenceI s)
setReference
in interface TierI
public int numFeatures(TierI.Level level)
numFeatures
in interface TierI
level
- the level to view the tier at
apollo.gui.detailviewers.exonviewer.TierI#numFeatures(int)
public org.bdgp.util.Range rangeAt(int position, TierI.Level level)
rangeAt
in interface TierI
position
- a position within the tierlevel
- a level to view the tier at
apollo.gui.detailviewers.exonviewer.TierI#rangeAt(int, int)
public void removeFeature(SeqFeatureI feature)
removeFeature
in interface TierI
feature
- the feature to be removedapollo.gui.detailviewers.exonviewer.TierI#removeFeature(apollo.datamodel.SeqFeatureI)
public java.util.Collection<SeqFeatureI> getFeatures(TierI.Level level)
getFeatures
in interface TierI
public int getHigh()
getHigh
in interface org.bdgp.util.Range
Range.getHigh()
public int getLow()
getLow
in interface org.bdgp.util.Range
Range.getLow()
public int getBasePair(int position)
getBasePair
in interface TierI
position
- a position within the tier
public int getPosition(int basePair)
getPosition
in interface TierI
basePair
- a base pair coordinate within the tier
public boolean willOverlap(SeqFeatureI feature)
willOverlap
in interface TierI
feature
- the feature to be tested
public Strand getStrand()
getStrand
in interface TierI
public void setStrand(Strand s)
setStrand
in interface TierI
public ReadingFrame getReadingFrame()
getReadingFrame
in interface TierI
public void setReadingFrame(ReadingFrame rf)
setReadingFrame
in interface TierI
public SeqFeatureI getNextFeature(int position, TierI.Level level)
getNextFeature
in interface TierI
public SeqFeatureI getPrevFeature(int position, TierI.Level level)
getPrevFeature
in interface TierI
public void clear()
clear
in interface TierI
public boolean handleAnnotationChangeEvent(AnnotationChangeEvent evt)
handleAnnotationChangeEvent
in interface AnnotationChangeListener
public SequenceType getType()
getType
in interface TierI
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Before Change
def test_one_channel(self):
(x_train, _), (_, _), _, _ = load_mnist()
x_train = x_train[:2]
x_train = x_train[:, 10:15, 15:20, :]
preprocess = PixelDefend(eps=5, pixel_cnn=self.pixelcnn)
defended_x, _ = preprocess(x_train)
After Change
x_train = x_train[:2, 10:15, 15:20, :]
// Define the network
model = ModelImage()
loss_fn = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(), lr=0.01)
self.pixelcnn = PyTorchClassifier(model=model, loss=loss_fn, optimizer=optimizer, input_shape=(1, 28, 28),
nb_classes=10, clip_values=(0, 1))
preprocess = PixelDefend(eps=5, pixel_cnn=self.pixelcnn)
defended_x, _ = preprocess(x_train)


In C#/F# data is also piped into dedicated event handlers for each data type. To use data this way, you
need to put an event handler in your algorithm that follows the pattern:
public void OnData(TradeBars data) {}
. LEAN automatically detects the method exists and sends data to it.
Python passes all data events into the def OnData(self, slice):
event handler. This is the preferred way to
access data for your strategy. This includes all the data you've requested for your algorithm, including custom data.
public void OnData(TradeBars data) { // TradeBars objects are piped into this method. } public void OnData(Ticks data) { // Ticks objects are piped into this method. }


{% extends "base.html" %} {% load static %} {% block main %}
by {{ book.author }}
{{ book.category.name }}
Book not found