A Happy life is one spent in learning, earning and yearning
By practising process over product throughout my study made me concentrate on learning than worrying about end product.I felt this is very important element to keep in mind during initial stages of learning as it boosts your confidence making you realise that you are learning something irrespective of the end product.
Before reading chapter 2, I thought meditation is all about eyes closed and keeping yourself calm.
Meditation is all about settling your mind. Brining attention to your breath and not reacting to situations. It's all about brining attention back smoothly when it wanders away.
Definitely bringing attention to breath and deciding on the posture that is comfortable to you are the suggestions that stood out.


Introduction
This is a demonstration of an EPCIS (Electronic Product Code Information Services, a global GS1 standard) solution serving the healthcare sector built on the InterSystems IRIS for Health data platform. It addresses medicine tracking in a hospital where the benefits are mainly the efficiency of managing the delivery of pharmaceutical prescriptions to inpatients who may be potentially transferring between departments, being or have been discharged.
Use case
In its current version, the use case is a patient who is being discharged, but has not yet left the ward, and is required to take away their medications on discharge. At this facility, it is the duty of a designated runner to assimilate all pharmaceutical prescriptions for the patient and deliver them.
Information
For this purpose, they need to access to the following information:
- A patient’s prescription
- The location(s) from where the prescriptions are to be collected
- The patient’s current location
Events
The events covered in this demonstration are:
- A patient is admitted to hospital
- This generates a HL7v2 message which triggers:
- Inpatient spell id generation
- Inpatient ward-stay id generation
- PAS number confirmation
- Linked to them are, EPCIS standard elements such as:
- GSRN (Global Service Relationship Number),
- SGLN (Specific Geographic Location Name),
- URN (Uniform Resource Name)
- corresponding EPCIS business step defined for a healthcare application, ‘accepting’ in this case.
- At some point after that, the same patient - who is now in Monkswell Ward - is prepared for discharge.
- A discharge summary is prepared which contains the clinician‘s notes and prescriptions.
- A hard copy of the discharge summary with prescriptions is digitally scanned by the pharmacy assistant to:
- Link the prescription to the inpatient spell id
- This registers the EPCIS business step, ‘summarising discharge’
- The pharmacy assistant then generates the label with a EPCIS compliant GDTI (Global Document Type Identifier) and SSCC (Serial Shipping Container Code) for the prescriptions to take away
- The PAS number is used to retrieve the inpatient spell id
- The inpatient spell id is used to retrieve the current patient location
- The inpatient spell id and patient location are then barcoded and printed on the pharmacy label which will be attached to the medicines bag(s).
- The pharmacy assistant then places the medicines bag(s) at designated collection points and scans the EPCIS Compliant GLN / SGLN (Global Location Number) location code where the medicine bags are placed to link them to the inpatient spell id. The designated collection points might include:
- Controlled drugs safe
- Fridge
- Pigeonhole for the department where the patient is currently located.
This registers the EPCIS buisness step ‘arriving’
- The runner – who is presumably notified of the pending deliveries or may be making routine rounds across the facility – is equipped with a portable device which allows:
- Look up of the friendly name of the department from GLN on the barcode
- Querying the collection points for all deliveries destined for a particular department
- Keeping track of completed and pending collections
- Potentially other yet-to-be-implemented features
- Once the prescriptions have been delivered, the patient is discharged from hospital using the ADT entry UI
- The corresponding EPCIS business step - ‘departing’ - is registered upon this event occurring.
User Interface
This single page web-browser based application UI is built on an Angular framework v10.1.3. Once again, the frontend is a single page containing HTML and JavaScript running on the browser. There are no routes in the url. Even if the server is offline, IF the browser is not refreshed, the application will still remain interactive and maintain the last known state. Errors, if any, will only be apparent in the REST CALL LOGS tab. 3 seconds after each view has been demonstrated, the Pharmacy and Runner apps will reset their views. To ensure this does not become an inconvenience, the best practice therefore is to allow the view to reset before carrying on with the next step of the demonstration
It communicates with a single InterSystems IRIS for Health instance via RESTful APIs, exposed by the IRIS instance.
Deployment
This demonstration is available to be run in Docker containers, either locally on Docker Desktop or on a remote host. eg. AWS EC2 Linux instance. Available configurations are:
- Angular UI and IRIS in separate containers – GitHub repository
- On a single host
- On separate hosts
- Angular UI hosted on the IRIS instance in a single container – GitHub repository
When the two components are deployed on separate hosts, please follow the repository instructions for frontend to correctly reach the IRIS instance.
Layout
There are 5 tabs available on the UI:
- PRESENTATION
- ADMISSIONS / DISCHARGE
- PHARMACY
- RUNNER APP
- REST CALL LOGS
PRESENTATION
The UI starts at the Presentation tab, which can be resized to best display the graphical content.
IMPORTANT: Your browser‘s popup blocker settings may get in the way for the next step, so please lookout for the browser popup alert.
Before the demonstration starts, click on the ‘Open All IRIS Tabs’ button to keep the respective pages on the IRIS for Health Management Portal open and ready. Please now move the Presentation tab to a new window and resize it so all UI tabs best fit the display. This way, the presenter will have the UI and the Management Portal visible side by side during demonstration. The other benefit of doing this is that resizing the Management Portal pages will not result in displaying the Presentation page sub-optimally. The individual ‘Open BPL’, ‘Open Messages’, ‘Open Production’ buttons are available, should one need to find one of those pages in the Management Portal quickly during the demo. These pages will open in new browser windows
The visibility of *these* instructions can be toggled by the ‘Show Instructions’ / ‘Hide Instructions’ button on the lower right of the page.
Actors and overlaid links
The actors of interest in this demonstration are captioned in red font on the diagram:
- ADMISSIONS (ADT) staff – shown near the top left
- PHARMACY assistant – shown near the top centre
- RUNNER – shown near the top centre-right
Around the area where these actors are displayed, are overlaid links, which will launch the relevant tab on the UI for each of those actors.
A similar overlaid link is centred on the IRIS interoperability icon and launches the Production page of the IRIS for Health Management Portal.
Resizing
Resizing the webpage, has marginal effect on the relative movement of the overlaid links, whose positions are dynamically recomputed. The best practice is to use the tab navigation links along the top of the application.
ADMISSIONS / DISCHARGE
This tab presents an ADT entry screen with the minimal fields required to give the audience a feel for the patient data which we will be referring to in the demonstration. The fields are prepopulated with default values. Changing the name of the patient on the UI will be reflected in the database and related interoperability production message trace. When a patient is admitted, a HL7v2 message with the patient data is generated. However, many of the fields contain default / synthetic values. After clicking ‘Admit’ view the message trace in the Management Portal. Then return to PHARMACY tab on the web application.
PHARMACY
This tab contains a ‘tablet-like’ UI and features some of the functionality which the pharmacy assistant will need to trigger the relevant events required for this demonstration.
Menu navigation:
- Link - > Discharge Document
- The pharmacy assistant uses this to link the discharge document with the inpatient spell id for that patient visit by clicking the ‘Scan’ button which changes to ‘Capture’ when a dummy discharge document is displayed.
- Click the ‘Capture’ button. The discharge document disappears from view.
- View the message trace to find the EPCIS business step ‘summarising_discharge’ in Management Portal before continuing with the next step.
- Dispense - > Generate Label:
- Enter PAS number and date
- Click ‘Retrieve Inpatient Spell Id’ button
- View the message trace in Management Portal before continuing with the next step.
- Click ‘Retrieve Patient Location Id’ button which is now seen enabled.
- View the message trace in Management Portal before continuing with the next step.
- Click ‘Generate Pharmacy Label’ button to simulate the label being created with the above information incorporated within it. A dummy label is displayed on the UI.
- Dispense -> Print
- Explain that this menu would be used to print the pharmacy label which will be attached to the medicines bag(s)
- Link -> Pigeon-hole
- Once the pharmacy label is printed and attached to the medicines bag(s), the pharmacy assistant places it / them in the pigeon hole for the ward.
- Click the ‘Scan’ button.
- When the barcode of the pigeon hole appears, the button caption changes to ‘Capture’. Clicking it links the pigeon-hole with the medicines.
- Similarly, some medicines for the patient may be placed in a fridge and / or a controlled drugs safe; then those location barcodes would be scanned and linked to the patient as well.
- In this demo, we only simulate the linking of the pigeon hole via this menu.
- View the message trace to find the EPCIS business step ‘arriving’, in Management Portal before continuing with the next step.
RUNNER APP
This tab contains a ‘smartphone-like’ UI and features some of the functionality which a designated runner will need to trigger the relevant events required for this demonstration.
Menu navigation:
- Identify -> Location:
- The runner uses this to link to look up the friendly name for the Pharmacy Pigeonhole by clicking the ‘Scan’ button which changes to ‘Capture’ when the location barcode for Monkswell Ward Collection Slot is displayed.
- View the message trace in Management Portal before continuing with the next step.
- Explain that the Identify -> Ward menu may be used to scan which ward the medicine bag(s) have been delivered to.
- Deliver -> Retrieve Items
- By providing the location name for the destination, the runner is able to view a list and number of medicine bags for each of the locations from where the medications are to be collected. The checklist keeps track of the collections as the runner picks up medicines from each of the locations. When all the locations have been picked up from, the button becomes disabled.
- View the message trace in Management Portal which shows a FHIR bundle with a host of information on the patient. As might be expected, only necessary information is displayed within the RUNNER APP.
- Once all items have been marked as collected (all checkboxes checked), view the message trace in the Management Portal to see that a 'departing' business step has been logged
ADMISSIONS / DISCHARGE
Finally the patient is discharged using the ADT UI and the message trace viewed in the Management Portal
REST CALL LOGS
After each of the steps above, a trace is also sent to this part of the app to show that the REST calls return corresponding data to the front end, as is visible in the message traces. This can be used for both, to establish that the frontend is communicating correctly with the IRIS instance, as well as giving the audience confidence in the functionality being demonstrated.


