AvaTax4J Readme |
This is a Java client adapter for Avalara AvaTax web services. This version has support for the tax and address services.
The adapter was built using Apache Axis WSDL2Java to build the stubs which were then enhanced to support a custom Profile SOAP header element and a WS-Security UsernameToken SOAP header element.
A set of JUnit tests are provided as examples. You may wish to refer to .NET/COM documentation for more details.
YOU MUST CONFIGURE avatax4j.properties before running tests or samples!
Use avatax4j.properties.sample as an example and insert your account and license.
| Contents | |
| /doc/api | Javadocs - API Documentation |
| /lib | All required jars |
| /samples | Sample applications
|
| /src | Full source code |
| /test | TaxSvcTest JUnit test class to be used as an initial example. |
| avatax4j.properties.sample | Sample properties file for JUnit tests to configure url, account, license This must be renamed to avatax4.properties and configured prior to running the unit tests. |
| build.xml | Ant build script. Run "ant" for usage instructions |
All dependent jar files are included for build and running.
A complete Ant build.xml script is provided in the root directory. Here is a list of the main target Ant tasks.
Many applications will only need to deploy the avatax4j.jar and avatax4j.properties file. The avatax4j.properties file can be eliminated by setting the server url, username and password credentials in your code. Examples of this can be found in any of the samples (e.g. TestConnectionSample).
Some applications may require deployment of additional jar files from the lib folder. These are all standard Sun, Apache, or other open-source components. The version is indicated in most of the jar file names, but avatax4j should be generally compatible with later versions. The axis-ant.jar, junit.jar, wsdl4j.jar are only used for building and testing avatax4j.
The changes in this release are primarily to support our upcoming high-availability initiative (AvaTax 6.0) which will provide multiple live AvaTax sites, called Tax Calculation Centers or TCCs. This new release eliminates the DocId property for all operations. Instead, clients will need to use DocCode instead of DocId. DocCode is specified by the client and typically represents an order or invoice number. Site specific DocIds are not compatible with a multi-site, highly-available architecture. We will maintain support for clients using earlier adapters, but they will not be able to take advantage of the new high-availability architecture. If you are developing a new client, then these changes do not affect you.
In this release we have exposed the ability to specify a latitude and longitude as part of the address.
Address class
BaseAddress class
package: com.avalara.avatax.services.tax
This release adds new Service AvaCert2.
General
- Added new Service AvaCert2 to add exempt customers, certificate request initiate, certificate request get, certificate get, and certificate image get.
AvaCert2Svc
- CustomerSaveRequest class
- Customer has been added. The customer data to add.
- CustomerSaveResult class
- CertificateRequestInitiateRequest class
- CompanyCode has been added. CompanyCode for the customer.
- CustomerCode has been added. CustomerCode indicates the customer identification code from client system.
- CommunicationMode has been added. CommunicationMode indicates the mode to use for communicating with the customer like Email, Mail, or Fax.
- SourceLocationCode has been added. SourceLocationCode is the Source LocationCode for the request. If provided; the code must be one that exists for the Company.
- RequestType has been added. RequestType indicates the type of the request to be initiated.
- CustomMessage has been added. Custom message to be used for the request.
- LetterTemplate has been added. The name of the Letter Template to use for the correspondence.
- IncludeCoverPage has been added. Whether or not a fax cover sheet with a barcode will be attached to the correspondence. If null, the default is used (false).
- CloseReason has been added. Reason for closing the Request.
- RequestId has been added. Unique identifier for the Request record.
- CertificateRequestInitiateResult class
- TrackingCode has been added. TrackingCode indicates the unique Tracking Code of the Request.
- WizardLaunchUrl has been added. WizardLaunchUrl indicates the unique tracking Url for the Request, that is used to launch the wizard.
- RequestId has been added. Unique identifier for the Request record.
- CustomerCode has been added. Customer identification code from client system.
- CertificateGetRequest class
- CompanyCode has been added. The ComapnyCode associated with a certificate record.
- CustomerCode has been added. The CustomerCode associated with a certificate record.
- ModFromDate has been added. The ModFromDate indicates the date from which the certificates needs to be fetched.
- ModToDate has been added. The ModToDate indicates the date from which the certificates needs to be fetched.
- CertificateGetResult class
- Certificates has been added. The Certificates contains collection of exemption certificate records.
- CertificateRequestGetRequest class
- CompanyCode has been added. The ComapnyCode associated with a certificate record.
- CustomerCode has been added. The CustomerCode associated with a certificate record.
- RequestStatus has been added. Current status of the Request.
- ModFromDate has been added. The ModFromDate indicates the date from which the certificates needs to be fetched.
- ModToDate has been added. The ModToDate indicates the date from which the certificates needs to be fetched.
- CertificateRequestGetResult class
- CertificateRequests has been added. The CertificateRequests contains collection of certificate request records
- CertificateImageGetRequest class
- CompanyCode has been added. The ComapnyCode associated with a certificate record.
- AvaCertId has been added. Unique identifier for the Certificate record.
- Format has been added. Format in which the image needs to be exported.
- PageNumber has been added. Page number of of the certificate image.
- CertificateImageGetResult class
- AvaCertId has been added. Unique identifier for the Certificate record.
- Image has been added. Image is the Certificate image.
- Customer class
- CustomerCode has been added. CustomerCode indicates the customer identification code from client system.
- NewCustomerCode has been added. NewCustomerCode is used for changing the CustomerCode.
- ParentCustomerCode has been added. ParentCustomerCode is unique identifier for the parent customer record.
- Type has been added. Type indicates the customer type code.
- BusinessName has been added. BusinessName indicates the business or organization name.
- Attn has been added. Attn indicates the name of the person to use in correspondence for the Customer record..
- Address1 has been added. Address1 is the Address line 1 .
- Address2 has been added. Address2 is the Address line 2 .
- City has been added. City name.
- State has been added. State indicates the state or province name.
- Country has been added. Country is the ISO 2-character country code.
- Zip has been added. Zip is the ZIP or postal code.
- Phone has been added. Phone number.
- Fax has been added. Fax number.
- Email has been added. Email address.
- Certificate class
- AvaCertId has been added. The AvaCertId is the unique identifier for the Certificate record.
- CertificateJurisdictions has been added. The CertificateJurisdictions contains the details of Certificate Jurisdiction.
- CustomerCodes has been added. The CustomerCodes for the customer associated with the Certificate record.
- CustomerType has been added. The CustomerType of the customer associated with the Certificate record.
- SourceLocationName has been added. The SourceLocationName is the source location display name for the Certificate record (the client location responsible for tracking the certificate).
- SourceLocationCode has been added. The SourceLocationCode is the source location code for the Certificate record (the client location responsible for tracking the certificate).
- CertificateStatus has been added. The CertificateStatus is the status for the Certificate record.
- ReviewStatus has been added. The ReviewStatus is the review status for the Certificate record.
- RejectionReasonCode has been added. Reason for rejection of a certificate when ReviewStatus of the Certificate record is REJECTED.
- RejectionReasonDetailCode has been added. Details about the reason for rejection of a certificate when ReviewStatus of the Certificate record is REJECTED.
- RejectionReasonCustomText has been added. Custom Reason or details about a reason for rejection of a certificate provided by the user when ReviewStatus of the Certificate record is REJECTED.
- CreatedDate has been added. The CreatedDate is the creation date of the Certificate record.
- LastModifiedDate has been added. The LastModifiedDate is the last modified date of the Certificate record.
- DocReceivedDate has been added. The DocReceivedDate is the received date of the Certificate record.
- BusinessName has been added. The BusinessName is the business name of the Certificate record.
- Address1 has been added. Address1 is the address1 field for the Certificate record.
- Address2 has been added. Address2 is the address2 field for the Certificate record.
- City has been added. City is the exempt customer city address field for the Certificate record.
- State has been added. State is the exempt customer region address field for the Certificate record.
- Country has been added. Country is the exempt customer country address field for the Certificate record.
- Zip has been added. Zip is the US zip or zip+4 code (or CA postal code) address field for the Certificate record.
- Phone has been added. Phone number field for the Certificate record.
- Email has been added. Email address field for the Certificate record.
- SignerName has been added. SignerName is the exempt customer signer name field for the Certificate record.
- SignerTitle has been added. SignerTitle is the exempt customer signer title field for the Certificate record.
- SignedDate has been added. SignedDate is the effective date (or the actual signature date) of the Certificate record.
- BusinessDescription has been added. BusinessDescription is the exempt customer business description field for the Certificate record.
- SellerPropertyDescription has been added. SellerPropertyDescription is the seller property description the exempt customer selected for the Certificate record.
- CertificateUsage has been added. CertificateUsage is the usage type for the Certificate record.
- PartialExemption has been added. PartialExemption indicates whether the Certificate record is considered "partially exempt".
- ExemptReasonCode has been added. ExemptReasonCode is the client-specified exemption reason code for the Certificate record.
- ExemptFormName has been added. ExemptFormName is the name of the state-issued form for the Certificate record; either a system-defined code name or a client-specified custom name.
- Custom1 has been added. Custom1 is the client-specified value for custom Certificate field 1.
- Custom2 has been added. Custom2 is the client-specified value for custom Certificate field 2.
- Custom3 has been added. Custom3 is the client-specified value for custom Certificate field 3.
- PageCount has been added. Number of pages in the Certificate record.
- RequestType enum
- Created new enum type called STANDARD which sends correspondences and follow ups related to this Request to the associated Customer.
- Created new enum type called DIRECT which does not send any correspondence or follow ups related to this Request to the associated Customer.
- FormatType enum
- Created new enum type called NULL which is a NULL(value not set) value (default value).
- Created new enum type called PNG which is a bitmapped binary image in the 1-bit PNG format .
- Created new enum type called PDF which is a document in Portable document format with images of every page in the certificate.
- CertificateStatus enum
- Created new enum type called ACTIVE which is active with images received.
- Created new enum type called VOID which has been voided from active use.
- Created new enum type called INCOMPLETE which does not yet have all of its images received.
- CertificateReviewStatus enum
- Created new enum type called PENDING which has not yet been reviewed.
- Created new enum type called ACCEPTED which was accepted during review.
- Created new enum type called REJECTED which was rejected during review.
- CertificateRequestStatus enum
- Created new enum type called ALL which is of any status.
- Created new enum type called OPEN which has been initiated and is currently open.
- Created new enum type called CLOSED which has been closed, either manually or automatically.
- CertificateRequestStage enum
- Created new enum type called REQUESTINITIATED which indicates request has been initiated; correspondence has been sent to the associated Customer.
- Created new enum type called CUSTOMERRESPONDED which indicates customer has responded to the correspondence.
- Created new enum type called CERTIFICATERECEIVED which indicates customer has provided a Certificate.
- CertificateUsage enum
- Created new enum type called BLANKET which indicates the certificate may be used multiple times.
- Created new enum type called SINGLE which indicates the certificate may only be used for a single transaction.
- Created new enum type called NULL which indicates value has not been set.
- CommunicationMode enum
- Created new enum type called NULL which is no value has been set.
- Created new enum type called EMAIL which is Email address.
- Created new enum type called MAIL which is Mail address.
- Created new enum type called FAX which is Fax number.
This release adds New Request Type (DIRECT) to InitiateExemptionCertificate where wizard will get launched to initiate certificate . This release also contains operations to get Exemption Certificate.
General
- Added new GetExemptionCertificates AvaCert method that will obtain all certificates from vCert for a customer.
AvaCertSvc
- InitiateExemptCertRequest class
- RequestType has been added. The RequestType indicates the type of the request to be initiated.
- InitiateExemptCertResult class
- WizardLaunchUrl has been added. The WizardLaunchUrl is an unique tracking Url for the Request, that is used to launch the wizard
- GetExemptionCertificatesRequest class
- CompanyCode has been added. The ComapnyCode associated with a certificate record.
- CustomerCode has been added. The CustomerCode associated with a certificate record.
- FromDate has been added. The FromDate indicates the date from which the certificates needs to be fetched.
- ToDate has been added. The ToDate indicates the date from which the certificates needs to be fetched.
- Region has been added. The Region associated with a certificate record.
- GetExemptionCertificatesResult class
- ArrayOfExemptionCertificate has been added. The ArrayOfExemptionCertificate contains collection of exemption certificate records.
- RecordCount has been added. The RecordCount indicates the total number of exemption certificates returned.
- ExemptionCertificate class
- AvaCertId has been added. The AvaCertId is the unique identifier for the Certificate record.
- Jurisdictions has been added. The Jurisdictions contains the details of Jurisdiction.
- CustomerCodes has been added. The CustomerCodes for the customer associated with the Certificate record.
- CustomerType has been added. The CustomerType of the customer associated with the Certificate record.
- LocationName has been added. The LocationName is the source location display name for the Certificate record (the client location responsible for tracking the certificate).
- LocationCode has been added. The LocationCode is the source location code for the Certificate record (the client location responsible for tracking the certificate).
- CertificateStatus has been added. The CertificateStatus is the status for the Certificate record.
- ReviewStatus has been added. The ReviewStatus is the review status for the Certificate record.
- CreatedDate has been added. The CreatedDate is the creation date of the Certificate record.
- ModifiedDate has been added. The ModifiedDate is the last modified date of the Certificate record.
- ReceivedDate has been added. The ReceivedDate is the received date of the Certificate record.
- BusinessName has been added. The BusinessName is the business name of the Certificate record.
- Address1 has been added. Address1 is the address1 field for the Certificate record.
- Address2 has been added. Address2 is the address2 field for the Certificate record.
- City has been added. City is the exempt customer city address field for the Certificate record.
- Region has been added. Region is the exempt customer region address field for the Certificate record.
- Country has been added. Country is the exempt customer country address field for the Certificate record.
- PostalCode has been added. PostalCode is the US zip or zip+4 code (or CA postal code) address field for the Certificate record.
- Phone has been added. Phone number field for the Certificate record.
- Email has been added. Email address field for the Certificate record.
- SignerName has been added. SignerName is the exempt customer signer name field for the Certificate record.
- SignerTitle has been added. SignerTitle is the exempt customer signer title field for the Certificate record.
- SignedDate has been added. SignedDate is the effective date (or the actual signature date) of the Certificate record.
- BusinessDescription has been added. BusinessDescription is the exempt customer business description field for the Certificate record.
- SellerPropertyDescription has been added. SellerPropertyDescription is the seller property description the exempt customer selected for the Certificate record.
- CertificateUsage has been added. CertificateUsage is the usage type for the Certificate record.
- IsPartialExemption has been added. IsPartialExemption indicates whether the Certificate record is considered "partially exempt".
- ExemptReasonCode has been added. ExemptReasonCode is the client-specified exemption reason code for the Certificate record.
- ExemptFormName has been added. ExemptFormName is the name of the state-issued form for the Certificate record; either a system-defined code name or a client-specified custom name.
- Custom1 has been added. Custom1 is the client-specified value for custom Certificate field 1.
- Custom2 has been added. Custom2 is the client-specified value for custom Certificate field 2.
- Custom3 has been added. Custom3 is the client-specified value for custom Certificate field 3.
- Jurisdiction class
- JurisdictionCode has been added. The JurisdictionCode for the Jurisdiction record.
- Country has been added. The Country code for the Jurisdiction record (ISO-3166-1-alpha-2 Country Code).
- ExpiryDate has been added. The Expiry Date is an expiration date for the Jurisdiction record..
- DoesNotExpire has been added. The DoesNotExpire indicates whether the Jurisdiction can expire.
- PermitNumbers has been added. The PermitNumbers are the exempt customer permit number(s) for the Jurisdiction record.
- RequestType enum
- Created new enum type called STANDARD which sends correspondences and follow ups related to this Request to the associated Customer.
- Created new enum type called DIRECT which does not send any correspondence or follow ups related to this Request to the associated Customer
- CertificateStatus enum
- Created new enum type called ACTIVE which is active with images received.
- Created new enum type called VOID which has been voided from active use.
- Created new enum type called INCOMPLETE which does not yet have all of its images received.
- ReviewStatus enum
- Created new enum type called PENDING which has not yet been reviewed.
- Created new enum type called ACCEPTED which was accepted during review.
- Created new enum type called REJECTED which was rejected during review.
- CertificateUsage enum
- Created new enum type called BLANKET which indicates the certificate may be used multiple times.
- Created new enum type called SINGLE which indicates the certificate may only be used for a single transaction.
- Created new enum type called NULL which indicates value has not been set.
This release adds the new AvaCertSvc web service interface. AvaCert is a new web-hosted, exemption certificate management service which automates the collection and management of exemption certificates. See www.avalara.com for details. An AvaCert subscription is required to use this service. Contact Avalara Sales to sign-up or find out more.
This version contains the changes to support AvaTax Tax Calculation Centers (our upcoming high availability solution). This adapter version will work with the AvaTax 5.7 and later service versions. It is intended to prepare clients for our upcoming AvaTax HA (6.0) release. It contains changes that may require code changes for existing changes. These are necessary to work with AvaTax HA services and Tax Calculation Centers.
1. Eliminated use of Document Ids
The DocId properties have been removed from the interface. Document Ids are internal, persistent identifiers for a specific document. AvaTax 5.6 and earlier adapters returned a DocId from GetTax which could optionally be used for subsequent calls to other methods such as PostTax. In the HA environment, DocIds are not assigned until the document reaches the Primary Data Center; therefore, DocIds are not available from a TCC (Tax Calculation Center). Use of DocId has always been optional as an alternative to specifying the CompanyCode, DocType and DocCode. The DocId properties have been removed from the interface in this adapter version. Clients that are not using DocIds will continue to work with no changes. Those using DocIds will need to switch to using DocCodes.
DocId has been removed from the following types. Use DocCode and CompanyCode instead of DocId.
GetTaxResult
PostTaxRequest
PostTaxResult
CommitTaxRequest
CommitTaxResult
CancelTaxRequest
CancelTaxResult
ApplyPaymentRequest
ApplyPaymentResult2. Added NewDocCode to PostTax and CommitTax
AvaTax allows clients to change the DocCode when calling PostTax or CommitTax. This is typically used to assign an invoice number during posting. If your application uses this capability, you will need to make some minor code changes. DocId was previously used to identify the document and DocCode was used to indicate the new document code.
The DocId property on the PostTaxRequest and CommitTaxRequest has been replaced with a NewDocCode property. DocCode is now used to identify the existing document instead of DocId. NewDocCode indicates the new DocCode.
3. Removed HashCode from the following types. This has not proven to be useful and will be replaced with a better mechanism in AvaTax 6.0.
GetTaxRequest
GetTaxResult
PostTaxRequest4. ReconcileTaxHistory Changes
A number of changes have been made to ReconcileTaxHistory to eliminate DocIds and provide additional filtering options.
ReconcileTaxHistoryRequest
DocType has been added as a filter. This allows filtering on SalesInvoices or other specific types.. A new enum value of DocumentType.Any can be used to return all types of documents.
LastDocId has been replaced with LastDocCode which is used for paging through the history. Results are now returned sorted by DocCode instead of DocId.
PageSize has been added to indicate the number of records to return. This defaults to 1000 as before.ReconcileTaxHistoryResult
LastDocId has been replaced with LastDocCode.
RecordCount has been added to indicate the total number of records in the ReconcileTaxHistoryResult.5. TaxDetail StateAssignedCode
StateAssignedNo has been added to the TaxDetail class. StateAssignedNo indicates the identifier given to the location by the state.
Several properties were added and some behavioral changes were made for the existing ones.
GetTaxRequest class
GetTaxResult class
TaxDetail class
TaxLine class
TaxSvc class
<IP_ADDRESS> - August 2008
<IP_ADDRESS>1 - June 2007
Commit
has been added. Setting this value to true
will straight away commit the document at the time of GetTax call. This
saves you separate PostTax and CommitTax call. IsTotalTaxOverriden
has been added. IsTotalTaxOverriden
indicates to apply tax to this line that has already been calculated by
the seller instead of calculating the tax. TotalTaxOverride
has been added. TotalTaxOverride is the tax
amount that has already been calculated by the seller that should be
applied to the line instead of the AvaTax calculate tax. Locked
has been added. Flag identifying the
Document has been locked by Avalara's MRS process.. AdjustmentReason
has
been added. Valid reason for adjusting document. AdjustmentDescription
has
been added. Description for adjusting document. Version
has
been added. This shows current version of document. TaxDate
has
been added. It is the date used to calculate tax on the Document.
IsTaxOverriden
has been added. IsTaxOverriden indicates to
apply tax that has already been calculated by the seller instead of
calculating the tax. TaxOverride
has been added. TaxOverride is the tax
amount that has already been calculated by the seller that should be
applied instead of the AvaTax calculate tax. TaxRegionId
has been added. TaxRegionId provides the
ability to override the tax region assignment for an address.
AdjustTax
call has been added. This takes
AdjustTaxRequest as an input and returns AdjustTaxResult which inherits
GetTaxResult. AdjustTaxRequest
has been added. It is made of
AdjustmentReason, AdjustmentDescription and GetTaxRequest object. It is
an input for AdjustTax call. AdjustTaxResult
has been added. It is similar to
GetTaxResult object. It is returned from AdjustTax call. Commit
has been added. Setting this value to true
will straight away commit the document at the time of PostTax call. This
saves you separate CommitTax call. ExemptCertId
has been added. This specifies ExemptCertId
applied to a particulat Line during GetTax call. AdjustmentCancelled
which cancels the adjustment made. Adjusted
which says document has been adjusted using AdjustTax call.


