...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
...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
...The Parable Of The Pipeline Once upon a time long, long ago, two ambitious young cousins named Pablo and Bruno lived side by side in a small Italian village. The young men were best buddies, and big dreamers. They would talk endlessly about how someday, someway, they would become the richest men in the village. They were both bright and hard working. All they needed was an opportunity. One day that opportunity arrived. The village decided to hire two men to carry water from a nearby river to a cistern in the town square. The job went to Pablo and Bruno. Each man grabbed two buckets and headed to the river. By the end of the day, they had filled the town cistern to the brim. The village elder paid them one penny for each bucket of water. "This is our dream come true! "shouted Bruno. "I can't believe our good fortune." But Pablo wasn't so sure. His back ached and his hands were blistered from carrying the heavy buckets. He dreaded getting up and going to work the next morning. He vowed to think of a better way to get the water from the river to the village. Pablo The Pipeline Man: "Bruno, I have a plan," Pablo said the next morning as they grabbed their buckets and headed for the river. "Instead of lugging buckets back and forth for pennies a day, let's build a pipeline from the village to the river." Bruno stopped dead in his tracks. "A pipeline! Whoever heard of such a thing?" Bruno shouted. "We've got a great job, Pablo. I can carry 100 buckets a...
Words: 5801 - Pages: 24
...Essay: Taiwan Gas explosionBy: Leo Chen | 2014/09/09 | Three hours before the midnight of July 31, 2014, the Fire department of Kaohsiung city (The second largest city of Taiwan) received an emergency call to report a gas-leaking case. Five minutes later the fire trucks arrived, and found white smoke kept rising up from several drain ditch covers, strong and unpleasant odor filled the air, the Fire department judged as leaking of flammable gas; so they sealed several blocks, restrained surrounding traffic, and tried to dilute the gas by spreading water, and call for EPA’s (Environmental Protection Administration) emergent assistance in the meantime, to identify the substance to cool down the temperature with proper procedure…Unfortunately, a series of gas blasts started just before midnight, huge fireballs soaring in the air that the flams even flung a car to the roof of a 3-story building. The pipeline-blast tore trenches under several main roads as long as 6 kilo-meters, and the cratered streets swallowed cars and trucks… that killed 30 people and injured over 300, which left a trail of devastation in the city. After investigations, the explosions were caused by the leak of some 10 tones of propylene gas pipeline into the ground, that a petrochemical company transmit between 2 firms with underground pipeline through main streets of the city for over 30 years, which means those dense underground pipelines were installed even earlier than the area was developed or the residents...
Words: 621 - Pages: 3
...Recently Brooklyn District Attorney Ken Thompson informed that a Georgia person has been sent to ten years imprisonment for trafficking weapons from Georgia to Brooklyn up Interstate 95. Generally, it is known as the “Iron Pipeline”. He had five co-defendants. His nephew, Michael Quick was the ring's mastermind. Michael was convicted and sentenced too. Attorney Thompson said, "The defendant cohorts tried out to make some easy money by supplying with weapons of death and takes local lives at risk. They have now been brought to justice in Brooklyn. This kind of case picture is a warning to out-of-state firearm traffickers that we will continue to go against them and hold them under law; no matter where they are. " The Ag discovered the offender...
Words: 647 - 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