The following illustrates some of the common security challanges Node.js developers are up against. The presentation covers various types of JavaScript-related hacks and NoSQL injection hacking via Express and MongoDB.
This document provides an overview of functional programming using Underscore.js and Lo-Dash. It discusses key concepts of functional programming like pure functions, first class functions, and higher order functions. It then explains how Underscore.js and Lo-Dash support functional programming in JavaScript with functions like compose, map, reduce, filter, and utilities to work with functions as first class citizens. The document compares Underscore.js and Lo-Dash, noting Lo-Dash's better performance, larger feature set, and utilities like partial and result. It emphasizes applying functional concepts judiciously for benefits while avoiding rewriting all code to be purely functional.
Ember.js is a JavaScript framework for building web applications. It provides conventions and architecture to make applications more organized and testable. Key aspects of Ember.js include Ember objects, computed properties, templates powered by Handlebars, routes for navigation, and a data modeling layer using Ember Data. Components are also used to build reusable isolated views. Ember follows a "data down, actions up" pattern where data flows from parent to child components and user actions bubble up through the components.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiInfluxData
When a large group of people change their habits, it can be tricky for infrastructures! Working from home and spending time indoor today means attending video calls and streaming movies and tv shows. This leads to increased internet traffic that can create congestion on the network infrastructure. So how do you get real-time visibility into your ISP connection? In this meetup, Mirko presents his setup based on a time series database and Raspberry Pi to better understand his ISP connection quality and speed — including upload and download speeds. Join us to discover how he does it using Telegraf, InfluxDB Cloud, Astro Pi, Telegram and Grafana! Finally, proof that your ISP connection is (or is not) as fast as it promises.
The document discusses object-oriented programming concepts in JavaScript. It begins with an overview of how everything in JavaScript is an object, even functions, and how objects have prototypes. It then provides examples of using constructor functions, prototype inheritance, and the extend method to create base classes and subclasses. Config objects and model-view design patterns are also demonstrated. The examples show how to build classes for containers, limited containers, query controllers, and adding map and view capabilities to queries. Resources for further learning are provided at the end.
Object-Oriented JavaScript presentation given at the 2010 ESRI Developer Summit. Code and slides are also available at http://github.com/kvangork/OOJS-Presentation
Find me on twitter @kvangork
or my blog http://prng.vangorkom.org
The following illustrates some of the common security challanges Node.js developers are up against. The presentation covers various types of JavaScript-related hacks and NoSQL injection hacking via Express and MongoDB.
This document provides an overview of functional programming using Underscore.js and Lo-Dash. It discusses key concepts of functional programming like pure functions, first class functions, and higher order functions. It then explains how Underscore.js and Lo-Dash support functional programming in JavaScript with functions like compose, map, reduce, filter, and utilities to work with functions as first class citizens. The document compares Underscore.js and Lo-Dash, noting Lo-Dash's better performance, larger feature set, and utilities like partial and result. It emphasizes applying functional concepts judiciously for benefits while avoiding rewriting all code to be purely functional.
Ember.js is a JavaScript framework for building web applications. It provides conventions and architecture to make applications more organized and testable. Key aspects of Ember.js include Ember objects, computed properties, templates powered by Handlebars, routes for navigation, and a data modeling layer using Ember Data. Components are also used to build reusable isolated views. Ember follows a "data down, actions up" pattern where data flows from parent to child components and user actions bubble up through the components.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
Monitoring Your ISP Using InfluxDB Cloud and Raspberry PiInfluxData
When a large group of people change their habits, it can be tricky for infrastructures! Working from home and spending time indoor today means attending video calls and streaming movies and tv shows. This leads to increased internet traffic that can create congestion on the network infrastructure. So how do you get real-time visibility into your ISP connection? In this meetup, Mirko presents his setup based on a time series database and Raspberry Pi to better understand his ISP connection quality and speed — including upload and download speeds. Join us to discover how he does it using Telegraf, InfluxDB Cloud, Astro Pi, Telegram and Grafana! Finally, proof that your ISP connection is (or is not) as fast as it promises.
The document discusses object-oriented programming concepts in JavaScript. It begins with an overview of how everything in JavaScript is an object, even functions, and how objects have prototypes. It then provides examples of using constructor functions, prototype inheritance, and the extend method to create base classes and subclasses. Config objects and model-view design patterns are also demonstrated. The examples show how to build classes for containers, limited containers, query controllers, and adding map and view capabilities to queries. Resources for further learning are provided at the end.
Object-Oriented JavaScript presentation given at the 2010 ESRI Developer Summit. Code and slides are also available at http://github.com/kvangork/OOJS-Presentation
Find me on twitter @kvangork
or my blog http://prng.vangorkom.org
This document discusses best practices for developing Node.js applications. It recommends using frameworks like Express for building web apps, libraries like Async to avoid callback hell, and organizing code into modular sub-applications. It also covers testing, error handling, documentation, and open-sourcing projects. Standards like Felix's Style Guide and domain-driven design principles are advocated. Communication channels like events, HTTP APIs, and WebSockets are examined.
This document provides an overview of using Redux middleware for asynchronous actions, logging, analytics, and authentication. It demonstrates how to structure asynchronous action creators to work with Redux Thunk middleware and make API calls. It also shows how to build custom middleware to handle API requests, add authentication headers, and process responses. The document recommends middleware as a way to separate logic from components and encourages further reading on middleware patterns and the Redux ecosystem.
The document discusses deploying Firebase Cloud Functions using Firebase CLI commands. It also discusses types for defining Cloud Function interfaces and callable functions. There are examples of managing Algolia indexes using Cloud Functions and security rules for Firestore.
This document provides an overview of ES6 features and how to set them up for use in Ruby on Rails applications. It describes key ES6 features such as let and const block scoping, template strings, destructuring assignment, default and rest parameters, loops and generators, enhanced object literals, Maps and Sets, arrow functions, modules, and classes. It then provides instructions for using the sprockets-es6 gem to transpile ES6 code to ES5 for use in Rails, as well as using Node.js and Gulp as an alternative approach.
iPhone applications can often benefit by talking to a web service to synchronize data or share information with a community. Ruby on Rails, with its RESTful conventions, is an ideal backend for iPhone applications. In this session you'll learn how to use ObjectiveResource in an iPhone application to interact with a RESTful web service implemented in Rails. This session isn't about how to build web applications that are served up on the iPhone. It's about how to build iPhone applications with a native look and feel that happen to talk to Rails applications under the hood. The upshot is a user experience that transcends the device.
JavaScript provides core functionality for web pages and applications. It has a C-like syntax and is dynamically typed. JavaScript code runs on both the client-side in web browsers and the server-side in environments like Node.js. It uses prototype-based inheritance where objects can inherit properties from object prototypes. New features are being added regularly through the ECMAScript specification. JavaScript allows DOM manipulation to modify web pages and event handling for user interactions.
The document discusses connecting Pebble smartwatches to external devices and APIs. It provides examples of prototyping an app to get weather data from an API and display it, controlling Hue lights by calling a REST API, and creating a "PebbleBot" to control servos over BLE. The document emphasizes identifying available APIs, prototyping interactions, and connecting Pebble to other devices and services.
AST - the only true tool for building JavaScriptIngvar Stepanyan
The document discusses working with code abstract syntax trees (ASTs). It provides examples of parsing code into ASTs using libraries like Esprima, querying ASTs using libraries like grasp-equery, constructing and transforming ASTs, and generating code from ASTs. It introduces aster, an AST-based code builder that allows defining reusable AST transformations as plugins and integrating AST-based builds into generic build systems like Grunt and Gulp. Aster aims to improve on file-based builders by working directly with ASTs in a streaming fashion.
The document discusses different types of tests for Node.js applications from unit tests to integration tests. It provides examples of setting up unit tests using Mocha, Chai and Sinon. Integration tests examples are also given using Mocha, Chai and Chai HTTP to test routes and make requests to the application. Noch is also introduced for mocking external API responses in integration tests. The document emphasizes the importance of both unit and integration tests during development.
The document defines a LineChart class that extends the Chart class. The LineChart class constructor calls the parent constructor and draws the chart. The draw method builds a line chart from the series data using an SVG library, appends it to the canvas, and adds statistics for each data point by calling the parent addStats method. The getSerieData static method calculates max and average values for a data series. The class is exported for use in other code.
The document describes the structure and components of an application codebase, including:
- The directory structure contains controllers, views, resources, and backend code
- Common UI components like linear layouts, cell layouts, panels, text views and inputs, images, and scenes are implemented
- Client-server communication uses messages to send commands and return results
- Server storage is implemented using Redis and simple data storage
The document provides code examples and explanations for various JavaScript programming techniques. Some examples covered include:
1. Using logical operators and default parameters to handle function arguments concisely.
2. Different methods for converting strings to numbers, setting default object properties, and checking if an object property exists.
3. Techniques for improving loop performance by caching array lengths and merging arrays without creating new objects.
4. Examples of array slicing and truncation, as well as converting array-like objects to arrays.
5. Explanations of equality comparisons, typeof, instanceof, and immediately invoked function expressions.
Cross Domain Web Mashups with JQuery and Google App EngineAndy McKay
This document discusses cross-domain mashups using jQuery and Google App Engine. It describes common techniques for dealing with the same-origin policy, including proxies, JSONP, and building sample applications that mashup Twitter data, geotagged tweets, and maps. Examples include parsing RSS feeds from Twitter into JSONP and displaying tweets on a map based on their geotagged locations. The document concludes by noting issues with trust, failures, and limitations for enterprise use.
The document provides 5 things for developers including: 1) Research resources on Yahoo patterns, performance, and YUI; 2) Flexible professional development with YUI; 3) Documentation; 4) Things to impress bosses like search and YSlow; and 5) Partnering by using custom YQL tables.
This document provides information on developing chaincode using Fabric chaincode and the development environment, YAML configuration, dev mode, chaincode programming structure, dependencies, deploying and invoking chaincode, RESTful APIs, data structures including key-value and table access, HFC APIs for user management, chaincode operations, and the gateway. It describes tools for chaincode development including Docker Compose, Golang SDK, Nodejs SDK, and windows build tools.
The document discusses the mobl programming language for building mobile web applications. Mobl is a statically-typed language that compiles to HTML and JavaScript. It aims to provide features for building reactive user interfaces and uses techniques like continuation-passing style and observables to support asynchronous programming in a synchronous-looking way. The document provides examples of coding common mobile app patterns like data binding, network requests, and user input handling in mobl.
Angular is a web application framework developed in 2009. It allows developers to create single page applications using HTML enhanced with Angular specific directives and by associating angular components like controllers, services and filters with HTML. The document provides an overview of key Angular concepts like controllers, services, filters and routing and how they are used to build interactive single page applications. It also demonstrates how to make HTTP requests to backend services and handle promises using the $http service and $q.
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)AvitoTech
В своём докладе Влад будет говорить об использовании STL, управлении памятью, как работает ARC и C++, лямбды и блоки. И самое главное: где и как можно «выстрелить себе в ногу».
Apply Information System Auditing AssignmentResearch an art.docxarmitageclaire49
Apply: Information System Auditing Assignment
Research an article in the University Library related to this week's objectives. (Information Technology Auditing)
Write a 700- to 1,050-word summary of the article.
Apply what you learned to your professional life. How could you use the information on your job?
Format your paper consistent with APA standards.
Notes: Any article is alright about the week’s objectives which is information system auditing.
I am currently a fiscal assistant for a government agency.
Let me know if you need anything else. Thank you.
PS355 – Winter 2019
Civic Engagement Project
Assignment
The core of this assignment is for you to practice "engaging yourself and engaging your civic community." Your goal should be multi-layered - to bring change in one social issue that is of concern to you in your community, to develop your knowledge and skills related to civics, and to challenge yourself to reach outside of the classroom to learn and then bring your knowledge back to the classroom to share with your classmates.
You will need to (1) choose and research one substantial social issue at Western Oregon University or in your surrounding community, (2) define a problem found within the issue, and (3) devise and implement a local solution to that problem. If the type of project you choose does not allow for implementation during this quarter, you must submit a detailed proposal of how your project would be implemented with additional time.
You will present your project to the class (a) briefly in Week 4 to gain feedback (January 28th), and (b) the complete project at the end of the quarter (classes during Week 9 and 10 of the quarter, plus on final exam day if needed). In addition, you will need to turn in progress reports and hold brief meetings with me to discuss your efforts. You may work alone or in a group (if you work in a group, you will receive a group score). You will have a great deal of latitude in the project you choose. However, you will work closely with me in planning your actions, and determining what is sufficient progress based on the project and problem you choose.
As you begin work on the project keep the following questions in mind:
· What may prevent progress or help you succeed, and how can you plan for these challenges?
· Who will you need to work with (who are the stakeholders and what are their interests)?
· What will be most effective to change behavior?
Grading
Grades will be determined by the amount and quality of work you complete, not necessarily completing the project, as there is a time limitation of just one quarter. However, the average amount of time that should be spent on the project should be at least 40 hours (4 hours a week) as the assignment is 50% of the class grade. The 40 hours includes the time needed to write the Design, Project Reports, and Project Summary. In addition, you will be assessed on how well your project changes behavior. Therefore, you need to es.
Apply information from the Aquifer Case Study to answer the followin.docxarmitageclaire49
Apply information from the Aquifer case study to answer the following questions:
Why is developmental assessment essential in the provision of primary care for infants, children, and adolescents, and what are the essential components of this assessment on the basis of this child’s age?
Which tools will you use to assess specific components of development (such as speech, motor skills, social skills, etc.)? Which tools do you think are the most accurate in assessing the developmental components and why?
Which components would you consider in assessing the basic biological functioning and well-being of your pediatric patients? Why are these components important in providing primary health-care services to children?
.
This document discusses best practices for developing Node.js applications. It recommends using frameworks like Express for building web apps, libraries like Async to avoid callback hell, and organizing code into modular sub-applications. It also covers testing, error handling, documentation, and open-sourcing projects. Standards like Felix's Style Guide and domain-driven design principles are advocated. Communication channels like events, HTTP APIs, and WebSockets are examined.
This document provides an overview of using Redux middleware for asynchronous actions, logging, analytics, and authentication. It demonstrates how to structure asynchronous action creators to work with Redux Thunk middleware and make API calls. It also shows how to build custom middleware to handle API requests, add authentication headers, and process responses. The document recommends middleware as a way to separate logic from components and encourages further reading on middleware patterns and the Redux ecosystem.
The document discusses deploying Firebase Cloud Functions using Firebase CLI commands. It also discusses types for defining Cloud Function interfaces and callable functions. There are examples of managing Algolia indexes using Cloud Functions and security rules for Firestore.
This document provides an overview of ES6 features and how to set them up for use in Ruby on Rails applications. It describes key ES6 features such as let and const block scoping, template strings, destructuring assignment, default and rest parameters, loops and generators, enhanced object literals, Maps and Sets, arrow functions, modules, and classes. It then provides instructions for using the sprockets-es6 gem to transpile ES6 code to ES5 for use in Rails, as well as using Node.js and Gulp as an alternative approach.
iPhone applications can often benefit by talking to a web service to synchronize data or share information with a community. Ruby on Rails, with its RESTful conventions, is an ideal backend for iPhone applications. In this session you'll learn how to use ObjectiveResource in an iPhone application to interact with a RESTful web service implemented in Rails. This session isn't about how to build web applications that are served up on the iPhone. It's about how to build iPhone applications with a native look and feel that happen to talk to Rails applications under the hood. The upshot is a user experience that transcends the device.
JavaScript provides core functionality for web pages and applications. It has a C-like syntax and is dynamically typed. JavaScript code runs on both the client-side in web browsers and the server-side in environments like Node.js. It uses prototype-based inheritance where objects can inherit properties from object prototypes. New features are being added regularly through the ECMAScript specification. JavaScript allows DOM manipulation to modify web pages and event handling for user interactions.
The document discusses connecting Pebble smartwatches to external devices and APIs. It provides examples of prototyping an app to get weather data from an API and display it, controlling Hue lights by calling a REST API, and creating a "PebbleBot" to control servos over BLE. The document emphasizes identifying available APIs, prototyping interactions, and connecting Pebble to other devices and services.
AST - the only true tool for building JavaScriptIngvar Stepanyan
The document discusses working with code abstract syntax trees (ASTs). It provides examples of parsing code into ASTs using libraries like Esprima, querying ASTs using libraries like grasp-equery, constructing and transforming ASTs, and generating code from ASTs. It introduces aster, an AST-based code builder that allows defining reusable AST transformations as plugins and integrating AST-based builds into generic build systems like Grunt and Gulp. Aster aims to improve on file-based builders by working directly with ASTs in a streaming fashion.
The document discusses different types of tests for Node.js applications from unit tests to integration tests. It provides examples of setting up unit tests using Mocha, Chai and Sinon. Integration tests examples are also given using Mocha, Chai and Chai HTTP to test routes and make requests to the application. Noch is also introduced for mocking external API responses in integration tests. The document emphasizes the importance of both unit and integration tests during development.
The document defines a LineChart class that extends the Chart class. The LineChart class constructor calls the parent constructor and draws the chart. The draw method builds a line chart from the series data using an SVG library, appends it to the canvas, and adds statistics for each data point by calling the parent addStats method. The getSerieData static method calculates max and average values for a data series. The class is exported for use in other code.
The document describes the structure and components of an application codebase, including:
- The directory structure contains controllers, views, resources, and backend code
- Common UI components like linear layouts, cell layouts, panels, text views and inputs, images, and scenes are implemented
- Client-server communication uses messages to send commands and return results
- Server storage is implemented using Redis and simple data storage
The document provides code examples and explanations for various JavaScript programming techniques. Some examples covered include:
1. Using logical operators and default parameters to handle function arguments concisely.
2. Different methods for converting strings to numbers, setting default object properties, and checking if an object property exists.
3. Techniques for improving loop performance by caching array lengths and merging arrays without creating new objects.
4. Examples of array slicing and truncation, as well as converting array-like objects to arrays.
5. Explanations of equality comparisons, typeof, instanceof, and immediately invoked function expressions.
Cross Domain Web Mashups with JQuery and Google App EngineAndy McKay
This document discusses cross-domain mashups using jQuery and Google App Engine. It describes common techniques for dealing with the same-origin policy, including proxies, JSONP, and building sample applications that mashup Twitter data, geotagged tweets, and maps. Examples include parsing RSS feeds from Twitter into JSONP and displaying tweets on a map based on their geotagged locations. The document concludes by noting issues with trust, failures, and limitations for enterprise use.
The document provides 5 things for developers including: 1) Research resources on Yahoo patterns, performance, and YUI; 2) Flexible professional development with YUI; 3) Documentation; 4) Things to impress bosses like search and YSlow; and 5) Partnering by using custom YQL tables.
This document provides information on developing chaincode using Fabric chaincode and the development environment, YAML configuration, dev mode, chaincode programming structure, dependencies, deploying and invoking chaincode, RESTful APIs, data structures including key-value and table access, HFC APIs for user management, chaincode operations, and the gateway. It describes tools for chaincode development including Docker Compose, Golang SDK, Nodejs SDK, and windows build tools.
The document discusses the mobl programming language for building mobile web applications. Mobl is a statically-typed language that compiles to HTML and JavaScript. It aims to provide features for building reactive user interfaces and uses techniques like continuation-passing style and observables to support asynchronous programming in a synchronous-looking way. The document provides examples of coding common mobile app patterns like data binding, network requests, and user input handling in mobl.
Angular is a web application framework developed in 2009. It allows developers to create single page applications using HTML enhanced with Angular specific directives and by associating angular components like controllers, services and filters with HTML. The document provides an overview of key Angular concepts like controllers, services, filters and routing and how they are used to build interactive single page applications. It also demonstrates how to make HTTP requests to backend services and handle promises using the $http service and $q.
"О некоторых особенностях Objective-C++" Влад Михайленко (Maps.Me)AvitoTech
В своём докладе Влад будет говорить об использовании STL, управлении памятью, как работает ARC и C++, лямбды и блоки. И самое главное: где и как можно «выстрелить себе в ногу».
Apply Information System Auditing AssignmentResearch an art.docxarmitageclaire49
Apply: Information System Auditing Assignment
Research an article in the University Library related to this week's objectives. (Information Technology Auditing)
Write a 700- to 1,050-word summary of the article.
Apply what you learned to your professional life. How could you use the information on your job?
Format your paper consistent with APA standards.
Notes: Any article is alright about the week’s objectives which is information system auditing.
I am currently a fiscal assistant for a government agency.
Let me know if you need anything else. Thank you.
PS355 – Winter 2019
Civic Engagement Project
Assignment
The core of this assignment is for you to practice "engaging yourself and engaging your civic community." Your goal should be multi-layered - to bring change in one social issue that is of concern to you in your community, to develop your knowledge and skills related to civics, and to challenge yourself to reach outside of the classroom to learn and then bring your knowledge back to the classroom to share with your classmates.
You will need to (1) choose and research one substantial social issue at Western Oregon University or in your surrounding community, (2) define a problem found within the issue, and (3) devise and implement a local solution to that problem. If the type of project you choose does not allow for implementation during this quarter, you must submit a detailed proposal of how your project would be implemented with additional time.
You will present your project to the class (a) briefly in Week 4 to gain feedback (January 28th), and (b) the complete project at the end of the quarter (classes during Week 9 and 10 of the quarter, plus on final exam day if needed). In addition, you will need to turn in progress reports and hold brief meetings with me to discuss your efforts. You may work alone or in a group (if you work in a group, you will receive a group score). You will have a great deal of latitude in the project you choose. However, you will work closely with me in planning your actions, and determining what is sufficient progress based on the project and problem you choose.
As you begin work on the project keep the following questions in mind:
· What may prevent progress or help you succeed, and how can you plan for these challenges?
· Who will you need to work with (who are the stakeholders and what are their interests)?
· What will be most effective to change behavior?
Grading
Grades will be determined by the amount and quality of work you complete, not necessarily completing the project, as there is a time limitation of just one quarter. However, the average amount of time that should be spent on the project should be at least 40 hours (4 hours a week) as the assignment is 50% of the class grade. The 40 hours includes the time needed to write the Design, Project Reports, and Project Summary. In addition, you will be assessed on how well your project changes behavior. Therefore, you need to es.
Apply information from the Aquifer Case Study to answer the followin.docxarmitageclaire49
Apply information from the Aquifer case study to answer the following questions:
Why is developmental assessment essential in the provision of primary care for infants, children, and adolescents, and what are the essential components of this assessment on the basis of this child’s age?
Which tools will you use to assess specific components of development (such as speech, motor skills, social skills, etc.)? Which tools do you think are the most accurate in assessing the developmental components and why?
Which components would you consider in assessing the basic biological functioning and well-being of your pediatric patients? Why are these components important in providing primary health-care services to children?
.
Apply Development PlanCreate a 700- to 1,050-word development.docxarmitageclaire49
Apply: Development Plan
Create a 700- to 1,050-word development plan that includes the following:
· Assess the legalities of training.
· Determine whether the plan could offend any of the protected classes.
· Evaluate whether you will use the plan as the sole weighting for promoting and determining the eligibility of employees for the opportunity to move forward at work.
· Conduct a cultural assessment of your terminology.
· Consider the various aspects of EEOC.
Cite any sources according to APA formatting guidelines.
INSTRUCTIONS
Just a quick note to make sure you all went to the V&A (Jameel Collection and South Asian Galleries) yesterday or before and you found your visit interesting. If you haven't been yet, please make sure you go as soon as possible to complete your first written graded assignment for our course.
2000 words
WEEK 6, TUESDAY 19 FEBRUARY:
Student-led activity.
This session will take place without the instructor. Students are required to visit the Jameel Gallery AND the South Asian Gallery (on Islamic art and Mughal objects) at the Victoria and Albert Museum, London.
Students are then asked to submit ONLINE, by SUNDAY 3 MARCH, a written GALLERY REVIEW on their visit (2,000 – 3,000 words.), in which they:
- Briefly outline the main features of their chosen exhibiting space;
- Choose and discuss at least FIVE art pieces, providing a short art-historical analysis, a relevant bibliography and set of illustrations for each of them;
- Briefly consider the interaction between Western and non-Western art.
Make sure you describe all your chosen objects in a way that is meaningful and art-historically relevant (facts and dates).
Your report should reflect both the academic research behind the curating of your chosen space (how well is it curated, in your opinion?) and your own personal ideas (it should be a mixture of both).
Finally, don’t forget to structure your essay rigorously,
weave your observations within a coherent and cohesive framework,
and provide original and meaningful conclusions.
Students who fail to visit this museum and submit their written report will be marked as absent and receive an F for this assignment.
STRUCTURE
(title)
Jameel Gallery Review
2000 words (5 pieces)
INTRODUCTION and thesis (150)
(Briefly outline the main features of their chosen exhibiting space, describe the two pictures below of the gallery space called the jameel gallery) its spacious its white, the center is the ardabil carpet (talk a bit about it)
Explain how the objects are displayed in glass cubes arround the room and there is a main piece in the center
The vibrant collection spans from the early Islamic period (the 7th century) to the early 20th century and include holdings of metalwork, ceramics, architectural woodwork and textiles. Highlights include the Ardabil Carpet, the world's oldest dated carpet and one of the largest, most beautiful and historically important. CENTER PIECE OF THE .
Applied TodayMedia—tv, movies booksConcept of PrisonerKe.docxarmitageclaire49
Applied Today
Media—tv, movies books
Concept of Prisoner
Kept from reality
Helpless
Content to remain prisoners
Role of Enlightened
After prisoner get freed, he goes back and tries to enlighten the other prisoners. They resist enlightenment and refuse to leave
Symbolism of caves and shadows
Cave-physical world
Shadows- What was believed to be true
.
Applied Social PsychologyApplied social psychology is a field .docxarmitageclaire49
Applied Social Psychology
Applied social psychology is a field unto itself and provides researchers with a direct connection between academic social psychology and their desire to have an impact on social change. Social psychology is a highly applicable field, and social psychological research influences such areas as: consumer behavior, immigration, cultural diversity, education, the environment, organizational functioning, health/mental health, and politics, to name a few (Steg, Buunk, & Rothengatter, 2008).
For this Discussion, review this week’s Learning Resources. Think about how you might use applied social psychology in your field of interest and ways in which to have an impact on social change.
With these thoughts in mind:
Post by Day 3 a brief definition of applied social psychology. Then explain how you might apply one element of applied social psychology in your field of interest. Finally, explain one way using applied social psychology in your field of interest may affect social change.
.
Applied LearningPsychology is an interesting field of study be.docxarmitageclaire49
Applied Learning
Psychology is an interesting field of study because the theories and concepts that you learn can often be observed in the world around you. This assignment allows you to consider material you have covered in the content of this module and apply those concepts to your own life.
In Section 1, you will identify and define ideas. In this module, as you reviewed your course materials, you likely discovered many interesting new ideas in psychology.
· Identify three different concepts, ideas, or research findings that were interesting or useful to you.
· Explain or describe each concept, theory or research finding in detail, in your own words.
· A good response here would be at least 150 words. Be sure to use proper spelling and grammar in your response. Write your response in the space below.
Response:
The three concepts or theories that I am most interested in are the Psychodynamic Theory, the Cognitive Perspective, and the Gestalt Theory. My first interest, the psychodynamic theory, was developed by neurologist Sigman Freud. Freud believed that unconscious and conscious forces drive human behavior to try and solve conflicts with personal needs and society's demands. His theory views a person as being pushed or pulled, and emphasizes early childhood as a time in which a persons personality is formed. The theory goes on to explain that a persons personality is formed by the events that motivate behavior in early childhood, therefore proving that all behavior is motivated. Freud proposed this theory by studying which parts of the personality consisted of the Id (instincts and pleasure), the superego (obedience to parents and society), and the ego (mediates between Id and superego according to it's demands). Freud felt that if he could help people understand how their personalities were developed and to understand the unconscious and conscious mind, they could actually experience an emotional release, therefore finding relief from psychological disturbances and distress. Behaviorist and Humanist also support Freud's psychodynamic theory of personalities.
My second interest, Gestalt psychology, was developed by psychologist Max Wertheimer et al., and is a theory of visual perception. Gestalt psychology has also been referred to as gestalt theory and the Max Wertheimer theory. The idea of the gestalt theory is that the mind can understand experiences as a whole and not just as a collection of different experiences. It has also been explained as the whole of anything is greater than its parts. This is why the theory is appropriately named gestalt, because gestalt is a German word that means unified whole. Wertheimer believes that the human mind has the capability to accumulate and maintain many different perceptions in a chaotic world. Wertheimer's theory has been become known as “ The laws of Max Wertheimer" and also as “ Gestalt laws of grouping.” Gestalt psyc.
Applied Assignment III – write 5 primary goals and their metrics f.docxarmitageclaire49
Applied Assignment III – write 5 primary goals and their metrics for the railroad facility (that is for one of the maintenance/repair facilities, provide examples); please describe and use examples, provide details about how the metrics and goals link together.
It has to be about 2 pages.
It has to be plagiarism free!
Needs to be done by Wednesday before 6pm.
.
Applied Assignment I – describe the primary business processes, key .docxarmitageclaire49
Applied Assignment I – describe the primary business processes, key supporting processes, key work interdependences, and possible key deliberations. Describe them and give examples for how they might work for the organization I provided. You’ll find definition and examples of these in the supplemental information under the content area and in the applied assignment folder
2 pages before 9pm
.
Applied Final ProjectThe Cultural OtherResearch the hist.docxarmitageclaire49
Applied Final Project
"The Cultural Other"
Research the history and traditions of a culture that is of special interest to you. You may research the arts, musical traditions, literature, significant historical events, and religions of your chosen culture.
Armed with this background, create a portfolio of an invented person from that culture. The result will be a case study.
Decide on the age, gender, socioeconomic class, family situation, and community role of the individual, as well as a personal crisis the individual has involving culture.
Write up the case study. Include a key historical event that has some influence on the case.
.
applied sciencesReviewA State-of-the-Art Review of .docxarmitageclaire49
applied
sciences
Review
A State-of-the-Art Review of Nanoparticles
Application in Petroleum with a Focus on
Enhanced Oil Recovery
Madhan Nur Agista 1,2, Kun Guo 1,3,* ID and Zhixin Yu 1,* ID
1 Department of Energy and Petroleum Engineering, University of Stavanger, 4036 Stavanger, Norway;
[email protected]
2 Auroris Energy, Jakarta 12950, Indonesia
3 The National IOR Centre of Norway, University of Stavanger, 4036 Stavanger, Norway
* Correspondence: [email protected] (K.G.); [email protected] (Z.Y.);
Tel.: +47-5183-2198 (K.G.); +47-5183-2238 (Z.Y.)
Received: 21 April 2018; Accepted: 15 May 2018; Published: 25 May 2018
����������
�������
Abstract: Research on nanotechnology application in the oil and gas industry has been growing
rapidly in the past decade, as evidenced by the number of scientific articles published in
the field. With oil and gas reserves harder to find, access, and produce, the pursuit of more
game-changing technologies that can address the challenges of the industry has stimulated this
growth. Nanotechnology has the potential to revolutionize the petroleum industry both upstream
and downstream, including exploration, drilling, production, and enhanced oil recovery (EOR),
as well as refinery processes. It provides a wide range of alternatives for technologies and materials to
be utilized in the petroleum industry. Nanoscale materials in various forms such as solid composites,
complex fluids, and functional nanoparticle-fluid combinations are key to the new technological
advances. This paper aims to provide a state-of-the-art review on the application of nanoparticles and
technology in the petroleum industry, and focuses on enhanced oil recovery. We briefly summarize
nanotechnology application in exploration and reservoir characterization, drilling and completion,
production and stimulation, and refinery. Thereafter, this paper focuses on the application of
nanoparticles in EOR. The different types of nanomaterials, e.g., silica, aluminum oxides, iron oxide,
nickel oxide, titanium oxide, zinc oxide, zirconium oxide, polymers, and carbon nanotubes that have
been studied in EOR are discussed with respect to their properties, their performance, advantages,
and disadvantages. We then elaborate upon the parameters that will affect the performance of
nanoparticles in EOR, and guidelines for promising recovery factors are emphasized. The mechanisms
of the nanoparticles in the EOR processes are then underlined, such as wettability alteration, interfacial
tension reduction, disjoining pressure, and viscosity control. The objective of this review is to present
a wide range of knowledge and expertise related to the nanotechnology application in the petroleum
industry in general, and the EOR process in particular. The challenges and future research directions
for nano-EOR are pinpointed.
Keywords: nanotechnology; nanoparticle; petroleum; enhanced oil recovery; recovery mechanism;
wettability alteration; interfacial tension reduc.
Applications of Epidemiology – A Case Study The situation at Goo.docxarmitageclaire49
Applications of Epidemiology – A Case Study
The situation at Good Health Hospital has become a bit overwhelming ever since the outbreak of E. coli in Ward 10 on the second floor. It appears that there are six (6) cases of the disease. To better understand the situation, communication with the CDC has revealed that this particular bacterium can be found in many everyday items. The CDC recommends that investigation begins in the hospital kitchens, since E. coli can be transmitted via contaminated vegetables, as well as delicatessen meats such as salami and other cold cuts. The following table shows the number of cases identified so far: Case
Age
Gender
1
23
M
2
21
F
3
15
M
4
42
F
After meeting yesterday with chief administrator Joe Wellborn, it has been decided that the litigation issues with one (1) of the patients may need further information to determine if the patient was already symptomatic with the bacteria prior to admission.
Research has indicated that hospitals operating in the Tampa Bay area have been known to have cases of E. coli contamination. This substantiates the need for further investigations by the County Health Department.
Due to the severity of the cases, and the potential for further spread, it is recommended that the hospital seek alternate vending services since the present suppliers cannot verify sanitation protocols for their products.
In conclusion, the study done at Good Health Hospital has indicated that the E. coli outbreak was in fact caused by spoil food from the cafeteria.
As a social science researcher working for a regional hospital, you are placed in charge of contacting the DOH from your home state, as well as the CDC for statistical data on nosocomial diseases that frequently cause illness at your health care facility. Using information from both agencies, evaluate the data on common nosocomial diseases and compile a treatment contingency plan for dealing with the hospital infections.
Write a five to six (5-6) page evaluation report in which you:
Analyze Good Health Hospital’s records and itemize recent nosocomial infections that occurred within the past year. In your report, categorize the different parameters (i.e., person, time, place, ethnicity, and gender) used in the compilation of data into the information summative.
Propose at least six (6) questions for the health care administrator at Good Health Hospital, regarding potential litigation issues with infections from the nosocomial diseases. Rationalize, in your report, the logic behind your six (6) questions.
Identify a targeted audience within Good Health Hospital, and prepare an implementation plan based on your hypothetical meeting with the hospital health care administrator. Propose four (4) steps that will be useful in the final implementation plan.
Suggest at least five (5) recommendations to your department head based on the steps taken in the implementation plan. Provide rationale for your suggestions.
Using these approved r.
ApplicationFederal Statutes and the Impact of Legislative Bills.docxarmitageclaire49
Application:
Federal Statutes and the Impact of Legislative Bills
A statute provides the written process that transforms a bill from a static piece of legislation to action. Enacting a statute is more complicated than simply having the legislature vote on and approve it. Once a member of Congress introduces a bill, it is sent to various House and Senate committees and subcommittees, any of which may edit, add to, amend, or “kill” the bill at any point. Therefore, only a small fraction of the bills submitted for consideration are passed into law. If a bill passes through the committees, it will be presented for a floor debate and full vote of both houses of Congress. Then, it must be signed into law by the President. After they are voted on and signed into law, bills are then subject to interpretation and analysis by the judicial system regarding how they apply to specific legal problems and cases.
To prepare for this assignment:
Review the assigned pages of Chapter 3 in your course text,
Principles of Legal Research
. Focus on sources of and research methods for locating enacted federal legislation.
Review Chapter 4 in your course text,
Principles of Legal Research
. Think about the legislative process and how to research pending legislation.
Select a policy issue that interests you.
Use the LexisNexis Academic database in the Walden library, and search for current statutes that may impact the policy issue you selected. Use the source
United States
Code Service – Titles 1 through 50
, located in the Federal & State Codes section of the Legal tab.
Access “The Library of Congress: THOMAS” website and search for current bills that may impact the policy issue you selected.
The assignment:
(2–3 pages)
Briefly describe the issue you selected.
Describe two or three federal statutes that relate to the issue and explain how each does so.
Describe one
current
legislative bill related to the issue, and explain how it might impact the law or policy related to the issue if passed. Be specific.
Support your Application Assignment with specific references to all resources used in its preparation. You are asked to provide a reference list only
.
ApplicationFederal Statutes and the Impact of Legislative B.docxarmitageclaire49
Application:
Federal Statutes and the Impact of Legislative Bills
A statute provides the written process that transforms a bill from a static piece of legislation to action. Enacting a statute is more complicated than simply having the legislature vote on and approve it. Once a member of Congress introduces a bill, it is sent to various House and Senate committees and subcommittees, any of which may edit, add to, amend, or “kill” the bill at any point. Therefore, only a small fraction of the bills submitted for consideration are passed into law. If a bill passes through the committees, it will be presented for a floor debate and full vote of both houses of Congress. Then, it must be signed into law by the President. After they are voted on and signed into law, bills are then subject to interpretation and analysis by the judicial system regarding how they apply to specific legal problems and cases.
To prepare for this assignment:
Review the assigned pages of Chapter 3 in your course text,
Principles of Legal Research
. Focus on sources of and research methods for locating enacted federal legislation.
Review Chapter 4 in your course text,
Principles of Legal Research
. Think about the legislative process and how to research pending legislation.
Select a policy issue that interests you.
Use the LexisNexis Academic database in the Walden library, and search for current statutes that may impact the policy issue you selected. Use the source
United States
Code Service – Titles 1 through 50
, located in the Federal & State Codes section of the Legal tab.
Access “The Library of Congress: THOMAS” website and search for current bills that may impact the policy issue you selected.
The assignment:
(2–3 pages)
Briefly describe the issue you selected.
Describe two or three federal statutes that relate to the issue and explain how each does so.
Describe one
current
legislative bill related to the issue, and explain how it might impact the law or policy related to the issue if passed. Be specific.
Support your Application Assignment with specific references to all resources used in its preparation. You are asked to provide a reference list only for those resources
not
included in the Learning Resources for this course.
.
Application Topics The APPLICATION PROJECT OPTIONS from which yo.docxarmitageclaire49
Application Topics
The APPLICATION PROJECT OPTIONS from which you may choose are:
1. Prenatal Development
Design an education course for expectant parents. At the minimum, prepare an outline of all the topics that you would cover in this course and include a description of any activities and resources you would use.
2. Infant Development
Observe the motor behavior of an infant (0-3 years) over three (3) periods of at least 30 minutes. You may interact with the infant during this time. Record your detailed, objective observations, then write out your evaluation of the infant's motor development based on the information presented in this course.
3. Preschool Development
Observe the language behavior of a preschool child (3-6 years) over three (3) periods of at least 30 minutes. You may interact with the child during this time. Record your detailed, objective observations, then write out your evaluation of the child's language development based on the information presented in this course.
4. Middle Childhood Development
Observe the play behavior of a middle-years child (6-12 years) over three (3) periods of at least 30 minutes. Do not interact with the child during this time. Try to make your presence as inconspicuous as possible. You may want to go to a park or playground. Record your detailed, objective observations then write out your evaluation of the child's play/social development based on the information presented in this course.
5. Adolescent Development
Make up at least ten (10) open-ended questions and ask them of a minimum of 5 adolescents. The questions could concern school, sex, food, use of time, occupation, plans for the future, etc. Record their answers as best you can and then write out your evaluation of the adolescents' identity formation based on the information presented in this course.
6. Adult Development
Write your autobiography from your earliest memories to your present stage of adult development. The focus of this paper should be on the determinants of your present personality. Using Erik Erikson's theory of psychosocial development, state how you think you resolved each of the crises of development (for early stages, you may have to ask others or draw conclusions based on your present personality). Give specific examples from your life story to support your conclusions.
7. Aging
Make up at least ten open-ended questions and ask them of a minimum of 5 individuals over the age of 65. Among the questions that you should ask them are, "What would you do differently if you had your life to live over again?" and "What advice would you give a person of my age on how to live a meaningful life?" Write your questions and the answers received in your paper and include any conclusions you would make about aging.
8. Death and Dying
Design a death education course that would help you deal with your own death or the death of a loved one. Prepare an outline of all of the topics you would cover in this cour.
ApplicationDeveloping Your Professional Philosophy of Teaching .docxarmitageclaire49
Application:
Developing Your Professional Philosophy of Teaching and Learning
Part 3: Environments and Experiences That Inspire and Support Development and Learning
Each of the people you studied this week
—< /font>Johann Pestalozzi, Fredrich Froebel, John Dewey, and Maria Montessori - developed his or her philosophy of education based on personal and professional experiences. Each was interested in understanding and defining the environments, experiences, and resources that inspire children's learning.
For this section of your Professional Philosophy of Teaching and Learning:
Think about the people that you studied this week and what you have learned. Carefully choose at least five points that have inspired your thinking and helped clarify, expand, and/or deepen your philosophy of education with regard to environments, experiences, and resources that define and inspire teaching and learning. Then, s
ummarize these five points in such a way that also explains how these philosophers have influenced your philosophy of education and the environment you hope to create. Be sure to cite the sources of
each of the points you include.
Assignment length: 1
–
2 pages
.
Application Social ClassIn the Discussion, you addressed how .docxarmitageclaire49
Application: Social Class
In the Discussion, you addressed how constructionism influenced your racial and ethnic identities. The concept of social class is also based on or influenced by constructionism. Social class categorizes people according to their level of importance in society. According to the constructionist approach, social processes, such as political, legal, economic, and other outside influences help to categorize you as one class or another. Since outside influences change over time, designations of social class may change over time as well.
When you think of social class, you may think of wealth or power. These attributes do influence social class and will be addressed further in Week 3. Characteristics of race, such as skin color, also can influence social class. In some cultures, people may be assigned to a social class based on their skin, hair, or eye color. For example, in a culture in which white people are considered to be in a higher social class than dark people, the class of people in between may be based on the darkness of their skin, with light-skinned black people being considered in a higher class than dark-skinned black people. In a Native American society, a dark-haired person may be considered to be in a higher social class than a light-haired person. Dark hair matches expectations of appearance for members of a particular tribe. Categorizing individuals by social class can lead to conflicts in defining racial and ethnic identities. In Reading 4, June grapples with such a conflict and must revisit the definition of what it means to be Indian.
To prepare for this assignment:
Review the Readings 1, 4, and 6 in the course text, The Meaning of Difference. Pay particular attention to social class and the biological definitions of race and ethnicity.
Think of an historical example of how social class has changed over time.
Identify the major conflict in June's scenario in Reading 4.
Think about the consistencies and inconsistencies in June's approach to solving the conflict.
Consider the impact of social class on June's logic.
The assignment (1–2 pages):
Describe an historical example of how social class has changed over time. Then explain how social class changed in the example, and what caused it to change.
Describe the major conflict in June's scenario.
Explain the consistencies and inconsistencies in June's approach to solving the conflict.
Analyze the impact of social class on June's logic.
.
Application Role and Value of EvaluationThe United Nations, the.docxarmitageclaire49
Application: Role and Value of Evaluation
The United Nations, the American Red Cross, and other international disaster response organizations worked together to care for the trauma survivors after a series of four devastating hurricanes smashed into Haiti one after another, before communities had time to regroup from the previous ones. Then the 2010 massive earthquake struck the island. The poverty in Haiti complicated responder effectiveness and may have compounded survivor trauma because residents had few resources. While back to back disasters may make it difficult to evaluate crisis management plans, they point to the importance of learning what worked and what went wrong.
Once a disaster has occurred, the evaluation process includes a review of what was effective in the response as well as what was not effective. Learning and improved insights from a disaster can require making strategic changes in an organization or community. Last week you encountered new procedures for disaster transportation recovery, such as design-build, that can change the manner in which communities recover from disasters. Organizations can take a lesson from this change in thinking and creativity and look at innovative practices for strategic planning and recovery. Therefore, evaluation is a key element in crisis management planning and recovery.
To prepare for this assignment
:
Review Chapter 17 in your course text,
Crisis Intervention Strategies
, focusing on systems overviews and the Principles of a Crisis Intervention Ecosystem. Consider the value of ongoing plan evaluation.
Review the Appendix and Chapters 5 and 9 in your course text,
Crisis Management in the New Strategy Landscape
, focusing on organizational learning and evaluation of crisis management plans.
Review the article, "Program Evaluation: The Accountability Bridge Model for Counselors." Consider how counselors can use program evaluation to enhance accountability to stakeholders.
Review recent crises and/or disasters online and think about what can be learned about crisis management from them.
The assignment: (2-3 pages)
Provide an analysis of the role and value of evaluation as part of a crisis management plan. Provide specific examples to illustrate your arguments.
.
Application of Nursing Theory to Practice What would _(Pla.docxarmitageclaire49
Application of Nursing Theory to Practice
What would _(Place any nurse theorist or theory here)_ do?
Case Study:
Abigail Goldberg is a 46-year-old female who has recently been admitted to the hospital
after falling down the stairs and breaking her ankle. Her ankle has been repaired with an
open reduction and fixation device. Currently she has unable to bear weight on that
extremity. Physical Therapy is working with Mrs. Goldberg to assist her in advancing
her mobility.
While talking to Mrs. Goldberg the nurse finds out that she has been experiencing muscle
weakness in her legs for the last two months. She has a history of scoliosis and believed
the weakness was due to an “alignment” problem. Upon admission Mrs. Goldberg has
bilateral weakness in her lower legs. You are unable to assess her gait due to the fractured
ankle, but she states she has been “unsteady on her feet for the last few weeks”. Upon
further history taking you find out her appetite has diminished over the last three weeks,
she states she is hungry but when she tries to eat she fatigues easily then quickly losses
her appetite. She has lost 10 pounds in the “few” months and now weighs 120lbs. Her
CBC and CMP are within normal limits with the exception of mild anemia with an H&H
of 11.5 and 32.9.
Testing is currently being undertaken for a definitive diagnosis of the weakness that lead
to Mrs. Goldberg’s fall. Her physician strongly believes she experiencing symptoms
common for multiple sclerosis. The physician has shared this with Mrs. Goldberg. The
physician has ordered further blood work to evaluate any elevation in antibodies. The
physician has also ordered a CT scan and a spinal tap to assist with making the final
diagnosis.
Mrs. Goldberg has no other significant medical history. She takes only a multi-vitamin
daily. She has never had surgery. She has three children, all girls, ages 18, 15, and 11.
The girls are very active and rely on Mrs. Goldberg to take them to most of their
extracurricular events. The oldest has just started college and this is the first time any of
her children will live away from home. She has been looking forward to traveling to her
daughter’s college for visits. Her religious preference is Judaism. Her family of origin
practices Conservative Judaism. While Mrs. Goldberg participates in religious holiday
celebrations she does not actively practice Judaism nor does she attend temple regularly.
Mrs. Goldberg has been married 5 years to her second husband and states they have a
“good relationship” but that they “have not been intimate for 2 months” because she has
not been feeling well. Mrs. Goldberg was married to her first husband for 15 years. That
marriage ended in divorce after she discovered her first husband was gay.
When the nurse enters Mrs. Goldberg’s room to discuss the plan for the shift and day the
nurse observes Mrs. Goldberg’s affect to be sad. She sta.
Application Paper #4 1.Please pick 1 or 2 of Gardners Intell.docxarmitageclaire49
Application Paper #4
1.Please pick 1 or 2 of Gardner's Intelligences which you find you do well. What are they and what are your strengths in these areas?
Gardner's Multiple Intelligences
Gardner asked, How is the person smart, not how smart are you? Gardner believes there are at least a minimum of 8 different Intelligences. these do not act alone; they act in concert.
· Musical Intelligence = Skills in tasks involved in music.
· Bodily Kinesthetic Intelligence = Skills in tasks involved in using whole or parts of body
such as dancers ,athletes, actors, surgeons.
· Logical-Mathematical Intelligence = Skills in problem-solving and scientific thinking.
· Linguistic Intelligence= Skills in production and use of language.
· Spatial Intelligence = skills re: spatial configurations for instance artists and architect
· Interpersonal Intelligence =Skills interacting with others, understanding sensitivity to moods, temperaments, motivations, and intentions of others.
· Interpersonal Intelligence = Knowledge about internal aspects of oneself; access to one's feelings and emotions.
· Naturalistic Intelligence = Ability to identify and classify patterns in nature
2. Enclosed is information about intelligence. Please read the following scenario.
Practical and Emotional Intelligence:
Practical Intelligence produces overall success in living and is used through observation of others' behavior. Emotional Intelligence shows skills that underlie accurate assessment, evaluation, expression of emotions, and regulation of emotions. It is the basis of empathy for others, self-awareness, and social skills. It shows understanding of others' feelings and so can assist others.
Scenario
"An employee who reports to a supervisor that you supervise, has asked to talk with you about waste, poor management practices, and possible violations of company policy and the law on the part of your supervisor. You have been in your position for only a year, but in that time you have had no indications of trouble with that supervisor.
Neither you nor your company has an " open door" policy. It is expected employees take their concerns to their immediate supervisor before bringing the information to others. The employee who wished to meet with you has not discussed the issues with her supervisors because of its delicate nature."
What would you do?
What are your reasons?
Explain the form of intelligence ( practical and/or emotional) you used and how you used it.
Application Paper #4
1.
Please pick 1 or 2 of Gardner's I
ntelligences which you find you do well. What are
they a
nd what
are
your strengths in these areas
?
Gardner's Multiple Intelligences
Gardner asked, How is the person
smart, not how smart are you?
Gardner believes there are at
least a
minimum of 8 different Intelligences. these do not act alone; they act in concert.
·
Musical Intelligence = Skills in tasks involved in music.
·
Bodily Kinesthetic Intelligence = Skills in t
a.
This presentation was provided by Rebecca Benner, Ph.D., of the American Society of Anesthesiologists, for the second session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session Two: 'Expanding Pathways to Publishing Careers,' was held June 13, 2024.
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.pptHenry Hollis
The History of NZ 1870-1900.
Making of a Nation.
From the NZ Wars to Liberals,
Richard Seddon, George Grey,
Social Laboratory, New Zealand,
Confiscations, Kotahitanga, Kingitanga, Parliament, Suffrage, Repudiation, Economic Change, Agriculture, Gold Mining, Timber, Flax, Sheep, Dairying,
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
1. app.js
/****************************************************
***************************
* Copyright (c) 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying
materials
* are made available under the terms of the Eclipse Public
License v1.0
* and Eclipse Distribution License v1.0 which accompany this
distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Bryan Boyd - Initial implementation
*****************************************************
**************************/
var parseString = require('xml2js').parseString;
var vincenty = require('node-vincenty');
var fs = require('fs');
var argv = require('optimist').argv;
var mqtt = require('mqtt');
var http = require('http');
var settings = require('./config/settings');
var appInfo = JSON.parse(process.env.VCAP_APPLICATION ||
"{}");
var appHost = appInfo.host || "localhost";
2. console.log(argv);
var deviceIndex = (appInfo && appInfo.instance_index) ?
appInfo.instance_index : 0;
var deviceId = settings.iot_deviceSet[deviceIndex].deviceId;
var token = settings.iot_deviceSet[deviceIndex].token;
var iot_server = settings.iot_deviceOrg +
".messaging.internetofthings.ibmcloud.com";
var iot_port = 1883;
var iot_username = "use-token-auth";
var iot_password = token;
var iot_clientid = "d:" + settings.iot_deviceOrg + ":" +
settings.iot_deviceType + ":" + deviceId
console.log(iot_server, iot_clientid, iot_username,
iot_password);
//var client = mqtt.createClient(1883, iot_server, { clientId:
iot_clientid, username: iot_username, password: iot_password
});
var options1 = {
port: 1883,
host: iot_server,
clientId: iot_clientid,
username: iot_username,
password: iot_password,
protocolId: 'MQIsdp',
protocolVersion: 3
};
var client = mqtt.connect(options1);
console.log(JSON.stringify(process.env));
var VEHICLE_COUNT = (argv.count ? argv.count :
4. if (err) throw err;
parseString(data, function(err, result) {
console.log("parseString");
if (err) throw err;
map.createMapFromJSON(result);
setTimeout(mapLoaded, 5000);
});
}
})(this));
}
Map.prototype.createMapFromJSON = function(json) {
console.log("createMapFromJSON");
for (var i in json.osm.node) {
var n = json.osm.node[i];
this.nodes[n.$.id] = {
id: n.$.id,
lon: parseFloat(n.$.lon),
lat: parseFloat(n.$.lat),
edges: Array()
}
this.nodeCount++;
if (this.nodeCount % 1000 == 0) {
console.log("nodes: " + this.nodeCount); }
}
for (var i in json.osm.way) {
var w = json.osm.way[i];
var wId = w.$.id;
var tags = {};
for (var j in w.tag) {
tags[w.tag[j].$.k] = w.tag[j].$.v;
}
var last_ref = null;
for (var j in w.nd) {
var ref = w.nd[j].$.ref; // node id
11. }
Vehicle.prototype.setTurnSignal = function(val) {
if (val == "LEFT" || val == "NONE" || val == "RIGHT" ||
val == "OFF") {
this.customProps.turnSignal = val;
}
}
Vehicle.prototype.setStartingEdge = function() {
var keys = [];
for (var i in this.map.edges) {
keys.push(i);
}
this.currentEdge =
this.map.edges[keys[Math.floor(Math.random() *
keys.length)]];
this.perc = 0;
this.lastUpdateTime = (new Date()).getTime();
}
Vehicle.prototype.updatePosition = function() {
var a = this.map.nodes[this.currentEdge.a];
var b = this.map.nodes[this.currentEdge.b];
if (a && b) {
this.geo.lon = a.lon + this.perc * (b.lon - a.lon);
this.geo.lat = a.lat + this.perc * (b.lat - a.lat);
} else {
//console.log("ERROR", a, b);
this.setStartingEdge();
}
//console.log("updatePosition: " + this.geo.lon + ", " +
this.geo.lat);
}
Vehicle.prototype.setNextEdge = function() {
12. //console.log(" setNextEdge");
var n = this.map.nodes[this.currentEdge.b];
if (!n) {
// no valid next edge
//console.log("RESPAWNING");
this.setStartingEdge();
return;
}
var edge = null;
var reverseCount = 0;
var leftTurnEdge = null, leftTurnAngle = 0;
var rightTurnEdge = null, rightTurnAngle = 0;
var straightEdge = null, straightAngle = 180;
var a1 = this.currentEdge.heading;
for (var i in n.edges) {
var a2 = n.edges[i].heading;
var left_diff = (a1-a2+360)%360;
var right_diff = (a2-a1+360)%360;
if (left_diff > leftTurnAngle && left_diff < 160) {
leftTurnEdge = n.edges[i];
leftTurnAngle = left_diff;
}
if (right_diff > rightTurnAngle && right_diff < 160)
{
rightTurnEdge = n.edges[i];
rightTurnAngle = right_diff;
}
var smallest = Math.min(left_diff, right_diff);
if (smallest < straightAngle) {
straightEdge = n.edges[i];
straightAngle = smallest;
}
console.log("possible edge: " + n.edges[i].id + " |
heading: " + n.edges[i].heading + " | left_diff: " + left_diff + " |
right_diff: " + right_diff);
}
13. console.log("-- LEFT edge: " + (leftTurnEdge ?
leftTurnEdge.id : "(nil)") + " | angle: " + leftTurnAngle);
console.log("-- RIGHT edge: " + (rightTurnEdge ?
rightTurnEdge.id : "(nil)") + " | angle: " + rightTurnAngle);
console.log("-- STRAIGHT edge: " + (straightEdge ?
straightEdge.id : "(nil)") + " | angle: " + straightAngle);
while (!edge) {
try {
if (this.customProps.turnSignal &&
this.customProps.turnSignal == "LEFT" && leftTurnEdge) {
console.log("trying LEFT turn: " +
leftTurnEdge.id);
edge = leftTurnEdge;
} else if (this.customProps.turnSignal &&
this.customProps.turnSignal == "RIGHT" && rightTurnEdge) {
console.log("trying RIGHT turn: " +
rightTurnEdge.id);
edge = rightTurnEdge;
} else if (this.customProps.turnSignal &&
this.customProps.turnSignal == "STRAIGHT" && straightEdge)
{
console.log("trying STRAIGHT: " +
straightEdge.id);
edge = straightEdge;
} else {
console.log("trying RANDOM turn");
var idx = Math.floor(Math.random() *
n.edges.length);
edge = n.edges[idx];
}
// check to make sure we didn't reverse direction
if there are multiple edges
console.log("checking edge: " +
this.currentEdge.a + " " + edge.b);
if (this.currentEdge.a == edge.b) {
14. if (n.edges.length == 1) {
//console.log("End of the line!
Respawning...");
this.setStartingEdge();
return;
} else {
//console.log("edge won't work, it's a
reverse!");
reverseCount++;
if (reverseCount > 10) {
this.setStartingEdge();
return;
} else {
edge = null;
}
}
}
} catch (e) {
console.log(e, "ERROR", n, this.currentEdge);
this.setStartingEdge();
return;
}
}
//console.log("new edge = ", edge);
this.perc = 0;
this.currentEdge = edge;
}
var vehicles = Array();
for (var i = 1; i <= VEHICLE_COUNT; i++) {
var vid = deviceId;
var suffix = "";
if (VEHICLE_COUNT > 1) { suffix = "-" + i; }
vehicles.push(new Vehicle(vid, suffix));
}
15. var bMapLoaded = false;
function drive() {
for (var i in vehicles) {
vehicles[i].drive();
}
}
function subscribeToProperties() {
client.subscribe(propertyTopic);
console.log("subscribed to: " + propertyTopic);
client.on('message', function(topic, message) {
console.log("message recv: " + topic + " = " +
message);
try {
//var id = topic.split("/")[3];
var data = JSON.parse(message);
var id = data.id;
if (!id) { id = deviceId; }
console.log("setProperty(id="+id+"): " +
data.property + " = " + data.value);
var v = getVehicle(id);
var prop = data.property;
var val = data.value;
if (v) {
if (prop == "lng" || prop == "lat" || prop ==
"heading" || prop == "id") { return; }
switch (prop) {
case "speed": v.setSpeed(val); break;
case "state": v.state = val; break;
case "description": v.description =
val; break;
case "type": v.type = val; break;
default:
if (val == "") {
16. if (v.customProps[prop]) {
delete v.customProps[prop]; }
} else {
v.customProps[prop] = val;
}
}
}
} catch (e) { console.error(e); }
});
}
function publishVehicleData() {
var payload = [];
for (var i in vehicles) {
payload.push(vehicles[i].getPublishPayload());
}
//console.log("publishing data: " + telemetryTopic + " | " +
JSON.stringify(payload));
if (payload.length == 1) {
client.publish(telemetryTopic,
JSON.stringify(payload[0]));
} else {
client.publish(telemetryTopic,
JSON.stringify(payload));
}
}
function getVehicle(id) {
for (var i in vehicles) {
if ((vehicles[i].id + vehicles[i].suffix) == id) {
return vehicles[i];
}
}
return null;
}
17. function mapLoaded() {
subscribeToProperties();
setInterval(function() {
drive();
publishVehicleData();
}, 1000 / TELEMETRY_RATE);
}
// setup middleware
var express = require('express'),
https = require('https'),
path = require('path');
var app = express();
var bodyParser = require('body-parser');
var methodOverride = require('method-override')
// all environments
app.set('port', process.env.PORT || 3000);
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(bodyParser.json());
app.use(methodOverride());
app.use(express.urlencoded());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
// development only
if ('development' === app.get('env')) {
app.use(express.errorHandler());
}
var geo_props = null;
18. //parse VCAP_SERVICES if running in Bluemix
if (process.env.VCAP_SERVICES) {
var env = JSON.parse(process.env.VCAP_SERVICES);
console.log(env);
//find the Streams Geo service
if (env["Geospatial Analytics"])
{
geo_props = env['Geospatial
Analytics'][0]['credentials'];
console.log(geo_props);
}
else
{
console.log('You must bind the Streams Geo service
to this application');
}
}
if (geo_props) {
// sample vehicle topic/payload:
// {"id":"G-13","name":"Car G-13","lng":-
122.41950721920685,"lat":37.76330689770606,"heading":177.0
6799545408498,"speed":30,"state":"normal","description":"I am
a connected
car.","type":"car","customProps":{"customProp":"customValue"
}}
var inputClientId = "a:"+settings.iot_deviceOrg +
":geoInput" + Math.floor(Math.random() * 1000);
var notifyClientId = "a:"+settings.iot_deviceOrg +
":geoNotify" + Math.floor(Math.random() * 1000);
var apis = [
{
20. {"latitude": "30.27617",
"longitude": "-97.73573"},
{"latitude": "30.26676",
"longitude": "-97.73917"},
{"latitude": "30.26852",
"longitude": "-97.74560"}
// an edge is drawn
between last and first points to close the poly
]
}
]
}
},
{
name: "removeRegion",
path: geo_props.remove_region_path,
method: "PUT",
json: { // sample JSON for removing the sample
region
"region_type": "custom",
"region_name": "custom_poly"
}
},
{
name: "restart",
path: geo_props.restart_path,
method: "PUT",
json: null
},
{
name: "status",
path: geo_props.status_path,
method: "GET",
json: null
},
]
21. // build routes
for (var i in apis) {
var route = "/GeospatialService_"+apis[i].name;
console.log("Creating route: " + route);
app.get(route, (function(api) {
return function(request, response) {
var route =
"/GeospatialService_"+api.name;
console.log("About to call " + route);
// prepare options
var options = {
host: geo_props.geo_host,
port: geo_props.geo_port,
path: api.path,
method: api.method,
headers: {
'Authorization' : ('Basic ' + new
Buffer(geo_props.userid + ':' +
geo_props.password).toString('base64'))
}
};
// start by loading sample JSON
var bodyJson = api.json;
// if we pass in query parameters, overwrite
the sample JSON with this information
if (request.query &&
Object.keys(request.query).length > 0) {
console.log("BODY: ", request.query);
bodyJson = request.query;
22. } else {
console.log("NO BODY");
}
if (bodyJson) {
options.headers['Content-Type'] =
'application/json';
options.headers['Content-Length'] =
Buffer.byteLength(JSON.stringify(bodyJson), 'utf8');
}
console.log('Options prepared:', options);
console.log('Do the GeospatialService_' +
api.name + ' call');
// do the PUT call
var reqPut = https.request(options,
function(res) {
// uncomment it for header details
console.log("headers: ", res.headers);
console.log("statusCode: ",
res.statusCode);
var responseData = '';
res.on('data', function(chunk) {
responseData +=
chunk.toString();
});
res.on('end', function() {
try {
console.log(route + '
response:n');
console.log(responseData);
console.log("n" + route + '
completed');
23. console.log("statusCode: ",
res.statusCode);
var result =
JSON.parse(responseData);
console.log("result:n",
result);
if (res.statusCode != 200) {
response.send(res.statusCode, "<h1>"+route+" failed with
code: "+res.statusCode+"</h1>");
} else {
if (route ==
"/GeospatialService_status") {
response.send(res.statusCode, result);
} else {
response.send(res.statusCode, "<h1>"+route+"
succeeded!</h1><pre>" + JSON.stringify(result, null, 4) +
"</pre>");
}
}
} catch (e) { console.error(e);
response.send(500, { error: "parse error: " + route }); }
});
if (res.statusCode != 200) {
runError = 1;
}
});
if (bodyJson) {
// write the json data
console.log('Writing json:n',
JSON.stringify(bodyJson, null, 4));
reqPut.write(JSON.stringify(bodyJson));
24. }
reqPut.end();
reqPut.on('error', function(e) {
console.error(e);
});
}
})(apis[i]));
}
}
app.get("/credentials", function(request, response) {
response.send(200, settings);
});
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' +
app.get('port'));
});
config/settings.js
/****************************************************
***************************
* Copyright (c) 2014 IBM Corp.
*
* All rights reserved. This program and the accompanying
materials
* are made available under the terms of the Eclipse Public
License v1.0
* and Eclipse Distribution License v1.0 which accompany this
distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
25. *
* Contributors:
* Bryan Boyd - Initial implementation
*****************************************************
**************************/
var config = {
iot_deviceType: "Vehicle", // replace with your
deviceType
iot_deviceOrg: "lzfew7", // replace with your IoT
Foundation organization
iot_deviceSet: [ // replace with your registered
device(s)
{ deviceId: "Vehicle1", token: "qaz123WSX" },
{ deviceId: "Vehicle2", token: "wsx123QAZ" },
{ deviceId: "Vehicle3", token: "edc123WSX" }
],
iot_apiKey: "a-lzfew7-rdy0ukhyjs", // replace with the
key for a generated API token
iot_apiToken: "2IJ3YkURaos!Hj&RH)", // replace with
the generated API token
// these topics will be used by Geospatial Analytics
notifyTopic: "iot-
2/type/api/id/geospatial/cmd/geoAlert/fmt/json",
inputTopic: "iot-
2/type/Vehicle/id/+/evt/telemetry/fmt/json",
};
try {
module.exports = config;
} catch (e) { window.config = config; }
docs/add_overlay1.png
28. 1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial code and
documentation
distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate
from and are
distributed by that particular Contributor. A Contribution
'originates'
from a Contributor if it was added to the Program by such
Contributor
itself or anyone acting on such Contributor's behalf.
Contributions do not
include additions to the Program which: (i) are separate
modules of
software distributed in conjunction with the Program under
their own
license agreement, and (ii) are not derivative works of the
Program.
"Contributor" means any person or entity that distributes the
Program.
"Licensed Patents" mean patent claims licensable by a
Contributor which are
necessarily infringed by the use or sale of its Contribution alone
or when
combined with the Program.
29. "Program" means the Contributions distributed in accordance
with this
Agreement.
"Recipient" means anyone who receives the Program under this
Agreement,
including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor
hereby grants
Recipient a non-exclusive, worldwide, royalty-free copyright
license to
reproduce, prepare derivative works of, publicly display,
publicly
perform, distribute and sublicense the Contribution of such
Contributor,
if any, and such derivative works, in source code and object
code form.
b) Subject to the terms of this Agreement, each Contributor
hereby grants
Recipient a non-exclusive, worldwide, royalty-free patent
license under
Licensed Patents to make, use, sell, offer to sell, import and
otherwise
transfer the Contribution of such Contributor, if any, in
source code and
object code form. This patent license shall apply to the
combination of
the Contribution and the Program if, at the time the
Contribution is
added by the Contributor, such addition of the Contribution
causes such
combination to be covered by the Licensed Patents. The
patent license
shall not apply to any other combinations which include the
30. Contribution.
No hardware per se is licensed hereunder.
c) Recipient understands that although each Contributor grants
the licenses
to its Contributions set forth herein, no assurances are
provided by any
Contributor that the Program does not infringe the patent or
other
intellectual property rights of any other entity. Each
Contributor
disclaims any liability to Recipient for claims brought by
any other
entity based on infringement of intellectual property rights
or
otherwise. As a condition to exercising the rights and
licenses granted
hereunder, each Recipient hereby assumes sole
responsibility to secure
any other intellectual property rights needed, if any. For
example, if a
third party patent license is required to allow Recipient to
distribute
the Program, it is Recipient's responsibility to acquire that
license
before distributing the Program.
d) Each Contributor represents that to its knowledge it has
sufficient
copyright rights in its Contribution, if any, to grant the
copyright
license set forth in this Agreement.
3. REQUIREMENTS
A Contributor may choose to distribute the Program in object
code form under
its own license agreement, provided that:
31. a) it complies with the terms and conditions of this
Agreement; and
b) its license agreement:
i) effectively disclaims on behalf of all Contributors all
warranties
and conditions, express and implied, including warranties
or
conditions of title and non-infringement, and implied
warranties or
conditions of merchantability and fitness for a particular
purpose;
ii) effectively excludes on behalf of all Contributors all
liability for
damages, including direct, indirect, special, incidental
and
consequential damages, such as lost profits;
iii) states that any provisions which differ from this
Agreement are
offered by that Contributor alone and not by any other
party; and
iv) states that source code for the Program is available from
such
Contributor, and informs licensees how to obtain it in a
reasonable
manner on or through a medium customarily used for
software exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy
of the Program.
Contributors may not remove or alter any copyright notices
contained
within the Program.
32. Each Contributor must identify itself as the originator of its
Contribution,
if
any, in a manner that reasonably allows subsequent Recipients
to identify the
originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain
responsibilities with
respect to end users, business partners and the like. While this
license is
intended to facilitate the commercial use of the Program, the
Contributor who
includes the Program in a commercial product offering should
do so in a manner
which does not create potential liability for other Contributors.
Therefore,
if a Contributor includes the Program in a commercial product
offering, such
Contributor ("Commercial Contributor") hereby agrees to
defend and indemnify
every other Contributor ("Indemnified Contributor") against any
losses,
damages and costs (collectively "Losses") arising from claims,
lawsuits and
other legal actions brought by a third party against the
Indemnified
Contributor to the extent caused by the acts or omissions of
such Commercial
Contributor in connection with its distribution of the Program in
a commercial
product offering. The obligations in this section do not apply to
any claims
33. or Losses relating to any actual or alleged intellectual property
infringement. In order to qualify, an Indemnified Contributor
must:
a) promptly notify the Commercial Contributor in writing of
such claim, and
b) allow the Commercial Contributor to control, and cooperate
with the
Commercial Contributor in, the defense and any related
settlement
negotiations. The Indemnified Contributor may participate in
any such claim at
its own expense.
For example, a Contributor might include the Program in a
commercial product
offering, Product X. That Contributor is then a Commercial
Contributor. If
that Commercial Contributor then makes performance claims, or
offers
warranties related to Product X, those performance claims and
warranties are
such Commercial Contributor's responsibility alone. Under this
section, the
Commercial Contributor would have to defend claims against
the other
Contributors related to those performance claims and
warranties, and if a
court requires any other Contributor to pay any damages as a
result, the
Commercial Contributor must pay those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, THE PROGRAM IS PROVIDED ON AN
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
34. OF ANY KIND, EITHER EXPRESS OR
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Each
Recipient is solely responsible for determining the
appropriateness of using
and distributing the Program and assumes all risks associated
with its
exercise of rights under this Agreement , including but not
limited to the
risks and costs of program errors, compliance with applicable
laws, damage to
or loss of data, programs or equipment, and unavailability or
interruption of
operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, NEITHER RECIPIENT NOR ANY
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING WITHOUT LIMITATION
LOST PROFITS), HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OR
DISTRIBUTION OF THE PROGRAM OR THE
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER,
EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES.
7. GENERAL
35. If any provision of this Agreement is invalid or unenforceable
under
applicable law, it shall not affect the validity or enforceability
of the
remainder of the terms of this Agreement, and without further
action by the
parties hereto, such provision shall be reformed to the minimum
extent
necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity
(including a
cross-claim or counterclaim in a lawsuit) alleging that the
Program itself
(excluding combinations of the Program with other software or
hardware)
infringes such Recipient's patent(s), then such Recipient's rights
granted
under Section 2(b) shall terminate as of the date such litigation
is filed.
All Recipient's rights under this Agreement shall terminate if it
fails to
comply with any of the material terms or conditions of this
Agreement and does
not cure such failure in a reasonable period of time after
becoming aware of
such noncompliance. If all Recipient's rights under this
Agreement terminate,
Recipient agrees to cease use and distribution of the Program as
soon as
reasonably practicable. However, Recipient's obligations under
this Agreement
and any licenses granted by Recipient relating to the Program
shall continue
36. and survive.
Everyone is permitted to copy and distribute copies of this
Agreement, but in
order to avoid inconsistency the Agreement is copyrighted and
may only be
modified in the following manner. The Agreement Steward
reserves the right to
publish new versions (including revisions) of this Agreement
from time to
time. No one other than the Agreement Steward has the right to
modify this
Agreement. The Eclipse Foundation is the initial Agreement
Steward. The
Eclipse Foundation may assign the responsibility to serve as the
Agreement
Steward to a suitable separate entity. Each new version of the
Agreement will
be given a distinguishing version number. The Program
(including
Contributions) may always be distributed subject to the version
of the
Agreement under which it was received. In addition, after a new
version of the
Agreement is published, Contributor may elect to distribute the
Program
(including its Contributions) under the new version. Except as
expressly
stated in Sections 2(a) and 2(b) above, Recipient receives no
rights or
licenses to the intellectual property of any Contributor under
this Agreement,
whether expressly, by implication, estoppel or otherwise. All
rights in the
Program not expressly granted under this Agreement are
reserved.
37. This Agreement is governed by the laws of the State of New
York and the
intellectual property laws of the United States of America. No
party to this
Agreement will bring a legal action under this Agreement more
than one year
after the cause of action arose. Each party waives its rights to a
jury trial in
any resulting litigation.
manifest.yml
applications:
- host: Lab8TestT12018Assignment3
disk: 128M
name: Lab8TestT12018Assignment3
command: node app.js
path: .
domain: mybluemix.net
memory: 128M
instances: 3
maps/austin_downtown-clean.osm
maps/san_francisco-clean.osm
maps/vegas-clean.osm
node_modules/body-parser/HISTORY.md
1.17.2 / 2017-05-17
===================
* deps: [email protected]
- Fix `DEBUG_MAX_ARRAY_LENGTH`
38. - deps: [email protected]
* deps: [email protected]~1.6.15
- deps: [email protected]~2.1.15
1.17.1 / 2017-03-06
===================
* deps: [email protected]
- Fix regression parsing keys starting with `[`
1.17.0 / 2017-03-01
===================
* deps: [email protected]~1.6.1
- Make `message` property enumerable for `HttpError`s
- deps: [email protected]
* deps: [email protected]
- Fix compacting nested arrays
1.16.1 / 2017-02-10
===================
* deps: [email protected]
- Fix deprecation messages in WebStorm and other editors
- Undeprecate `DEBUG_FD` set to `1` or `2`
1.16.0 / 2017-01-17
===================
* deps: [email protected]
- Allow colors in workers
- Deprecated `DEBUG_FD` environment variable
- Fix error when running under React Native
- Use same color for same namespace
- deps: [email protected]
* deps: [email protected]~1.5.1
55. enumerable: true,
get: createParserGetter('urlencoded')
})
/**
* Create a middleware to parse json and urlencoded bodies.
*
* @param {object} [options]
* @return {function}
* @deprecated
* @public
*/
function bodyParser (options) {
var opts = {}
// exclude type option
if (options) {
for (var prop in options) {
if (prop !== 'type') {
opts[prop] = options[prop]
}
}
}
var _urlencoded = exports.urlencoded(opts)
var _json = exports.json(opts)
return function bodyParser (req, res, next) {
_json(req, res, function (err) {
if (err) return next(err)
_urlencoded(req, res, next)
})
}
}
56. /**
* Create a getter for loading a parser.
* @private
*/
function createParserGetter (name) {
return function get () {
return loadParser(name)
}
}
/**
* Load a parser module.
* @private
*/
function loadParser (parserName) {
var parser = parsers[parserName]
if (parser !== undefined) {
return parser
}
// this uses a switch for static require analysis
switch (parserName) {
case 'json':
parser = require('./lib/types/json')
break
case 'raw':
parser = require('./lib/types/raw')
break
case 'text':
parser = require('./lib/types/text')
break
case 'urlencoded':
parser = require('./lib/types/urlencoded')
57. break
}
// store to prevent invoking require()
return (parsers[parserName] = parser)
}
node_modules/body-parser/lib/read.js
/*!
* body-parser
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var createError = require('http-errors')
var getBody = require('raw-body')
var iconv = require('iconv-lite')
var onFinished = require('on-finished')
var zlib = require('zlib')
/**
* Module exports.
*/
module.exports = read
/**
* Read a request into a buffer and parse.
58. *
* @param {object} req
* @param {object} res
* @param {function} next
* @param {function} parse
* @param {function} debug
* @param {object} options
* @private
*/
function read (req, res, next, parse, debug, options) {
var length
var opts = options
var stream
// flag as parsed
req._body = true
// read options
var encoding = opts.encoding !== null
? opts.encoding
: null
var verify = opts.verify
try {
// get the content stream
stream = contentstream(req, debug, opts.inflate)
length = stream.length
stream.length = undefined
} catch (err) {
return next(err)
}
// set raw-body options
opts.length = length
opts.encoding = verify
59. ? null
: encoding
// assert charset is supported
if (opts.encoding === null && encoding !== null &&
!iconv.encodingExists(encoding)) {
return next(createError(415, 'unsupported charset "' +
encoding.toUpperCase() + '"', {
charset: encoding.toLowerCase()
}))
}
// read body
debug('read body')
getBody(stream, opts, function (err, body) {
if (err) {
// default to 400
setErrorStatus(err, 400)
// echo back charset
if (err.type === 'encoding.unsupported') {
err = createError(415, 'unsupported charset "' +
encoding.toUpperCase() + '"', {
charset: encoding.toLowerCase()
})
}
// read off entire request
stream.resume()
onFinished(req, function onfinished () {
next(err)
})
return
}
// verify
60. if (verify) {
try {
debug('verify body')
verify(req, res, body, encoding)
} catch (err) {
// default to 403
setErrorStatus(err, 403)
next(err)
return
}
}
// parse
var str
try {
debug('parse body')
str = typeof body !== 'string' && encoding !== null
? iconv.decode(body, encoding)
: body
req.body = parse(str)
} catch (err) {
// istanbul ignore next
err.body = str === undefined
? body
: str
// default to 400
setErrorStatus(err, 400)
next(err)
return
}
next()
})
}
61. /**
* Get the content stream of the request.
*
* @param {object} req
* @param {function} debug
* @param {boolean} [inflate=true]
* @return {object}
* @api private
*/
function contentstream (req, debug, inflate) {
var encoding = (req.headers['content-encoding'] ||
'identity').toLowerCase()
var length = req.headers['content-length']
var stream
debug('content-encoding "%s"', encoding)
if (inflate === false && encoding !== 'identity') {
throw createError(415, 'content encoding unsupported')
}
switch (encoding) {
case 'deflate':
stream = zlib.createInflate()
debug('inflate body')
req.pipe(stream)
break
case 'gzip':
stream = zlib.createGunzip()
debug('gunzip body')
req.pipe(stream)
break
case 'identity':
stream = req
62. stream.length = length
break
default:
throw createError(415, 'unsupported content encoding "' +
encoding + '"', {
encoding: encoding
})
}
return stream
}
/**
* Set a status on an error object, if ones does not exist
* @private
*/
function setErrorStatus (error, status) {
if (!error.status && !error.statusCode) {
error.status = status
error.statusCode = status
}
}
node_modules/body-parser/lib/types/json.js
/*!
* body-parser
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
63. * Module dependencies.
* @private
*/
var bytes = require('bytes')
var contentType = require('content-type')
var createError = require('http-errors')
var debug = require('debug')('body-parser:json')
var read = require('../read')
var typeis = require('type-is')
/**
* Module exports.
*/
module.exports = json
/**
* RegExp to match the first non-space in a string.
*
* Allowed whitespace is defined in RFC 7159:
*
* ws = *(
* %x20 / ; Space
* %x09 / ; Horizontal tab
* %x0A / ; Line feed or New line
* %x0D ) ; Carriage return
*/
var FIRST_CHAR_REGEXP = /^[x20x09x0ax0d]*(.)/ //
eslint-disable-line no-control-regex
/**
* Create a middleware to parse JSON bodies.
*
* @param {object} [options]
64. * @return {function}
* @public
*/
function json (options) {
var opts = options || {}
var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var inflate = opts.inflate !== false
var reviver = opts.reviver
var strict = opts.strict !== false
var type = opts.type || 'application/json'
var verify = opts.verify || false
if (verify !== false && typeof verify !== 'function') {
throw new TypeError('option verify must be function')
}
// create the appropriate type checking function
var shouldParse = typeof type !== 'function'
? typeChecker(type)
: type
function parse (body) {
if (body.length === 0) {
// special-case empty json body, as it's a common client-side
mistake
// TODO: maybe make this configurable or part of "strict"
option
return {}
}
if (strict) {
var first = firstchar(body)
65. if (first !== '{' && first !== '[') {
debug('strict violation')
throw new SyntaxError('Unexpected token ' + first)
}
}
debug('parse json')
return JSON.parse(body, reviver)
}
return function jsonParser (req, res, next) {
if (req._body) {
debug('body already parsed')
next()
return
}
req.body = req.body || {}
// skip requests without bodies
if (!typeis.hasBody(req)) {
debug('skip empty body')
next()
return
}
debug('content-type %j', req.headers['content-type'])
// determine if request should be parsed
if (!shouldParse(req)) {
debug('skip parsing')
next()
return
}
66. // assert charset per RFC 7159 sec 8.1
var charset = getCharset(req) || 'utf-8'
if (charset.substr(0, 4) !== 'utf-') {
debug('invalid charset')
next(createError(415, 'unsupported charset "' +
charset.toUpperCase() + '"', {
charset: charset
}))
return
}
// read
read(req, res, next, parse, debug, {
encoding: charset,
inflate: inflate,
limit: limit,
verify: verify
})
}
}
/**
* Get the first non-whitespace character in a string.
*
* @param {string} str
* @return {function}
* @private
*/
function firstchar (str) {
return FIRST_CHAR_REGEXP.exec(str)[1]
}
/**
* Get the charset of a request.
*
67. * @param {object} req
* @api private
*/
function getCharset (req) {
try {
return
contentType.parse(req).parameters.charset.toLowerCase()
} catch (e) {
return undefined
}
}
/**
* Get the simple type checker.
*
* @param {string} type
* @return {function}
*/
function typeChecker (type) {
return function checkType (req) {
return Boolean(typeis(req, type))
}
}
node_modules/body-parser/lib/types/raw.js
/*!
* body-parser
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
68. /**
* Module dependencies.
*/
var bytes = require('bytes')
var debug = require('debug')('body-parser:raw')
var read = require('../read')
var typeis = require('type-is')
/**
* Module exports.
*/
module.exports = raw
/**
* Create a middleware to parse raw bodies.
*
* @param {object} [options]
* @return {function}
* @api public
*/
function raw (options) {
var opts = options || {}
var inflate = opts.inflate !== false
var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var type = opts.type || 'application/octet-stream'
var verify = opts.verify || false
if (verify !== false && typeof verify !== 'function') {
throw new TypeError('option verify must be function')
}
69. // create the appropriate type checking function
var shouldParse = typeof type !== 'function'
? typeChecker(type)
: type
function parse (buf) {
return buf
}
return function rawParser (req, res, next) {
if (req._body) {
debug('body already parsed')
next()
return
}
req.body = req.body || {}
// skip requests without bodies
if (!typeis.hasBody(req)) {
debug('skip empty body')
next()
return
}
debug('content-type %j', req.headers['content-type'])
// determine if request should be parsed
if (!shouldParse(req)) {
debug('skip parsing')
next()
return
}
// read
70. read(req, res, next, parse, debug, {
encoding: null,
inflate: inflate,
limit: limit,
verify: verify
})
}
}
/**
* Get the simple type checker.
*
* @param {string} type
* @return {function}
*/
function typeChecker (type) {
return function checkType (req) {
return Boolean(typeis(req, type))
}
}
node_modules/body-parser/lib/types/text.js
/*!
* body-parser
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
*/
71. var bytes = require('bytes')
var contentType = require('content-type')
var debug = require('debug')('body-parser:text')
var read = require('../read')
var typeis = require('type-is')
/**
* Module exports.
*/
module.exports = text
/**
* Create a middleware to parse text bodies.
*
* @param {object} [options]
* @return {function}
* @api public
*/
function text (options) {
var opts = options || {}
var defaultCharset = opts.defaultCharset || 'utf-8'
var inflate = opts.inflate !== false
var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var type = opts.type || 'text/plain'
var verify = opts.verify || false
if (verify !== false && typeof verify !== 'function') {
throw new TypeError('option verify must be function')
}
// create the appropriate type checking function
72. var shouldParse = typeof type !== 'function'
? typeChecker(type)
: type
function parse (buf) {
return buf
}
return function textParser (req, res, next) {
if (req._body) {
debug('body already parsed')
next()
return
}
req.body = req.body || {}
// skip requests without bodies
if (!typeis.hasBody(req)) {
debug('skip empty body')
next()
return
}
debug('content-type %j', req.headers['content-type'])
// determine if request should be parsed
if (!shouldParse(req)) {
debug('skip parsing')
next()
return
}
// get charset
var charset = getCharset(req) || defaultCharset
73. // read
read(req, res, next, parse, debug, {
encoding: charset,
inflate: inflate,
limit: limit,
verify: verify
})
}
}
/**
* Get the charset of a request.
*
* @param {object} req
* @api private
*/
function getCharset (req) {
try {
return
contentType.parse(req).parameters.charset.toLowerCase()
} catch (e) {
return undefined
}
}
/**
* Get the simple type checker.
*
* @param {string} type
* @return {function}
*/
function typeChecker (type) {
return function checkType (req) {
return Boolean(typeis(req, type))
74. }
}
node_modules/body-parser/lib/types/urlencoded.js
/*!
* body-parser
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
/**
* Module dependencies.
* @private
*/
var bytes = require('bytes')
var contentType = require('content-type')
var createError = require('http-errors')
var debug = require('debug')('body-parser:urlencoded')
var deprecate = require('depd')('body-parser')
var read = require('../read')
var typeis = require('type-is')
/**
* Module exports.
*/
module.exports = urlencoded
/**
* Cache of parser modules.
*/
75. var parsers = Object.create(null)
/**
* Create a middleware to parse urlencoded bodies.
*
* @param {object} [options]
* @return {function}
* @public
*/
function urlencoded (options) {
var opts = options || {}
// notice because option default will flip in next major
if (opts.extended === undefined) {
deprecate('undefined extended: provide extended option')
}
var extended = opts.extended !== false
var inflate = opts.inflate !== false
var limit = typeof opts.limit !== 'number'
? bytes.parse(opts.limit || '100kb')
: opts.limit
var type = opts.type || 'application/x-www-form-urlencoded'
var verify = opts.verify || false
if (verify !== false && typeof verify !== 'function') {
throw new TypeError('option verify must be function')
}
// create the appropriate query parser
var queryparse = extended
? extendedparser(opts)
: simpleparser(opts)
76. // create the appropriate type checking function
var shouldParse = typeof type !== 'function'
? typeChecker(type)
: type
function parse (body) {
return body.length
? queryparse(body)
: {}
}
return function urlencodedParser (req, res, next) {
if (req._body) {
debug('body already parsed')
next()
return
}
req.body = req.body || {}
// skip requests without bodies
if (!typeis.hasBody(req)) {
debug('skip empty body')
next()
return
}
debug('content-type %j', req.headers['content-type'])
// determine if request should be parsed
if (!shouldParse(req)) {
debug('skip parsing')
next()
return
}
77. // assert charset
var charset = getCharset(req) || 'utf-8'
if (charset !== 'utf-8') {
debug('invalid charset')
next(createError(415, 'unsupported charset "' +
charset.toUpperCase() + '"', {
charset: charset
}))
return
}
// read
read(req, res, next, parse, debug, {
debug: debug,
encoding: charset,
inflate: inflate,
limit: limit,
verify: verify
})
}
}
/**
* Get the extended query parser.
*
* @param {object} options
*/
function extendedparser (options) {
var parameterLimit = options.parameterLimit !== undefined
? options.parameterLimit
: 1000
var parse = parser('qs')
if (isNaN(parameterLimit) || parameterLimit < 1) {
throw new TypeError('option parameterLimit must be a
78. positive number')
}
if (isFinite(parameterLimit)) {
parameterLimit = parameterLimit | 0
}
return function queryparse (body) {
var paramCount = parameterCount(body, parameterLimit)
if (paramCount === undefined) {
debug('too many parameters')
throw createError(413, 'too many parameters')
}
var arrayLimit = Math.max(100, paramCount)
debug('parse extended urlencoding')
return parse(body, {
allowPrototypes: true,
arrayLimit: arrayLimit,
depth: Infinity,
parameterLimit: parameterLimit
})
}
}
/**
* Get the charset of a request.
*
* @param {object} req
* @api private
*/
function getCharset (req) {
try {
79. return
contentType.parse(req).parameters.charset.toLowerCase()
} catch (e) {
return undefined
}
}
/**
* Count the number of parameters, stopping once limit reached
*
* @param {string} body
* @param {number} limit
* @api private
*/
function parameterCount (body, limit) {
var count = 0
var index = 0
while ((index = body.indexOf('&', index)) !== -1) {
count++
index++
if (count === limit) {
return undefined
}
}
return count
}
/**
* Get parser for module name dynamically.
*
* @param {string} name
* @return {function}
80. * @api private
*/
function parser (name) {
var mod = parsers[name]
if (mod !== undefined) {
return mod.parse
}
// this uses a switch for static require analysis
switch (name) {
case 'qs':
mod = require('qs')
break
case 'querystring':
mod = require('querystring')
break
}
// store to prevent invoking require()
parsers[name] = mod
return mod.parse
}
/**
* Get the simple query parser.
*
* @param {object} options
*/
function simpleparser (options) {
var parameterLimit = options.parameterLimit !== undefined
? options.parameterLimit
: 1000
81. var parse = parser('querystring')
if (isNaN(parameterLimit) || parameterLimit < 1) {
throw new TypeError('option parameterLimit must be a
positive number')
}
if (isFinite(parameterLimit)) {
parameterLimit = parameterLimit | 0
}
return function queryparse (body) {
var paramCount = parameterCount(body, parameterLimit)
if (paramCount === undefined) {
debug('too many parameters')
throw createError(413, 'too many parameters')
}
debug('parse urlencoding')
return parse(body, undefined, undefined, {maxKeys:
parameterLimit})
}
}
/**
* Get the simple type checker.
*
* @param {string} type
* @return {function}
*/
function typeChecker (type) {
return function checkType (req) {
return Boolean(typeis(req, type))
}
82. }
node_modules/body-parser/LICENSE
(The MIT License)
Copyright (c) 2014 Jonathan Ong <[email protected]>
Copyright (c) 2014-2015 Douglas Christopher Wilson
<[email protected]>
Permission is hereby granted, free of charge, to any person
obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction,
including
without limitation the rights to use, copy, modify, merge,
publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so,
subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT
WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
83. CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
node_modules/body-parser/package.json
{
"_args": [
[
{
"raw": "body-parser",
"scope": null,
"escapedName": "body-parser",
"name": "body-parser",
"rawSpec": "",
"spec": "latest",
"type": "tag"
},
"C:UsersraybDesktopCQU coursesT2-
2017COIT20260LabsLab 8Lab8"
]
],
"_from": "[email protected]",
"_id": "[email protected]",
"_inCache": true,
"_location": "/body-parser",
"_nodeVersion": "6.10.3",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/body-parser-
1.17.2.tgz_1495083464528_0.912320519099012"
},
"_npmUser": {
"name": "dougwilson",
"email": "[email protected]"
},
87. node_modules/body-parser/README.md
# body-parser
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
[![Gratipay][gratipay-image]][gratipay-url]
Node.js body parsing middleware.
Parse incoming request bodies in a middleware before your
handlers, available
under the `req.body` property.
[Learn about the anatomy of an HTTP transaction in
Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-
transaction/).
_This does not handle multipart bodies_, due to their complex
and typically
large nature. For multipart bodies, you may be interested in the
following
modules:
* [busboy](https://www.npmjs.org/package/busboy#readme)
and
[connect-busboy](https://www.npmjs.org/package/connect-
busboy#readme)
*
[multiparty](https://www.npmjs.org/package/multiparty#readme
) and
[connect-
multiparty](https://www.npmjs.org/package/connect-
multiparty#readme)
88. *
[formidable](https://www.npmjs.org/package/formidable#readm
e)
* [multer](https://www.npmjs.org/package/multer#readme)
This module provides the following parsers:
* [JSON body parser](#bodyparserjsonoptions)
* [Raw body parser](#bodyparserrawoptions)
* [Text body parser](#bodyparsertextoptions)
* [URL-encoded form body
parser](#bodyparserurlencodedoptions)
Other body parsers you might be interested in:
- [body](https://www.npmjs.org/package/body#readme)
- [co-body](https://www.npmjs.org/package/co-body#readme)
## Installation
```sh
$ npm install body-parser
```
## API
<!-- eslint-disable no-unused-vars -->
```js
var bodyParser = require('body-parser')
```
The `bodyParser` object exposes various factories to create
middlewares. All
middlewares will populate the `req.body` property with the
parsed body when
89. the `Content-Type` request header matches the `type` option, or
an empty
object (`{}`) if there was no body to parse, the `Content-Type`
was not matched,
or an error occurred.
The various errors returned by this module are described in the
[errors section](#errors).
### bodyParser.json(options)
Returns middleware that only parses `json` and only looks at
requests where
the `Content-Type` header matches the `type` option. This
parser accepts any
Unicode encoding of the body and supports automatic inflation
of `gzip` and
`deflate` encodings.
A new `body` object containing the parsed data is populated on
the `request`
object after the middleware (i.e. `req.body`).
#### Options
The `json` function takes an option `options` object that may
contain any of
the following keys:
##### inflate
When set to `true`, then deflated (compressed) bodies will be
inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
90. Controls the maximum request body size. If this is a number,
then the value
specifies the number of bytes; if it is a string, the value is
passed to the
[bytes](https://www.npmjs.com/package/bytes) library for
parsing. Defaults
to `'100kb'`.
##### reviver
The `reviver` option is passed directly to `JSON.parse` as the
second
argument. You can find more information on this argument
[in the MDN documentation about
JSON.parse](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
#Example.3A_Using_the_reviver_parameter).
##### strict
When set to `true`, will only accept arrays and objects; when
`false` will
accept anything `JSON.parse` accepts. Defaults to `true`.
##### type
The `type` option is used to determine what media type the
middleware will
parse. This option can be a function or a string. If a string,
`type` option
is passed directly to the [type-
is](https://www.npmjs.org/package/type-is#readme)
library and this can be an extension name (like `json`), a mime
type (like
`application/json`), or a mime type with a wildcard (like `*/*`
91. or `*/json`).
If a function, the `type` option is called as `fn(req)` and the
request is
parsed if it returns a truthy value. Defaults to `application/json`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res,
buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding`
is the
encoding of the request. The parsing can be aborted by throwing
an error.
### bodyParser.raw(options)
Returns middleware that parses all bodies as a `Buffer` and only
looks at
requests where the `Content-Type` header matches the `type`
option. This
parser supports automatic inflation of `gzip` and `deflate`
encodings.
A new `body` object containing the parsed data is populated on
the `request`
object after the middleware (i.e. `req.body`). This will be a
`Buffer` object
of the body.
#### Options
The `raw` function takes an option `options` object that may
contain any of
the following keys:
##### inflate
92. When set to `true`, then deflated (compressed) bodies will be
inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number,
then the value
specifies the number of bytes; if it is a string, the value is
passed to the
[bytes](https://www.npmjs.com/package/bytes) library for
parsing. Defaults
to `'100kb'`.
##### type
The `type` option is used to determine what media type the
middleware will
parse. This option can be a function or a string. If a string,
`type` option
is passed directly to the [type-
is](https://www.npmjs.org/package/type-is#readme)
library and this can be an extension name (like `bin`), a mime
type (like
`application/octet-stream`), or a mime type with a wildcard (like
`*/*` or
`application/*`). If a function, the `type` option is called as
`fn(req)`
and the request is parsed if it returns a truthy value. Defaults to
`application/octet-stream`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res,
buf, encoding)`,
93. where `buf` is a `Buffer` of the raw request body and `encoding`
is the
encoding of the request. The parsing can be aborted by throwing
an error.
### bodyParser.text(options)
Returns middleware that parses all bodies as a string and only
looks at
requests where the `Content-Type` header matches the `type`
option. This
parser supports automatic inflation of `gzip` and `deflate`
encodings.
A new `body` string containing the parsed data is populated on
the `request`
object after the middleware (i.e. `req.body`). This will be a
string of the
body.
#### Options
The `text` function takes an option `options` object that may
contain any of
the following keys:
##### defaultCharset
Specify the default character set for the text content if the
charset is not
specified in the `Content-Type` header of the request. Defaults
to `utf-8`.
##### inflate
When set to `true`, then deflated (compressed) bodies will be
94. inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number,
then the value
specifies the number of bytes; if it is a string, the value is
passed to the
[bytes](https://www.npmjs.com/package/bytes) library for
parsing. Defaults
to `'100kb'`.
##### type
The `type` option is used to determine what media type the
middleware will
parse. This option can be a function or a string. If a string,
`type` option
is passed directly to the [type-
is](https://www.npmjs.org/package/type-is#readme)
library and this can be an extension name (like `txt`), a mime
type (like
`text/plain`), or a mime type with a wildcard (like `*/*` or
`text/*`).
If a function, the `type` option is called as `fn(req)` and the
request is
parsed if it returns a truthy value. Defaults to `text/plain`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res,
buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding`
is the
encoding of the request. The parsing can be aborted by throwing
95. an error.
### bodyParser.urlencoded(options)
Returns middleware that only parses `urlencoded` bodies and
only looks at
requests where the `Content-Type` header matches the `type`
option. This
parser accepts only UTF-8 encoding of the body and supports
automatic
inflation of `gzip` and `deflate` encodings.
A new `body` object containing the parsed data is populated on
the `request`
object after the middleware (i.e. `req.body`). This object will
contain
key-value pairs, where the value can be a string or array (when
`extended` is
`false`), or any type (when `extended` is `true`).
#### Options
The `urlencoded` function takes an option `options` object that
may contain
any of the following keys:
##### extended
The `extended` option allows to choose between parsing the
URL-encoded data
with the `querystring` library (when `false`) or the `qs` library
(when
`true`). The "extended" syntax allows for rich objects and arrays
to be
encoded into the URL-encoded format, allowing for a JSON-
like experience
96. with URL-encoded. For more information, please
[see the qs library](https://www.npmjs.org/package/qs#readme).
Defaults to `true`, but using the default has been deprecated.
Please
research into the difference between `qs` and `querystring` and
choose the
appropriate setting.
##### inflate
When set to `true`, then deflated (compressed) bodies will be
inflated; when
`false`, deflated bodies are rejected. Defaults to `true`.
##### limit
Controls the maximum request body size. If this is a number,
then the value
specifies the number of bytes; if it is a string, the value is
passed to the
[bytes](https://www.npmjs.com/package/bytes) library for
parsing. Defaults
to `'100kb'`.
##### parameterLimit
The `parameterLimit` option controls the maximum number of
parameters that
are allowed in the URL-encoded data. If a request contains more
parameters
than this value, a 413 will be returned to the client. Defaults to
`1000`.
##### type
97. The `type` option is used to determine what media type the
middleware will
parse. This option can be a function or a string. If a string,
`type` option
is passed directly to the [type-
is](https://www.npmjs.org/package/type-is#readme)
library and this can be an extension name (like `urlencoded`), a
mime type (like
`application/x-www-form-urlencoded`), or a mime type with a
wildcard (like
`*/x-www-form-urlencoded`). If a function, the `type` option is
called as
`fn(req)` and the request is parsed if it returns a truthy value.
Defaults
to `application/x-www-form-urlencoded`.
##### verify
The `verify` option, if supplied, is called as `verify(req, res,
buf, encoding)`,
where `buf` is a `Buffer` of the raw request body and `encoding`
is the
encoding of the request. The parsing can be aborted by throwing
an error.
## Errors
The middlewares provided by this module create errors
depending on the error
condition during parsing. The errors will typically have a
`status` property
that contains the suggested HTTP response code and a `body`
property containing
the read body, if available.
The following are the common errors emitted, though any error
98. can come through
for various reasons.
### content encoding unsupported
This error will occur when the request had a `Content-
Encoding` header that
contained an encoding but the "inflation" option was set to
`false`. The
`status` property is set to `415`.
### request aborted
This error will occur when the request is aborted by the client
before reading
the body has finished. The `received` property will be set to the
number of
bytes received before the request was aborted and the
`expected` property is
set to the number of expected bytes. The `status` property is set
to `400`.
### request entity too large
This error will occur when the request body's size is larger than
the "limit"
option. The `limit` property will be set to the byte limit and the
`length`
property will be set to the request body's length. The `status`
property is
set to `413`.
### request size did not match content length
This error will occur when the request's length did not match
the length from
99. the `Content-Length` header. This typically occurs when the
request is malformed,
typically when the `Content-Length` header was calculated
based on characters
instead of bytes. The `status` property is set to `400`.
### stream encoding should not be set
This error will occur when something called the
`req.setEncoding` method prior
to this middleware. This module operates directly on bytes only
and you cannot
call `req.setEncoding` when using this module. The `status`
property is set to
`500`.
### unsupported charset "BOGUS"
This error will occur when the request had a charset parameter
in the
`Content-Type` header, but the `iconv-lite` module does not
support it OR the
parser does not support it. The charset is contained in the
message as well
as in the `charset` property. The `status` property is set to
`415`.
### unsupported content encoding "bogus"
This error will occur when the request had a `Content-
Encoding` header that
contained an unsupported encoding. The encoding is contained
in the message
as well as in the `encoding` property. The `status` property is
set to `415`.
100. ## Examples
### Express/Connect top-level generic
This example demonstrates adding a generic JSON and URL-
encoded parser as a
top-level middleware, which will parse the bodies of all
incoming requests.
This is the simplest setup.
```js
var express = require('express')
var bodyParser = require('body-parser')
var app = express()
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }))
// parse application/json
app.use(bodyParser.json())
app.use(function (req, res) {
res.setHeader('Content-Type', 'text/plain')
res.write('you posted:n')
res.end(JSON.stringify(req.body, null, 2))
})
```
### Express route-specific
This example demonstrates adding body parsers specifically to
the routes that
need them. In general, this is the most recommended way to use
body-parser with
Express.
101. ```js
var express = require('express')
var bodyParser = require('body-parser')
var app = express()
// create application/json parser
var jsonParser = bodyParser.json()
// create application/x-www-form-urlencoded parser
var urlencodedParser = bodyParser.urlencoded({ extended: false
})
// POST /login gets urlencoded bodies
app.post('/login', urlencodedParser, function (req, res) {
if (!req.body) return res.sendStatus(400)
res.send('welcome, ' + req.body.username)
})
// POST /api/users gets JSON bodies
app.post('/api/users', jsonParser, function (req, res) {
if (!req.body) return res.sendStatus(400)
// create user in req.body
})
```
### Change accepted type for parsers
All the parsers accept a `type` option which allows you to
change the
`Content-Type` that the middleware will parse.
```js
var express = require('express')
var bodyParser = require('body-parser')
102. var app = express()
// parse various different custom JSON types as JSON
app.use(bodyParser.json({ type: 'application/*+json' }))
// parse some custom thing into a Buffer
app.use(bodyParser.raw({ type: 'application/vnd.custom-type'
}))
// parse an HTML body into a string
app.use(bodyParser.text({ type: 'text/html' }))
```
## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/body-parser.svg
[npm-url]: https://npmjs.org/package/body-parser
[travis-image]: https://img.shields.io/travis/expressjs/body-
parser/master.svg
[travis-url]: https://travis-ci.org/expressjs/body-parser
[coveralls-image]:
https://img.shields.io/coveralls/expressjs/body-
parser/master.svg
[coveralls-url]: https://coveralls.io/r/expressjs/body-
parser?branch=master
[downloads-image]: https://img.shields.io/npm/dm/body-
parser.svg
[downloads-url]: https://npmjs.org/package/body-parser
[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
[gratipay-url]: https://www.gratipay.com/dougwilson/
node_modules/bytes/History.md
106. // TODO: use is-finite module?
var numberIsFinite = Number.isFinite || function (v) { return
typeof v === 'number' && isFinite(v); };
var parseRegExp = /^((-|+)?(d+(?:.d+)?)) *(kb|mb|gb|tb)$/i;
/**
* Convert the given value in bytes into a string or parse to
string to an integer in bytes.
*
* @param {string|number} value
* @param {{
* case: [string],
* decimalPlaces: [number]
* fixedDecimals: [boolean]
* thousandsSeparator: [string]
* unitSeparator: [string]
* }} [options] bytes options.
*
* @returns {string|number|null}
*/
function bytes(value, options) {
if (typeof value === 'string') {
return parse(value);
}
if (typeof value === 'number') {
return format(value, options);
}
return null;
}
/**
* Format the given value in bytes into a string.
107. *
* If the value is negative, it is kept as such. If it is a float,
* it is rounded.
*
* @param {number} value
* @param {object} [options]
* @param {number} [options.decimalPlaces=2]
* @param {number} [options.fixedDecimals=false]
* @param {string} [options.thousandsSeparator=]
* @param {string} [options.unitSeparator=]
*
* @returns {string|null}
* @public
*/
function format(value, options) {
if (!numberIsFinite(value)) {
return null;
}
var mag = Math.abs(value);
var thousandsSeparator = (options &&
options.thousandsSeparator) || '';
var unitSeparator = (options && options.unitSeparator) || '';
var decimalPlaces = (options && options.decimalPlaces !==
undefined) ? options.decimalPlaces : 2;
var fixedDecimals = Boolean(options &&
options.fixedDecimals);
var unit = 'B';
if (mag >= map.tb) {
unit = 'TB';
} else if (mag >= map.gb) {
unit = 'GB';
} else if (mag >= map.mb) {
unit = 'MB';
108. } else if (mag >= map.kb) {
unit = 'kB';
}
var val = value / map[unit.toLowerCase()];
var str = val.toFixed(decimalPlaces);
if (!fixedDecimals) {
str = str.replace(formatDecimalsRegExp, '$1');
}
if (thousandsSeparator) {
str = str.replace(formatThousandsRegExp,
thousandsSeparator);
}
return str + unitSeparator + unit;
}
/**
* Parse the string value into an integer in bytes.
*
* If no unit is given, it is assumed the value is in bytes.
*
* @param {number|string} val
*
* @returns {number|null}
* @public
*/
function parse(val) {
if (typeof val === 'number' && !isNaN(val)) {
return val;
}
if (typeof val !== 'string') {
109. return null;
}
// Test if the string passed is valid
var results = parseRegExp.exec(val);
var floatValue;
var unit = 'b';
if (!results) {
// Nothing could be extracted from the given string
floatValue = parseInt(val, 10);
unit = 'b'
} else {
// Retrieve the value and the unit
floatValue = parseFloat(results[1]);
unit = results[4].toLowerCase();
}
return Math.floor(map[unit] * floatValue);
}
node_modules/bytes/LICENSE
(The MIT License)
Copyright (c) 2012-2014 TJ Holowaychuk <[email protected]>
Copyright (c) 2015 Jed Watson <[email protected]>
Permission is hereby granted, free of charge, to any person
obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction,
including
without limitation the rights to use, copy, modify, merge,
publish,
distribute, sublicense, and/or sell copies of the Software, and to
110. permit persons to whom the Software is furnished to do so,
subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT
WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
node_modules/bytes/package.json
{
"_args": [
[
{
"raw": "[email protected]",
"scope": null,
"escapedName": "bytes",
"name": "bytes",
"rawSpec": "2.4.0",
"spec": "2.4.0",
"type": "version"
},
114. "url": "git+https://github.com/visionmedia/bytes.js.git"
},
"scripts": {
"test": "mocha --check-leaks --reporter spec"
},
"version": "2.4.0"
}
node_modules/bytes/Readme.md
# Bytes utility
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url]
Utility to parse a string bytes (ex: `1TB`) to bytes
(`1099511627776`) and vice-versa.
## Usage
```js
var bytes = require('bytes');
```
#### bytes.format(number value, [options]): string|null
Format the given value in bytes into a string. If the value is
negative, it is kept as such. If it is a float, it is
rounded.
**Arguments**
| Name | Type | Description |
|---------|--------|--------------------|
| value | `number` | Value in bytes |
115. | options | `Object` | Conversion options |
**Options**
| Property | Type | Description
|
|-------------------|--------|----------------------------------------------
-------------------------------------------|
| decimalPlaces | `number`|`null` | Maximum number of
decimal places to include in output. Default value to `2`. |
| fixedDecimals | `boolean`|`null` | Whether to always
display the maximum number of decimal places. Default value
to `false` |
| thousandsSeparator | `string`|`null` | Example of values:
`' '`, `','` and `.`... Default value to `' '`. |
| unitSeparator | `string`|`null` | Separator to use between
number and unit. Default value to `''`. |
**Returns**
| Name | Type | Description |
|---------|-------------|-------------------------|
| results | `string`|`null` | Return null upon error. String
value otherwise. |
**Example**
```js
bytes(1024);
// output: '1kB'
bytes(1000);
// output: '1000B'
bytes(1000, {thousandsSeparator: ' '});
// output: '1 000B'