Who's next for NASCAR? Honda, Hyundai or someone else?
by Gary GasteluAnd then there were … four? NASCAR president Steve Phelps confirmed in Miami on Saturday that his team has recently had discussions with an unnamed manufacturer about joining Ford, Chevrolet and Toyota in the series.
“We had some folks out in Phoenix (last week) that were interested in coming into the sport,” Phelps said, according to NASCAR.com.
“It’s important for us. We are working hard to try to determine kind of the timing of that, what that looks like, and what that partnership would look like moving forward bringing someone in.”
DODGE TO QUIT NASCAR AT END OF 2012
Sports Business Journal reporter Adam Stern tweeted that word ahead of the Phoenix race was that Honda executives would be in attendance. Stern reported in May that NASCAR and Honda officials were seen meeting at the Indy 500, where Honda-powered teams were competing.
Honda V.P. Art St. Cyr told Motorsport.com in October that the automaker “would jump at the chance” to enter NASCAR if it “makes sense,” but there has been no official confirmation the two sides spoke in Phoenix.
Meanwhile, Hyundai has confirmed prior discussions with NASCAR. Thomas Schemera, the Korean automaker’s head of global product strategy, told Autoweek that it is looking at the situation closely.
NASCAR MAY SWITCH TO HYBRIDS IN 2022, EXECUTIVE SAYS
NASCAR is set to launch an all-new spec car for the 2019 season that’s being developed to be more cost-effective, competitive and relevant to road cars in an attempt to make the series more appealing to automakers.
“We’re trying to make it as easy as possible to have an OEM come in, plug in, and start to compete on the race track,” Phelps said.


