Category Archives: Research Papers

spanish

WRITE ANSWER IN SPANISH

THESIS: En este ensayo, demuestra que las influencias religiosas Española presente en Latinoamérica han evolucionado desde la época de colonización para mezclar con costumbres indígena de las Américas. Esta mezcla de costumbres produjo una forma distinta de celebraciones religiosas que podría observar durante la Semana Santa en Latinoamérica. Revise and edit thesis as needed

Why did Spain have to display religious dominance over the indegious population? How does the Spanish colonizers display of religious power and tradition relate to the observation of Semana Santa

Las costumbres religiosas asociaba con la Semana Santa fue introducido en las Américas por misioneros y frailes, que fueron empleados por la Monarquía francesa y española[1] (Alena, 2021). Why did the monarchy do this?

Explain significance of tradition in iztapala and its origin

How is it unique?

 

Introduce second tradición

Quemada de JUDAS en Latín AMERICA

QUEMADA DE Judas origin de España

How is the celebration unique in Latin Ameri

career in insurance

Pick a career in insurance that either you are most interested in or would liketolearn more about. Reasearch that job and tell me
(1) description of daily job duties
(2) anticipated salary/earnings
(3) what licensing or education are required or encouraged and what it wouldtake to meet those req

project

your report should include the following components:
1. Description of your registration system: describe the system in words and how it should
behave.
2. Database design: Based on the description above, design the different tables, relations,
and table column names.
3. Implementation: Use Oracle 19c software to implement your design.
4. System at work: In this section, provide screenshots of SQL queries to prove that your
database system is working according to the behavior that was put in the system
description

writing task

  1. Describe the intended audience, the genre, and the purpose.
  2. What are the characteristics of the audience overall – think about age, professions, education, and other factors you might assume from analyzing your samples?
  3. How should the audience use the information? What action should be taken or what is the audience asked to think about?
  4. What is its role in the larger discipline, potentially?
  5. What are the needs, values, or beliefs of the audience that the writer is working toward here? How is the writer appealing to the audience?
  6. Are any audiences excluded by the way the piece is written?
  7. How is information presented, formatted, arranged, and is it appropriate to the genre?
  8. What messages are intended, and are they clearly conveyed?
  9. Is there anything notable about the discourse used?
  10. What are the overall impressions of how each sample fits into the discipline or major? Is it surprising, or typical/expected of the major?
  11. How does each sample represent the major or discipline overall?
  12. Include any other analysis you want to share.

Please Read…

*I have attached a file called “Project three planning activity” and there you will find the three sources. you will answer these 12 questions for each source.

* For question (1). Describe the intended audience, the genre, and the purpose. the answer is already in “Project three planning activity

  1. Describe the intended audience, the genre, and the purpose.
  2. What are the characteristics of the audience overall – think about age, professions, education, and other factors you might assume from analyzing your samples?
  3. How should the audience use the information? What action should be taken or what is the audience asked to think about?
  4. What is its role in the larger discipline, potentially?
  5. What are the needs, values, or beliefs of the audience that the writer is working toward here? How is the writer appealing to the audience?
  6. Are any audiences excluded by the way the piece is written?
  7. How is information presented, formatted, arranged, and is it appropriate to the genre?
  8. What messages are intended, and are they clearly conveyed?
  9. Is there anything notable about the discourse used?
  10. What are the overall impressions of how each sample fits into the discipline or major? Is it surprising, or typical/expected of the major?
  11. How does each sample represent the major or discipline overall?
  12. Include any other analysis you want to share.

Please Read…

*I have attached a file called “Project three planning activity” and there you will find the three sources. you will answer these 12 questions for each source.

* For question (1). Describe the intended audience, the genre, and the purpose. the answer is already in “Project three planning activity

