Monday, January 23, 2017

python lists

Python Lists


%d int, %s string, %f/%g floating point # % operator text = "%d little pigs come out or I'll %s and %s and %s" % (3, 'huff', 'puff', 'blow down')
colors = ['red', 'blue', 'green'] print colors[0] print colors[2] print len(colors) b = colors squares = [1, 4, 9, 16] sum = 0 for num in squares: sum +=num print sum list = ['larry', 'curly', 'moe'] if 'curly in list: print 'yay' num = 1234 lst = [int(i) for i in str(num)] i= 37107287533902102798797998220837590246510135740250L >>> lst = [int(j) for j in str(i)] >>> lst [3, 7, 1, 0, 7, 2, 8, 7, 5, 3, 3, 9, 0, 2, 1, 0, 2, 7, 9, 8, 7, 9, 7, 9, 9, 8, 2, 2, 0, 8, 3, 7, 5, 9, 0, 2, 4, 6, 5, 1, 0, 1, 3, 5, 7, 4, 0, 2, 5, 0] http://stackoverflow.com/questions/780390/convert-a-number-to-a-list-of-integers range creates a list holding all the values while xrange creates an object that can iterate over the numbers on demand In python 2**3 equates to pow(2,3)
  • pow
  • xrange
  • str
>>>def main(): total = 0 for number in xrange(1, 1001): total += pow(number, number) print(str(total)[-10:]) >>> if __name__ == '__main__': main() 9110846700 __name__ : Every module in Python has a special attribute called __name__. It is a built-in variable that returns the name of the module. __main__ : Like other programming languages, Python too has an execution entry point i.e. main. 'main' is the name of the scope in which top-level code executes. Basically you have two ways of using a Python module: Run it directly as a script, or import it. When a module is run as a script, its __name__ is set to __main__. Thus,the value of __name__ attribute is set to __main__ when the module is run as main program. Otherwise the value of __name__ is set to contain the name of the module. http://stackoverflow.com/questions/419163/what-does-if-name-main-do

Python Data Types

Data Types Heap Queue algorithm


priority queue algorithm

Heap:

binary trees which every parent node has a value less than or equal to any of its children.

implementation uses arrays for which heap[k] <= heap [2*k+1] and heap(k) <= heap[2*k+2] for all k, counting elements form zero.