Leaver Settings
When Leaver is enabled, the channel specified will log when users have left the server
The channel leaver will use to send messages
When Enabled, leaver messages will be in an embed
Configure the message that the leaver will use. Welcomer direct messages also support the use of formatting which you can find here


#include "synch.h"
Go to the source code of this file.
Classes | |
| class | DriverACIA |
| Defines an ACIA (Asynchronous Communication Interface Adapter) device driver. More... | |
Defines | |
| #define | BUFFER_SIZE 256 |
The ACIA is an asynchronous device (requests return immediately, and an interrupt happens later on). This is a layer on top of the ACIA. Two working modes are to be implemented in assignment 2: a Busy Waiting mode and an Interrupt mode. The Busy Waiting mode implements a synchronous IO whereas IOs are asynchronous IOs are implemented in the Interrupt mode (see the Nachos roadmap for further details).
Copyright (c) 1999-2000 INSA de Rennes. All rights reserved. See copyright_insa.h for copyright notice and limitation of liability and disclaimer of warranty provisions.
|
|
|


Some quick notes about using macros and quotations. This should really be merged with macros' documentation page, but it will wait, because our parsetree structure is going to be changed soon and this will also impact quotations (simplyfiy them) a lot.
For best reference of how to write quotations, take a look at algorithm used to translate them in the sources. This code is quite self explaining (at least if you just need to know how to write quotations).
So first, why can't I write
<[ | Some (x) => x ]>
Unfortunately
| Some (x) => x
is a match case, not an expression, and standard quotation is used by default for expressions. To make a quoted match case, you must simply add the case:
target to the quotation. So it would finally look like
<[ case: | Some (x) => x ]>
Unfortunately parsetree is not yet unified enough to look very consistent and try
statement use different syntax for quotations. You write
<[ try $body catch { $exn : $exn_ty => $handler } ]>
This quotation allows only one handler in catch, but you can nest others in body of try block.
Macros are arbitrary functions and they can reference any external classes. It is sometimes also useful to use Nemerle compiler API from withing a macro. It is usually done using two methods
- Using static helper functions from Nemerle.Compiler namespace
- Using the instance of typer to make more advanced things, like typing some code fragment, asking for defined local variables in current scope, etc.
The second operation requires obtaining an instance of
Nemerle.Compiler.Typer within a macro. Actually, every macro has it as a hidden
parameter (we just didn't want to pollute macros syntax with this parameter, because it is rarely used) and it can be obtained using
Nemerle.Macros.ImplicitCTX () function (it is a macro returning the hidden parameter).
Consider following code:
macro print_visible_vars () {
def locals = Nemerle.Macros.ImplicitCTX ().GetLocals ();
def amount = locals.Fold (0, fun (n : Name, loc : LocalValue, acc) {
System.Console.WriteLine ($"var $(n.Id) is visible");
acc + 1
}
System.Console.WriteLine ($"seen $amount variables");
}
This is the way how you can get some compiler's internals for your own usage. Feel free to ask for new useful methods to be created in compiler if you need them.


∙ My name is
Nicole Chan
∙ This was the final project for my undergraduate data visualization course at Boston College with Professor Kim.
∙ The
World Health Organization has data on total deaths by suicide and suicide rates per 100,000 people overall and by age group and sex for 198 countries.
∙ This project seeks to inform the end user on worldwide suicide rates since 1985. I used an explanatory approach that combines data on suicides around the world with text displays that allow the user to fully immerse themselves with the visualizations and the gravity of what they are seeing. This data set gave the most complete look on an issue that is becoming more pressing as time goes on.


"x" "1" "SCHOENY,R AND WARSHAWSKY,D, MUTAGENICITY OF 7H-DIBENZO[C,G]CARBAZOLEAND METABOLITES IN SALMONELLA TYPHIMURIUM, MUTAT. RES. 188(4):275-286,1987"


-
{{Burger.name}}
Burger Price: {{Burger.price}}
Contains: Lactose
Contains: Gluten
Allergy friendly!
{{burgerdetails.chosen_burger}}
Customer Information
Please, fill in information for delivery & receipt in the fields below
Delivery Information:
Please, indicate point of delivery
T
Gender Statistics Study
Please select your gender by choosing one of the options listed below
Order Confirmed!
Customer Information:
Name: {{burgerdetails.fullname}}
Email: {{burgerdetails.email}}
Deliver to: {{x}} x / {{y}} y
Payment method: {{burgerdetails.payment}}
Gender: {{burgerdetails.gender}}


The sample prefix, e.g., shearwater-20140922-
The expected number of samples
A list of organs, separated by commas
A list of storage media, separated by commas


Coronation Street SPOILERS: Kel holds Bernie hostage
Kel groomed Paul when he was a child
by Charlotte RodriguesNew cobbles villain Kel Hinchley will turn nasty with Bernie Winter after his true colours are exposed in next week's Coronation Street.
Bernie is furious when she learns Kel sexually abused her son Paul Foreman when he was a child.
New spoilers on Coronation Street's official website have revealed Bernie confronts her boyfriend at No.5.
But as Bernie tries to make her escape, Kel steals the house keys and holds her hostage.
Can Gemma and Paul rescue their mum before it's too late?
It was recently confirmed that Gemma and Bernie would find out about Kel's crimes.
Read More: Coronation Street's Andy Whyment 'lands new £125,000-a-year contract for soap'
In this week's Coronation Street, when a spate of robberies take place at the church, they realise Kel is to blame and Gemma and Bernie go to his flat to investigate.
But what they find leaves them completely shocked.
The pair are horrified to find Daniel Osbourne's stolen laptop as well as photos of Paul and some other children.
Read More: Beverley Callard has quit Coronation Street as Liz McDonald
Gemma soon realises the significance of what they've found.
Paul later recounts his abuse at the hands of Kel, leaving Bernie and Gemma shocked.
Whilst Gemma urges her brother to go to the police, he refuses, adamant that raking over the past would be too painful.
Coronation Street airs on Mondays, Wednesdays and Fridays at 7.30pm and 8.30pm on ITV.
Have you been watching this storyline? Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know what you think!


|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
| Class Summary | |
|---|---|
| AbstractGroupTabHandler | The base tab handler for all Target Group Handlers. |
| AccessHandler | The handler for the groups access tab. |
| AddMembersController | This controller manages the process of adding members to a Target Group. |
| AddParentsController | This controller manages the process of adding members to a Target Group. |
| DescriptionHandler | The tab handler for the Target Group Description Tab. |
| GeneralHandler | The tab handler for the Target Group General Tab. |
| GroupAnnotationHandler | The handler for the group annotations tab. |
| GroupSearchController | The controller for processing target group searches. |
| GroupsProfileHandler | The tab handler for the Target Group Profile Tab. |
| MemberOfHandler | The tab handler for the Target Group 'Member Of' Tab. |
| MembersHandler | The tab handler for the Target Group Members Tab. |
| MoveTargetsController | This controller manages the process of adding members to a Target Group. |
| TabbedGroupController | The controller for handling the Target Group Tabs. |
|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


Note
Click here to download the full example code
Intrinsics and Math Functions¶
Author: Tianqi Chen
While TVM supports basic arithmetic operations. In many cases
usually we will need more complicated builtin functions.
For example exp
to take the exponetial of the function.
These functions are target system dependent and may have different names of different target platforms. In this tutorial, we will learn how we can invoke these target specific functions, and how we can unify the interface via tvm’s intrinsic API.
from __future__ import absolute_import, print_function
import tvm
import numpy as np
Direct Declare Extern Math Call¶
The most straight-forward way to call target specific function is via
extern function call construct in tvm.
In th following example, we use tvm.call_pure_extern
to call
__expf
function, which is only available under CUDA.
n = tvm.var("n")
A = tvm.placeholder((n,), name='A')
B = tvm.compute(A.shape,
lambda i: tvm.call_pure_extern("float32", "__expf", A[i]),
name="B")
s = tvm.create_schedule(B.op)
num_thread = 64
bx, tx = s[B].split(B.op.axis[0], factor=num_thread)
s[B].bind(bx, tvm.thread_axis("blockIdx.x"))
s[B].bind(tx, tvm.thread_axis("threadIdx.x"))
f = tvm.build(s, [A, B], "cuda", name="myexp")
print(f.imported_modules[0].get_source())
Unified Intrinsic Call¶
The above code verifies that direct external call can be used to call into device specific functions. However, the above way only works for CUDA target with float type. Ideally, we want to write same code for any device and any data type.
TVM intrinsic provides the user a mechanism to achieve this, and this
is the recommended way to solve the problem.
The following code use tvm.exp instead, which create an intrinsic call
tvm.exp
to do the exponential.
n = tvm.var("n")
A = tvm.placeholder((n,), name='A')
B = tvm.compute(A.shape, lambda i: tvm.exp(A[i]), name="B")
s = tvm.create_schedule(B.op)
num_thread = 64
bx, tx = s[B].split(B.op.axis[0], factor=num_thread)
s[B].bind(bx, tvm.thread_axis("blockIdx.x"))
s[B].bind(tx, tvm.thread_axis("threadIdx.x"))
fcuda = tvm.build(s, [A, B], "cuda", name="myexp")
print(fcuda.imported_modules[0].get_source())
We can find that the code works for both CUDA and opencl. The same tvm.exp can also be used for float64 data types.
fopencl = tvm.build(s, [A, B], "opencl", name="myexp")
print(fopencl.imported_modules[0].get_source())
Intrinsic Lowering Rule¶
When tvm.exp
is called, TVM creates an intrinsic Call Expr.
TVM uses transformation rules to transform the intrinsic
call to device specific extern calls.
TVM also allows user to customize the rules during runtime.
The following example customizes CUDA lowering rule for exp
.
def my_cuda_math_rule(op):
"""Customized CUDA intrinsic lowering rule"""
assert isinstance(op, tvm.expr.Call)
if op.dtype == "float32":
# call float function
return tvm.call_pure_extern("float32", "%sf" % op.name, op.args[0])
elif op.dtype == "float64":
# call double function
return tvm.call_pure_extern("float32", op.name, op.args[0])
else:
# cannot do translation, return self.
return op
tvm.register_intrin_rule("cuda", "exp", my_cuda_math_rule, override=True)
Register the rule to TVM with override option to override existing rule.
Notice the difference between the printed code from previous one:
our new rule uses math function expf
instead of
fast math version __expf
.
fcuda = tvm.build(s, [A, B], "cuda", name="myexp")
print(fcuda.imported_modules[0].get_source())
Add Your Own Intrinsic¶
If there is an instrinsic that is not provided by TVM.
User can easily add new intrinsic by using the intrinsic rule system.
The following example add an intrinsic mylog
to the system.
def mylog(x):
"""customized log intrinsic function"""
return tvm.call_pure_intrin(x.dtype, "mylog", x)
def my_cuda_mylog_rule(op):
"""CUDA lowering rule for log"""
if op.dtype == "float32":
return tvm.call_pure_extern("float32", "logf", op.args[0])
elif op.dtype == "float64":
return tvm.call_pure_extern("float64", "log", op.args[0])
else:
return op
tvm.register_intrin_rule("cuda", "mylog", my_cuda_mylog_rule, override=True)
n = tvm.var("n")
A = tvm.placeholder((n,), name='A')
B = tvm.compute(A.shape, lambda i: mylog(A[i]), name="B")
s = tvm.create_schedule(B.op)
num_thread = 64
bx, tx = s[B].split(B.op.axis[0], factor=num_thread)
s[B].bind(bx, tvm.thread_axis("blockIdx.x"))
s[B].bind(tx, tvm.thread_axis("threadIdx.x"))
fcuda = tvm.build(s, [A, B], "cuda", name="mylog")
print(fcuda.imported_modules[0].get_source())
Summary¶
TVM can call extern target dependent math function.
Use intrinsic to defined a unified interface for the functions.
For more intrinsics available in tvm, take a look at
tvm.intrin
You can customize the intrinsic behavior by defining your own rules.
Total running time of the script: ( 0 minutes 0.000 seconds)


LojaVirtual
Home
(current)
Categorias
Action
Another action
Something else here
Contato
Pesquisa
Login
Carrinho


|
libcoap
4.3.0
|
Structures, Enums and Functions that are not exposed to applications. More...
Data Structures | |
| struct | coap_attr_t |
| Abstraction of attribute associated with a resource. More... | |
| struct | coap_resource_t |
| Abstraction of resource that can be attached to coap_context_t. More... | |
Macros | |
| #define | RESOURCES_ADD(r, obj) HASH_ADD(hh, (r), uri_path->s[0], (obj)->uri_path->length, (obj)) |
| #define | RESOURCES_DELETE(r, obj) HASH_DELETE(hh, (r), (obj)) |
| #define | RESOURCES_ITER(r, tmp) |
| #define | RESOURCES_FIND(r, k, res) |
Functions | |
| void | coap_delete_all_resources (coap_context_t *context) |
Deletes all resources from given context and frees their storage. More... | |
| void | coap_delete_attr (coap_attr_t *attr) |
| Deletes an attribute. More... | |
| coap_print_status_t | coap_print_wellknown (coap_context_t *, unsigned char *, size_t *, size_t, coap_opt_t *) |
Prints the names of all known resources to buf . More... | |
Structures, Enums and Functions that are not exposed to applications.
| #define RESOURCES_ADD | ( | r, | |
| obj | |||
| ) | HASH_ADD(hh, (r), uri_path->s[0], (obj)->uri_path->length, (obj)) |
Definition at line 110 of file coap_resource_internal.h.
| #define RESOURCES_DELETE | ( | r, | |
| obj | |||
| ) | HASH_DELETE(hh, (r), (obj)) |
Definition at line 113 of file coap_resource_internal.h.
| #define RESOURCES_FIND | ( | r, | |
| k, | |||
| res | |||
| ) |
Definition at line 120 of file coap_resource_internal.h.
| #define RESOURCES_ITER | ( | r, | |
| tmp | |||
| ) |
Definition at line 116 of file coap_resource_internal.h.
| void coap_delete_all_resources | ( | coap_context_t * | context | ) |
Deletes all resources from given context
and frees their storage.
| context | The CoAP context with the resources to be deleted. |
Definition at line 590 of file resource.c.
| void coap_delete_attr | ( | coap_attr_t * | attr | ) |
Deletes an attribute.
Note: This is for internal use only, as it is not deleted from its chain.
| attr | Pointer to a previously created attribute. |
Definition at line 468 of file resource.c.
| coap_print_status_t coap_print_wellknown | ( | coap_context_t * | context, |
| unsigned char * | buf, | ||
| size_t * | buflen, | ||
| size_t | offset, | ||
| coap_opt_t * | query_filter | ||
| ) |
Prints the names of all known resources to buf
.
This function sets buflen
to the number of bytes actually written and returns 1
on succes. On error, the value in buflen
is undefined and the return value will be 0
.
| context | The context with the resource map. |
| buf | The buffer to write the result. |
| buflen | Must be initialized to the maximum length of buf and will be set to the length of the well-known response on return. |
| offset | The offset in bytes where the output shall start and is shifted accordingly with the characters that have been processed. This parameter is used to support the block option. |
| query_filter | A filter query according to Link Format |
buf
. COAP_PRINT_STATUS_TRUNC is set when the output has been truncated. Definition at line 171 of file resource.c.