music 111 W

  • Explain how avant-garde jazz departed from established notions of melody, harmony and rhythm – provide a clear example for each. What were the primary critiques leveled by jazz journalists and musicians against the avant-garde?
  • Explain how spiritualism, black nationalism, and musical complexity factored into the development of the jazz avant-garde – using clear examples, connect each with a specific musician.
  • Considering that fusion and avant-garde styles were initially viewed as radical departures from the existing tradition of jazz, how would you feel if your favorite musical artist(s) began exploring ideas that “challenged” you as a listener? Should artists publicly express their political views? Can you provide an example where you approve or disapprove of an artist making a political statement?

music 111 G

  • Explain how avant-garde jazz departed from established notions of melody, harmony and rhythm – provide a clear example for each. What were the primary critiques leveled by jazz journalists and musicians against the avant-garde?
  • Explain how spiritualism, black nationalism, and musical complexity factored into the development of the jazz avant-garde – using clear examples, connect each with a specific musician.
  • Considering that fusion and avant-garde styles were initially viewed as radical departures from the existing tradition of jazz, how would you feel if your favorite musical artist(s) began exploring ideas that “challenged” you as a listener? Should artists publicly express their political views? Can you provide an example where you approve or disapprove of an artist making a political statement?

Python: The Dining Philosopher’s Proble