our pop method returns the smallest item, not the largest(mini heap; max heap is more common because of sorting.

heapq.heappush(heap, item) push the value item onto the heap, maintaining the heap invariant. heapq.heapop(heap) Pop the return the smallest item from the heap, maintaining the heap invariant. if the heap is empty, indexerror is raised. To access the smallest item wihtout popping it, use heap[0]. invariant: never changing -------------------------------------------------------------------------------------------------------------------------------------------------------------------
import heapq class PriorityQueue: def __init__(self): self._queue = [] self._index = 0 def push(self, item, priority): heapq.heappush(self._queue, (-priority, self._index, item)) self._index += 1 def pop(self): return heapq.heappop(self._queue)[-1]
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

Python Big List

Modules: modules are libraries in Python. Python ships with many standard library modules. Modules can be imported using the import statement. >>>import time >>> time.asctime() 'Mon Jan 23 12:25 2016' The asctime function form the time module returns the current time of the system as a string.

First name:

Last name:


if you click the "submit" button, the form data will be sent to a page called "action_page.php".

Python

----------------------------------------------------------------------------------


import heapq

class PriorityQueue:
    def __init__(self):
        self._queue = []
        self._index = 0


   def push(self, item, priority):
        heapq.heappush(self._queue, (-priority, self._index, item))
        self._index += 1

   def pop( self):
        return heapq.heapop(self._queue)[-1]


------------------------------------------------------------------------------------ Heap: an untidy collection f thigns piled up haphazardly. Heapsort: implemented by pushing all values onto a heap and then popping off the smallest values one at a time. Python standard library ---> webbrowser --->(function) def open ---> time --> (function) def ctime and def sleep(suspend for a few seconds) These functions are abstract....


import heapq

class PriorityQueue:
    def __init__(self):
        self._queue = []
        self._index = 0


   def push(self, item, priority):
        heapq.heappush(self._queue, (-priority, self._index, item))
        self._index += 1

   def pop( self):
        return heapq.heapop(self._queue)[-1]



self variable: represents the instance of the object itself; you have to declare it explicitly.  

a = A()
a.method_a('Sailor!')

__init__ roughly represents a constructor; 

when calling A() python creates an object for you, and passes it as the first parameter to the __init__ method.  A(24, 'Hello') will get passed as arguments--causing an exception to be raised.
 
Python Solutions


Here are the running times of some operations we might perform on the phone book, from best to worst:

    O(1) (worst case): Given the page that a business's name is on and the business name, find the phone number.

    O(1) (average case): Given the page that a person's name is on and their name, find the phone number.

    O(log n): Given a person's name, find the phone number by picking a random point about halfway through the part of the book you haven't searched yet, then checking to see whether the person's name is at that point. Then repeat the process about halfway through the part of the book where the person's name lies. (This is a binary search for a person's name.)

    O(n): Find all people whose phone numbers contain the digit "5".

    O(n): Given a phone number, find the person or business with that number.

    O(n log n): There was a mix-up at the printer's office, and our phone book had all its pages inserted in a random order. Fix the ordering so that it's correct by looking at the first name on each page and then putting that page in the appropriate spot in a new, empty phone book.

For the below examples, we're now at the printer's office. Phone books are waiting to be mailed to each resident or business, and there's a sticker on each phone book identifying where it should be mailed to. Every person or business gets one phone book.

    O(n log n): We want to personalize the phone book, so we're going to find each person or business's name in their designated copy, then circle their name in the book and write a short thank-you note for their patronage.

    O(n2): A mistake occurred at the office, and every entry in each of the phone books has an extra "0" at the end of the phone number. Take some white-out and remove each zero.

    O(n · n!): We're ready to load the phonebooks onto the shipping dock. Unfortunately, the robot that was supposed to load the books has gone haywire: it's putting the books onto the truck in a random order! Even worse, it loads all the books onto the truck, then checks to see if they're in the right order, and if not, it unloads them and starts over. (This is the dreaded bogo sort.)

    O(nn): You fix the robot so that it's loading things correctly. The next day, one of your co-workers plays a prank on you and wires the loading dock robot to the automated printing systems. Every time the robot goes to load an original book, the factory printer makes a duplicate run of all the phonebooks! Fortunately, the robot's bug-detection systems are sophisticated enough that the robot doesn't try printing even more copies when it encounters a duplicate book for loading, but it still has to load every original and duplicate book that's been printed.

Big O Notation

Tuesday, January 10, 2017

PMI

https://www.project-management-prepcast.com/pmp-itto

https://www.projectsmart.co.uk/tools.php

Methods:

Precedence Diagramming Method:  

A technique used for constructing a schedule model in which activities are represented by nodes and are graphically linked by one or more logical relationships to show the sequence in which the activities are to be performed. See also node and project schedule network diagram.

Weighted Milestone Method:

A method of estimating earned value in which the budget value of a work package is divided into measurable segments, each ending with a milestone that is assigned a weighted budget value. See also fixed formula method.
Critical Chain Method
A schedule method that allows the project team to place buffers on any project schedule path to account for limited resources and project uncertainties.

Critical Path Method
A method used to estimate the minimum project duration and determine the amount of scheduling flexibility on the logical network paths within the schedule model. See also critical path and critical path activity.

Earned Value Management
A methodology that combines scope, schedule, and resource measurements to assess project performance and progress.

Fixed Formula Method
A method of estimating earned value in which a specified percentage of the budget value of a work package is assigned to the start milestone and the remaining percentage is assigned when the work package is complete. See also weighted milestone method.

Sunday, January 8, 2017

PMI

https://quizlet.com/87447425/flashcards

PMI

10 questions/day

---------------------------------------------------------------------------------------------------------------------

1) Human Resource Management Plan

A component of the project or program management plan that describes the roles and responsibilities, reporting relationships, and staff management. See also project management plan, and staffing management plan.

2) Issue

A threat that has occurred. See also opportunity, risk, and threat..

3) Lag

The amount of time whereby a successor activity will be delayed with respect to a predecessor activity. See also lead.

4) Late Finish Date
In the critical path method, the latest possible point in time when the uncompleted portions of a schedule activity can finish based on the schedule network logic, the project completion date, and any schedule constraints. See also early finish date, early start date, late start date, and schedule network analysis.

5) Late Start Date

In the critical path method, the latest possible point in time when the uncompleted portions of a schedule activity can start based on the schedule network logic, the project completion date, and any schedule constraints. See also early finish date, late finish date, early start date, and schedule network analysis.