Dashboard
6302
1354
4562
362
Total Views
Area Chart Example
Recently users and
experts
| Username | Position | Full Name | Time |
|---|---|---|---|
| tigernixon | User | Tiger Nixon | 1 min |
| garrettwinters | User | Garrett Winters | 1 min |
| ashtoncox | User | Ashton Cox | 1 min |
| cedrickelly | User | Cedric Kelly | 1 min |
| airisatou | Expert | Airi Satou | 1 min |
| briellewilliamson | Expert | Brielle Williamson | 1min |
| herrodchandler | User | Herrod Chandler | 1 min |
| tigernixon | User | Tiger Nixon | 1 min |
| garrettwinters | User | Garrett Winters | 1 min |
| ashtoncox | User | Ashton Cox | 1 min |
| cedrickelly | User | Cedric Kelly | 1 min |
| airisatou | Expert | Airi Satou | 1 min |
| briellewilliamson | Expert | Brielle Williamson | 1min |
| herrodchandler | User | Herrod Chandler | 1 min |
| tigernixon | User | Tiger Nixon | 1 min |
| garrettwinters | User | Garrett Winters | 1 min |
| ashtoncox | User | Ashton Cox | 1 min |
| cedrickelly | User | Cedric Kelly | 1 min |
| airisatou | Expert | Airi Satou | 1 min |
| briellewilliamson | Expert | Brielle Williamson | 1min |
| herrodchandler | User | Herrod Chandler | 1 min |
| tigernixon | User | Tiger Nixon | 1 min |
| garrettwinters | User | Garrett Winters | 1 min |
| ashtoncox | User | Ashton Cox | 1 min |
| cedrickelly | User | Cedric Kelly | 1 min |
| airisatou | Expert | Airi Satou | 1 min |
| briellewilliamson | Expert | Brielle Williamson | 1min |
| herrodchandler | User | Herrod Chandler | 1 min |
| tigernixon | User | Tiger Nixon | 1 min |
| garrettwinters | User | Garrett Winters | 1 min |
| Username | Position | Full Name | Time |


