...Concurrency in C+ + 1 Assignment 1 These questions requires the use of C+ which means compiling the program with the u++ command, including +, uC++.h as the first include file in each translation unit, and replacing routine main with member uMain::main . 1. Write a semi-coroutine with the following public interface (you may only add a public destructor and private members): _Coroutine FloatConstant { public: enum status { MORE, GOOD, BAD }; // possible status private: status stat; // current status of match char ch; // character passed by cocaller void main(); // coroutine main public: status next( char c ) { ch = c; // communication in resume(); // activate return stat; // communication out } }; which verifies a string of characters corresponds to a C+ floating-point constant described by: + floating-constant : signÓÔØ fractional-constant exponent-part ÓÔØ floating-suffixÓÔØ signÓÔØ digit-sequence exponent-part floating-suffixÓÔØ fractional-constant : digit-sequenceÓÔØ “.” digit-sequence digit-sequence “.” “e” “E” signÓÔØ digit-sequence exponent-part : sign : “+” “-” digit-sequence : digit digit-sequence digit floating-suffix : “f” “l” “F” “L” digit : “0” “1” “2” “3” “4” “5” “6” “7” “8” “9” (Where XÓÔØ means X ¯ and ¯ means empty.) In addition, there is a maximum of 16 digits for the mantissa (non-exponent digits) and 3 digits for the characteristic (exponent digits). For example, the following are valid C/C+ floating-point constants: + 123.456 -.099 +555. 2.7E+1 -3.555E-12 After creation...
Words: 1986 - Pages: 8
...1. Inter-process Communication (IPC) Introduction Inter-Process Communication, which in short is known as IPC, deals mainly with the techniques and mechanisms that facilitate communication between processes. Now, why do we need special separate mechanisms or techniques for communicating between processes? Why isn't it possible to have information shared between two processes without using such special mechanisms? Let us start from something primitive. Imagine you have two glasses completely filled with water. One glass contains hot water and the other contains cold water. What can you do to make the temperature of water in both the glasses equal? The simplest answer will be to mix the water from both the glasses in a glass with much bigger capacity. Once water is mixed, the temperature becomes equal after some time. If one can remember, this will be framed as a problem with some numerical data in a High-School Physics examination. If we go by principles, then the phenomenon here is conduction. If we go by our topic of IPC, then we can say that since the two glasses were full, we had to use another glass with a larger capacity to mix the contents in order to balance their heat energy. We know that some medium or other is required for communication between different processes. Similarly, when it comes to computer programs, we need some mechanism or medium for communication. Primarily, processes can use the available memory to communicate with each other. But then, the memory...
Words: 2437 - Pages: 10
...------------------------------------------------- a spiritual gem With nearly two million copies sold around the world, this wonderful fable is becoming recognized for what it is—one of the truly great charmers of the late twentieth century. It's like a surprisingly cool sea breeze coming over the desert in the evening. The innocence and charm of this fable are comparable to Jonathan Livingston Seagull, but The Alchemistis more humorous, more spiritual, and wiser. This is the story of Santiago, a wanderlust shepherd boy in Spain, who decides to act upon a dream he has one night—of discovering a buried treasure at the Pyramids of Egypt. Santiago's journey is not easy, but his humility, faith, and simplicity are simply unshakable. In fact, he is so naïve (in the best way possible) that it does not seem to occur to him that he could be shaken. Reading it, I was reminded of something Søren Kierkegaard wrote regarding spiritual warfare: One thing there is which all Satan's cunning and all the snares of temptation cannot take by surprise, and that is simplicity. After Santiago has his dream, he is soon visited by Melchizedek, the mysterious King of Salem, who tells him that soon after someone embarks upon the path of their destiny, all the Universe conspires to help them, but only for a little while. Soon after embarking upon a trip to Africa, his money is gone and he must struggle, as almost all of us do, with precariously balancing his material needs against not losing sight...
Words: 617 - Pages: 3
...Guide to Linux+ (2nd Edition) ISBN 0-619-21621-2 End of Chapter Solutions Chapter 8 Solutions Review Questions 1. Because Standard Error and Standard Ouput represent the results of a command and Standard Input represents the input required for a command, only Standard Error and Standard Ouput can be redirected to/from a file. True or False? Answer: False 2. Before a user-defined variable can be used by processes that run in subshells, that variable must be __________. a. imported b. validated by running the env command c. exported d. redirected to the BASH shell Answer: c 3. The alias command can be used to make a shortcut to a single command. True or False? Answer: True 4. Which of the following files is always executed immediately after a user logs in to a Linux system and receives a BASH shell? a. /etc/profile b. ~/.bash_profile c. ~/.bash_login d. ~/.profile Answer: a 5. Which command could you use to see a list of all environment and user-defined shell variables as well as their current values? a. ls /var b. env c. set d. echo Answer: c 6. Every if construct begins with if and must be terminated with? a. end b. endif c. stop d. fi Answer: d 7. Which of the following will display the message welcome home if the cd /home/user1 command is successfully executed...
Words: 2616 - Pages: 11
...Conjoined by Judith Minty is a poem that represents a broken relationship or a broken marriage. Minty uses similes, metaphors, and analogies to describe the miserable union of two people and the inseparability of the marriage that these two people are in. Marriage; the poem’s subtitle sets the theme of the poem and it is only when one begins to read the poem that it becomes understood as an unhappy poem rather than that of joy and happiness. Minty uses words that with connotations that steer more to the negative side to describe the life of a married couple. Although she does not come right out and say what she means to say, the poem speaks for itself. Orson Scott Card once said, “Metaphors have a way of holding the most truth in the least space,” Minty’s poem completely supports this theory. Minty uses this poem to satirize and demean marriage by means of utilizing metaphors and imagery. The first example of her demeaning marriage is presented in the first stanza of the poem when she makes reference to the two onions that become joined. “Two joined under one transparent skin: each half-round then flat and deformed where it pressed and grew against each other” (L 2-4). When one thinks of marriage the first thing that comes to mind is oneness and unity, however, in this case it is the opposite. The two joined under one transparent skin refers to two people who have tied the knot and became one but rather than just coming together as a whole with no issues, they come together...
Words: 719 - Pages: 3
...The recent environmental campaign discussed in this report is Shell2Sea campaign which originates in the parish of Cill Chomáin, Erris, Co. Mayo, Ireland. This environmental campaign was established in opposition of the proposed construction of a natural gas pipeline through Cill Chomáin. It was also established in opposition of the construction of a natural gas refinery for the Corrib gas field by three companies (Royal Dutch Shell, Statoil and Vermilion Energy Trust) in Bellanaboy. There were many social and economic causes and effects of environmental degradation. Individuals who live along the course of the proposed pipeline argued that they were not adequately consulted about the construction and felt as if the decision was forced on them. Individuals believe the construction of the pipeline would disrupt the natural landscape and natural habitats of wildlife. There was much concern for marine biology due to the construction of the pipeline offshore leading to pollution and disruption of any species native to the area. The residents of Cill Chomáin showed much concern for the environment in relation to the processing of the gas which was planned to be processed on land rather than on an offshore location. The location of the processing facility on an area of land that was formerly forested caused controversy. This area is also located near a water supply which many believe is dangerous in relation to water pollution due to run-off of industrial chemicals and fumes. I...
Words: 493 - Pages: 2
...The Keystone XL Pipeline: It’s a Good Thing By: Samantha Prewitt The Keystone XL Pipeline: It’s a Good Thing The Keystone XL Pipeline Project is a proposed crude oil pipeline that begins in Hardisty, Alberta, Canada, crosses through an international border and ends in Steele City, Nebraska. From here it connects with existing pipelines, which will allow American oil producers more access to the large refining areas located in the Midwest and along the US Gulf Coast. It has been six years since TransCanada has applied for approval for this project and the project itself has gone through three revisions, including two reroutes of the pipeline itself. This article will attempt to dissect the benefits of the Keystone XL project and what it could mean to the American people if construction is approved. The implementation and construction of any project having to do with dangerous chemicals and oil is a frightening thought for any environmentally concerned person. These feeling are usually amplified when the construction site includes the Gulf Coast, being that the last spill is still wrecking havoc on our environment. But these feeling can all be set aside because according to Russ Girling, the president and CEO of TransCanada, “The environmental analysis of Keystone XL once again supports the science that this pipeline would have minimal impact on the environment” (Triplett, 2014). If and when President Obama grants the approval for construction, TransCanada is already...
Words: 823 - Pages: 4
...Nepal Biogas Plant -- Construction Manual Construction Manual for GGC 2047 Model Biogas Plant Biogas Support Programme (BSP) P.O. Box No.: 1966, Kathmandu, Nepal September, 1994 Sundar Bajgain Programme Manager Biogas Support Programme Tel. 5521742, 5534035 Email snvbsp@wlink.com.np Scanned by Biofuel Mailing List member Olivier Morf (with thanks) Introduction The success or failure of any biogas plant mainly depends upon the quality of construction works. To come to a successfully constructed biogas plant, the mason should not only respect the dimensions as indicated on the drawing but also follow the correct construction method. Hereunder, in a step-by-step fashion, the right construction method of the 2047 design GGC model biogas plant is given. 1. Different Sizes of Plant To become eligible to receive the investment subsidy provided by His Majesty's Government of Nepal under the Biogas Support Programme (BSP), only the 2047 design GGC model plants of 4, 6, 8, 10, 15 and 20 cubic meters capacity should be constructed. If the design and size of the plant other than mentioned above is chosen, the subsidy is not allowed. The table below gives some relevant data about these six different sizes of biogas plants. Table 1 S.N. Size of Plant Daily Fresh Dung (Kg) Daily Water Liters Approx. No. Cattle Required 1. 4 24 24 2 - 3 2. 6 36 36 3 – 4 3. 8 48 48 4 – 6 4. 10 60 60 6 – 9 5. 15 90 90 9 – 14 6. 20 120 120 14 and more * Plant size is the sum of digester...
Words: 4152 - Pages: 17
...Burma Pipelines Case Study OL 690 Helen Cowell Prof. Jan Wyatt August 16, 2012 Torture, forced displacement, land confiscation, genocide and arbitrary arrest are connected to the Shwe natural gas and oil project in Burma. What is the damage to the environment and the livelihood of the thousands of the displaced people? Are the people’s human rights being violated by being forced to give up their land? Are Chinese companies being unethical and prey-hunter businessmen? These are just a few of the questions being asked concerning the new pipelines being built. Natural gas and oil pipelines, which will start in Kyaukphyu, are being constructed to provide gas and oil to resource hungry China. The oil pipeline will be 479 miles long and will be able to discharge 240 thousand barrels of oil per day. The natural gas pipelines will extend even further to Guangxiin China, running a total of 1700 miles long. Burma relies on agriculture and exports of rice to keep their economy afloat. Climate changes, due to burning gas, will have huge impacts on global temperatures in Burma. Burma is a lowland delta region which is vulnerable to flooding. The project has led to the confiscation of thousands of acres of land across the area of Burma due to creating a “security corridor” adjacent to the pipeline, destroyed the livelihood of farmers due to land confiscation, bankrupted fisherman by devastating the marine ecosystem, due to underwater mining, and killing fish. Some farmers...
Words: 441 - Pages: 2
...Professional English Engineering Cambridge English for UNIT 1 CASE STUDY Capsule pipelines Capsule Pipelines – Essential Facts Capsule pipelines are underground pipes designed to transport hollow cylindrical containers (capsules). The function of the capsules is to transport things from A to B. Potential applications include carrying items such as mail (letters and parcels), minerals, for example coal, agricultural products, for example wheat, packaged products (in boxes or bags), and waste (household garbage or industrial waste). There are two main types of system: pneumatic capsule pipelines (PCPs) and hydraulic capsule pipelines (HCPs). In PCPs, the capsules are propelled by air, which is blown into the pipeline at one end and flows along it, driving the capsule forward. In order to limit friction between the outside of the capsule and the inside of the pipeline, capsules can be fitted with wheels (see the picture). In HCPs the pipeline is filled with water which is pumped along the pipeline. The capsules are watertight and are immersed in the water. They are driven along the pipeline by the flow of water. Small-diameter PCPs were popular in the second half of the 19th century and in the first half of the 20th century, for carrying documents – used mainly by government departments and postal authorities in large cities. Such systems were used in Berlin, Hamburg, London and Paris. A network in Prague is still in use today. A largediameter PCP was built...
Words: 1207 - Pages: 5
...interwoven in Punj Lloyd Group’s core practices and decision making. From providing education to many underprivileged children through its own school to enriching the lives of thousands of workers at its sites, Punj Lloyd is committed to the cause of community enrichment. HISTORY OF THE COMPANY:- 1988 The dawn of Punj Lloyd Engineering Private Limited 1989:- Renamed Punj Lloyd Private Limited 1992:- Becomes Public Limited and wins its first overseas pipeline contract in Indonesia 1993:- Gets its first Middle East Contract for Field Development 1995:- Gets its 1st EPC contract in Oil & Gas sector in India 1998:- Awarded a project for the construction of India’s first LNG and regasification terminal at Dabhol, India gets its first Refinery project, De-sulphurisation unit, IOCL’s Mathura Refinery 1999:- Gets its 1st Road project, Vadodara-Halol Tollway, India 2001 Gets its first highway project in the Golden Quadrilateral – Belgaum – Maharashtra road project 2002 Gains entry into the Caspian with KAM pipeline, Kazakshtan Gets its...
Words: 618 - Pages: 3
...After the recent veto of the Keystone XL Pipeline by President Obama, there have been heated debates with supporters and non-supporters of the Keystone XL pipeline. What is a way that the United States can receive more oil at a more efficient price? How can the United States provide many unemployed Americans with jobs? The Keystone XL Pipeline would provide all of these things in the United States, but what harmful influences would it have on our environment. In this paper, there will be information about both the helpful and harmful effects of the Keystone XL pipeline. This paper will include the ways that the Keystone pipeline will help the economy. The paper will also include ways that the Keystone Pipeline could possibly harm the people...
Words: 1483 - Pages: 6
...Journal of Universal Computer Science, vol. 13, no. 7 (2007), 959-969 submitted: 7/3/07, accepted: 25/7/07, appeared: 28/7/07 © J.UCS Pipeline-scheduling Simulator for Educational Purpose José M. Chaves-González (University of Extremadura, Spain jm@unex.es) Miguel A. Vega-Rodríguez (University of Extremadura, Spain mavega@unex.es) Juan A. Gómez-Pulido (University of Extremadura, Spain jangomez@unex.es) Juan M. Sánchez-Pérez (University of Extremadura, Spain sanperez@unex.es) Abstract: This paper presents a project that provides both, to professors and to students, a tool that is useful for studying, teaching and learning how pipelines work and how they can be scheduled in an easy and widespread way. The project is called PipeSim, and features static and dynamic pipelines with a very attractive, dynamic and intuitive interface. It is well known that pipeline and pipeline-scheduling are very relevant concepts in computer science studies and it is very important that students can learn these in an easy and reliable way. The simulator makes easy both working in depth about pipeline scheduling and working slowly paying attention in the different stages of the scheduling. However, we designed the simulator knowing that principal users would be students with no experience, so both the execution and the presentation of the results have been carefully developed. In addition to this, to check the success of PipeSim, a survey has been made among some students that used...
Words: 4080 - Pages: 17
...INTRODUCTION * SSGC is the largest integrated natural gas transmission and distribution companies in Pakistan * Serving the entire Southern region of the country, comprising the provinces of Sindh and Balochistan. * It has exclusive distribution and sale license in the provinces of Sindh and Balochistan. * Company’s core business is to buy natural gas in bulk from E&P (exploration & production) companies, transmit it to load centres over its high pressure transmission system, distribute and sell it to its customers through its supply network. * The Company is also involved in certain activities related to the gas business, including the manufacturing and sale of gas meters, and construction contracts for lying of pipelines....
Words: 3229 - Pages: 13
...and demand fluctuation, improved commodities markets), competition, natural disasters 2) Problem Analysis (this should be clear and to the point-a few sentences is all that is necessary): Their image is tarnished, so they are concentrating on rebuilding this. They started this process by changing their name from British Petroleum to simply BP (Beyond Petroleum-suggesting that they will focus their efforts on multiple energy sources). Why is their image tarnished? What led to this occurring? What measures have they taken to address this issue? 3) Develop strategic alternatives to solve the problem (BP has already addressed some of this, but there are flaws in some of the changes they have implemented) * reinvest money into pipeline maintenance and infrastructure (original) * have contingency plans (expand later) * Implement more effective ethics plans * Focus on hiring processes * Focus on training process to...
Words: 1521 - Pages: 7