6) Lead

The amount of time whereby a successor activity can be advanced with respect to a predecessor activity. See also lag.

7) Lessons Learned

The knowledge gained during a project which shows how project events were addressed or should be addressed in the future for the purpose of improving future performance.

8)Level of Effort
An activity that does not produce definitive end products and is measured by the passage of time. [Note: Level of effort is one of three earned value management (EVM) types of activities used to measure work performance.] See also apportioned effort and discrete effort.

9) Logical Relationship
A dependency between two activities or between an activity and a milestone. See also finish-to-finish, finish-to-start, start-to-finish, and start-to-start.

10) Management Reserve
Time or money that management sets aside in addition to the schedule or cost baseline and releases for unforeseen work that is within the scope of the project. See also contingency reserve and project budget.





---------------------------------------------------------------------------------------------------------------------


1/10/17


1) Change Control

A process whereby modifications to documents, deliverables, or baselines associated with the project are identified, documented, approved, or rejected. See also change control board and change control system.

2) Change Control Board

A formally chartered group responsible for reviewing, evaluating, approving, delaying, or rejecting changes to the project, and for recording and communicating such decisions. See also change control and change control system.


3)Change Control System

A set of procedures that describes how modifications to the project deliverables and documentation are managed and controlled. See also change control and change control board.

4) Change Request

A formal proposal to modify any document, deliverable, or baseline.


5) Code of Accounts

A numbering system used to uniquely identify each component of the work breakdown structure.


6) Communications Management Plan

A component of the project, program, or portfolio management plan that describes how, when, and by whom information will be administered and disseminated. See also project management plan.

7) Configuration Management System

A collection of procedures used to track project artifacts and monitor and control changes to these artifacts.

8) Constraint

A limiting factor that affects the execution of a project, program, portfolio, or process.

9) Contingency Plan

A document describing actions that the project team can take if predetermined trigger conditions occur.

10) Contingency Reserve

Time or money allocated in the schedule or cost baseline for known risks with active response strategies. See also management reserve and project budget.

11) Control Account

A management control point where scope, budget, actual cost, and schedule are integrated and compared to earned value for performance measurement.

12) Corrective Action
An intentional activity that realigns the performance of the project work with the project management plan. See also preventive action.


13) Cost Baseline
The approved version of work package cost estimates and contingency reserve that can be changed using formal change control procedures and is used as the basis for comparison to actual results. See also baseline, performance measurement baseline, schedule baseline, and scope baseline.

14) Cost Management Plan
A component of a project or program management plan that describes how costs will be planned, structured, and controlled. See also project management plan.

15) Cost Performance Index (CPI)

A measure of the cost efficiency of budgeted resources expressed as the ratio of earned value to actual cost. See also schedule performance index (SPI).

16)  Cost Variance (CV)
The amount of budget deficit or surplus at a given point in time, expressed as the difference between the earned value and the actual cost. See also schedule variance (SV).

17) Crashing

A schedule compression technique used to shorten the schedule duration for the least incremental cost by adding resources.See also fast tracking and schedule compression.

18) Critical Chain Method

A schedule method that allows the project team to place buffers on any project schedule path to account for limited resources and project uncertainties.


19) Critical Path


The sequence of activities that represents the longest path through a project, which determines the shortest possible duration. See also critical path activity and critical path method.

20) Critical Path Activity

Any activity on the critical path in a project schedule. See also critical path and critical path method.

21) Critical Path Method

A method used to estimate the minimum project duration and determine the amount of scheduling flexibility on the logical network paths within the schedule model. See also critical path and critical path activity.



Scrum

https://quizlet.com/131772808/flashcards
10/day

Current 32/148
---------------------------------------------------------------------------------------------------------------------
1) Definition of SCRUM:

A framework within which people can address complex adaptive problems, while productively and creatively delivering products of the highest possible value.

2) 3 things SCRUM is...

Lightweight
Simple to understand
Difficult to master

3) What is empiricism? (SCRUM's founding principle.)

Empiricism asserts that knowledge comes from experience and making decisions based on what is known.

4)What are the 3 pillars that uphold empirical process control?

transparency, inspection, and adaptation

5) define transparency for SCRUM

Significant aspects of the process must be visible to those responsible for the outcome.


6) name some examples of transparency aspects for SCRUM