1 The Jinterface Package
The Jinterface package provides a set of tools for communication with Erlang processes. It can also be used for communication with other Java processes using the same package, as well as C processes using the Erl_Interface library.
The set of classes in the package can be divided into two categories: those that provide the actual communication, and those that provide a Java representation of the Erlang data types. The latter are all subclasses of OtpErlangObject, and they are identified by the OtpErlang prefix.
Since this package provides a mechanism for communicating with Erlang, message recipients can be Erlang processes or instances of com.ericsson.otp.erlang.OtpMbox, both of which are identified with pids and possibly registered names. When pids or mailboxes are mentioned as message senders or recipients in this section, it should assumed that even Erlang processes are included, unless specified otherwise. The classes in Jinterface support the following:
- manipulation of data represented as Erlang data types
- conversion of data between Java and Erlang formats
- encoding and decoding of Erlang data types for transmission or storage
- communication between Java nodes and Erlang processes
In the following sections, these topics are described:
- mapping of Erlang types to Java
- encoding, decoding, and sending Erlang terms
- connecting to a distributed Erlang node
- using nodes, mailboxes and EPMD
- sending and receiving Erlang messages and data
- remote procedure calls
- linking to remote processes
- compiling your code for use with Jinterface
- tracing message flow
1.1 Mapping of Basic Erlang Types to Java
This section describes the mapping of Erlang basic types to Java.
| Erlang type | Java type |
| atom | OtpErlangAtom |
| binary | OtpErlangBinary |
| floating point types | OtpErlangFloator OtpErlangDouble, depending on the floating point value size |
| integral types | One of OtpErlangByte,OtpErlangChar,OtpErlangShort,OtpErlangUShort,OtpErlangInt,OtpErlangUIntorOtpErlangLong, depending on the integral value size and sign |
| list | OtpErlangList |
| pid | OtpErlangPid |
| port | OtpErlangPort |
| ref | OtpErlangRef |
| tuple | OtpErlangTuple |
| map | OtpErlangMap |
| term | OtpErlangObject |
1.2 Special Mapping Issues
The atoms true and false are special atoms, used as boolean values. The class OtpErlangBoolean can be used to represent these.
Lists in Erlang are also used to describe sequences of printable characters (strings). A convenience class OtpErlangString is provided to represent Erlang strings.
1.3 Nodes
A node as defined by Erlang/OTP is an instance of the Erlang Runtime System, a virtual machine roughly equivalent to a JVM. Each node has a unique name in the form of an identifier composed partly of the hostname on which the node is running, e.g<EMAIL_ADDRESS>Several such nodes can run on the same host as long as their names are unique. The class OtpNode represents an Erlang node. It is created with a name and optionally a port number on which it listens for incoming connections. Before creating an instance of OtpNode, ensure that Epmd is running on the host machine. See the Erlang documentation for more information about Epmd. In this example, the host name is appended automatically to the identifier, and the port number is chosen by the underlying system:
OtpNode node = new OtpNode("gurka");
1.4 Mailboxes
Erlang processes running on an Erlang node are identified by process identifiers (pids) and, optionally, by registered names unique within the node. Each Erlang process has an implicit mailbox that is used to receive messages; the mailbox is identified with the pid of the process.
Jinterface provides a similar mechanism with the class OtpMbox, a mailbox that can be used to send and receive messages asynchronously. Each OtpMbox is identified with a unique pid and , optionally, a registered name unique within the OtpNode.
Applications are free to create mailboxes as necessary. This is done as follows:
OtpMbox mbox = node.createMbox();
The mailbox created in the above example has no registered name, although it does have a pid. The pid can be obtained from the mailbox and included in messages sent from the mailbox, so that remote processes are able to respond.
An application can register a name for a mailbox, either when the mailbox is initially created:
OtpMbox mbox = node.createMbox("server");
or later on, as necessary:
OtpMbox mbox = node.createMbox(); mbox.registerName("server");
Registered names are usually necessary in order to start communication, since it is impossible to know in advance the pid of a remote process. If a well-known name for one of the processes is chosen in advance and known by all communicating parties within an application, each mailbox can send an initial message to the named mailbox, which then can identify the sender pid.
1.5 Connections
It is not necessary to explicitly set up communication with a remote node. Simply sending a message to a mailbox on that node will cause the OtpNode to create a connection if one does not already exist. Once the connection is established, subsequent messages to the same node will reuse the same connection.
It is possible to check for the existence of a remote node before attempting to communicate with it. Here we send a ping message to the remote node to see if it is alive and accepting connections:
if (node.ping("remote",2000)) { System.out.println("remote is up"); } else { System.out.println("remote is not up"); }
If the call to ping() succeeds, a connection to the remote node has been established. Note that it is not necessary to ping remote nodes before communicating with them, but by using ping you can determine if the remote exists before attempting to communicate with it.
Connections are only permitted by nodes using the same security cookie. The cookie is a short string provided either as an argument when creating OtpNode objects, or found in the user's home directory in the file .erlang.cookie. When a connection attempt is made, the string is used as part of the authentication process. If you are having trouble getting communication to work, use the trace facility (described later in this document) to show the connection establishment. A likely problem is that the cookies are different.
Connections are never broken explicitly. If a node fails or is closed, a connection may be broken however.
1.6 Transport Factory
All necessary connections are made using methods of OtpTransportFactory interface. Default OtpTransportFactory implementation is based on standard Socket class. User may provide custom transport factory as needed. See java doc for details.
1.7 Sending and Receiving Messages
Messages sent with this package must be instances of OtpErlangObject or one of its subclasses. Message can be sent to processes or pids, either by specifying the pid of the remote, or its registered name and node.
In this example, we create a message containing our own pid so the echo process can reply:
OtpErlangObject[] msg = new OtpErlangObject[2]; msg[0] = mbox.self(); msg[1] = new OtpErlangAtom("hello, world"); OtpErlangTuple tuple = new OtpErlangTuple(msg);
When we send the message, a connection will be created:
mbox.send("echo"<EMAIL_ADDRESS>tuple);
And here we receive the reply:
OtpErlangObject reply = mbox.receive();
Messages are sent asynchronously, so the call to send() returns as soon as the message has been dispatched to the underlying communication layer. This means that you receive no indication whether the operation completed successfully or the remote even existed. If you need this kind of confirmation, you should wait for a response from the remote process.
The echo server itself might look like this:
OtpNode self = new OtpNode("gurka"); OtpMbox mbox = self.createMbox("echo"); OtpErlangObject o; OtpErlangTuple msg; OtpErlangPid from; while (true) { try { o = mbox.receive(); if (o instanceof OtpErlangTuple) { msg = (OtpErlangTuple)o; from = (OtpErlangPid)(msg.elementAt(0)); mbox.send(from,msg.elementAt(1)); } catch (Exception e) { System.out.println("" + e); } }
In the examples above, only one mailbox was created on each node. however you are free to create as many mailboxes on each node as you like. You are also free to create as many nodes as you like on each JVM, however because each node uses some limited system resources such as file descriptors, it is recommended that you create only a small number of nodes (such as one) on each JVM.
1.8 Sending Arbitrary Data
This package was originally intended to be used for communicating between Java and Erlang, and for that reason the send and receive methods all use Java representations of Erlang data types.
However it is possible to use the package to communicate with remote processes written in Java as well, and in these cases it may be desirable to send other data types.
The simplest way to do this is to encapsulate arbitrary data in messages of type OtpErlangBinary. The OtpErlangBinary class can be created from arbitrary Java objects that implement the Serializable or Externalizable interface:
o = new MyClass(foo); mbox.send(remote,new OtpErlangBinary(o));
The example above will cause the object to be serialized and encapsulated in an OtpErlangBinary before being sent. The recipient will receive an OtpErlangBinary but can extract the original object from it:
msg = mbox.receive(); if (msg instanceof OtpErlangBinary) { OtpErlangBinary b = (OtpErlangBinary)msg; MyClass o = (MyClass)(b.getObject()); }
1.9 Linking to Remote Processes
Erlang defines a concept known as linked processes. A link is an implicit connection between two processes that causes an exception to be raised in one of the processes if the other process terminates for any reason. Links are bidirectional: it does not matter which of the two processes created the link or which of the linked processes eventually terminates; an exception will be raised in the remaining process. Links are also idempotent: at most one link can exist between two given processes, only one operation is necessary to remove the link.
 Also here, no distinction is made between mailboxes and Erlang processes. A link can be created to a remote mailbox or process when its pid is known:
mbox.link(remote);
The link can be removed by either of the processes in a similar manner:
mbox.unlink(remote);
If the remote process terminates while the link is still in place, an exception will be raised on a subsequent call to receive():
try { msg = mbox.receive(); } catch (OtpErlangExit e) { System.out.println("Remote pid " + e.pid() + " has terminated"); } catch (OtpErlangDecodeException f) { System.out.println("Received message could not be decoded: " + f); }
When a mailbox is explicitly closed, exit messages will be sent in order to break any outstanding links. If a mailbox is never closed but instead goes out of scope, the objects finalize() method will call close(). However since Java provides no guarantees about when or even if finalize() will be called, it is important that your application explicitly closes mailboxes when they are no longer needed if you want links to work in a timely manner.
1.10 Using EPMD
Epmd is the Erlang Port Mapper Daemon. Distributed Erlang nodes register with epmd on the localhost to indicate to other nodes that they exist and can accept connections. Epmd maintains a register of node and port number information, and when a node wishes to connect to another node, it first contacts epmd in order to find out the correct port number to connect to.
The basic interaction with EPMD is done through instances of OtpEpmd class. Nodes wishing to contact other nodes must first request information from Epmd before a connection can be set up, however this is done automatically by OtpSelf.connect() when necessary.
When you use OtpSelf.connect() to connect to an Erlang node, a connection is first made to epmd and, if the node is known, a connection is then made to the Erlang node.
Java nodes can also register themselves with epmd if they want other nodes in the system to be able to find and connect to them. This is done by call to method OtpEpmd.publishPort().
Be aware that on some systems (such as VxWorks), a failed node will not be detected by this mechanism since the operating system does not automatically close descriptors that were left open when the node failed. If a node has failed in this way, epmd will prevent you from registering a new node with the old name, since it thinks that the old name is still in use. In this case, you must unregister the name explicitly, by using OtpEpmd.unPublishPort()
This will cause epmd to close the connection from the far end. Note that if the name was in fact still in use by a node, the results of this operation are unpredictable. Also, doing this does not cause the local end of the connection to close, so resources may be consumed.
1.11 Remote Procedure Calls
An Erlang node acting as a client to another Erlang node typically sends a request and waits for a reply. Such a request is included in a function call at a remote node and is called a remote procedure call. Remote procedure calls are supported through the class OtpConnection. The following example shows how the OtpConnection class is used for remote procedure calls:
OtpSelf self = new OtpSelf("client", "hejsan" ); OtpPeer other = new OtpPeer("server@balin"); OtpConnection connection = self.connect(other); connection.sendRPC("erlang","date",new OtpErlangList()); OtpErlangObject received = connection.receiveRPC();
erlang:date/0 is just called to get the date tuple from a remote host.
1.12 Compiling and Loading Your Code
In order to use any of the Jinterface classes, include the following line in your code:
import com.ericsson.otp.erlang.*;
Determine where the top directory of your OTP installation is. You can find this out by starting Erlang and entering the following command at the Eshell prompt:
Eshell V<IP_ADDRESS> (abort with ^G) 1> code:root_dir(). /usr/local/otp
To compile your code, make sure that your Java compiler knows where to find the file OtpErlang.jar which contains the package. This is done by specifying an appropriate -classpath argument on the command line, or by adding it to the CLASSPATH definition in your Makefile. The correct value for this path is $OTPROOT/lib/jinterfaceVsn/priv/OtpErlang.jar, where $OTPROOT is the path reported by code:root_dir/0 in the above example and Vsn is the version of Jinterface, for example jinterface-1.2
$ javac -classpath ".:/usr/local/otp/lib/jinterface-1.2/priv/OtpErlang.jar" myclass.java
When running your program, you will also need to specify the path to OtpErlang.jar in a similar way.
$ java ".:/usr/local/otp/lib/jinterface-1.2/priv/OtpErlang.jar" myclass
1.13 Tracing
Communication between nodes can be traced by setting a system property before the communication classes in this package are initialized. The value system property "OtpConnection.trace" is the default trace level for all connections. Normally the default trace level is zero, i.e. no tracing is performed. By setting OtpConnection.trace to some non-zero value, the communication protocol can be shown in more or less detail. The valid values are:
- 0: no tracing is performed
- 1: only ordinary send and reg-send messages are shown
- 2: control messages such as link, unlink and exit are shown
- 3: connection setup (handshake) is shown
- 4: epmd requests are shown
Each level also includes the information shown by all lower levels.


Build
Open Attestation 2.2
The build environment has been
validated in Fedora 21.
If you build package behind
firewall, you would need to setup following proxies in order to download source
code and needed libraries.
# export http_proxy=
http://<proxy_server>:<proxy_port>
# export https_proxy=
https://<proxy_server>:<proxy_port>
# export ftp_proxy=
ftp://<proxy_server>:<proxy_port>
# yum install git maven
# yum install java-1.8.0-openjdk
# yum install zip make gcc-c++ makeself
Open Attestation 2.2 uses Bouncycastle JCE provider, add the provider to the list of
trusted in $JAVA_HOME/jre/lib/security/java.security like this:
security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider
Besides, if you are using jdk6 and
previous, pls copy corresponding jars to $JAVA_HOME/jre/lib/security to support the provider. Download these
jars from Oracle website jce-6-download.
# unzip jce_policy-6.zip
# cp jce/*.jar JAVA_HOME/jre/lib/security
Notes: Some JDK, especially openJDK 1.6 haven't integrated with bouncy castle, so you
need copy the binary of bouncy castle, in some case named as "bcprov-jdk*.jar" to this directory:$JAVA_HOME/lib/ext, you can download Bouncy Castle provider from here Bouncy Castle.
Using git
tool to download the source code, suppose your code is located in home
directory
# cd $HOME
# git clone
https://github.com/OpenAttestation/OpenAttestation/
Download XenServer
SDK {optional}
If you plan to use XenServer feature, you need download XenServer-6.2.0-SDK.zip from XenServer
website, and copy xenserver-6.2.0-1.jar from zip to citrix-sdk
directory.
# unzip
XenServer-6.2.0-SDK.zip
# cp XenServer-SDK/XenServerJava/bin/xenserver-6.2.0-1.jar $HOME/OpenAttestation/services/citrix-sdk/
Open Attestation 2.2 uses maven tool
to build source code. Run the following commands to build the source code, if
the code is built behind the firewall, you need explicitly adjust
"settings.xml" to add proxy for maven.
# cd $HOME/OpenAttestation
# git checkout v2.2
# mvn clean install -Dbuild.compiler=javac1.7 //compile general code
or
# mvn clean install –Dcompile.xenserver=true -Dbuild.compiler=javac1.7 //compile XenServer code
If
you want skip our test cases, you can use this command:
# mvn
clean install -DskipTests=true
-Dbuild.compiler=javac1.7
Note: Default
build compiler has not supported at present, and javac1.7 has replaced it
temporarily.
Attestation Server Installation
So far, the server installation has
been verified on Fedora 21.
Make sure TCP port 8181, 8080 are not
blocked by firewall.
Fedora 21
iptables -I INPUT 1 -p tcp --dport 8181 -j ACCEPT
iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
Install packages listed below:
# yum install java-1.8.0-openjdk
# yum install openssl
# yum install gcc unzip
Also install the following packages:
Database system: MySQL 5.0 / MariaDB or later, or PostgreSQL
Java web application container: Glassfish 3.0 or later, or Tomcat 6.0 or later.
Attestation requires glassfish
version 3.0, or tomcat 6.0 or later.
Attestation needs install Jackson library into the web container’s endorsed
modules directory. These libraries’ version must be 1.9 or later, you can find
them from
$HOME/OpenAttestation/services/AttestationService/target/AttestationService-{version}/WEB-INF/lib
after building the attestation.
If you use glassfish as the web container, you need copy these jars to
GLASSFISH_HOME/modules. Do like this:
cp
$HOME/OpenAttestation/services/AttestationService/target/AttestationService-{version}/WEB-INF/lib/jackson*.jar
$GLASSFISH_HOME/modules
Execute following commands to create
database schema:
mysql -uroot
-p<password> -e 'create database mw_as';
mysql -uroot
-p<password> mw_as <
database/mysql/src/main/resources/com/intel/mtwilson/database/mysql/mtwilson.sql
We need to create some configuration
files used by the later setup process. These configuration files include mtwilson.properties, privacyca-client.properties,
attestation-service.properties, trust-dashboard.properties and whitelist-portal.properties.
# mkdir -p /etc/intel/cloudsecurity
# chown -R tomcat:tomcat
/etc/intel
(take "tomcat" for example, you should make sure tomcat or
glassfish have the permission on this folder)
# cd /etc/intel/cloudsecurity
# nano /etc/intel/cloudsecurity/mtwilson.properties
mtwilson.api.baseurl=https://<attestationserver ip>:8181
mtwilson.api.ssl.policy=TRUST_FIRST_CERTIFICATE
mtwilson.db.driver=com.mysql.jdbc.Driver
mtwilson.db.url=jdbc:mysql://localhost/mw_as
mtwilson.db.user=root
mtwilson.db.password=password
# nano /etc/intel/cloudsecurity/attestation-service.properties
com.intel.mountwilson.as.trustagent.timeout=3
com.intel.mountwilson.as.attestation.hostTimeout=60
com.intel.mountwilson.as.home=/var/opt/intel/aikverifyhome
com.intel.mountwilson.as.aikqverify.cmd=aikqverify
com.intel.mountwilson.as.openssl.cmd=openssl.sh
saml.key.alias=samlkey1
saml.keystore.file=SAML.jks
saml.keystore.password=changeit
saml.validity.seconds=3600
saml.issuer=https://<attetationserver ip>:8181
saml.key.password=changeit
privacyca.server=<privacyca ip>
com.intel.mtwilson.as.business.trust.sleepTime=1
# nano /etc/intel/cloudsecurity/trust-dashboard.properties
mtwilson.tdbp.keystore.dir=/etc/intel/cloudsecurity
mtwilson.tdbp.keystore.password=password
imagesRootPath = images/
trustUnknow = images/Unknown.png
trustTure = images/Trusted.png
trustFalse = images/UnTrusted.png
ubuntu = images/ubuntu.png
vmware = images/vmware.png
suse = images/suse.png
kvm = images/kvm.png
xen = images/xen.png
mtwilson.tdbp.sessionTimeOut = 1800
mtwilson.tdbp.paginationRowCount = 10
# nano /etc/intel/cloudsecurity/whitelist-portal.properties
mtwilson.wlmp.keystore.dir=/etc/intel/cloudsecurity
mtwilson.wlmp.keystore.password=password
mtwilson.wlmp.openSourceHypervisors=KVM;Xen
mtwilson.wlmp.sessionTimeOut=1800
mtwilson.wlmp.pagingSize=8
Notes:
Attestation service must use “aikqverify” program, so you need to compile and install it
located in $HOME/OpenAttestation/services/aikqverify/target/aikqverify-2.2.zip.
Here are the steps:
# cp $HOME/OpenAttestation/services/aikqverify/target/aikqverify-2.2.zip
$HOME
# cd $HOME
# unzip aikqverify-2.2.zip
# cd aikqverify-2.2
# make
# make install
Besides, you need to make sure
glassfish or tomcat have the write permission for the
directory of "/var/opt/intel/aikverifyhome/data".
In this section, you will create a keystore SAML.jks with a signing
private key, and this private key must be protected by a password.
You can follow the below commands to
generate these certificates. But you should modify the some fields according to
your preference, find the definition in /etc/intel/cloudsecurity/attestation-service.properties.
# cd /etc/intel/cloudsecurity
# keytool -genkey
-alias <saml.key.alias> -keyalg
RSA -keysize
2048 -keystore <saml.keystore.file>
-storepass <saml.keystore.password>
-dname "CN=AttestationService,
OU=Mt Wilson, O=My Org, C=US" -validity 3650 -keypass <saml.key.password>
# keytool -export -alias <saml.key.alias> -keystore <saml.keystore.file> -storepass
<saml.keystore.password> -file saml.crt
Create Attestation Server
Certificate
In this part, you will create an
attestation server certificate, run the below commands:
# cd $GLASSFISH_HOME/domains/domain1/config
In case using tomcat as web
container, please create a directory named "Certificate" in the
$TOMCAT_HOME directory and go to "Certificate" instead. The default
password is “changeit”, you can change the value.
# rm -rf keystore.jks
# keytool -genkey
-alias s1as -keyalg RSA -keysize
2048 -keystore keystore.jks
-storepass changeit -dname "CN=<server ip>,
OU=Mt Wilson, O=My Org, C=US" -validity 3650 -ext
san=IP:<server ip> -keypass
changeit
# keytool -exportcert
-alias s1as -keystore keystore.jks
-storepass changeit -file ssl.<server ip>.crt
Notes:
The following commands will create a
keystore portal.jks, which
is used for secure connection between Whitelist Portal and Trust Dashboard, and
between Whitelist Service and Attestation Service. The "password"
should be consistent with mtwilson.tdbp.keystore.password
and mtwilson.wlmp.keystore.password from trust-dashboard.properties and whitelist-portal.properties.
# cd /etc/intel/cloudsecurity
# keytool -genkey
-alias admin -keyalg RSA -keysize
2048 -keystore portal.jks -storepass password -dname
"CN=Portal User, OU=Mt Wilson, O=My Org, C=US" -validity 3650 -keypass password
# keytool -importcert
-file saml.crt -keystore portal.jks
-storepass password -alias "mtwilson
(saml)"
# keytool -importcert
-file $GLASSFISH/domains/domain1/config/ssl.<server ip>.crt -keystore portal.jks
-storepass password -alias "mtwilson
(ssl)"
Note: For the last command of this
section, replace the ssl certification directory with
the corresponding directory in tomcat if using tomcat as the web container,
"$TOMCAT_HOME/Certificate" for example.
Create oVirt
Signing Key {optional}
Here you will create the ovirt.jks file used for secure communicating with oVirt, this is an optional step is only needed in oVirt environment. The default password is “password”, you
can change the value. Follow the following commands to generate the ovirt.jks:
# cd /etc/intel/cloudsecurity
# keytool -genkey
-alias ovirtssl -keyalg
RSA -keysize
2048 -keystore ovirt.jks -storepass password -dname
"CN=<server ip>, OU=Mt Wilson, O=My Org,
C=US" -validity 3650 -keypass password
# keytool -importcert
-file $GLASSFISH/domains/domain1/config/ssl.<server ip>.crt -keystore ovirt.jks
-storepass password -alias "attestation server"
You need configure ciphers for SSL protocol, follow these steps to add suitable ciphers:
TLS_ECDH_anon_WITH_AES_256_CBC_SHA,
TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA,
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA
# /usr/share/glassfish3/glassfish/bin/asadmin
restart-domain
If using tomcat as the web
container, please modify tomcat configuration file by executing follow shell
scripts:
sed -i "s/
<\/Service>/<Connector port=\"8181\" minSpareThreads=\"5\"
maxSpareThreads=\"75\" enableLookups=\"false\"
disableUploadTimeout=\"true\" acceptCount=\"100\" maxThreads=\"200\"
scheme=\"https\" secure=\"true\" SSLEnabled=\"true\"
clientAuth=\"want\" sslProtocol=\"TLS\"
ciphers=\"TLS_ECDH_anon_WITH_AES_256_CBC_SHA,
TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA,
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA\" keystoreFile=\"Certificate\/keystore.jks\" keystorePass=\"changeit\" truststoreFile=\"Certificate\/keystore.jks\" truststorePass=\"changeit\" \/><\/Service>/g"
$TOMCAT_HOME/conf/server.xml
Note: the password "changeit" should be consistent with tomcat password
from "Create Attestation Server Certificate"
Deploying the compiled web services
is very easy.
In case of using glassfish as web container, you need to copy the compiled war
package to $GLASSFISH_HOME/domains/domain1/autodeploy
directory in following order (suppose the build server and attestation server
is the same host).
# cd $GLASSFISH_HOME/domains/domain1/autodeploy
# cp
$HOME/OpenAttestation/services/WLMService/target/WLMService-2.2-core.war WLMService.war
# cp
$HOME/OpenAttestation/portals/WhiteListPortal/target/WhiteListPortal-2.2-core.war
WhiteListPortal.war
# cp
$HOME/OpenAttestation/services/AttestationService/target/AttestationService-2.2-core.war
AttestationService.war
# cp
$HOME/OpenAttestation/portals/TrustDashBoard/target/TrustDashBoard-2.2-core.war
TrustDashBoard.war
After deploying it, you should
manually restart glassfish by running:
/usr/share/glassfish3/glassfish/bin/asadmin
restart-domain
In
case of using tomcat as web container, you need to copy the compiled war
package to $TOMCAT_HOME/webapps directory in following order
(suppose the build server and attestation server is the same host).
# cd $TOMCAT_HOME/webapps
# cp
$HOME/OpenAttestation/services/WLMService/target/WLMService-2.2-core.war WLMService.war
# cp
$HOME/OpenAttestation/portals/WhiteListPortal/target/WhiteListPortal-2.2-core.war
WhiteListPortal.war
# cp
$HOME/OpenAttestation/services/AttestationService/target/AttestationService-2.2-core.war
AttestationService.war
# cp
$HOME/OpenAttestation/portals/TrustDashBoard/target/TrustDashBoard-2.2-core.war
TrustDashBoard.war
After
deploying it, you should manually restart tomcat service by running:
# service tomcat restart
#
chown -R tomcat:tomcat /var/opt/intel/aikverifyhome/
So far, the server installation has
been verified on Fedora 21.
Make sure TCP port 8181, 8080 are not
blocked by firewall.
Fedora 21
iptables -I INPUT 1 -p tcp --dport 8181 -j ACCEPT
iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
Install packages listed below:
# yum install java-1.8.0-openjdk
# yum install tomcat
Note:
suppose tomcat as web container, and please refer to attestation server
installation to configure it if glassfish is chosen.
We need to create some configuration
files used by the later setup process. These configuration files include privacyca-client.properties, PrivacyCA.properties.
# mkdir -p /etc/intel/cloudsecurity
# chown -R tomcat:tomcat
/etc/intel
(take "tomcat" for example, you should make sure tomcat or
glassfish have the permission on this folder)
# cd /etc/intel/cloudsecurity
# nano /etc/intel/cloudsecurity/privacyca-client.properties
PrivacyCaUrl=https://<privacyca ip>:8181/HisPrivacyCAWebServices2
PrivacyCaSubjectName=HIS_Privacy_CA
PrivacyCaPassword=***replace***
EndorsementCaSubjectName=Endorsement_CA_Rev_1
EndorsementCaPassword=***replace***
CertValidityDays=3652
AikAuth=1111111111111111111111111111111111111111
ecStorage=NVRAM
ecSigningKeySize=2048
ecLocation=/opt/intel/cloudsecurity/trustagent
TpmOwnerAuth=1111111111111111111111111111111111111111
# nano /etc/intel/cloudsecurity/PrivacyCA.properties
ClientFilesDownloadUsername=admin
ClientFilesDownloadPassword=password
Notes: The value of "ecStorage" indicate where you store the EC file, you
can specify the value as "FILE" beside "NVRAM" if you want
to store EC in file system instead of non-volatile memory.
The jar file will create a file /etc/intel/cloudsecurity/EndorsementCA.properties, and store the password in the
file that defines the password as EndorsementP12Pass. The commands
is as bellows:
# cd /etc/intel/cloudsecurity
# java -jar
$HOME/OpenAttestation/trust-agent/HisPrivacyCAWebServices2/target/HisPrivacyCAWebServices2-2.2-setup.jar
# scp /etc/intel/cloudsecurity/clientfiles/PrivacyCA.cer
<attestationserver ip>:/etc/intel/cloudsecurity/
Create PrivacyCA
Server Certificate
In this part, you will create an
attestation server certificate. Please
create a directory named "Certificate" in the $TOMCAT_HOME directory
and go to "Certificate" instead. The default password is “changeit”, you can change the value.
# rm -rf keystore.jks
# keytool -genkey
-alias s1as -keyalg RSA -keysize
2048 -keystore keystore.jks
-storepass changeit -dname "CN=<server ip>,
OU=Mt Wilson, O=My Org, C=US" -validity 3650 -ext
san=IP:<server ip> -keypass
changeit
# keytool -exportcert
-alias s1as -keystore keystore.jks
-storepass changeit -file ssl.<server ip>.crt
Please modify tomcat configuration
file by executing follow shell scripts:
# sed
-i "s/ <\/Service>/<Connector
port=\"8181\" minSpareThreads=\"5\"
maxSpareThreads=\"75\" enableLookups=\"false\"
disableUploadTimeout=\"true\" acceptCount=\"100\" maxThreads=\"200\"
scheme=\"https\" secure=\"true\" SSLEnabled=\"true\"
clientAuth=\"want\" sslProtocol=\"TLS\"
ciphers=\"TLS_ECDH_anon_WITH_AES_256_CBC_SHA,
TLS_ECDH_anon_WITH_AES_128_CBC_SHA, TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA,
TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA\" keystoreFile=\"Certificate\/keystore.jks\" keystorePass=\"changeit\" truststoreFile=\"Certificate\/keystore.jks\" truststorePass=\"changeit\" \/><\/Service>/g"
$TOMCAT_HOME/conf/server.xml
Note: the password "changeit" should be consistent with tomcat password
from "Create PrivacyCA
Server Certificate"
Deploy The Web Services
In case of using tomcat as web
container, you need to copy the compiled war package to $TOMCAT_HOME/webapps directory in following order (suppose the build
server and attestation server is the same host).
# cd $TOMCAT_HOME/webapps
# cp
$HOME/OpenAttestation/trust-agent/HisPrivacyCAWebServices2/target/HisPrivacyCAWebServices2.war
HisPrivacyCAWebServices2.war
After deploying it, you should
manually restart tomcat service by running:
# service tomcat restart
Attestation Client Installation
Make sure TCP port 9999, 9998 are
not blocked by firewall.
iptables -I
INPUT 1 -p tcp --dport 9999
-j ACCEPT
iptables -I
INPUT 1 -p tcp --dport 9998
-j ACCEPT
Install packages listed below:
# yum install java-1.8.0-openjdk
# yum install make gcc-c++
Client system must have TPM 1.2
compliant device with driver installed, and TPM/TXT enabled in BIOS to perform
the operation. Below is a
example for HP8300 system:
Open Attestation 2.2 uses Bouncycastle JCE provider, add the provider to the list of
trusted in $JAVA_HOME/jre/lib/security/java.security like this:
security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider
Besides, copy corresponding jars to
$JAVA_HOME/jre/lib/security to support the provider.
Download these jars from Oracle website jce-6-download.
# unzip
jce_policy-6.zip
# cp jce/*.jar JAVA_HOME/jre/lib/security
Notes: Some JDK, especially openJDK 1.6 haven't integrated with bouncy castle, so you
need copy the binary of bouncy castle, in some case named as "bcprov-jdk*.jar" to this directory:$JAVA_HOME/lib/ext
Start Agent Service in General
Client
If you install client package
before, you should uninstall it.
# /etc/init.d/tagent
uninstall (uninstall service)
# rm -rf /etc/intel/cloudsecurity/*
/opt/intel/cloudsecurity/*
You just need run the bin file
located in $HOME/OpenAttestation/trust-agent/TrustAgentLinuxInstaller/target/TrustAgentLinuxInstaller-2.2.bin.
After installed the bin package, you should make sure tagent
service is running. If it is inactive, you must manually start it.
# cd $HOME
# scp <server ip>:$HOME/OpenAttestation/trust-agent/TrustAgentLinuxInstaller/target/TrustAgentLinuxInstaller-2.2.bin
.
#
./TrustAgentLinuxInstaller-2.2.bin
# service tagent
status (check service)
# service tagent
start (start service)
Note: If TPM's ownership has been
taken, please run "/usr/local/bin/tagent fixek” or
“/etc/init.d/tagent fixek" to forcibly generate EC.
Start Agent Service in XenServer Client
The only thing that needs to be
installed on the XenServer to make it work is the XenServer-6.2-measured-boot.iso
# mkdir /mnt/xenserver –p
# mount -o loop
XenServer-6.2-measured-boot.iso /mnt/xenserver/
# cd /mnt/xenserver/
# ./install.sh
How
to Reset the Client TPM Password
# chkconfig
–del tagent
# cat /sys/class/misc/tpm0/device/enabled
# cat /sys/class/misc/tpm0/device/owned
# tpm_takeownership -z
# <Input the new TPM password>
# tpm_getpubek
# <The TPM Password>
# The public key will be
displayed
On the server side, the tpm password template has to be modified for the change.
a. Reset the password in /etc/intel/cloudsecurity/clientfiles/hisprovisioner.properties
# sed -i 's/TpmOwnerAuth =
1111111111111111111111111111111111111111/TpmOwnerAuth
=<replace with your TPM password>/g' /etc/intel/cloudsecurity/clientfiles/hisprovisioner.properties
b. Back up the original zip package.
# cp /etc/intel/cloudsecurity/clientfiles.zip
/etc/intel/cloudsecurity/clientfiles_bak.zip
c. Compress a new zip package with the
updated TPM password
# cd /etc/intel/cloudsecurity/clientfiles
# zip clientfiles.zip *
# mv clientfiles.zip ../
On the client side,
a. If the tagent's
already installed, remove the current installation by
# service tagent
uninstall
b. Install the tagent
on the client
# ./ TrustAgentLinuxInstaller-2.2.bin
At least OEM, OS, MLE, and HOST
information should be added to Attestation Server’s White List database. You
can open the following two links to add a trusted host.
http://oatserver.*.com:8080/WhiteListPortal/home.html
http://oatserver.*.com:8080/TrustDashBoard/home.html
Notes: oatserver.*.com should be the
host name of attestation server.
OAT2.2 also provides command tools,
these command tools can be used to create data in the console, for example, add
OEM by executing follow command in the console, users can read
"README" for more information.
bash oat_oem -a -h his8
'{"Name":"OEM1","Description":"Newdescription"}'
Name: OEM1 Description: Newdescription
Name: OS1 Version: v1 Description:
Test1
MLE-Type: VMM
HOST OS: OS1 V1
VMM Name: KVM
VMM Version: v123
Description: Test
Manifest List -> 18: CE796BD88E58890534CF6131571D5AF652293E55
Notes: "18" means PCR 18, the value could be got via "# cat
/sys/.../pcrs" on oat agent system, but the
space chars should be removed first.
MLE-Type: BIOS
OEM Vendor: OEM1
BIOS Name: NewMLE1
BIOS Version: v123
Description: Test
Manifest List -> 0: D8FE91C410E7A3F9CAD8C05F42AC2DDFF707902E
Notes: "0" means PCR 0, the value could be got via "# cat
/sys/.../pcrs" on oat agent system, but the
space chars should be removed first.
http://oatserver.*.com:8080/TrustDashBoard/home.html
Host Name: agent.*.com
Host Ip Address: <IP_ADDRESS>
Host Port: 9999
OEM Vendor: OEM1
BIOS Info: New MLE1 v123
OS-VMM Info: OS1 v1|KVM:v123
Notes: by far, "IPAddress" and
"Port" are not really used, so just leave a placeholder there. "HostName":"agent.*.com" should be the host
name of the oat agent (same as what hostname cmd
returns on the oat agent system).
In our system, we made the
constraint limit for every filed, and you need to refer to following values to
input valid parameters. These fields is just for user
input, and not containing all fields.
|
Name
|
Type
|
Size
|
|
Name |
Varchar |
40 |
|
IpAddress |
Varchar |
20 |
|
Port |
Int |
11 |
|
Description |
Varchar |
100 |
|
Email |
Varchar |
45 |
|
Name
|
Type
|
Size
|
|
Name |
Varchar |
100 |
|
Description |
Varchar |
200 |
|
Name
|
Type
|
Size
|
|
Name |
Varchar |
100 |
|
Version |
Varchar |
50 |
|
Description |
Varchar |
200 |
|
Name
|
Type
|
Size
|
|
Name |
Varchar |
100 |
|
Version |
Varchar |
100 |
|
Attestation_type |
Varchar |
20 |
|
Required_Manifest_List |
Varchar |
100 |
|
Description |
Varchar |
200 |
|
Name
|
Type
|
Size
|
|
Name |
Varchar |
20 |
|
Value |
Varchar |
100 |
|
PCR_Description |
Varchar |
100 |
|
Item
|
Description
|
FileName |
Location
|
|
Username |
Login to download the Privacy CA
client files |
PrivacyCA.properties |
/etc/intel/cloudsecurity |
|
Password |
Login to download the Privacy CA
client files |
PrivacyCA.properties |
/etc/intel/cloudsecurity |
|
saml.key.alias |
key alias |
attestation-service.properties
|
/etc/intel/cloudsecurity |
|
saml.keystore.file |
filename of saml
keystore |
attestation-service.properties
|
/etc/intel/cloudsecurity |
|
saml.key.password |
saml key password |
attestation-service.properties
|
/etc/intel/cloudsecurity |
|
saml.keystore.password |
keystore password |
attestation-service.properties
|
/etc/intel/cloudsecurity |
|
attestationserver
ip |
the IP of Attestation
server |
null |
null |
|
privacyca ip |
the IP of privacy CA |
null |
null |
|
mtwilson.db.user |
the username used to login
database |
mtwilson.properties |
/etc/intel/cloudsecurity |
|
mtwilson.db.password |
the password used to login
database (optional) |
mtwilson.properties |
/etc/intel/cloudsecurity |
To be continue.
Check log file when you met issues:
client (/var/log/tagent.log), server (catalina.out)


Stock Finder
Go ahead and search a stock.... you know you want to
{{ticker}} Chart
{{ticker}} DataTable
| Date | High | Low | Open | Close | Volume | Adjusted Close | {% for row in rows %}
| {{row["Date"]}} | {{row["High"]}} | {{row["Low"]}} | {{row["Open"]}} | {{row["Close"]}} | {{row["Volume"]}} | {{row["AdjClose"]}} |


21. Main Reference¶
| [Bird2009] |
|
| [Feng2017] |
|
| [Karau2015] |
|
| [Kirillov2016] | Anton Kirillov. Apache Spark: core concepts, architecture and internals. http://datastrophic.io/core-concepts-architecture-and-internals-of-apache-spark/ |
| [Bird2009] |
|
| [Feng2017] |
|
| [Karau2015] |
|
| [Kirillov2016] | Anton Kirillov. Apache Spark: core concepts, architecture and internals. http://datastrophic.io/core-concepts-architecture-and-internals-of-apache-spark/ |


description
Line charts are most commonly used to show
temporal changes
or trends in quantitative data. As the data points are connected, it is expected that consecutive points are
related
to each other.
min.js
docs
source


Exports that are defined here
Lightcord Api defined at /LightcordApi/src/index.ts
Lightcord's exported component. You can see a list in the app settings when activating Developer Options
in lightcord's settings.
Set of methods that can help you sometimes.
WebpackLoader loads Internal Discord's modules with given filter.
Create uuids.
The main Api. Can be accessed with
window.Lightcord.Api


pstat¶
Plot statistics for a specified image section up the stack of a an IR MultiAccum image. Sections from any of the SCI, ERR, DQ, image extensions can be plotted. A choice of mean, median, mode, standard deviation, minimum and maximum statistics is available. The total number of samples is determined from the primary header keyword NSAMP and all samples (excluding the zeroth-read) are plotted. The SCI, ERR, DQ statistics are plotted as a function of sample time. The sample times are read from the SAMPTIME keyword in the SCI header for each readout.
SAMP and TIME aren’t generally populated until the FLT image stage To plot the samptime vs sample, use wfc3tools.pstat and the “time” extension
In [1]: pstat('ibh719grq_ima.fits')
The plotting data is returned as two arrays:
Out[2]:
(array([ 100.651947, 93.470573, 86.2892 , 79.107826, 71.926453,
64.745079, 57.563702, 50.382328, 43.200954, 36.019581,
28.838205, 21.65683 , 14.475455, 7.29408 , 0.112705,
0. ]),
array([<PHONE_NUMBER>5,<PHONE_NUMBER>5,<PHONE_NUMBER>1,<PHONE_NUMBER>4,
125.91510743,<PHONE_NUMBER>9,<PHONE_NUMBER>6, 90.97130078,
78.26479365, 67.16825321, 53.6897243 , 41.71639092,
29.36628817, 16.47151355, -0.20821257, 0. ]))
If you want to save the plotting data into the variables time
and counts
you can issue the command like this:
In [1]: time,counts =pstat.pstat('ibh719grq_ima.fits')
In [2]: time
Out[3]:
array([ 100.651947, 93.470573, 86.2892 , 79.107826, 71.926453,
64.745079, 57.563702, 50.382328, 43.200954, 36.019581,
28.838205, 21.65683 , 14.475455, 7.29408 , 0.112705,
0. ])
In [4]: counts
Out[5]:
array([<PHONE_NUMBER>5,<PHONE_NUMBER>5,<PHONE_NUMBER>1,<PHONE_NUMBER>4,
125.91510743,<PHONE_NUMBER>9,<PHONE_NUMBER>6, 90.97130078,
78.26479365, 67.16825321, 53.6897243 , 41.71639092,
29.36628817, 16.47151355, -0.20821257, 0. ])
Warning
Note that the arrays are structured in SCI order, so the final exposure is the first element in the array
Parameters¶
- filename [file]
Input MultiAccum image name with optional image section specification. If no image section is specified, the entire image is used. This should be either a _raw or _ima file, containing all the data from multiple readouts. You must specify just the file name and image section, with no extname designation.
- extname = “sci” [string, allowed values: sci | err | dq ]
Extension name (EXTNAME keyword value) of data to plot.
- units = “counts” [string, allowed values: counts | rate]
Plot “sci” or “err” data in units of counts or countrate (“rate”). Input data can be in either unit; conversion will be performed automatically. Ignored when plotting “dq”, “samp”, or “time” data.
- stat = “midpt” [string, allowed values: mean|midpt|mode|stddev|min|max]
Type of statistic to compute.
- title = “” [string]
Title for the plot. If left blank, the name of the input image, appended with the extname and image section, is used.
- xlabel = “” [string]
Label for the X-axis of the plot. If left blank, a suitable default is generated.
- ylabel = “” [string]
Label for the Y-axis of the plot. If left blank, a suitable default based on the plot units and the extname of the data is generated.
plot = True [bool] set plot to false if you only want the data returned
Usage¶
pstat.py inputFilename [pixel range]
>>> python
>>> from wfc3tools import pstat
>>> pstat(inputFilename,extname="sci",units="counts",stat="midpt",title="",xlabel="",ylabel="" )


Sorry! Your browser doesn't support Javascript
This web application requires JS, to work at all
User Login
Messanger Web App
Logout
Active Users:
0
Conversations
Write your message
Send


Classes
AddPublisherAssertions
DeleteBinding
DeleteBusiness
DeletePublisherAssertions
DeleteService
DeleteTModel
DiscardAuthToken
FindBinding
FindBusiness
FindRelatedBusinesses
FindService
FindTModel
GetAssertionStatusReport
GetAuthToken
GetBindingDetail
GetBusinessDetail
GetBusinessDetailExt
GetPublisherAssertions
GetRegisteredInfo
GetServiceDetail
GetTModelDetail
SaveBinding
SaveBusiness
SaveService
SaveTModel
SetPublisherAssertions
ValidateValues |


{% extends 'base.html' %} {% load static %} {% load widget_tweaks %} {% block title %}Project details{% endblock %} {% block content %}
| Title | {{project.title}} |
|---|---|
| Description | {{project.description}} |
| Status | {{project.get_status_display}} |
| Legacy HPC Wales ID | {{project.legacy_hpcw_id}} |
| Legacy ARCCA ID | {{project.legacy_arcca_id}} |
| Institution | {{project.institution}} |
| Owning institution project reference | {{project.institution_reference}} |
| Principal Investigator | {{project.pi}} |
| Funding source | {{project.funding_source}} |
| Start date | {{project.start_date}} |
| End date | {{project.end_date}} |
| Requirements software | {{project.requirements_software}} |
| Requirements gateways | {{project.requirements_gateways}} |
| Requirements training | {{project.requirements_training}} |
| Requirements onboarding | {{project.requirements_onboarding}} |
| CPU time allocation in hours | {{project.allocation_cputime}} |
| Storage allocation in GB | {{project.allocation_storage}} |


I’ve made a dramatic change in my career over the past few months. I went from completely front end development to a focus on the full stack. Throughout my career I have always dabbled a bit in the backend changing a few lines of codes in php and then uploading them to the server via ssh or ftp, but this is a whole new ball game. Each day I experiment and learn something new. Its 100% frustrating but get this I love it .
I’ve been working as a web developer professionally since 2008, I was 19 then, and i’m 24 now. One thing I experienced that first year and a half of my career was this extreme learning growth spurt. I remember being completely lost but eventually I would figure it out. It wasn’t always easy, I had to develop with ie 6 compatability in mind, but at the end of the day I would always have a sense of accomplishment. I don’t want anyone to think I stumbled upon this field with no knowledge I had a fundamental understanding of html and css and layouts back then before jumping in, but it wasn’t until I jumped into developing site after site that I really started to exercise this knowledge and put it to the test.
Fast forward to today. I’ve been working as a full stack developer and I feel I’m back at the beginning of the learning cycle, but I think as developers maybe that’s the most appropriate place for us to be. I speak from experience when I say its extermely easy to get stuck in this idea of a label. Were a front end developer, or a designer, or a programmer. It takes a large amount of work and dedication to learning something new and its extremely frustrating at first, and maybe always.. isn’t our job about solving problems… some we’ve never had to solve before, but eventually things get easier and you start to grasp ideas you thought you were never going to grasp. Its a wonderful feeling to finally understand, and use , an idea that you’ve been trying to grasp for a while.
I know this idea of always learning isn’t new at all, but its something I truly believe in. We don’t have to be the best or the smartest but if we always strive to learn and improve I really think we’ll always have a job… an increasingly complex job at that. I think about a quote I heard first from a pretty cool guy Noah Kagen “If its uncomfortable, you’re growing.”. I can’t tell you how often I think about that quote, especially when learning what at first feels awkward like learning vim, using the terminal for everything, or learning ruby and then rails within a month period… but its extremely true. Each day things feel less awkward, but its only because I’m learning and its the normal progression. I can’t wait to get a bit more awkward just when I think I’ve learned it all :).
Be Awesome
Jeff Richardson


Home>
Blog>
News>
HOME
SOBRE
JOGAR
CONTATO
A Link to the Past
Ocarina of Time
Majora's Mask
The Wind Waker
Twilight Princess
Phantom Hourglass
Spirit Tracks
Skyward Sword
Zelda Breath of The Wild
Jogo da Velha


Data - preprocessing functions (pynance.data.prep
)¶
-
pynance.data.prep.
center
(dataset, out=None)[source]¶ Returns a centered data set.
Each column of the returned data will have mean 0. The row vector subtracted from each row to achieve this transformation is also returned.
Parameters: dataset : DataFrame or ndarray
out : DataFrame or ndarray, optional
Alternate output array in which to place the result. If provided, it must have the same shape and type (DataFrame or ndarray) as the expected output.
Returns: out : tuple of DataFrame or ndarray
The output data is of the same type as the input.
Notes
To exclude a column (such as a constant feature, which is usually the first or last column of data) simply don’t include it in the input. For example:
>>> centered_data, means = pn.center(mydata.iloc[:, 1:])
To perform this operation in place:
>>> _, means = pn.center(mydata.iloc[:, 1:], out=mydata.iloc:, 1:])
-
pynance.data.prep.
normalize
(centered_data, out=None)[source]¶ Returns a data set with standard deviation of 1.
The input data must be centered for the operation to yield valid results: The mean of each column must be 0. Each column of the returned data set will have standard deviation 1.
The row vector by which each row of data is divided is also returned.
Parameters: centered_data : DataFrame or ndarray
out : DataFrame or ndarray, optional
Alternate output array in which to place the result. If provided, it must have the same shape and type (DataFrame or ndarray) as the expected output.
Returns: out : tuple of DataFrame or ndarray
The output data is of the same type as the input.
Notes
To exclude a column (such as a constant feature, which is usually the first or last column of data) simply don’t include it in the input. For example:
>>> normalized_data, sd_adj = pn.normalize(mydata.iloc[:, 1:])
To perform this operation in place:
>>> _, sd_adj = pn.normalize(mydata.iloc[:, 1:], out=mydata.iloc:, 1:])
-
pynance.data.prep.
transform
(data_frame, **kwargs)[source]¶ Return a transformed DataFrame.
Transform data_frame along the given axis. By default, each row will be normalized (axis=0).
Parameters: data_frame : DataFrame
Data to be normalized.
axis : int, optional
0 (default) to normalize each row, 1 to normalize each column.
method : str, optional
Valid methods are:
- “vector” : Default for normalization by row (axis=0). Normalize along axis as a vector with norm norm
- “last” : Linear normalization setting last value along the axis to norm
- “first” : Default for normalization of columns (axis=1). Linear normalization setting first value along the given axis to norm
- “mean” : Normalize so that the mean of each vector along the given axis is norm
norm : float, optional
Target value of normalization, defaults to 1.0.
labels : DataFrame, optional
Labels may be passed as keyword argument, in which case the label values will also be normalized and returned.
Returns: df : DataFrame
Normalized data.
labels : DataFrame, optional
Normalized labels, if provided as input.
Notes
If labels are real-valued, they should also be normalized.


Greater Than , Less Than , or Equal to |
You can also compare numbers using the words greater than, less than, or equal to. Listen to your teacher read each sentence. Repeat after him or her.
Use the symbol > if the first number is greater than the second number.
Example: 25 > 20
Use the symbol < if the first number is less than the second number.
Example: 12 < 21
Use the symbol = if the numbers are the same or have the same value.
Example: 100 = 100


if resolution.kwargs.has_key("site_short_name"):
projectname = resolution.kwargs["site_short_name"]
elif resolution.kwargs.has_key("project_name"):
projectname = resolution.kwargs["project_name"]
else:
projectname = settings.MAIN_PROJECT_NAME
try:
request = self.add_project_name(request)
except Resolver404:
request.projectname = settings.MAIN_PROJECT_NAME
try:
request = self.add_project_pk(request)
except Resolver404:
request.project_pk = -1