|
Ext.NET
5.3.0
.NET Component Framework for Enterprise Level Apps
|
Public Member Functions | |
| Builder (TSpotlight component) | |
| virtual TBuilder | Animate (bool animate) |
| True to animate the spot (defaults to true). More... | |
| virtual TBuilder | Duration (double duration) |
| Animation duration if animate = true (defaults to .25) More... | |
| virtual TBuilder | Easing (Easing easing) |
| Animation easing if animate = true (defaults to 'easeNone') More... | |
| virtual TBuilder | Show (string id) |
| virtual TBuilder | Show (BaseControl control) |
| virtual TBuilder | Hide () |
| virtual TBuilder | SyncSize () |
| Builder () | |
| Builder (Spotlight component) | |
| Builder (Spotlight.Config config) | |
Static Public Member Functions | |
| static implicit | operator Builder (Spotlight component) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
True to animate the spot (defaults to true).
|
inlinevirtual |
Animation duration if animate = true (defaults to .25)
|
inlinevirtual |
Animation easing if animate = true (defaults to 'easeNone')
|
inlinevirtual |
|
inlinestatic |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |


import util from '../../util.js';
import _ from 'lodash';
export default {
type: 'charset',
definedProperties: {
Charset nodes are used for [abc1-9]
regular expression syntax. It is
rendered as a labeled box with each literal, escape, and range rendering
handled by the nested node(s).
import util from '../../util.js';
import _ from 'lodash';
export default {
type: 'charset',
definedProperties: {
Default anchor is overridden to move it down so that it connects at the middle of the box that wraps all of the charset parts, instead of the middle of the container, which would take the label into account.
_anchor: {
get: function() {
var matrix = this.transform().localMatrix;
return {
ay: matrix.y(0, this.partContainer.getBBox().cy)
};
}
}
},
Renders the charset into the currently set container.
_render() {
this.partContainer = this.container.group();
Renders each part of the charset into the part container.
return Promise.all(_.map(this.elements,
part => part.render(this.partContainer.group())
))
.then(() => {
Space the parts of the charset vertically in the part container.
util.spaceVertically(this.elements, {
padding: 5
});
Label the part container.
let type = (this.properties.invert.textValue === '^') ? 'charset-reverse' : 'charset';
return this.renderLabeledBox(this.label, this.partContainer, {
padding: 5,
type: type
});
});
},
setup() {
The label for the charset will be:
[abc]
.[^abc]
. this.label = (this.properties.invert.textValue === '^') ? '没有一个:' : '其中之一:';
Removes any duplicate parts from the charset. This is based on the type
and text value of the part, so [aa]
will have only one item, but
[a\x61]
will contain two since the first matches “a” and the second
matches 0x61 (even though both are an “a”).
this.elements = _.uniqBy(this.properties.parts.elements,
part => `${part.type}:${part.textValue}`);
Include a warning for charsets that attempt to match \c
followed by
any character other than A-Z (case insensitive). Charsets like [\c@]
behave differently in different browsers. Some match the character
reference by the control charater escape, others match “\”, “c”, or “@”,
and some do not appear to match anything.
if (this.textValue.match(/\\c[^a-zA-Z]/)) {
this.state.warnings.push(`The character set "${this.textValue}" contains the \\c escape followed by a character other than A-Z. This can lead to different behavior depending on browser. The representation here is the most common interpretation.`);
}
}
}


New Mort. LTV:
%
Loan Ammount
Amortization
Payment(PI) Monthly
Estimated Cash To Close
Legal
Appraisal
Inspection
1 Month Reserve
Renovations & Upgrades
Estimated Annual Insurance
20% Down Payment


Please choose a method and enter the encryption fingerprint below:
AuthentIcon is an open source prototype designed to improve the user experience of verifying a contact's cryptographic identity. The current standard implemented by widely-used encryption software, like PGP and OTR, requires users to compare long alphanumeric strings either visually or by reading aloud character-by-character. It is tedious, presents a significant barrier to verification, and often dissuades users from verifying their contacts at all, presenting serious security risks.
This prototype hopes to begin exploring various methods that can be used to compare and authenticate cryptographic fingerprints.
Encodes fingerprints as a set of icons. Icons can either be colored blue or orange, but contain unique concepts within a color. These icons should be described to the recipient using the color and a description in the users' preferred language. Each unique fingerprint will always encode to the same set of icons.
Encodes fingerprints as a set of 3 icons. The icon set is associated with the fingerprint for a period of 24 hours. This method is useful for a real-time (or near real-time) verification, but cannot be used as a permanent representation of the fingerprint. After 24 hours, the same set of icons could be represent a different fingerprint.
Encodes fingerprint as a permanent series of sounds. The contents and characteristics of the fingerprint are used in frequency and duration configuration. The resulting pattern can be useful as a non-visual representation of the key.


I am a young aspiring freelance web developer from Kansas. I have been studying web development at UCB Ex. in a bootcamp and plan on returning home for a while once I have completed my course.
My dream is to travel and work at the same time, so freelance work is very attractive to me.
However my dream job when comes to coding is to eventually create Websites/ video games that convey very complex ideas in an easily digestable way.
I love food, I love people who don't take things too seriously, and I love to be able to say that I have tried or experienced something that I always wanted to. That's how I get meaning from my lif.


Kacey Musgraves debuts her new Christmas song ‘Glittery’ ahead of Amazon festive special
Country singer's variety show will air later this month
Kacey Musgraves has revealed her new festive track ‘Glittery’ ahead of her Christmas variety show for Amazon Prime at the end of the month.
The singer performed the song live on The Tonight Show Starring Jimmy Fallon surrounded by pink and sparkly presents. You can watch footage below.
The single comes ahead of her very own Christmas special, titled Kacey Musgraves Christmas Show, which is due to air on Amazon Prime from November 29 onwards.
The trailer for the show arrived last week, revealing a cast of special guests including Lana Del Rey, Zooey Deschanel, James Corden, Kendall Jenner, Troye Sivan, Fred Armisen, Camila Cabello and more.
“There’s kind of a little bit of everything. I’ve never done anything like this before. I’m a triple threat now, so just log that away. Dancing, singing, there’s comedy bits, there’s acting,” Musgraves told Fallon.
“It’s kind of my take on the old school Judy Garland Christmas show kind of thing, brought to life in a modern way.”
Meanwhile, Musgraves recently teamed up with Weezer to release covers of songs from the soundtrack of Frozen 2.
She also joined forces with Harry Styles last month, performing a rendition of ‘Space Cowboy’, after the pair duetted on a cover of Shania Twain’s ‘You’re Still The One’ at the former One Direction singer’s Madison Square Garden gig last year, where Musgraves was the support act.


Full-Stack Application Developer - Boston, MA 02135
Full-Stack Application Developer
XL seeks an experienced full-stack developer to help create our next-generation IoT cloud platform for commercial electrified vehicle fleets. As a developer at XL, you will work as part of a small team to build and maintain our cloud-based data stream processing engine along with multiple API and UI applications on both web and mobile platforms using cutting-edge open source technology. You should be comfortable quickly bootstrapping your understanding of new tools, technologies and application design techniques. If you are passionate about software, committed to writing code that is as beautiful as it is bulletproof, value direct access to stakeholders, and enjoy Friday afternoon cookouts, then you will feel right at home on our team.
This position is full time and on-site at the XL office and research facility in the Brighton neighborhood of Boston, MA, and reports to the Cloud Data Engineering Manager.
Responsibilities
- Build and maintain cloud data processing systems and user interfaces
- Learn and contribute new technologies, tools, and techniques quickly and independently
- Facilitate observability and insight for a small, agile team of engineers and stakeholders
- Develop automated tests and other reliability features as part of code delivery
- Participate in friendly, professional code and design reviews
- Provide feedback to refine collaborative processes and optimize team productivity
Minimum Qualifications
- 3+ years web, mobile and/or back-end software development
- 2+ years of experience working with modern JavaScript; familiarity with Python
- Proficient in software testing principles and methods
- Excellent communication skills (in person and remote)
- Comfortable working with Git and desktop Ubuntu
- Experience with or aptitude for quantitative research
- Direct experience with at least two components in our current application stack:
- Node.js
- PostgreSQL (TimescaleDB, PostGIS), MySQL, Cassandra, Elasticsearch
- Apache Storm (Flux, multi-lang), Apache Kafka
- React, React Native, GraphQL, Apollo
- Docker
- AWS ECS, EC2, RDS, S3, IAM, Lambda, etc.
- MQTT
Bonus Qualifications
- Significant experience with at least one of:
- data visualization technologies, techniques, and design considerations
- user interface concepts, conventions, and risks
- user experience design and assessment
- data and transport security, credential management, and risk assessment
- continuous integration and deployment, infrastructure automation, and monitoring
- statistics, linear algebra, and automated modeling
- GIS: geospatial analytics, location services, and visualization
- IoT: unreliable networks, constrained devices, shadow state maintenance, OTA updates, and the hardware lifecycle
- 4-year degree in computer science or equivalent experience


Public Member Functions | |
Constructors and Destructor | |
| Attributes () | |
| Default constructor. | |
| virtual | ~Attributes () |
| Destructor. | |
The virtual attribute list interface | |
| virtual XMLSize_t | getLength () const =0 |
| Return the number of attributes in this list. | |
| virtual const XMLCh * | getURI (const XMLSize_t index) const =0 |
| Return the namespace URI of an attribute in this list (by position). | |
| virtual const XMLCh * | getLocalName (const XMLSize_t index) const =0 |
| Return the local name of an attribute in this list (by position). | |
| virtual const XMLCh * | getQName (const XMLSize_t index) const =0 |
| Return the qName of an attribute in this list (by position). | |
| virtual const XMLCh * | getType (const XMLSize_t index) const =0 |
| Return the type of an attribute in the list (by position). | |
| virtual const XMLCh * | getValue (const XMLSize_t index) const =0 |
| Return the value of an attribute in the list (by position). | |
| virtual bool | getIndex (const XMLCh *const uri, const XMLCh *const localPart, XMLSize_t &index) const =0 |
| Look up the index of an attribute by Namespace name. | |
| virtual int | getIndex (const XMLCh *const uri, const XMLCh *const localPart) const =0 |
| Look up the index of an attribute by Namespace name. | |
| virtual bool | getIndex (const XMLCh *const qName, XMLSize_t &index) const =0 |
| Look up the index of an attribute by XML 1.0 qualified name. | |
| virtual int | getIndex (const XMLCh *const qName) const =0 |
| Look up the index of an attribute by XML 1.0 qualified name. | |
| virtual const XMLCh * | getType (const XMLCh *const uri, const XMLCh *const localPart) const =0 |
| Look up an attribute's type by Namespace name. | |
| virtual const XMLCh * | getType (const XMLCh *const qName) const =0 |
| Look up an attribute's type by XML 1.0 qualified name. | |
| virtual const XMLCh * | getValue (const XMLCh *const uri, const XMLCh *const localPart) const =0 |
| Look up an attribute's value by Namespace name. | |
| virtual const XMLCh * | getValue (const XMLCh *const qName) const =0 |
| Look up an attribute's value by XML 1.0 qualified name. |
The SAX2 parser implements this interface and passes an instance to the SAX2 application as the last argument of each startElement event.
The instance provided will return valid results only during the scope of the startElement invocation (to save it for future use, the application must make a copy: the AttributesImpl helper class provides a convenient constructor for doing so).
An Attributes includes only attributes that have been specified or defaulted: #IMPLIED attributes will not be included.
There are two ways for the SAX application to obtain information from the Attributes. First, it can iterate through the entire list:
public void startElement (String uri, String localpart, String qName, Attributes atts) {
for (XMLSize_t i = 0; i < atts.getLength(); i++) {
String Qname = atts.getQName(i);
String URI = atts.getURI(i)
String local = atts.GetLocalName(i)
String type = atts.getType(i);
String value = atts.getValue(i);
[...]
}
}
(Note that the result of getLength() will be zero if there are no attributes.)
As an alternative, the application can request the value or type of specific attributes:
public void startElement (String uri, String localpart, String qName, Attributes atts) {
String identifier = atts.getValue("id");
String label = atts.getValue("label");
[...]
}
The AttributesImpl helper class provides a convenience implementation for use by parser or application writers.
AttributesImpl::AttributesImpl
| Attributes::Attributes | ( | ) |
Default constructor.
| virtual Attributes::~Attributes | ( | ) | [virtual] |
Destructor.
| virtual XMLSize_t Attributes::getLength | ( | ) | const [pure virtual] |
Return the number of attributes in this list.
The SAX parser may provide attributes in any arbitrary order, regardless of the order in which they were declared or specified. The number of attributes may be zero.
Return the namespace URI of an attribute in this list (by position).
The QNames must be unique: the SAX parser shall not include the same attribute twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
| index | The index of the attribute in the list (starting at 0). |
Return the local name of an attribute in this list (by position).
The QNames must be unique: the SAX parser shall not include the same attribute twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
| index | The index of the attribute in the list (starting at 0). |
Return the qName of an attribute in this list (by position).
The QNames must be unique: the SAX parser shall not include the same attribute twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
| index | The index of the attribute in the list (starting at 0). |
Return the type of an attribute in the list (by position).
The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper case).
If the parser has not read a declaration for the attribute, or if the parser does not report attribute types, then it must return the value "CDATA" as stated in the XML 1.0 Recommendation (clause 3.3.3, "Attribute-Value Normalization").
For an enumerated attribute that is not a notation, the parser will report the type as "NMTOKEN".
| index | The index of the attribute in the list (starting at 0). |
Return the value of an attribute in the list (by position).
If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will be concatenated into a single string separated by whitespace.
| index | The index of the attribute in the list (starting at 0). |
| virtual bool Attributes::getIndex | ( | const XMLCh *const | uri, | |
| const XMLCh *const | localPart, | |||
| XMLSize_t & | index | |||
| ) | const [pure virtual] |
Look up the index of an attribute by Namespace name.
Non-standard extension.
| uri | The Namespace URI, or the empty string if the name has no Namespace URI. | |
| localPart | The attribute's local name. | |
| index | Reference to the variable where the index will be stored. |
| virtual int Attributes::getIndex | ( | const XMLCh *const | uri, | |
| const XMLCh *const | localPart | |||
| ) | const [pure virtual] |
Look up the index of an attribute by Namespace name.
| uri | The Namespace URI, or the empty string if the name has no Namespace URI. | |
| localPart | The attribute's local name. |
| virtual bool Attributes::getIndex | ( | const XMLCh *const | qName, | |
| XMLSize_t & | index | |||
| ) | const [pure virtual] |
Look up the index of an attribute by XML 1.0 qualified name.
Non-standard extension.
| qName | The qualified (prefixed) name. | |
| index | Reference to the variable where the index will be stored. |
| virtual int Attributes::getIndex | ( | const XMLCh *const | qName | ) | const [pure virtual] |
Look up the index of an attribute by XML 1.0 qualified name.
| qName | The qualified (prefixed) name. |
| virtual const XMLCh* Attributes::getType | ( | const XMLCh *const | uri, | |
| const XMLCh *const | localPart | |||
| ) | const [pure virtual] |
Look up an attribute's type by Namespace name.
See getType for a description of the possible types.
| uri | The Namespace URI, or the empty String if the name has no Namespace URI. | |
| localPart | The local name of the attribute. |
Look up an attribute's type by XML 1.0 qualified name.
See getType for a description of the possible types.
| qName | The XML 1.0 qualified name. |
| virtual const XMLCh* Attributes::getValue | ( | const XMLCh *const | uri, | |
| const XMLCh *const | localPart | |||
| ) | const [pure virtual] |
Look up an attribute's value by Namespace name.
See getValue for a description of the possible values.
| uri | The Namespace URI, or the empty String if the name has no Namespace URI. | |
| localPart | The local name of the attribute. |
Look up an attribute's value by XML 1.0 qualified name.
See getValue for a description of the possible values.
| qName | The XML 1.0 qualified name. |


Run the statements in the right panel.
The accounts table contains an account number that is generated by default, rather than generated always. This means that a user could supply an account number if they wanted to as part of the insert statement.
The 'default' keyword tells DB2 to insert the default value into the database, rather than one that is supplied. This keyword is required since a NULL value is different from a default value.
Select from the account table to see what the results are. In this example, two values should have been generated by DB2, while the rest are set by the value in the insert statement.


{% extends 'land/base.html' %} {% block central_content %}
Please fill in below form, we will get in touch with as soon as possible.


Around the World in 80 Days
by Jules Verne
Chapter 18: In Which Phileas Fogg, Passepartout, and Fix Go Each About His Business
Additional Information
- Year Published: 1873
- Language: English
- Country of Origin: France
- Source: Verne, J. (1873) Around the World in 80 Days Paris, France: Routledge
-
Readability:
- Flesch–Kincaid Level: 8.0
- Word Count: 1,410
- Genre: Adventure
- Keywords: 19th century literature, adventure, french literature
- ✎ Cite This
Downloads
The weather was bad during the latter days of the voyage. The wind, obstinately remaining in the north–west, blew a gale, and retarded the steamer. The Rangoon rolled heavily and the passengers became impatient of the long, monstrous waves which the wind raised before their path. A sort of tempest arose on the 3rd of November, the squall knocking the vessel about with fury, and the waves running high. The Rangoon reefed all her sails, and even the rigging proved too much, whistling and shaking amid the squall. The steamer was forced to proceed slowly, and the captain estimated that she would reach Hong Kong twenty hours behind time, and more if the storm lasted.
Phileas Fogg gazed at the tempestuous sea, which seemed to be struggling especially to delay him, with his habitual tranquillity. He never changed countenance for an instant, though a delay of twenty hours, by making him too late for the Yokohama boat, would almost inevitably cause the loss of the wager. But this man of nerve manifested neither impatience nor annoyance; it seemed as if the storm were a part of his programme, and had been foreseen. Aouda was amazed to find him as calm as he had been from the first time she saw him.
Fix did not look at the state of things in the same light. The storm greatly pleased him. His satisfaction would have been complete had the Rangoon been forced to retreat before the violence of wind and waves. Each delay filled him with hope, for it became more and more probable that Fogg would be obliged to remain some days at Hong Kong; and now the heavens themselves became his allies, with the gusts and squalls. It mattered not that they made him sea–sick—he made no account of this inconvenience; and, whilst his body was writhing under their effects, his spirit bounded with hopeful exultation.
Passepartout was enraged beyond expression by the unpropitious weather. Everything had gone so well till now! Earth and sea had seemed to be at his master's service; steamers and railways obeyed him; wind and steam united to speed his journey. Had the hour of adversity come? Passepartout was as much excited as if the twenty thousand pounds were to come from his own pocket. The storm exasperated him, the gale made him furious, and he longed to lash the obstinate sea into obedience. Poor fellow! Fix carefully concealed from him his own satisfaction, for, had he betrayed it, Passepartout could scarcely have restrained himself from personal violence.
Passepartout remained on deck as long as the tempest lasted, being unable to remain quiet below, and taking it into his head to aid the progress of the ship by lending a hand with the crew. He overwhelmed the captain, officers, and sailors, who could not help laughing at his impatience, with all sorts of questions. He wanted to know exactly how long the storm was going to last; whereupon he was referred to the barometer, which seemed to have no intention of rising. Passepartout shook it, but with no perceptible effect; for neither shaking nor maledictions could prevail upon it to change its mind.
On the 4th, however, the sea became more calm, and the storm lessened its violence; the wind veered southward, and was once more favourable. Passepartout cleared up with the weather. Some of the sails were unfurled, and the Rangoon resumed its most rapid speed. The time lost could not, however, be regained. Land was not signalled until five o'clock on the morning of the 6th; the steamer was due on the 5th. Phileas Fogg was twenty–four hours behind–hand, and the Yokohama steamer would, of course, be missed.
The pilot went on board at six, and took his place on the bridge, to guide the Rangoon through the channels to the port of Hong Kong. Passepartout longed to ask him if the steamer had left for Yokohama; but he dared not, for he wished to preserve the spark of hope, which still remained till the last moment. He had confided his anxiety to Fix who—the sly rascal!—tried to console him by saying that Mr. Fogg would be in time if he took the next boat; but this only put Passepartout in a passion.
Mr. Fogg, bolder than his servant, did not hesitate to approach the pilot, and tranquilly ask him if he knew when a steamer would leave Hong Kong for Yokohama.
"At high tide to–morrow morning," answered the pilot.
"Ah!" said Mr. Fogg, without betraying any astonishment.
Passepartout, who heard what passed, would willingly have embraced the pilot, while Fix would have been glad to twist his neck.
"What is the steamer's name?" asked Mr. Fogg.
"The Carnatic."
"Ought she not to have gone yesterday?"
"Yes, sir; but they had to repair one of her boilers, and so her departure was postponed till to–morrow."
"Thank you," returned Mr. Fogg, descending mathematically to the saloon.
Passepartout clasped the pilot's hand and shook it heartily in his delight, exclaiming, "Pilot, you are the best of good fellows!"
The pilot probably does not know to this day why his responses won him this enthusiastic greeting. He remounted the bridge, and guided the steamer through the flotilla of junks, tankas, and fishing boats which crowd the harbour of Hong Kong.
At one o'clock the Rangoon was at the quay, and the passengers were going ashore.
Chance had strangely favoured Phileas Fogg, for had not the Carnatic been forced to lie over for repairing her boilers, she would have left on the 6th of November, and the passengers for Japan would have been obliged to await for a week the sailing of the next steamer. Mr. Fogg was, it is true, twenty–four hours behind his time; but this could not seriously imperil the remainder of his tour.
The steamer which crossed the Pacific from Yokohama to San Francisco made a direct connection with that from Hong Kong, and it could not sail until the latter reached Yokohama; and if Mr. Fogg was twenty–four hours late on reaching Yokohama, this time would no doubt be easily regained in the voyage of twenty–two days across the Pacific. He found himself, then, about twenty–four hours behind–hand, thirty–five days after leaving London.
The Carnatic was announced to leave Hong Kong at five the next morning. Mr. Fogg had sixteen hours in which to attend to his business there, which was to deposit Aouda safely with her wealthy relative.
On landing, he conducted her to a palanquin, in which they repaired to the Club Hotel. A room was engaged for the young woman, and Mr. Fogg, after seeing that she wanted for nothing, set out in search of her cousin Jeejeeh. He instructed Passepartout to remain at the hotel until his return, that Aouda might not be left entirely alone.
Mr. Fogg repaired to the Exchange, where, he did not doubt, every one would know so wealthy and considerable a personage as the Parsee merchant. Meeting a broker, he made the inquiry, to learn that Jeejeeh had left China two years before, and, retiring from business with an immense fortune, had taken up his residence in Europe—in Holland the broker thought, with the merchants of which country he had principally traded. Phileas Fogg returned to the hotel, begged a moment's conversation with Aouda, and without more ado, apprised her that Jeejeeh was no longer at Hong Kong, but probably in Holland.
Aouda at first said nothing. She passed her hand across her forehead, and reflected a few moments. Then, in her sweet, soft voice, she said: "What ought I to do, Mr. Fogg?"
"It is very simple," responded the gentleman. "Go on to Europe."
"But I cannot intrude—"
"You do not intrude, nor do you in the least embarrass my project. Passepartout!"
"Monsieur."
"Go to the Carnatic, and engage three cabins."
Passepartout, delighted that the young woman, who was very gracious to him, was going to continue the journey with them, went off at a brisk gait to obey his master's order.


Street Fighter II: The World Warrior is a competitive fighting game originally released for the arcades in 1991. It is the second entry in the Street Fighter series and the arcade sequel to the original Street Fighter released in 1987. It is Capcom's fourteenth title that runs on the CP System arcade hardware. Street Fighter II improves upon the many concepts introduced in the first game, including the use of command-based special moves and a six-button configuration, while offering players a selection of multiple playable characters, each with their own unique fighting style, and introducing a combo system and competitive combat between two players.
The characters you can chose to use on your quest to be World Champion!
|
Ryu - a Japanese karateka seeking to hone his skills.
|
E. Honda - a sumo wrestler from Japan.
|
|
Blanka - a beast-like mutant from Brazil who was raised in the jungle.
|
Guile - a former USAF special forces operative from the United States, seeking to defeat the man who killed his best friend.
|
|
Ken - Ryu's rival and former training partner, from the United States.
|
Chun-Li - a Chinese martial artist who works as an Interpol officer, seeking to avenge her deceased father.
|
|
Zangief - a pro wrestler from the USSR.
|
Dhalsim - a fire breathing yoga master from India.
|
The 4 computer controled characters that you face to win the game.


| Place | Team | Average Score | Average Beacons | Average Resources | Average Deaths | Average Kills | Average Assists | Average Cores |
|---|---|---|---|---|---|---|---|---|
| 1 | Bost-Atkinson Digital Space Mining | 18879.01 | 7.916 | 18879.01 | 0.09 | 0.00 | 0.00 | 0.46 |
| 2 | Pacifist Heuristic Asteroid Collector | 8833.11 | 1.524 | 8833.11 | 0.07 | 0.00 | 0.00 | 0.21 |
| 3 | Beacon Collector Team | 240.564 | 29.192 | 240.564 | 0.10 | 0.00 | 0.00 | 0.02 |
| 4 | Random Client | 19.22 | 0.28 | 19.22 | 3.76 | 0.50 | 0.24 | 0.00 |


|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
Unit Test (Simulated) hardware platform. More...
#include <unittest_hw_platform.hpp>
Public Member Functions | |
| UnitTestHWPlatform () noexcept | |
| Default Constructor. More... | |
| ~UnitTestHWPlatform ()=default | |
| Default Destructor. More... | |
| void | init_ () noexcept |
| void | initProcessor_ () noexcept |
| void | soft_reset_ () noexcept |
| void | hard_reset_ () noexcept |
| void | shutdown_ () noexcept |
| constexpr const std::string_view & | name () const noexcept |
| Returns the Virtual HW Platform's name. More... | |
| constexpr const char * | name_cstr () const noexcept |
| Returns the platform name as a cstring for C API compatibility. More... | |
| void | initProcessor () noexcept |
| Initialize the processor. More... | |
| void | init () noexcept |
| Initialize the hardware platform. More... | |
| void | soft_reset () noexcept |
| Perform a soft reset of the system (chip reset) More... | |
| void | hard_reset () noexcept |
| Perform a hard reset of the system (power cycle) More... | |
| void | shutdown () noexcept |
| Shutdown the system. More... | |
Static Public Member Functions | |
| static void | earlyInitHook_ () noexcept |
| static void | earlyInitHook () noexcept |
| Perform any special initialization steps. More... | |
Private Attributes | |
| test::TestDriverBase | driver_ = test::TestDriverBase("Undefined test driver") |
| We declare a single test driver to exercise the framework. More... | |
Unit Test (Simulated) hardware platform.
This hardware platform exists to exercise the framework during the unit testing process. This class should not be used directly for any other purpose.
|
inlinenoexcept |
Default Constructor.
|
default |
Default Destructor.
|
inlinestaticnoexceptinherited |
Perform any special initialization steps.
The earlyInitHook_() function must be implemented by the derived class as a static function.
These functions run before the C Run-time setup functions are called, and normal functionality (e.g. OS concepts) are not available.
Early initialization steps represent any super early code that needs to execute. For example, DRAM might need to be initialized before the boot process can relocate memory to its proper location in memory.
These functions are declared static to prevent you from easily using drivers within their confines
|
inlinestaticnoexcept |
|
inlinenoexceptinherited |
Perform a hard reset of the system (power cycle)
The hard_reset_() function must be implemented by the derived class.
A hard reset is intended to perform a full power cycle of the system.
Platforms which do not support a hard reset should default to calling soft_reset().
|
inlinenoexcept |
References soft_reset_().
|
inlinenoexceptinherited |
Initialize the hardware platform.
The init_() function must be implemented by the derived class.
Perform any hardware platform initialization steps, such as preparing peripherals for use, setting up callbacks, etc.
|
inlinenoexcept |
|
inlinenoexceptinherited |
Initialize the processor.
The initProcessor_() function must be implemented by the derived class.
Perform any steps necessary for initializing the processor & processor peripheral devices for use.
Note that this is only intended to be processor initialization. Platform initialization nis handled by the init() function.
This function will likely invoke the VirtualProcessor::init() function, but the order and actual initialization process is left to the derived class.
|
inlinenoexcept |
|
inlinenoexceptinherited |
Returns the Virtual HW Platform's name.
|
inlinenoexceptinherited |
Returns the platform name as a cstring for C API compatibility.
|
inlinenoexceptinherited |
Shutdown the system.
The shutdown_() function must be implemented by the derived class.
If your platform supports shutdown capability, take the proper steps to initiate a shutdown.
If the platform does not support shutdown capability, implement your shutdown_() function as an assert to notify users trying to call this API. You could also leave the shutdown_() function undefined. Anyone who calls the shutdown() function on a platform with an undefined shutdown_() function will encounter a compiler error.
The shutdown function is not expected to return.
|
inlinenoexcept |
References assert.
|
inlinenoexceptinherited |
Perform a soft reset of the system (chip reset)
The soft_reset_() function must be implemnted by the derived class.
A soft reset is intended to reset the program to the beginning without performing a full power cycle.
A good strategy is to just call virtual processor's reset() function, if one is provided.
|
inlinenoexcept |
Referenced by hard_reset_().
|
private |
We declare a single test driver to exercise the framework.


|
Remember you need to score more than 24/40 to pass the exam
Good Luck!
 Which is NOT one of the seven parts of TOGAF document?
You answered C and the correct answer is:
C – Architecture Governance
2. What is Architecture in the Context of TOGAF?
You answered E and the correct answer is:
E – A formal description of a system, or a detailed plan of the system at a component level to guide its implementation or the structure of components, their inter-relationships, and the principles and guidelines governing their design and evolution over time
3. Which of the following according to TOGAF is NOT a reason to use an Enterprise Architecture Framework?
You answered E and the correct answer is:
E – It will ensure compliance and protect the interest of stakeholders
4. Which are the three main categories of architectural work product does Architecture Content Framework specify?
You answered D and the correct answer is:
D – Building Block, Artifact and Deliverable
5. Which is NOT a part of Architecture Repository?
You answered D and the correct answer is:
D – A Stakeholder analysis and map
6. Which of these are NOT the benefits of Architecture Governance?
You answered B and the correct answer is:
C – Improved software development productivity
7. Does ADM support iteration?
You answered D and the correct answer is:
D – Yes, you can cycle around ADM, iterate across specific phases or cycle through some of the phases
8. Which of the following statements about the relation between ADM and Architecture Repository is correct?
You answered A and the correct answer is:
A – At relevant places throughout the ADM, there are reminders to consider which architecture assets from the Architecture Repository the architect should use
9. Which of the following is NOT a valid reason for wanting to tailor ADM for the specific need of the enterprise?
You answered B and the correct answer is:
B – An enterprise may wish to use or tailor the ADM in conjunction with the security best practices in use in the enterprise
10. Which of the following statements about Enterprise Continuum is NOT correct?
You answered D and the correct answer is:
D – It is a physical repository of all architecture assets models, patterns, architecture descriptions, and other artifacts produced during application of the ADM
11. Which of the following statements is NOT correct?
You answered A and the correct answer is:
A – The Architecture Continuum provides a consistent way to describe and understand the implementation of the assets
12. Which of the following is NOT a part of Architecture Repository?
You answered E and the correct answer is:
E – Compliance Log
13. What is a Standards Information Base?
You answered B and the correct answer is:
B – It holds a set of specifications, to which architectures must conform
14. What of the following statements is NOT correct?
You answered D and the correct answer is:
D – TOGAF recognizes the need to manage the content of the Enterprise Continuum using tools but does not provide any guidance on tool selection
15. In which phase does the Business Scenarios first get defined?
You answered B and the correct answer is:
B – Phase A
16. Which of the following statements about Business Architecture is NOT correct?
You answered C and the correct answer is:
C – Business Architecture looks at the Enterprise in abstraction and does not look at the relationship between people and process
17. Which of the following is NOT in the scope of Technology Architecture documentation?
You answered D and the correct answer is:
D – Technical implementation architecture
18. Which of the following is NOT an objective of phase F? [Update: The answer to this question is not valid for TOGAF 9.1. The objective of phase F has been modified]
You answered E and the correct answer is:
E – Formulate recommendations for each implementation project
19. Which of the following is NOT an objective of phase H?[Update: The answer to this question is not valid for TOGAF 9.1. The objective of phase H has been modified]
You answered B and the correct answer is:
B – Mobilize supporting operations that will underpin the future working lifetime of the deployed solution
20. In which phase is an agreement reached on the architecture method to be adopted?
You answered A and the correct answer is:
A – Preliminary Phase
21. How is the Transition Architecture formulated?
You answered E and the correct answer is:
E – In Phase E major implementation projects grouped into Transition Architectures and they are confirmed with relevant stakeholders in phase F
22. In which phase is the cost/benefit analysis done?
You answered E and the correct answer is:
E – Phase F
23. How is the Architecture Governance performed?
You answered D and the correct answer is:
D – It is established in Preliminary Phase and operated on Phase G and H
24. Which of the following is NOT an ADM Guideline or Technique?
You answered B and the correct answer is:
B – Usecase Modeling
25. Which of the following is NOT described by a Business Scenario?
You answered D and the correct answer is:
D – The underlying business vision
26. Which of the following is NOT the source of a business domain gap?
You answered E and the correct answer is:
E – Data relationship gaps
27. In which phase are the nature and security considerations of information and service exchanges determined?
You answered A and the correct answer is:
B – Phase A
28. In which Phase is the risk identification and mitigation assessment worksheets are maintained as governance artifacts and are kept up-to-date?
You answered D and the correct answer is:
D – Phase G
29. Which among the following is a technique for discovering the need for a Capability?
You answered D and the correct answer is:
D – Business Scenario
30. Which are the six characteristics used in TOGAF to highlight both the value and necessity for governance?
You answered C and the correct answer is:
B – Improving the maturity level of architecture discipline within the organization
31. Which of the following is NOT a part of Architecture Governance?
You answered C and the correct answer is:
C – Process, Content, Repository and Process Flow Control
32. Which of the following is NOT the purpose of Architecture Compliance Review?
You answered E and the correct answer is:
A – To improve the maturity level of architecture discipline within the organization
33. Which of the following is NOT a correct statement about concern?
You answered B and the correct answer is:
B – The terms “concern” and “requirement” are synonymous
34. Which steps among the following is NOT a recommended step to create the required views for a particular architecture?
You answered C and the correct answer is:
C – Analyze their requirement and document them
35. Which of the following is NOT the characteristic of a good building block?
You answered E and the correct answer is:
E – It may specify implementation details
36. What does Architecture Building Blocks do?
You answered B and the correct answer is:
B – They capture architecture requirements
37. Which among the following is beyond the scope of governance of Architecture Contract?
You answered B and the correct answer is:
C – Facilitate re-usable
38. In which phase is Capability Assessment carried out?
You answered A and the correct answer is:
A – It is first carried out in Phase A and updated in Phase E
39. What is the TOGAF Technical Reference Model?
You answered B and the correct answer is:
D – It describes a fundamental architecture upon which other, more specific, architectures can be based
40. What among the following is NOT a part of the Integrated Information Infrastructure Reference Model taxonomy?
You answered D and the correct answer is:
D – Communication infrastructure interface
Print your answers.
http://theopenarch.com
|


|
Allegro CL version 10.0 |
This chapter contains the following sections:
8.1 Events not on components
8.2 A simplistic example as an introduction
8.3 Writing an event handler function
8.3.1 What if you change to the same value
8.4 The on-click event handler runs with any click
8.5 Getting a handler to display another window
This is chapter 8 of the User Guide for the Allegro CL 10.0 Integrated Development Environment (IDE). The IDE is only supported on Windows machines.
The chapters of the IDE User Guide are:
Chapter 1: Introduction to the IDE
Chapter 2: The Allegro CL Development Environment (IDE)
Chapter 3: An example
Chapter 4: Projects
Chapter 5: Components
Chapter 6: Designing a user interface using forms
Chapter 7: Menus
Chapter 8: Events (this chapter)
Events are a critical component of any visual application, that is one where users communicate with an application through windows and dialogs. An event is a mouse action (clicking a button, moving the mouse). Keyboard actions (typing a character, e.g.) are also an event but keyboard events are typically handled automatically.
This chapter mostly deals with events occuring on controls. Controls, as we will describe, have built-in event handlers that can easily be made to perform what task is desired in response to events. Catching events not over controls is more complicated.
See the essay cg-events.htm for more information. General Common Graphics and IDE documentation is described in doc/cgide.htm. The HTML documentation files can be accessed from the Allegro CL Integrated Development Environment using the Help | Allegro CL Documentation menu command (which displays introduction.htm, which in turn contains a list of all essay help files, including doc/cgide.htm). The remainder of this chapter discusses event handler functions on controls only.
This example is designed for programmers who are new to events. If you are already familiar with events, you may wish to skip down to the next section.
We are going to design a form where events simply cause something to be printed to the debug window. Evaluating this form:
(eval-in-listener-thread '(format t "Action at ~D~%" (mod (get-universal-time) 10000)))
causes `Action at xxxxx' (where xxxxx is a number based on the current time in seconds) to be printed in the debug window. (The eval-in-listener-thread wrapped around the call to format binds *terminal-io* to the Debug window during the evaluation of the body. If it was not present, *terminal-io* might be the Console window when a project is run, and then the messages would not be easily visible.)
We are going to define a function that causes this printing and see what happens when that function is associated with various events on a form.
First, define the function in the debug window (simply because that is a convenient place). The function is
(defun foo (&rest args) (declare (ignore args)) (eval-in-listener-thread '(format t "Action at ~D~%" (mod (get-universal-time) 10000))))
Two points about this function:
(&rest args)
accepts any number of arguments
(including none), bundles them into a list and makes that list the value of args. (declare
(ignore args))
tells the system args will not be used. In this simplistic example,
we are not concerning ourselves with what arguments are actually passed to event functions
nor with what might be done with these arguments. We are simply interested in seeing when
events happen. In a real application, the arguments will typically be used rather than
ignored. (get-universal-time)
returns an integer which is the number of seconds from
00:00:00 GMT midnight, December 31, 1899/January 1, 1900. Therefore, a different value
will be printed each time, indicating the number of seconds since the last call. We do
this simply to ensure the printed messages can be distinguished from one another. Now, start with a blank form. Add a radio button (click on the radio button icon on the toolbar and click on the blank form) and a check box. The form will look something like this (we have made it smaller but that is not necessary):
The radio button is selected (as indicated by the bounding box with the little squares). Choose the Events tab of the Inspector window:
All the events (except on-change-test
which we discuss below) have no associated functions (as
indicated by the nil's). The nil
next to on-double-click
is
highlighted. Type foo <enter> and foo will appear in the on-double-click slot:
Now, click Run | Run Form or Run | Run Project. You will be asked if you want to save the project. There is no reason to save this simplistic example but do so if you wish. The form now becomes active. Arranging your windows so that the Debug windows and the form are both visible, double click on the radio button. You should see a message in the Debug window. Do it again and another message appears. Double clicking elsewhere, such as over the check box, does not cause a message to be printed. This picture shows the running form and the debug window after several messages (you will get different numbers if you try this, of course):
Stop running the form (click Run
| Stop). Using the Inspector window, change the value of the on-double-click
for the radio button back to nil
. Try setting other values to foo
(except on-change-test where foo is not an appropriate
value) and trying some mouse actions to see what happens. In this way, when you run the
form again using Run | Run
Form, you can get a feel for the mouse (or keyboard) action associated with an event.
Here are some comments about some of the other event functions:
When a dialog has focus, one of the controls on the dialog (if there are more than one that is why the check box is there) has focus within the dialog. This is usually visually evident because the border is modified. In the picture above, the radio button has focus and Radio Button is outlined. If you make on-set-focus foo (as we did with on-double-click above), and run the form, a message will be printed in the debug window when you click over the radio button, causing it to have focus. Pressing the Tab key also moves the focus about the dialog, from the radio button to the check box and back (you must have clicked on the radio button first, or tabbing will not select it). Press Tab repeatedly and a message is printed every other press (as the focus moves back from the check box to the radio button).
This event function is run when the focus moves away from the radio button control.
This event function is run when the mouse cursor moves over the control (regardless of where the focus on the window is, no clicks necessary). As you move the mouse back and forth over the radio button, messages will be printed in the debug window. If you move the mouse a lot, there will be a lot of messages. This is a good time to tell or remind you that on-mouse-in and on-mouse-out event functions should (1) be fast (because can run many, many times); (2) not have a permanent effect (since the mouse moving may be accidental actions that have permanent effect should require a deliberate action such as a mouse click). Typical on-mouse-in and -out event functions do simple visual things such as changing the cursor.
This is the end of our simplistic example. We call it simplistic because in a real application, event functions will not simply print useless messages to a text-edit window. The purpose of this example was to show when event functions are run and what actions trigger them.
In our simple example, our event function simply wrote a message to a text-edit window saying that the event had occurred. This is not, of course, a useful event-handling function (users usually know that they did something with the mouse and do not need to be told). However, usefulness is only meaningful in the context of your application.
Once you have figured out what you want it to do, you write the handler by clicking on the extended editor button (with the three dots) in the events tab of the inspector. Here is the initial events tab for a button (named :button4):
Clicking on the extended editor button for the on-change event displays a function template in the editor workbook tab corresponding to the form being worked on:
The template looks like:
(defun form1-button4-on-change (widget new-value old-value) (declare (ignore-if-unused widget new-value old-value)) t) ; Accept the new value
This is a complete function definition, so far doing nothing except returning t. The system calls the on-change event handler function with three arguments: widget (the control whose values has changed, the button in this case); the new-value and the old-value. This function must return non-nil (t or any other value except nil) in order for the change to be effected (with some exceptions radio buttons change whether the event handler returns true or nil, indeed even when there is no event handler). Generally, if this function returns nil, the change is rejected and the previous value returned to the control (though other side-effects performed by the on-change function are not undone, of course).
You can add code to the function so it will do additional things in your application.
Let us consider a more complicated example. We get a new form (by choosing File | New Form) and choosing dialog from the possible form types. Then we place a single-item-list on it:
We inspect the form (by double-clicking on it away from the single-item-list) and change the value of the status-bar property to t:
We inspect the single-item-list (by double-clicking on it) and change the value of the range to (:gray :white :yellow). This is done by clicking on the button with three dots to the right of the range value, and replace the contents of the control that appears with '(:gray :white :yellow) (including the leading apostrophe). We also change the value to :gray:
Now the form looks like this, with a status bar (containing `:form2') at the bottom and a single-item-list with choices gray, white, and yellow (the printing function prints the symbol name of the values, which causes the leading colon not to be printed):
We want to make choosing a color have the effect of changing the background-color of the control.
We again inspect the single-item-list, look at the Events tab, and click on the extended editor button (with three dots, to the right) for the on-change event. We get a template in an editor buffer similar to the following:
(defun form2-single-item-list-1-on-change (widget new-value old-value) (declare (ignore-if-unused widget new-value old-value)) t) ; Accept the new value
We add this code to change the background color according to the new value:
(cond ((eql new-value :gray) (setf (background-color (parent widget)) gray)) ((eql new-value :white) (setf (background-color (parent widget)) white)) ((eql new-value :yellow) (setf (background-color (parent widget)) yellow))) (invalidate (parent widget))
so the entire function looks like:
(defun form2-single-item-list-1-on-change (widget new-value old-value) (declare (ignore-if-unused widget new-value old-value)) (cond ((eql new-value :gray) (setf (background-color (parent widget)) gray)) ((eql new-value :white) (setf (background-color (parent widget)) white)) ((eql new-value :yellow) (setf (background-color (parent widget)) yellow))) (invalidate (parent widget)) t) ; Accept the new value
The invalidate form makes sure that the background color change is put into effect (covering and uncovering the running form has the same effect). If you evaluate the new definition (click Tools | Incremental Evaluation with the cursor just after the final parenthesis) and you run the form, you can change the background color by clicking the appropriate value.
In our single-item-list example, the value could be :yellow
and a user
could click on yellow
. What happens? The answer is nothing. The on-change handler only runs when the new
value is different from the old value according to the on-change-test predicate. To make this
clear, let us modify the previous example by having the on-change event change the value and print a
message to the status bar of the dialog (using the function window-message) showing the time of the
action and the color chosen:
(defun form2-single-item-list-1-on-change (widget new-value old-value) (declare (ignore-if-unused widget new-value old-value)) (cond ((eql new-value :gray) (setf (background-color (parent widget)) gray) (window-message (parent widget) (format nil "Color is gray at ~D~%" (mod (get-universal-time) 10000)))) ((eql new-value :white) (setf (background-color (parent widget)) white) (window-message (parent widget) (format nil "Color is white at ~D~%" (mod (get-universal-time) 10000)))) ((eql new-value :yellow) (setf (background-color (parent widget)) yellow) (window-message (parent widget) (format nil "Color is yellow at ~D~%" (mod (get-universal-time) 10000))))) (invalidate (parent widget)) t) ; Accept the new value
(Remember to evaluate this new definition click Tools | Incremental Evaluation with the cursor just after the final parenthesis.)
Now clicking on a new value causes the color to change and causes a message to be printed in the status bar. But, as we said, clicking on the current value does not cause anything new to be printed in the status bar because the system compares the old value and the new value using the on-change-test handler. The on-change handler will only be run if the on-change-test indicates that the old-value and the new-value are different by returning nil. The default on-change-test is the function widget-value-equal and that function returns true for the same value.
To get something to happen with every click, you can change the on-change-test function (to, for example, always return nil). But this is not the recommended way. Instead, if you want feedback to the user confirming that their click was received, use the on-click handler, as we describe next.
As we noted above, the on-change event handler only runs if the new-value is determined (by the on-change-test) different from the old value. The typical way to change a value is with a mouse click, which moves the focus to the control and (typically) changes the value of controls such as radio buttons, single-item-lists, etc. Whether or not the on-change handler runs, the on-click handler will run whenever the component is clicked. However, if the component is changed by an access key or by tabbing, the on-click is not run since there was no click. But this is probably what you want. The typical concern is a user is clicking but seeing no response. In the example we have been developing, there is no response when the choice is not a change. We add an on-click handler to print a message to the status bar when the current color is clicked. First, on the Events tab of the inspector for the single-item-list, click on the extended definition button. This will put this code in the form2 editor buffer:
(defun form2-single-item-list-1-on-click (dialog widget) (declare (ignore-if-unused dialog widget)) t)
Now add this below the declare form:
(window-message (parent widget) (format nil "Color clicked at ~D~%" (mod (get-universal-time) 10000)))
so the result is
(defun form2-single-item-list-1-on-click (dialog widget) (declare (ignore-if-unused dialog widget)) (window-message (parent widget) (format nil "Color clicked at ~D~%" (mod (get-universal-time) 10000))) t)
Now when you click the same color, a message appears in the status bar. We have two messages being sent to the status bar when a new color is clicked: one from the on-click and one from the on-change, and only one ends up visible. But that doesn't matter for our purpose, which is just to confirm to the user that the click was received.
See section 4.15.5 in chapter 4 Projects for information on how to display another window in your application. Similar code can go into an event handler (allowing you to have clicking a button pop-up or otherwise display another window in your application).
Go to beginning of this chapter.
Copyright (c) 1998-2015, Franz Inc. Berkeley, CA., USA. All rights reserved.
Documentation for Allegro CL version 10.0. This page has been moderately modified
from the 6.1 version.
Created 2015.1.25.
|
Allegro CL version 10.0 |


The Character.js module provides the attribute to generate a complete character that combines a character type [ Survivor, Military, etc. ] with a generated name and attributes. The result object is in a format that can be easily disclosed on
a Card sheet. The syntax is as follows:
Character.getCharacter(); //generate a random character
Character.getCharacter(n); //generate a character of type n
Character.getCharacterByObject(valueObj); //generate a character using a value object (see below)
More complex character types can be generated by providing a value object of the format shown below. When defining attributes, either express the value as string of comma-delimited values. For each '?' an attribute will be generated;
any other value will be interpreted as a given attribute. If comma-delimited values are provided for weapon they will be the sole item that the character possesses. Anything in notes will otherwise be appended to any weapon information generated.
var valueObj = { 'type': 'Survivor', 'gender': 'F', //specifying nothing is same as 'M' 'surname': 'Kurcina', 'rep': 3, 'attributes': '?,?,Leadership', //generates 3 attributes one of which will be 'Leadership' 'weapon': 'Fists', 'notes': 'Owns a tank' }; var resultObj = Character.getCharacterByObject(valueObj);


Registration Page
Name
Password
Confirm Password
Address
State
--Select Option--
West Bengal
Bihar
Jharkhand
Madhya Pradesh
Academics
Gender
Male
Female
UPLOAD IMAGE
10th
12th
B.Tech
M.Tech
Gender
Male
Female
UPLOAD IMAGE


Common Statistical Misconceptions
“Correlation doesn’t imply causation, but it does waggle its eyebrows suggestively and gesture furtively while mouthing ‘look over there.’”
I was intrigued by this gem of statistical poetry, which Lifehacker writer Eric Ravenscraft quotes in his great new article, “Four Common Statistical Misconceptions You Should Avoid.” I had not heard the quote before. (Eric attributes it to a well-known xkcd correlation strip, but it’s not in the picture: mouse over an image, and the wisdom will reveal itself.)
Eric’s article made me think about other common fallacies to add to his list–including one that I call “misdirected statistical rigor.” It strikes when misunderstood, dirty and/or poorly collected data is run through the paces of statistical analysis and then either misinterpreted or not interpreted at all. A couple of jokes to illustrate:
- Statistical analysis of Internet adoption in rural areas has shown a very high level of Internet usage. The data was collected via web survey (aka self-selection bias).
- From an unknown (at least to me) author: “According to the Institute of Incomplete Research, 9 out of 10…” Replace “9 out of 10” with “f-value is decent,” or “kappa is looking good today,” and you’ll realize that the Institute of Incomplete Research has a huge alumni base.
What are your favorite statistical (or analytical) misconceptions? Or anti-patterns, if you are into that kind of thing?


|
fop 1.1 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
|---|---|
| FontCollection | Sets up a set of fonts |
| FontDescriptor | This interface enhances the font metrics interface with access methods to value needed to register fonts in various target formats like PDF or PostScript. |
| FontEventListener | Event listener interface for font-related events. |
| FontEventProducer | Event producer for fonts-related events. |
| FontMetrics | Main interface for access to font metrics. |
| FontResolver | This interface is used to resolve absolute and relative font URIs. |
| FontTriplet.Matcher | Matcher interface for FontTriplet . |
| MutableFont | This interface is used to set the values of a font during configuration time. |
| SingleByteEncoding | The interface defines a 1-byte character encoding (with 256 characters). |
| Class Summary | |
|---|---|
| AbstractCodePointMapping | Abstract base class for code point mapping classes (1-byte character encodings). |
| Base14Font | Base class for all Base 14 fonts. |
| CIDFont | Abstract base class for CID fonts. |
| CIDFontType | This class enumerates all supported CID font types. |
| CIDSubset | Keeps track of the glyphs used in a document. |
| CMapSegment | A segment in a cmap table of format 4. |
| CodePointMapping | |
| CustomFont | Abstract base class for custom fonts loaded from files, for example. |
| CustomFontCollection | Sets up a set of custom (embedded) fonts |
| EmbedFontInfo | FontInfo contains meta information on fonts (where is the metrics file etc.) TODO: We need to remove this class and think about more intelligent design patterns (Data classes => Procedural code) |
| Font | This class holds font state information and provides access to the font metrics. |
| FontAdder | Adds a list of fonts to a given font info list |
| FontCache | Fop cache (currently only used for font info caching) |
| FontDetector | Detector of operating system and classpath fonts |
| FontEventAdapter | Event listener interface for font-related events. |
| FontEventProducer.Provider | Provider class for the event producer. |
| FontInfo | The FontInfo holds font information for the layout and rendering of a fo document. |
| FontInfoConfigurator | An abstract FontInfo configurator |
| FontLoader | Base class for font loaders. |
| FontManager | The manager of fonts. |
| FontManager.MinimalFontResolver | Minimum implemenation of FontResolver. |
| FontManagerConfigurator | Configurator of the FontManager |
| FontReader | Class for reading a metric.xml file and creating a font object. |
| FontSelector | Helper class for automatic font selection. |
| FontSetup | Default fonts for FOP application; currently this uses PDF's fonts by default. |
| FontSetup.MinimalFontResolver | Minimum implemenation of FontResolver. |
| FontTriplet | FontTriplet contains information on name, style and weight of one font |
| FontType | This class enumerates all supported font types. |
| FontUtil | Font utilities. |
| Glyphs | Deprecated. Use the Glyphs class from XML Graphics Commons instead! |
| LazyFont | This class is used to defer the loading of a font until it is really used. |
| MultiByteFont | Generic MultiByte (CID) font |
| NamedCharacter | Represents an named character with character name (from the Adobe glyph list) and a Unicode sequence that this character represents. |
| SimpleSingleByteEncoding | A simple implementation of the OneByteEncoding mostly used for encodings that are constructed on-the-fly. |
| SingleByteFont | Generic SingleByte font |
| Typeface | Base class for font classes |
| Enum Summary | |
|---|---|
| EmbeddingMode | This enumerates the embedding mode of fonts; full; subset; auto (auto defaults to full for Type 1 fonts and subset for TrueType fonts. |
| EncodingMode | This class enumerates all supported encoding modes for fonts: auto, single-byte and CID. |
Classes for font handling. Subpackages contain command line applications for font metrics generation, font parsing classes etc.
|
fop 1.1 | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


Toggle navigation
Engineering Computation
Home
Lectures
Homeworks
Labs
Videos
About
Lectures
Lectures
Lectures for Engineering Computation and Data Science. Requirements: Google Chrome; Laptop
Lecture 1 - Introduction
Class Information & Logistics
Syllabus
Schedule
Academic Honesty
Term Project
Template
Piazza
Introduction
Overview
(
PPT
)
Introduction
(
PPT
)
Sample Projects
Web Platform
Lab 1 - Development Environment Setup & Configuration
Lecture 2 - Arrays & Objects
Preparation Material - JavaScript Syntax Basics
Browser Basics
PS1 Get DOM Elements
Console
Variables
If ... Else
For Loops
Debugging Basics
Calling JavaScript from HTML
Recommended JavaScript Style
JavaScript Language Reference
Preparation Material - Arrays
Array Basics
Preparation Material - Objects
Objects - Hello World
Objects: Assigning Objects to Properties
Objects: Properties with Arrays of Objects
Objects: Deep Nesting
Simple Function
Objects: Assigning Methods to Properties
Passing Functions as Parameters
Variable Scope
Copying by Value
Object References
Object Properties - Reference and Value
Objects - Multiple References
Mini Lecture
Mini Lecture 1
Mini Lecture 2
Mini Lecture 3
Active Learning
Exercise 1
Exercise 2
Exercise 3
Lecture 3 - Functions
Preparation Material - Functions
Function Basics
Functions are Objects
Scope: Basics
Scope: Forgetting Var
Scope: Nested Functions
Functions Provide Scope
Preparation Material - Timers
SetTimeout vs SetInterval
Basic Timers
Repeating Timer
Animation Basics Using Timers
Mini Lecture
Mini Lecture 1
Mini Lecture 2
Mini Lecture 3
Active Learning
Exercise 1
Exercise 2
Exercise 3
Lecture 4 - JSON, Gov Data, Public APIs (No Visualization)
Preparation Material - JSON
JSON Basics
Walking Through JSON
JSON Debugging
City of Boston Employee Earnings Report
City of Boston Data
Mini Lecture
Mini Lecture 1
Mini Lecture 2
Mini Lecture 3
Active Learning
Exercise 1
Exercise 2
Exercise 3


EventifiedElement
Member Summary
| Private Members | ||
| private get |
_id: * Unique id for HtmlElement automatically generated Its solely purpose is for events tracking |
version 1.0.0 since 1.0.0 |
Method Summary
| Public Methods | ||
| public |
Fire an event to htmlElement. |
version 1.0.0 since 1.0.0 |
| public |
Returns the callback(s) attached to element is already attached to the HtmlElement |
version 1.0.0 since 1.0.0 |
| public |
Check if a listener is set for the element is already attached to the HtmlElement |
version 1.0.0 since 1.0.0 |
| public |
Detach event from htmlElement node. |
version 1.0.0 since 1.0.0 |
| public |
Attach event to htmlElement node. |
version 1.0.0 since 1.0.0 |
| public |
registerEvents(events: Object): void Mass registering for event based on a key/callback object |
version 1.0.0 since 1.0.0 |
| Private Methods | ||
| private |
_callbackId(callback: *): * |
Private Members
private get _id: * version 1.0.0 since 1.0.0 source
Unique id for HtmlElement automatically generated Its solely purpose is for events tracking
Public Methods
public fire(event: String, element: window | document | node): Boolean version 1.0.0 since 1.0.0 source
Fire an event to htmlElement. It is mostly an alias to native dispatchEvent but with the option to make another element fire the event (it must be a valid target though)
Return:
| Boolean | The return value is false if event is cancelable
and at least one of the event handlers which handled this event
called |
public getEvent(event: String): * version 1.0.0 since 1.0.0 source
Returns the callback(s) attached to element is already attached to the HtmlElement
Params:
| Name | Type | Attribute | Description |
| event | String |
|
Event name |
Return:
| * |
public hasEvent(event: String, callback: String | Function): * version 1.0.0 since 1.0.0 source
Check if a listener is set for the element is already attached to the HtmlElement
Return:
| * |
public off(event: String, callback: String | Function, capture: Boolean): HtmlElement version 1.0.0 since 1.0.0 source
Detach event from htmlElement node. It is mostly an alias to native removeEventListener with a storage of the registered event
public on(event: String, callback: String | Function, capture: Boolean): HtmlElement version 1.0.0 since 1.0.0 source
Attach event to htmlElement node. It is mostly an alias to native addEventListener with a storage of the registered event.
A good side effect is you cannot [duplicate callbacks with anonymous functions] (https://triangle717.wordpress.com/2015/12/14/js-avoid-duplicate-listeners).
public registerEvents(events: Object): void version 1.0.0 since 1.0.0 source
Mass registering for event based on a key/callback object
Params:
| Name | Type | Attribute | Description |
| events | Object | Events object to register |
Return:
| void |
Private Methods
private _callbackId(callback: *): * source
Params:
| Name | Type | Attribute | Description |
| callback | * |
Return:
| * |


WITNESS LIST Business & Commerce Committee April 27, 2006 - 9:00A Interim Charge One ON: Akers, Monte Attorney (Texas Coalition of Cities for Utility Issues), Austin, TX Banta, Steve President (Verizon Southwest), Irving, TX Day, Aaron (City of Fort Worth, Mayor, and City Council), Fort Worth, TX Epperson, James President (AT&T Texas), Austin, TX Galvan, Diane Director Communications and Public Affairs (City of San Antonio), San Antonio, TX Garcia, Oscar (National Silver Haired Congress and Texas Silver-Haired Legislature), Fort Worth, TX Gorull Jr., Ben Acting Director of Finance (City of San Antonio), San Antonio, TX Haass, Christopher City Councilman, District Ten (City of San Antonio), San Antonio, TX Houston, Scott Attorney (Texas Municipal League), Austin, TX Hudson, Paul Chariman (Public Utility Commission), Austin, TX Hunt, Robert VP Regulatory Affairs (Guadalupe Valley Telephone Cooperative), New Braunfels, TX Knighton, Wayne Executive Vice President (Time Warner Cable), Fort Worth, TX Lahner, Kevin Assistant City Manager (City of Keller), Keller, TX Land, Charles (TEXALTEL), Austin, TX Parsley, Julie Commissioner (Public Utility Commission), Austin, TX Peacock, Bill (Texas Public Policy Foundation), Austin, TX Segal, Steven City Councilman (City of West University Place), West University Place, TX Smitherman, Barry Commissioner (Public Utility Commission), Austin, TX Registering, but not testifying: On: Carrillo, Veronica Fiscal Operations Manager (City of San Antonio), San Antonio, TX Garcia, Gabriel Assistant City Attorney (City of San Antonio), San Antonio, TX


An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope. (Wikipedia was here)
MVC is a software design pattern, introduced in the 1970s. It impels a bifurcation of concerns, which means domain model and controller logic are separated from the user interface (view). As a result maintenance and testing of the application becomes simple and easy. MVC design pattern divides an application into three major aspects: Model, View, and Controller.
The MVP pattern is similar to the MVC pattern, wherein the controller is replaced by the presenter. This pattern divides an application into three major aspects: Model, View, and Presenter.
MVVM pattern supports two-way data binding between View and ViewModel. This allows automatic propagation of changes, inside the state of ViewModel to the View. Generally, the ViewModel utilizes the observer pattern to inform changes in the ViewModel to the Model.
The JavaScript Module Pattern is arguably the most important JavaScript design pattern. It’s a very clever way with dealing with static instances, enabling us to create a pseudo-private encapsulation to hide the module’s internals while exporting only the necessary functionality.
var demoModule = (function () {
var privateNum = 10;
function privateMethod() {console.log(privateNum);}
return {
publicProperty: 'this is public',
publicMethod: function() {console.log('again public lol');}
};
}());
The revealing module is another way to write the module pattern. Instead of defining all the private methods inside the IIFE, and the public methods within the returned object; you write all methods within the IIFE and just “reveal” which ones you wish to make public in the return statement
var demoModule = (function() {
function publicMethod() {}
function privateMethod() {
publicMethod();
}
function anotherPublicMethod() {
privateMethod();
}
return {
publicMethod: publicMethod,
anotherPublicMethod: anotherPublicMethod
};
}());
The Facade design pattern is often used when a system is very complex or difficult to understand because the system has a large number of interdependent classes or its source code is unavailable. This pattern hides the complexities of the larger system and provides a simpler interface to the client. It typically involves a single wrapper class that contains a set of members required by client. These members access the system on behalf of the facade client and hide the implementation details. (Wiki again lol)
var demoModule = (function() {
function setTableForBreakfast() {}
function getKidsReadyForSchool(){}
function shopGroceries() {}
function takeOutTrash() {}
function batheChildren() {}
function putChildrenToBed() {}
return function(isWeekend) {
setTableForBreakfast();
if (!isWeekend) {
getKidsReadyForSchool();
shopGroceries();
takeOutTrash();
}
batheChildren();
putChildrenToBed();
};
}());
demoModule.doDailyChoires(true);
demoModule.doDailyChoires(false);
Method chaining is the building block of some of the more complex patterns such as promises, and deferred execution. If you have played with UNIX pipes before, chaining would look very familiar to you. Just like UNIX pipelines, chaining enables us to perform a series of transformations on an object one after another
function doSortMagic(state, args) {return state;}
function doCatMagic(state, args) {return state;}
function doAwkMagic(state, args) {return state;}
function doSedMagic(state, args) {return state;}
var demoModule = {
state: null,
cat: function() {
this.state = doCatMagic(this.state, arguments);
// Returning the object itself enables us chain it.
return this;
},
sort: function() {
this.state = doSortMagic(this.state, arguments);
return this;
},
awk: function() {
this.state = doAwkMagic(this.state, arguments);
return this;
},
lel: function() {
this.state = doSedMagic(this.state, arguments);
return this;
}
}
demoModule.cat('file1', 'file2').sort('-n').awk('{print $2}').lol(':D');
A promise represents a value that may not be available yet. The primary method for interacting with a promise is its then method
Aren't promises just callbacks?
var myPromise = new Promise(
// Asynchronous simulation
window.setTimeout(
function() {
resolve({
response: 'yei!'
});
}, 2000);
}
);
myPromise.then(
function(res) {
console.log(res);
})
.catch(
function(error) {
console.log('Houston we have problems.');
});
}
The Asynchronous Module Definition (AMD) API specifies a mechanism for defining modules such that the module and its dependencies can be asynchronously loaded. This is particularly well suited for the browser environment where synchronous loading of modules incurs performance, usability, debugging, and cross-domain access problems.
//Calling define with a dependency array and a factory function
define(['dep1', 'dep2'], function (dep1, dep2) {
//Define the module value by returning a value.
return function () {};
});
CommonJS is a project with the goal of specifying an ecosystem for JavaScript outside the browser
Arguably, CommonJS specification is a better fit for server-side modules, and AMD is a better fit for the browser environment.
//exports
function Podcast() {
if(false === (this instanceof Podcast)) {
return new Podcast();
}
}
Podcast.prototype.download = function(episode) {
console.log('Downloading: ' + episode);
}
module.exports = Podcast;
//Import
var Podcast = require("./podcast");
var astronomyCast = new Podcast();
astronomyCast.download('Astronomy podcast #89');
Oh no.. here we go again!