A common language referring to the process must be shared by all participants; and,
Those performing the work and those accepting the work product must share a common definition of "Done".


7) define Inspection for SCRUM
Scrum users must frequently inspect Scrum artifacts and progress toward a Sprint Goal to detect undesirable variances.

8) what are the four formal events for inspection and adaptation in SCRUM?

Sprint Planning
Daily Scrum
Sprint Review
Sprint Retrospective

9) What does a SCRUM team consist of?

The Scrum Team consists of a Product Owner, the Development Team, and a Scrum Master.

10) Two terms that describe SCRUM teams.

self-organizing and cross-functional



---------------------------------------------------------------------------------------------------------------------

1/10/17

1) What is a cross-functional team in SCRUM terms?

Cross-functional teams have all competencies needed to accomplish the work without depending on others not part of the team.


2) Why do SCRUM teams deliver products incrementally and iteratively?

to maximize opportunities for feedback


3) What do incremental deliveries of "done" ensure in SCRUM?

a potentially useful version of working product is always available


4) What is the responsibility of the product owner in SCRUM?

maximizing the value of the product and the work of the Development Team


5) What does the product owner manage in SCRUM?

the sole person responsible for managing the Product Backlog


6) What is involved in Product Management backlog?

Clearly expressing Product Backlog items;
Ordering the items in the Product Backlog to best achieve goals and missions;
Optimizing the value of the work the Development Team performs;
Ensuring that the Product Backlog is visible, transparent, and clear to all, and shows what the Scrum Team will work on next; and,
Ensuring the Development Team understands items in the Product Backlog to the level needed.





7) Can the product owner be a committee in SCRUM?

No.
Note: The Product Owner can represent the desires of a committee in the Product Backlog, but the person managing the Product Backlog is one person.



8)  What does the Product Owner need in order to succeed?

the entire organization must respect the Product Owner's decisions

9)  Who are and what do the Development Team members do in SCRUM?

The Development Team consists of professionals who do the work of delivering a potentially releasable Increment of "Done" product at the end of each Sprint.


10) What do the Development Team members create in SCRUM?

they create the Increment

11) Who manages and organizes the Development Team's work in SCRUM?

Development Teams are structured and empowered by the organization to organize and manage their own work.

12) What does a self-organizing Development Team look like in SCRUM?

They are self-organizing. No one (not even the Scrum Master) tells the Development Team how to turn Product Backlog into Increments of potentially releasable functionality.


13) What does a cross-functional Development Team look like in SCRUM?

Development Teams are cross-functional, with all of the skills as a team necessary to create a product Increment.

14) What are the titles on a Development Team in SCRUM?

Scrum recognizes no titles for Development Team members other than Developer.

15) How are sub-teams organized for the Development Team in SCRUM?

Scrum recognizes no sub-teams in the Development Team, regardless of particular domains that need to be addressed like testing or business analysis

16) What is the downside of having more than nine Development Team members on a SCRUM team?

Having more than nine members requires too much coordination. Large Development Teams generate too much complexity for an empirical process to manage.

17)Describe the role of the SCRUM master.

The Scrum Master is responsible for ensuring Scrum is understood and enacted. Scrum Masters do this by ensuring that the Scrum Team adheres to Scrum theory, practices, and rules.

18) Describe the various ways the SCRUM master serves the Product Owner.

Finding techniques for effective Product Backlog management;
Helping the Scrum Team understand the need for clear and concise Product Backlog items;
Understanding product planning in an empirical environment;
Ensuring the Product Owner knows how to arrange the Product Backlog to maximize value;
Understanding and practicing agility; and,
Facilitating Scrum events as requested or needed.


19) Describe the various ways the SCRUM master serves the Development Team.

Coaching the Development Team in self-organization and cross-functionality;
Helping the Development Team to create high-value products;
Removing impediments to the Development Team's progress;
Facilitating Scrum events as requested or needed; and,
Coaching the Development Team in organizational environments in which Scrum is not yet fully adopted and understood.


20) Describe the various ways the SCRUM Master serves the organization

Leading and coaching the organization in its Scrum adoption;
Planning Scrum implementations within the organization;
Helping employees and stakeholders understand and enact Scrum and empirical product development;
Causing change that increases the productivity of the Scrum Team; and,
Working with other Scrum Masters to increase the effectiveness of the application of Scrum in the organization.


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------