The Dining Philosopher’s Problem There are 5 (silent) philosophers sitting around a circular dinner table, each with a plate of food in front of them and a fork in between each plate. To be able to eat a philosopher must pick up their left and right forks, if available. Each philosopher can be in one of 3 states: 1. Thinking: a philosopher is pondering and not currently interested in eating 2. Eating: a philosopher has acquired their left and right fork and is currently consuming food 3. Hungry: the philosopher is hungry but is waiting for one, or both, forks to become available Each philosopher spends an arbitrary part of their time either thinking or eating and two philosophers cannot communicate or know what the other is thinking. Once a philosopher is done eating they will place both forks back on the table making them available for use by other philosophers. You can assume there is an infinite amount of food on each plate and that each philosopher will eventually become hungry again once they’ve eaten. The problem is to design a concurrent algorithm so that no philosopher will starve (i.e. avoid a “deadlock” where one or more philosophers can never eat). A deadlock would occur, for example, if all 5 philosophers sat down and all picked up their right fork. All philosophers would be waiting for their left fork to become available which will never happen. So, we need to ensure a philosopher will never pick up only one fork if it is available; they will only pick up their pair of forks when they are hungry and both forks are available. Fork Class(fork.py) The Fork class define a philosopher’s “fork”. In this assignment an instance of Fork contains a ‘threading.Lock()’ object. Recall from lecture that a Lock() object is a synchronization primitive that ensures a shared resource is only accessible by one object at a time. So, in order to make sure an instance of our “Fork” class can only be held by one philosopher at a time we’ve added a Lock() to it. To pick up a “Fork”, a philosopher must try to ‘acquire()’ it. If the “Fork” is already held by another philosopher who is currently eating the call to ‘acquire() will return False, otherwise it will return True and the “Fork” will be locked from other philosophers accessing it. You will implement the following Fork API: import threading class Fork: def __init__(self): # add a lock as an instance variable def acquire_fork(self): # return True if you can acquire self.lock, False otherwise def release_fork(self): # release lock Philosopher Class (philosopher.py) The Philosopher class represents a single philosopher. It is a descendant of the Python ‘threading.Thread’ class so it inherits all of the methods from ‘threading.Thread’. It also defines what it means for a philosopher to “think” and “eat”. You will implement the following API: import random import threading import time from fork import Fork class Philosopher(threading.Thread): running = True # initialize a Philosophers name, left fork, and right fork def __init__(self, name: str, left_fork: Fork, right_fork: Fork): # call ‘threading’ superclass constructor # initialize ‘name’ instance variable # initialize ‘left_fork’ instance variable # initialize ‘right_fork’ instance variable # run() is called by thread’s start() method; starts the thread running def run(self): while self.running: # call think() # call eat() # print is cleaning up. # make philosopher think for a random number of seconds until hungry def think(self): # ‘thinking’ = random number of seconds between 3 and 5 using # random.uniform() # print is thinking for ‘thinking’ seconds. # sleep for ‘thinking’ seconds # print is now hungry. # make philosopher eat for a random number of seconds until thinking again def eat(self): # try to acquire left fork # if successful, try to acquire right fork # if successful # ‘eating’ = random num of seconds between 3 and 5 using # random.uniform() # print is eating for ‘eating’ seconds. # sleep for ‘eating’ seconds # release right fork # print has put down his right fork. # release left fork # print has put down his left fork. # else: return Dining Philosophers Client (DiningPhilosophers.py) This Python script will serve as your main() method and will create your Philosopher’s and Fork’s as well as start the processing threads and shut them down. Your code should implement the following client: import time from fork import Fork from philosopher import Philosopher def DiningPhilosophers(): # create array of 5 names: Plato, Aristotle, Buddha, Marx, and Nietzsche # use a list comprehension to create 5 Fork’s # use a list comprehension to create 5 Philosopher’s and correctly # assign each pair of forks to each philosopher # start all 5 Philosopher threads (should be non-blocking) # sleep for 10 seconds # set ‘running’ to False # exit all threads if __name__ == “__main__”: DiningPhilosophers() Deliverables Please submit the following: 1. Your “Fork” source code in a file called fork.py 2. Your “Philosopher” source code in a file called philosopher.py 3. Your client code in a file called DiningPhilosophers.py 4. A PDF containing a screenshot containing your output (example below) The Dining Philosopher’s Problem There are 5 (silent) philosophers sitting around a circular dinner table, each with a plate of food in front of them and a fork in between each plate. To be able to eat a philosopher must pick up their left and right forks, if available. Each philosopher can be in one of 3 states: 1. Thinking: a philosopher is pondering and not currently interested in eating 2. Eating: a philosopher has acquired their left and right fork and is currently consuming food 3. Hungry: the philosopher is hungry but is waiting for one, or both, forks to become available Each philosopher spends an arbitrary part of their time either thinking or eating and two philosophers cannot communicate or know what the other is thinking. Once a philosopher is done eating they will place both forks back on the table making them available for use by other philosophers. You can assume there is an infinite amount of food on each plate and that each philosopher will eventually become hungry again once they’ve eaten. The problem is to design a concurrent algorithm so that no philosopher will starve (i.e. avoid a “deadlock” where one or more philosophers can never eat). A deadlock would occur, for example, if all 5 philosophers sat down and all picked up their right fork. All philosophers would be waiting for their left fork to become available which will never happen. So, we need to ensure a philosopher will never pick up only one fork if it is available; they will only pick up their pair of forks when they are hungry and both forks are available. Fork Class(fork.py) The Fork class define a philosopher’s “fork”. In this assignment an instance of Fork contains a ‘threading.Lock()’ object. Recall from lecture that a Lock() object is a synchronization primitive that ensures a shared resource is only accessible by one object at a time. So, in order to make sure an instance of our “Fork” class can only be held by one philosopher at a time we’ve added a Lock() to it. To pick up a “Fork”, a philosopher must try to ‘acquire()’ it. If the “Fork” is already held by another philosopher who is currently eating the call to ‘acquire() will return False, otherwise it will return True and the “Fork” will be locked from other philosophers accessing it. You will implement the following Fork API: import threading class Fork: def __init__(self): # add a lock as an instance variable def acquire_fork(self): # return True if you can acquire self.lock, False otherwise def release_fork(self): # release lock Philosopher Class (philosopher.py) The Philosopher class represents a single philosopher. It is a descendant of the Python ‘threading.Thread’ class so it inherits all of the methods from ‘threading.Thread’. It also defines what it means for a philosopher to “think” and “eat”. You will implement the following API: import random import threading import time from fork import Fork class Philosopher(threading.Thread): running = True # initialize a Philosophers name, left fork, and right fork def __init__(self, name: str, left_fork: Fork, right_fork: Fork): # call ‘threading’ superclass constructor # initialize ‘name’ instance variable # initialize ‘left_fork’ instance variable # initialize ‘right_fork’ instance variable # run() is called by thread’s start() method; starts the thread running def run(self): while self.running: # call think() # call eat() # print is cleaning up. # make philosopher think for a random number of seconds until hungry def think(self): # ‘thinking’ = random number of seconds between 3 and 5 using # random.uniform() # print is thinking for ‘thinking’ seconds. # sleep for ‘thinking’ seconds # print is now hungry. # make philosopher eat for a random number of seconds until thinking again def eat(self): # try to acquire left fork # if successful, try to acquire right fork # if successful # ‘eating’ = random num of seconds between 3 and 5 using # random.uniform() # print is eating for ‘eating’ seconds. # sleep for ‘eating’ seconds # release right fork # print has put down his right fork. # release left fork # print has put down his left fork. # else: return Dining Philosophers Client (DiningPhilosophers.py) This Python script will serve as your main() method and will create your Philosopher’s and Fork’s as well as start the processing threads and shut them down. Your code should implement the following client: import time from fork import Fork from philosopher import Philosopher def DiningPhilosophers(): # create array of 5 names: Plato, Aristotle, Buddha, Marx, and Nietzsche # use a list comprehension to create 5 Fork’s # use a list comprehension to create 5 Philosopher’s and correctly # assign each pair of forks to each philosopher # start all 5 Philosopher threads (should be non-blocking) # sleep for 10 seconds # set ‘running’ to False # exit all threads if __name__ == “__main__”: DiningPhilosophers() Deliverables Please submit the following: 1. Your “Fork” source code in a file called fork.py 2. Your “Philosopher” source code in a file called philosopher.py 3. Your client code in a file called DiningPhilosophers.py 4. A PDF containing a screenshot containing your output (example below) The Dining Philosopher’s Problem There are 5 (silent) philosophers sitting around a circular dinner table, each with a plate of food in front of them and a fork in between each plate. To be able to eat a philosopher must pick up their left and right forks, if available. Each philosopher can be in one of 3 states: 1. Thinking: a philosopher is pondering and not currently interested in eating 2. Eating: a philosopher has acquired their left and right fork and is currently consuming food 3. Hungry: the philosopher is hungry but is waiting for one, or both, forks to become available Each philosopher spends an arbitrary part of their time either thinking or eating and two philosophers cannot communicate or know what the other is thinking. Once a philosopher is done eating they will place both forks back on the table making them available for use by other philosophers. You can assume there is an infinite amount of food on each plate and that each philosopher will eventually become hungry again once they’ve eaten. The problem is to design a concurrent algorithm so that no philosopher will starve (i.e. avoid a “deadlock” where one or more philosophers can never eat). A deadlock would occur, for example, if all 5 philosophers sat down and all picked up their right fork. All philosophers would be waiting for their left fork to become available which will never happen. So, we need to ensure a philosopher will never pick up only one fork if it is available; they will only pick up their pair of forks when they are hungry and both forks are available. Fork Class(fork.py) The Fork class define a philosopher’s “fork”. In this assignment an instance of Fork contains a ‘threading.Lock()’ object. Recall from lecture that a Lock() object is a synchronization primitive that ensures a shared resource is only accessible by one object at a time. So, in order to make sure an instance of our “Fork” class can only be held by one philosopher at a time we’ve added a Lock() to it. To pick up a “Fork”, a philosopher must try to ‘acquire()’ it. If the “Fork” is already held by another philosopher who is currently eating the call to ‘acquire() will return False, otherwise it will return True and the “Fork” will be locked from other philosophers accessing it. You will implement the following Fork API: import threading class Fork: def __init__(self): # add a lock as an instance variable def acquire_fork(self): # return True if you can acquire self.lock, False otherwise def release_fork(self): # release lock Philosopher Class (philosopher.py) The Philosopher class represents a single philosopher. It is a descendant of the Python ‘threading.Thread’ class so it inherits all of the methods from ‘threading.Thread’. It also defines what it means for a philosopher to “think” and “eat”. You will implement the following API: import random import threading import time from fork import Fork class Philosopher(threading.Thread): running = True # initialize a Philosophers name, left fork, and right fork def __init__(self, name: str, left_fork: Fork, right_fork: Fork): # call ‘threading’ superclass constructor # initialize ‘name’ instance variable # initialize ‘left_fork’ instance variable # initialize ‘right_fork’ instance variable # run() is called by thread’s start() method; starts the thread running def run(self): while self.running: # call think() # call eat() # print is cleaning up. # make philosopher think for a random number of seconds until hungry def think(self): # ‘thinking’ = random number of seconds between 3 and 5 using # random.uniform() # print is thinking for ‘thinking’ seconds. # sleep for ‘thinking’ seconds # print is now hungry. # make philosopher eat for a random number of seconds until thinking again def eat(self): # try to acquire left fork # if successful, try to acquire right fork # if successful # ‘eating’ = random num of seconds between 3 and 5 using # random.uniform() # print is eating for ‘eating’ seconds. # sleep for ‘eating’ seconds # release right fork # print has put down his right fork. # release left fork # print has put down his left fork. # else: return Dining Philosophers Client (DiningPhilosophers.py) This Python script will serve as your main() method and will create your Philosopher’s and Fork’s as well as start the processing threads and shut them down. Your code should implement the following client: import time from fork import Fork from philosopher import Philosopher def DiningPhilosophers(): # create array of 5 names: Plato, Aristotle, Buddha, Marx, and Nietzsche # use a list comprehension to create 5 Fork’s # use a list comprehension to create 5 Philosopher’s and correctly # assign each pair of forks to each philosopher # start all 5 Philosopher threads (should be non-blocking) # sleep for 10 seconds # set ‘running’ to False # exit all threads if __name__ == “__main__”: DiningPhilosophers() Deliverables Please submit the following: 1. Your “Fork” source code in a file called fork.py 2. Your “Philosopher” source code in a file called philosopher.py 3. Your client code in a file called DiningPhilosophers.py 4. A PDF containing a screenshot containing your output (example below) The Dining Philosopher’s Problem There are 5 (silent) philosophers sitting around a circular dinner table, each with a plate of food in front of them and a fork in between each plate. To be able to eat a philosopher must pick up their left and right forks, if available. Each philosopher can be in one of 3 states: 1. Thinking: a philosopher is pondering and not currently interested in eating 2. Eating: a philosopher has acquired their left and right fork and is currently consuming food 3. Hungry: the philosopher is hungry but is waiting for one, or both, forks to become available Each philosopher spends an arbitrary part of their time either thinking or eating and two philosophers cannot communicate or know what the other is thinking. Once a philosopher is done eating they will place both forks back on the table making them available for use by other philosophers. You can assume there is an infinite amount of food on each plate and that each philosopher will eventually become hungry again once they’ve eaten. The problem is to design a concurrent algorithm so that no philosopher will starve (i.e. avoid a “deadlock” where one or more philosophers can never eat). A deadlock would occur, for example, if all 5 philosophers sat down and all picked up their right fork. All philosophers would be waiting for their left fork to become available which will never happen. So, we need to ensure a philosopher will never pick up only one fork if it is available; they will only pick up their pair of forks when they are hungry and both forks are available. Fork Class(fork.py) The Fork class define a philosopher’s “fork”. In this assignment an instance of Fork contains a ‘threading.Lock()’ object. Recall from lecture that a Lock() object is a synchronization primitive that ensures a shared resource is only accessible by one object at a time. So, in order to make sure an instance of our “Fork” class can only be held by one philosopher at a time we’ve added a Lock() to it. To pick up a “Fork”, a philosopher must try to ‘acquire()’ it. If the “Fork” is already held by another philosopher who is currently eating the call to ‘acquire() will return False, otherwise it will return True and the “Fork” will be locked from other philosophers accessing it. You will implement the following Fork API: import threading class Fork: def __init__(self): # add a lock as an instance variable def acquire_fork(self): # return True if you can acquire self.lock, False otherwise def release_fork(self): # release lock Philosopher Class (philosopher.py) The Philosopher class represents a single philosopher. It is a descendant of the Python ‘threading.Thread’ class so it inherits all of the methods from ‘threading.Thread’. It also defines what it means for a philosopher to “think” and “eat”. You will implement the following API: import random import threading import time from fork import Fork class Philosopher(threading.Thread): running = True # initialize a Philosophers name, left fork, and right fork def __init__(self, name: str, left_fork: Fork, right_fork: Fork): # call ‘threading’ superclass constructor # initialize ‘name’ instance variable # initialize ‘left_fork’ instance variable # initialize ‘right_fork’ instance variable # run() is called by thread’s start() method; starts the thread running def run(self): while self.running: # call think() # call eat() # print is cleaning up. # make philosopher think for a random number of seconds until hungry def think(self): # ‘thinking’ = random number of seconds between 3 and 5 using # random.uniform() # print is thinking for ‘thinking’ seconds. # sleep for ‘thinking’ seconds # print is now hungry. # make philosopher eat for a random number of seconds until thinking again def eat(self): # try to acquire left fork # if successful, try to acquire right fork # if successful # ‘eating’ = random num of seconds between 3 and 5 using # random.uniform() # print is eating for ‘eating’ seconds. # sleep for ‘eating’ seconds # release right fork # print has put down his right fork. # release left fork # print has put down his left fork. # else: return Dining Philosophers Client (DiningPhilosophers.py) This Python script will serve as your main() method and will create your Philosopher’s and Fork’s as well as start the processing threads and shut them down. Your code should implement the following client: import time from fork import Fork from philosopher import Philosopher def DiningPhilosophers(): # create array of 5 names: Plato, Aristotle, Buddha, Marx, and Nietzsche # use a list comprehension to create 5 Fork’s # use a list comprehension to create 5 Philosopher’s and correctly # assign each pair of forks to each philosopher # start all 5 Philosopher threads (should be non-blocking) # sleep for 10 seconds # set ‘running’ to False # exit all threads if __name__ == “__main__”: DiningPhilosophers() Deliverables Please submit the following: 1. Your “Fork” source code in a file called fork.py 2. Your “Philosopher” source code in a file called philosopher.py 3. Your client code in a file called DiningPhilosophers.py 4. A PDF containing a screenshot containing your output (example below) The Dining Philosopher’s Problem There are 5 (silent) philosophers sitting around a circular dinner table, each with a plate of food in front of them and a fork in between each plate. To be able to eat a philosopher must pick up their left and right forks, if available. Each philosopher can be in one of 3 states: 1. Thinking: a philosopher is pondering and not currently interested in eating 2. Eating: a philosopher has acquired their left and right fork and is currently consuming food 3. Hungry: the philosopher is hungry but is waiting for one, or both, forks to become available Each philosopher spends an arbitrary part of their time either thinking or eating and two philosophers cannot communicate or know what the other is thinking. Once a philosopher is done eating they will place both forks back on the table making them available for use by other philosophers. You can assume there is an infinite amount of food on each plate and that each philosopher will eventually become hungry again once they’ve eaten. The problem is to design a concurrent algorithm so that no philosopher will starve (i.e. avoid a “deadlock” where one or more philosophers can never eat). A deadlock would occur, for example, if all 5 philosophers sat down and all picked up their right fork. All philosophers would be waiting for their left fork to become available which will never happen. So, we need to ensure a philosopher will never pick up only one fork if it is available; they will only pick up their pair of forks when they are hungry and both forks are available. Fork Class(fork.py) The Fork class define a philosopher’s “fork”. In this assignment an instance of Fork contains a ‘threading.Lock()’ object. Recall from lecture that a Lock() object is a synchronization primitive that ensures a shared resource is only accessible by one object at a time. So, in order to make sure an instance of our “Fork” class can only be held by one philosopher at a time we’ve added a Lock() to it. To pick up a “Fork”, a philosopher must try to ‘acquire()’ it. If the “Fork” is already held by another philosopher who is currently eating the call to ‘acquire() will return False, otherwise it will return True and the “Fork” will be locked from other philosophers accessing it. You will implement the following Fork API: import threading class Fork: def __init__(self): # add a lock as an instance variable def acquire_fork(self): # return True if you can acquire self.lock, False otherwise def release_fork(self): # release lock Philosopher Class (philosopher.py) The Philosopher class represents a single philosopher. It is a descendant of the Python ‘threading.Thread’ class so it inherits all of the methods from ‘threading.Thread’. It also defines what it means for a philosopher to “think” and “eat”. You will implement the following API: import random import threading import time from fork import Fork class Philosopher(threading.Thread): running = True # initialize a Philosophers name, left fork, and right fork def __init__(self, name: str, left_fork: Fork, right_fork: Fork): # call ‘threading’ superclass constructor # initialize ‘name’ instance variable # initialize ‘left_fork’ instance variable # initialize ‘right_fork’ instance variable # run() is called by thread’s start() method; starts the thread running def run(self): while self.running: # call think() # call eat() # print is cleaning up. # make philosopher think for a random number of seconds until hungry def think(self): # ‘thinking’ = random number of seconds between 3 and 5 using # random.uniform() # print is thinking for ‘thinking’ seconds. # sleep for ‘thinking’ seconds # print is now hungry. # make philosopher eat for a random number of seconds until thinking again def eat(self): # try to acquire left fork # if successful, try to acquire right fork # if successful # ‘eating’ = random num of seconds between 3 and 5 using # random.uniform() # print is eating for ‘eating’ seconds. # sleep for ‘eating’ seconds # release right fork # print has put down his right fork. # release left fork # print has put down his left fork. # else: return Dining Philosophers Client (DiningPhilosophers.py) This Python script will serve as your main() method and will create your Philosopher’s and Fork’s as well as start the processing threads and shut them down. Your code should implement the following client: import time from fork import Fork from philosopher import Philosopher def DiningPhilosophers(): # create array of 5 names: Plato, Aristotle, Buddha, Marx, and Nietzsche # use a list comprehension to create 5 Fork’s # use a list comprehension to create 5 Philosopher’s and correctly # assign each pair of forks to each philosopher # start all 5 Philosopher threads (should be non-blocking) # sleep for 10 seconds # set ‘running’ to False # exit all threads if __name__ == “__main__”: DiningPhilosophers() Deliverables Please submit the following: 1. Your “Fork” source code in a file called fork.py 2. Your “Philosopher” source code in a file called philosopher.py 3. Your client code in a file called DiningPhilosophers.py 4. A PDF containing a screenshot containing your output (example below) The Dining Philosopher’s Problem There are 5 (silent) philosophers sitting around a circular dinner table, each with a plate of food in front of them and a fork in between each plate. To be able to eat a philosopher must pick up their left and right forks, if available. Each philosopher can be in one of 3 states: 1. Thinking: a philosopher is pondering and not currently interested in eating 2. Eating: a philosopher has acquired their left and right fork and is currently consuming food 3. Hungry: the philosopher is hungry but is waiting for one, or both, forks to become available Each philosopher spends an arbitrary part of their time either thinking or eating and two philosophers cannot communicate or know what the other is thinking. Once a philosopher is done eating they will place both forks back on the table making them available for use by other philosophers. You can assume there is an infinite amount of food on each plate and that each philosopher will eventually become hungry again once they’ve eaten. The problem is to design a concurrent algorithm so that no philosopher will starve (i.e. avoid a “deadlock” where one or more philosophers can never eat). A deadlock would occur, for example, if all 5 philosophers sat down and all picked up their right fork. All philosophers would be waiting for their left fork to become available which will never happen. So, we need to ensure a philosopher will never pick up only one fork if it is available; they will only pick up their pair of forks when they are hungry and both forks are available. Fork Class(fork.py) The Fork class define a philosopher’s “fork”. In this assignment an instance of Fork contains a ‘threading.Lock()’ object. Recall from lecture that a Lock() object is a synchronization primitive that ensures a shared resource is only accessible by one object at a time. So, in order to make sure an instance of our “Fork” class can only be held by one philosopher at a time we’ve added a Lock() to it. To pick up a “Fork”, a philosopher must try to ‘acquire()’ it. If the “Fork” is already held by another philosopher who is currently eating the call to ‘acquire() will return False, otherwise it will return True and the “Fork” will be locked from other philosophers accessing it. You will implement the following Fork API: import threading class Fork: def __init__(self): # add a lock as an instance variable def acquire_fork(self): # return True if you can acquire self.lock, False otherwise def release_fork(self): # release lock Philosopher Class (philosopher.py) The Philosopher class represents a single philosopher. It is a descendant of the Python ‘threading.Thread’ class so it inherits all of the methods from ‘threading.Thread’. It also defines what it means for a philosopher to “think” and “eat”. You will implement the following API: import random import threading import time from fork import Fork class Philosopher(threading.Thread): running = True # initialize a Philosophers name, left fork, and right fork def __init__(self, name: str, left_fork: Fork, right_fork: Fork): # call ‘threading’ superclass constructor # initialize ‘name’ instance variable # initialize ‘left_fork’ instance variable # initialize ‘right_fork’ instance variable # run() is called by thread’s start() method; starts the thread running def run(self): while self.running: # call think() # call eat() # print is cleaning up. # make philosopher think for a random number of seconds until hungry def think(self): # ‘thinking’ = random number of seconds between 3 and 5 using # random.uniform() # print is thinking for ‘thinking’ seconds. # sleep for ‘thinking’ seconds # print is now hungry. # make philosopher eat for a random number of seconds until thinking again def eat(self): # try to acquire left fork # if successful, try to acquire right fork # if successful # ‘eating’ = random num of seconds between 3 and 5 using # random.uniform() # print is eating for ‘eating’ seconds. # sleep for ‘eating’ seconds # release right fork # print has put down his right fork. # release left fork # print has put down his left fork. # else: return Dining Philosophers Client (DiningPhilosophers.py) This Python script will serve as your main() method and will create your Philosopher’s and Fork’s as well as start the processing threads and shut them down. Your code should implement the following client: import time from fork import Fork from philosopher import Philosopher def DiningPhilosophers(): # create array of 5 names: Plato, Aristotle, Buddha, Marx, and Nietzsche # use a list comprehension to create 5 Fork’s # use a list comprehension to create 5 Philosopher’s and correctly # assign each pair of forks to each philosopher # start all 5 Philosopher threads (should be non-blocking) # sleep for 10 seconds # set ‘running’ to False # exit all threads if __name__ == “__main__”: DiningPhilosophers() Deliverables Please submit the following: 1. Your “Fork” source code in a file called fork.py 2. Your “Philosopher” source code in a file called philosopher.py 3. Your client code in a file called DiningPhilosophers.py 4. A PDF containing a screenshot containing your output (example below)

NA GPI – Object oriented design project HW 2

 

Submit a DRAFT of

  1. STRUCTURAL DESIGN DIAGRAMS for the main Use-Cases in your project

 

  1. BEHAVIORAL DESIGN DIAGRAMS for the main Use-Cases in your project

 

 

masters in marketing

What does it mean to have a commitment to equity, diversity and inclusion? How do you intend to demonstrate your commitment to advancing EDI in our community as a future UBC Sauder student and alumnus?

Program:

  • MSc in marketing

https://www.sauder.ubc.ca/programs/masters-degrees/ubc-mm

PR for Business

For company Savage X Fenty provide an example of how public relations (PR) principles apply.

Write an 800-word APA-style paper in which you examine the following:

The multiple definitions of public relations

The connection between PR and the promotional aspect of the marketing mix (advertising, publicity, public relations)

How are they similar and how are they different?

How might PR be more important during a crisis situation for an organiza

Powered by WordPress