I need basic website Programming Assignment Help

I need basic website Programming Assignment Help. I need basic website Programming Assignment Help.


(/0x4*br />

This project is open for any type of webpage you want to make. It must contain certain elements however. The webpage should include both JavaScript, PHP, and SQL.

Pleas Follow The Steps:

1-Use of CSS throughout all pages. CSS should be an external ?le and included in each ?le.

2-Use of proper style. This includes color pallets that are suitable for color-blind, 508 compliance, and easy navigation.

3-All pages should include some common components such as a navigation bar.

4-Your site should contain at least 10 pages, all of which are linked in some way to each other. At least 5 of the pages must make use of PHP in a non trivial fashion. 2 pages should make use of MYSQ.

5-Your site should include a form with at least 5 input ?elds, of at least 3 types (one must be plain text).

6-Every input box should be checked for valid input via JavaScript.

7-Data is being both stored and retrieved from the database.

I need basic website Programming Assignment Help[supanova_question]

Marcia’s various statuses to achieve identity, homework help Humanities Assignment Help

Choose one of the following options

This allows others to see your work. So please rate at least 2 other reports.

  1. Journal about how YOU resolved Marcia’s various statuses to achieve identity.
    1. We all went through a process of figuring out who we are, what we believe, what we will do with the rest of our life. Some people got stuck, diffused. Others went with what was expected of them, foreclosure (very difficult for trans kids who are simply NOT what they appear to be). Most go through a period of moratorium where they search, explore, consider, and finally learn what will work for them and commit to that—by then they have achieved identity.
    2. My story is now about 8 pages long and I fully expect to re-invent myself when I retire. You too do have a story, and it is a good thing to know about yourself.
  2. Report on an article related to this stage of development and relate 5 concepts from the chapter to the article.
    1. What to read students ask? I really would like YOU to do some critical thinking.
    2. Go to http://www.scholar.google.com and key in your life stage and sex or whatever age of interest—like your parents stage and sex. I just searched mid-life and sex and found 56,000 hits—focused on safe sex to see if there is anything new that I don’t know, just to be sure.
    3. Why do you need to know about sex at all ages? Because as soon as you get a college degree, everyone expects you to be an expert in everything, including sex.
    4. Too Risque? Search Development of job skills or Cognitive dissonance.
  3. Report on a video related to this stage of development and relate 5 concepts from the chapter to the article
    1. Students are telling me they use UTube videos to help them learn course concepts. Gotta be something out there of interest to you. Let me try it.
    2. I went to goodsearch.com and asked for “Safe Sex for Seniors” video since “the rate of STDs among sexually active senior citizens has risen over 70% in the last five years.” Immediately envisioned my grandparents—not happening!
    3. Why do you need to know about sex at all ages? Because as soon as you tell people you took a psychology course, they ask you a question about sex. And if we are lucky, we will get there soon enough—might as well be able to enjoy it.
    4. Too risqué? Search Joy DeGruy – Post Traumatic Slave Syndrome – YouTube (Links to an external site.)Links to an external site.
  4. Metacognition Challenge for the 21st Century: How do we use the relativistic thinking and postformal operational thinking possible for adults to understand everything possible and make smart decisions about life?
    1. Ready to start thinking about thinking at an adult level? Here is some help from Buster Benson at http://www.businessinsider.com/4-basic-problems-cause-all-the-cognitive-biases-that-screw-up-our-judgment-2017-3 (Links to an external site.)Links to an external site. :
    2. Writing Assignment: Read the following and think about how it might help you organize all the information in your course along with all the information in your experience that is related to the course in the light of what you will be doing with your life in the next 10 years. 250-1000 words. Use at least five key terms from the article in the link.
    3. Clarification of this assignment: The above is one assignment. Those are both related to the article and the textbook.Remember in the introduction I asked you to say what you would be doing in 10 years? You will have decisions to make between now and then to meet your goals–decisions about your life.This course hopefully has given you information about those options and opportunities. It has involved a lot of information–you may have noticed; how will you take advantage of it?Hopefully you have been using formal operational thinking for a few years now and maybe even postformal operational thinking, or you will be soon–it will involve less dichotomous thinking and more relativistic thinking. So I’m asking you to take stock. Given your 10 year goals and what you have just learned, how will you handle it and make the decisions that will get you to your goal? I hope this clarification helps you do this assignment. syb

NOTE:. To improve your thinking and writing, create your report in a word processor and use the spell and grammar checker and then proofread your paper before you submit under Assignments. Due April 23.

Submit your assignment in the box that opens when you click assignments or attach a file. All types of files were submitted in the previous unit and I could open them there. That way I have a space to put the grade right there and a place to comment on your work. But if you try twice and it doesn’t work, just email it to me as an attachment with your name and course on it.

[supanova_question]

Economic Impact of Hurricanes in the U.S, business and finance homework help Business Finance Assignment Help

there is fail attached is describing everything

completing my project under this proposal:

Hurricanes inflict billions of dollars in economic damages throughout the United States. The potential for long-term effects becomes evident in various cases throughout the United States history dealing with such damaging effects caused from hurricanes. Such economic tolls display storm surges throughout the Atlantic coast while wreaking a havoc of tourism and agriculture industries being hit the hardest (Smith III, T. J., 2009). These hurricanes damage a lot more properties from the flooding that is left behind. Coastline storms are of the greatest hurricane occurrences and thus, causes the most economic damages done to the surrounding and impacted economies (Smith III, T. J., 2009). Hurricanes are feared along the Atlantic coasts, such as surrounding areas of Florida, while Florida has been hit the hardest from the most damaging and recent hurricane occurrences.

Physical harm in family units, business premises, and open framework will cost the US monetary state up to $30 billion. A few structures have been pulverized and additionally streets, rails, and sewage and water frameworks. Control blackouts have additionally been far reaching in affected regions because of devastation of electrical cables (Sinigalliano, C. D., 2007). To decrease the tropical storm’s negative effect, Americans are encouraged to take preventive measures against physical harms. They should guarantee that they know their environment. For instance, they should distinguish close-by dams and levees that may represent a peril and move things to more secure spots. Individuals are likewise asked to know the rise level of their property with a specific end goal to keep things at danger of harm in safe spots (Sinigalliano, C. D., 2007).

For a considerable length of time financial analysts have talked about whether ruinous tempests are even terrible for a nation’s economy. To a non-financial expert, the evil impacts of a tempest may appear to be natural, however market analysts have a talent for finding conceivable irrational clarifications. With regards to a noteworthy cataclysmic event, they had four contending speculations: Such a debacle may forever set a nation back; it may briefly crash development just to get back on course not far off; it may prompt much more prominent development, as new venture pours into supplant demolished resources; or, perhaps, it may yet far and away superior, invigorating development as well as freeing the nation of whatever obsolete framework was keeping it down (Sinigalliano, C. D., 2007).

References

Smith III, T. J., Anderson, G. H., Balentine, K., Tiling, G., Ward, G. A., & Whelan, K. R. (2009). Cumulative impacts of hurricanes on Florida mangrove ecosystems: sediment deposition, storm surges and vegetation. Wetlands, 29(1), 24-34.

Sinigalliano, C. D., Gidley, M. L., Shibata, T., Whitman, D., Dixon, T. H., Laws, E., … & Gast, R. J. (2007). Impacts of Hurricanes Katrina and Rita on the microbial landscape of the New Orleans area. Proceedings of the National Academy of Sciences, 104(21), 9029-9034.

[supanova_question]

respond to the pics Humanities Assignment Help

For our purposes, Reading Responses are focused responses to the assigned reading. These responses are the most important means for practicing and developing your ability to read and think critically. You will generally write one response each week. These responses should be typed, double-spaced, and at least one page in length. These are like journal entries relating how students respond to their reading.

How did the reading make you think and feel? Of what did the reading remind you? How can you relate the reading to your other classes? Or your current life situations? Or history? Try to make these relatively informal but still academic. Do not give me summaries! Some of the response may quote excerpts of the reading, but keep the quotes short. And make sure to use proper formatting for quotes.

Good Luck!

[supanova_question]

Access Control Policy Other Assignment Help

Based on your team’s Week Four Learning Team Collaborative discussion, write the Access Control Policy section of the Information Security Policy. Include the following:

  • User enrollment
  • Identification
  • Authentication
  • Privileged and special account access
  • Remote access

Format according to APA guidelines. I fully expect that this and all assignments related to the creation of the Security Policy document will be fully researched with all references cited with proper APA formating. I fully expect to see a reference section with an indication that you researched the information for this section.

I will attach the first two assignments. They all need to flow together and be coherent. The company is Apple

[supanova_question]

[supanova_question]

Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help

It should be in C languge

Inter-Process Communication/Synchronization via Shared Memory
In homework #1, you learned how one process can create (a.k.a. “spawn” or “fork”) another process using the system service call fork( ). In homework #2, you learned how a thread can create another thread. As you saw in both homework #2 and again in homework #3, it’s easy to arrange for multiple threads within the same process to communicate via shared memory: All threads in a process share the same physical address space so any global variables are certainly accessible (common) to all the threads. Processes, however, normally share no memory with other processes so even a parent/child process pair whose address spaces are initially almost identical in content can’t communicate via common variables, since there aren’t any: The contents of the parent’s address space, obviously including all the variables in the stack, heap, and data sections, are initially copied into the child’s address space during the spawn (Unix does that; but Windows doesn’t), but even if so, after that initialization of the child’s space, those two physical address spaces are totally independent of one another; changes the child makes to its variables (including global variables in its data section) are not reflected in the parent’s address space nor vice versa. If we want processes to share access to some common memory as a means of interprocess communication, we have to make special arrangements, which is what you’ll do for this assignment: Use the system service calls shmget and shmat to obtain some new memory that will be accessible to multiple processes (and use shmdt and shmctl to clean up when you’re done). Here’s what I want your code to do:
1. The parent process (only process at the start, right?) should get some new memory which will be shared with a child process that it (the parent) will create later. No magic here: In CS125 or some other C programming course, you’ve used the system service call malloc to get new memory before. Now you just need to learn to use a more complicated set of system service calls to get new memory that can be shared between processes (malloc’d memory is on the heap, remember, so it can’t be shared between processes). All we need here is enough memory for an integer (later we’ll try something more complicated 😉

a. First use shmget to tell the OS to assign you a block of memory (to be shared among multiple processes) big enough to hold an integer; have your program print out the shared memory identifier it receives from shmget. Shared memory identifier? Just an arbitrary number that identifies some chunk of shared memory, much the way a process identifier identifies a process. A shared memory identifier is not a segment number or address. Why not? Well, for one thing, shared memory can be shared among processes running very different programs — in thisassignment, parent and child run the same code, but that need not be true in general, as you demonstrated in your program #1, when child #2 used an execv to load a new program. There’s no way to insure that separate processes could all use the same segment number for a shared memory segment— different processes may have a different number of segments in their logical address space; and if they’re not parent and child, as they will be for this assignment, they probably will have different numbers of segments in their respective segment tables when shmatcomes along and attaches a new one. Although a shared segment is indeed a segment, the shared memoryID, which must somehow be made common among all processes wanting to use this segment, is not a segment number in the MMU/address binding sense of the term; but different processes can use different segment numbers to bind/attach to the same physical address just by putting the same physical address in their (different) entries in their respective segment tables. The point of the shared memory identifier is to allow multiple processes to have a common name to use for shmat to refer to a region of memory that may be (generally will be) at different logical addresses in the different processes — hey guys, how about we all communicate via shared memory ID #37; shmat will tell each of us individually what address to use to get to this shared block of memory.

b. Next, use shmat to get the address for your process to use to refer to the shared memory (this step is known as “attaching” the shared memory to your process). shmat adds an entry to the calling process’s segment table, often/usually assigning a different segment number in each process, but makes the base physical address of the new segment the same in the segment tables of all processes attached to this shared memory. But the protection bits in each process’s segment table could be different if some processes were only to be allowed read access while others could write as well as read.

2. The parent process should set the new (shareable) integer to 0 and then spawn a child process (and make sure to do this in the correct order — first set the new, shared memory to 0, then spawn a child).

3. In the parent (after the spawn):

a. Ask the user for a (non-zero) value to store in the new integer.

b. Once that has been accomplished, the parent should spin on that integer until it becomes zero again.

c. After exiting from the spin, the parent should print a message saying that the shared integer is now 0 again (thus confirming successful two way communications withthe child via shared memory).

d. Detach the shared memory from the process’s address space using shmdt

e. Return the shared memory segment to the memory manager using shmctl (roughly analogous to the “free” function used to return malloc’d memory).

f. Print out an “all done” message.

4. In the child (after the spawn):

a. Print some sort of “I’m alive” message

b. Spin on the new integer until it becomes non-zero. Note: You caught a small break here; when a child process is spawned, it inherits any shared memory attachments of its parent; otherwise the child too would have to call shmat (as the parent did) before it could “see” the shared memory. How would the child know what shared memory segment identifier to attach to? In Unix/Linux, that variable would be “passed” to the child when the parent’s address space was copied over during the spawn; exactly the same way your child processes figured out which child they were in homework #1 (in Windows it would be more difficult). Anyway, because a child inherits its parent’s attachments (otherwise how could it’s logical address space be a copy of its parent’s?), it doesn’t need to do a shmat itself, provided of course, that the parent attached before spawning the child.

c. After exiting from the spin (because the parent eventually puts a user-supplied non-zero value in the shared integer), print out the value just received from its parent and then re-set the shared integer back to 0 (so the parent can eventually stop spinning and finish up).

d. That’s it for the child. You don’t need to detach the child from the shared memory (the OS does that when a process terminates, which the child will do when it runs out of code to execute after step 4c, above) and you certainly don’t want the child to destroy the shared memory segment since the parent may still need it to finish its printout. When the parent is done printing out the value the child re-zeroed, it (the parent) removes/destroys the (no longer shared) shared memory segment in step 3e, above — it better; shared memory segments are persistent, they are allowed to continue to exist after their creating process terminates (as a means, perhaps, of allowing interprocess communication from beyond the grave). The first few times I myself tried this sort of programming I eventually discovered that I had left some previously shared segments around from several years earlier. Now I clean up each year over Xmas break, just in case you folks don’t do your own cleanup properly (see Note D, below). Here (this homework) there’s no need to leave that shared memory segment lying around “orphaned” after the parent terminates; so we’ll have the parent return it (the previously shared segment) to the OS before it (the parent) terminates.
Here’s what a sample output of mine looks like (user input in orange);
Parent: Successfully created shared memory segment with shared memory ID # (not segment #) of 12714047 (This shared memory doesn’t get a true segment number until this process adds it to its segment table by attaching to it.)
Parent: My pid is 29355; now spawning a child after setting the shared integer to 0
Child: My pid is 29356, my parent’s pid is 29355; the shared integer value is currently 0; I’ll spin until it’s not 0
Parent: My pid is 29355, spawned a child with pid of 29356; please enter an integer to be stored in shared memory: 48
Child: The value in the shared integer is now 48; I’ll set it back to 0
Parent: the child has re-zeroed our shared integer
Child process terminating
Parent: Child terminated; parent successfully removed segment whose ID # was 12714047

Notes:
A. This is a simple program to write; this writeup is a lot longer than the actual code itself will be. The challenge here of course is learning to use the new (and to be fair, modestly complex) system service calls. But the overall code is short and straightforward. You are welcome (encouraged, in fact) to scour the web for examples of using shmget, shmat, shmdt, and shmctl to help you figure out how to use them. I think our textbook may have an example somewhere and I’m sure there are some on the web somewhere

1. Make sure any web example is for Linux; different OS’s can and do differ, even for things that are supposed to be standard. Note: shmget, shmat, shmdt, and shmctl are documented under “System Calls” in the Linux documentation

2. Often, web examples are are intended to show how all the parameters to these system service calls work. That usually makes them a fair bit more complicated than we need them to be for this simple problem. I’ll deduct a point or two here if you don’t sufficiently simplify your code. But better, as far as grading is concerned, that you copy (and get working!) an overly complicated example that you don’t fully understand than you don’t get anything to work at all. Note that that’s a leniency we can afford in an academic setting; it won’t carry over to industry. “Oh yeah, the 747 crashed ’cause I didn’t really understand the system service call I used – it worked when I tested it on my desktop, though.”

B. When perusing any examples you find, remember that identifiers in ALL_CAPS are just human-readable symbolic names (#defined in the .h files you include as per the Linux

Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help[supanova_question]

T Test Assignment Writing Assignment Help

See the Resources area for links to resources that you will use for this assignment:

  • You will complete this assignment using the DAA Template.
  • Read the SPSS Data Analysis Report Guidelines for a more complete understanding of the DAA Template and how to format and organize your assignment.
  • Refer to the IBM SPSS Step-By-Step Guide: t Tests for additional information on using SPSS for this assignment.
  • If necessary, review the Copy/Export Output Instructions to refresh your memory on how to perform these tasks. As with your previous assignments, your submission should be in narrative format with supporting statistical output (table and graphs) integrated into the narrative in the appropriate places (not all at the end of the document).

You will analyze the following variables in the grades.sav data set:

  • gender
  • gpa

Step 1: Write Section 1 of the DAA.

  • Provide the context of the grades.sav data set.
  • Include a definition of the specified variables (predictor, outcome) and corresponding scales of measurement.
  • Specify the sample size of the data set.

Step 2: Write Section 2 of the DAA.

  • Analyze the assumptions of the t test.
  • Paste the SPSS histogram output for gpa and discuss your visual interpretations.
  • Paste SPSS descriptives output showing skewness and kurtosis values for gpa and interpret them.
  • Paste SPSS output for the Shapiro-Wilk test of gpa and interpret it.
  • Report the results of the Levene test and interpret it.
  • Summarize whether or not the assumptions of the t test are met.

Step 3: Write Section 3 of the DAA.

  • Specify a research question related to gender and gpa.
  • Articulate the null hypothesis and alternative hypothesis.
  • Specify the alpha level.

Step 4: Write Section 4 of the DAA.

  • Paste the SPSS output of the t test.
  • Report the results of the SPSS output using proper APA guidelines (refer to the Unit 8 Introduction and the “Results” example from the Warner text in Chapter 5). Include the following:
    • t.
    • Degrees of freedom.
    • p value.
    • Effect size.
    • Interpretation of effect size.
    • Means and standard deviations for each group.
    • Mean difference.
    • 95% confidence interval of the difference of sample means.
  • Interpret the results against the null hypothesis.

Step 5: Write Section 5 of the DAA.

  • Discuss the implications of this t test as it relates to the research question.
  • Conclude with an analysis of the strengths and limitations of the t test.

Submit your DAA Template as an attached Word document in the assignment area

[supanova_question]

criminal critical Writing Assignment Help

Using Microsoft PowerPoint, create a timeline, beginning in the 1960s, to demonstrate the specific changes that led to today’s paradigm of local policing. The timeline should include the following:

  • A description of the significant changes that occurred in local policing strategy, including the years in which these developments took place.
  • A description of crime conditions that led to such changes.
  • An explanation of other factors that increased the perceived need for those changes in law enforcement strategy. For instance, the cultural workforce, technology, social issues, etc.
  • An analysis of how the present state of police and law enforcement will impact the future of law enforcement. In what ways do you think community policing can be made more effective?
  • What other changes are required in law enforcement to prevent and reduce crime?
  • In what ways do you predict policing will change in the near future? Support your prediction.

[supanova_question]

Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model Humanities Assignment Help

Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model. Think about the “Big Five” personality traits we studied in class. Then select a real or fictional character from literature, film, television, or public life. How could the “Big Five” model be used to understand the character’s personality?

In a multi-paragraph essay, explain what is meant by a “personality trait” according to the “Big Five” model, define each of the “Big Five” traits, and describe the character’s personality using the “Big Five” traits. For each trait, be sure to provide evidence from the character’s thoughts, emotions, and behavior. Include details from class materials, readings, and research on personality to support your discussion.

[supanova_question]

Mutex Locks or Semaphores in Shared Memory Programming Assignment Help

Mutex Locks or Semaphores in Shared Memory
Last one of the semester. Let’s combine what we did in program #4 and program #5 and show, and then prevent, a race condition between processes rather than threads. Start with your code from program #5 but instead of simply putting an integer in shared memory, use a structure like the one that you used in program #4 to represent a 2-dimensional Cartesian point having two integer coordinates called x and y. Instead of communicating between parent and child by simply updating the integer with a user supplied value (as you did in program #5), update the racePoint coordinates as we did in program #4 (no user interaction necessary), which will create critical sections and then,as in program #4, use a stupidly placed sleep(1) call to simulate a random preemption causing a genuine race condition. Here, of course, we’ll have a race condition between two processes (over a shared resource in shared memory) rather than between two threads of the same process. Finally, just as in program #4, add entry and exit sections with a synchronization mechanism (semaphore, binary semaphore or mutex lock, whatever worked for you previously) to protect your critical sections and prevent the race condition.
Couple of notes:
A. Since both the parent and the child process obviously (I sure hope it’s obvious by now) need to use the same semaphore or mutex lock, it too will have to be in shared memory, no? Now I suppose you could just create a second shared memory segment for that; but that seems to me pretty inefficient. Instead, since a structure in C can contain other structures, why not put both the racePoint and the semaphore/mutex that will protect it inside a single structure and then create the shared memory to hold the “outer” structure containing the two “inner” structures your processes need to share access to; that way you don’t need an extra shmget, shmat, etc.
B. Remember that semaphores, mutex locks, and such like have to be initialized before they can be used. In program #4, where the semaphore or mutex lock was simply declared as a global variable, that initialization could be done in the declaration itself and many of you did. I myself, for example, used the following line to declare and initialize a POSIX mutex lock named demoLock:
pthread_mutex_t demoLock = PTHREAD_MUTEX_INITIALIZER;
where PTHREAD_MUTEX_INITIALIZER is #defined in one of the header files as as a set of the appropriate constants inside squiggly brackets, e.g., { …, …} That wouldn’t work here, since the the memory for the synchronization structure is being obtained dynamically (via the shmget) rather than by a simple compile-time declaration, as in my example just above. So here in this program, you’ll need to use some additional system service calls from the pthread library to initialize your mutex lock correctly.
Conceptually there’s not much new here. Aside from the half a dozen extra lines or so to get the mutx lock initialized properly, there’s not much new code to be written; you’re just mixing and matching stuff from programs #4 and #5 with a couple of fairly minor changes. But the changes involve handling pointers to components of structures inside dynamically allocated structures, which requires careful coding, so I think this program, as do most interesting programs, really begs for “build-a-little, test-a-little”. You’re obviously not required to proceed via the same sequence of stepwise refinements that I used (from the requirements engineering standpoint, that’s not a testable requirement 😉 but here’s roughly how I did it (compiling and executing after each step):
1. Start from program #5 (the process program, not the thread one) but change the integer in shared memory to the racePoint structure from program #4 and do the spinning/communicating on just the x component, ignoring the y component completely here in the beginning (we’ll use it later though). This step just ensures our code can create and properly access a dynamically allocated C structure (not just an integer) located in shared memory.

a. In program #4, the structure, racePoint, was simply a global variable of an anonymous structured type:
struct { int x, y; } racePoint={0,0};
Here, of course, it has to be placed in shared memory so you’ll need to give the structure definition a name, vis struct point { int x, y; }; so that you can refer to sizeof(struct point) when requesting your shared memory from shmget.

b. Note that I removed the variable declaration for racePoint. Here, we don’t want to allocate storage for racePoint when we define struct point; we just want to define the struct point data type so that storage for the one we need can be dynamically allocated later, during execution, with a shmget call. If you also declare a variable at this point in your code (the compiler wouldn’t care, now would it?), you might easily get confused later and refer to it (the totally unnecessary local variable) rather than the dynamically created one in shared memory, with the result that you’ll manipulate the wrong variable and your code won’t work as intended.

2. After attaching to the shared memory as we did in program #5, set both the x and y coordinates of the shared point to 0 Note that we’ll have to refer to the coordinates by pointer rather than by the name of the structure; e.g., racePointPtr->x, rather than racePoint.x, where racePointPtr contains the address we get when we do the shmat.

3. fork() a child process.

a. In the code executed by the parent process after the fork():
i. Take out the code from program #4 that requests user input and then spins until the child resets the integer.

ii. Replace it with the code for a critical section by copying the 3 lines from the critical section of the main thread of program #4 (suitably modified, as per item #2, above):

1. First, set the x coordinate to 1.

2. Then make a call to sleep(1) to simulate random preemption of the process.

3. Then set the y coordinate to 1 (modifying the copied code to refer to both x and y by pointer).

iii. Last thing in the parent code (after the critical section), print out the values of x and y so we can see if we got the race condition.

b. In the child code, insert a line that spins while the x coordinate is 0 — so the child doesn’t try to enter its critical section too soon, before the parent process even executes after the fork (At this point, we’re trying to force a race condition and if the child gets completely through its critical sectrion before the parent even enters its, we won’t get one.) Next (still in the child code) put in the two line critical section that sets the x and y coordinates to 2.

At this point, when you compile and execute your code you should see the simulated race condition: x will end up 2 while y will be 1.

4. Put the definition of the race point structure inside an outer structure of some sort, called something stunningly original like sharedData or whatever name your sense of programming style deems appropriate:
struct sharedData
{
struct point
{
int x, y;
} racePoint;
};
This outer structure is where, in the next step, we’ll also place the mutex mechanism we’ll need, but for now (build-a-little, test-a-little) just make the necessary modifications to show that your code can still access x and y properly now that they’re inside an inner structure that’s inside an outer structure — and remember to alter your shmget to request enough storage for the outer structure, e.g., sizeof(struct sharedData), or whatever you name your outer structure

 Helpful hint: If you saved the address returned by the shmat in a variable named, say, sharedMemoryPtr, you’d now need to refer to the x coordinate as (sharedMemoryPtr->racePoint).x sharedMemoryPtr points to the outer structure; sharedMemoryPtr->racePoint designates the component of the outer structure named racePoint, which is itself a structure. So (sharedMemoryPtr->racePoint).x refers to the x component of the inner structure.

 Irrelevant aside on programming style: (sharedMemoryPtr->racePoint).x can be written without the parentheses as sharedMemoryPtr->racePoint.x and the compiler will do the right thing, but I think that’s poor style. It forces you or your readers to think explicitly about the precedence or association order of the operators involved. Better to use parentheses and make your intentions clear.

 Note that I had to put the name racePoint back in when I defined struct point, but here it’s not the name of a variable being declared (as it was in program #4) but the name of a structured component in the definition of the structured sharedData type. Components or fields have to have names, no?

Anyway, compile and execute again; you should still see the race condition. Save this version of code somewhere; it’s one of two versions you’ll turn in for this assignment.

5. Now put your definition of your synchronization structure inside the definition of the outer structure and add your call to initialize it somewhere before the fork(). I found it helpful to save and check the value returned by the initialization call (see my examples on using perror or strerror) since it’s all too easy at this point to write code that the compiler accepts but still have the OS nonetheless reject the system service call since it didn’t like the address you sent it. You can waste a lot of time trying to figure out why your program doesn’t work if you assume that just because the compiler buys off on the data types you use as arguments to system service calls and your program executes without blowing up that therefore the OS is actually doing what you are asking it to. That’s why system service calls return success/failure values and what perror is for. Compile and execute again to make sure you haven’t screwed anything up; although you still won’t have fixed the race condition yet.

 Programming hint: While it’s never a good idea to ignore warnings from the compiler (as opposed to errors, which, of course, can’t be ignored), when working with complex pointer accesses it is particularly vital to not ignore warnings. If the compiler thinks you’re pointing to the wrong type of thing, even though that’s only a warning, not an error, it is very unlikely that your system service calls will work correctly even though they may not notice an error. When you tell a system service call to initialize something, for example, all it knows is the address of the

[supanova_question]

https://anyessayhelp.com/ :

  • Writing Assignment: Read the following and think about how it might help you organize all the information in your course along with all the information in your experience that is related to the course in the light of what you will be doing with your life in the next 10 years. 250-1000 words. Use at least five key terms from the article in the link.
  • Clarification of this assignment: The above is one assignment. Those are both related to the article and the textbook.Remember in the introduction I asked you to say what you would be doing in 10 years? You will have decisions to make between now and then to meet your goals–decisions about your life.This course hopefully has given you information about those options and opportunities. It has involved a lot of information–you may have noticed; how will you take advantage of it?Hopefully you have been using formal operational thinking for a few years now and maybe even postformal operational thinking, or you will be soon–it will involve less dichotomous thinking and more relativistic thinking. So I’m asking you to take stock. Given your 10 year goals and what you have just learned, how will you handle it and make the decisions that will get you to your goal? I hope this clarification helps you do this assignment. syb
  • NOTE:. To improve your thinking and writing, create your report in a word processor and use the spell and grammar checker and then proofread your paper before you submit under Assignments. Due April 23.

    Submit your assignment in the box that opens when you click assignments or attach a file. All types of files were submitted in the previous unit and I could open them there. That way I have a space to put the grade right there and a place to comment on your work. But if you try twice and it doesn’t work, just email it to me as an attachment with your name and course on it.

    [supanova_question]

    Economic Impact of Hurricanes in the U.S, business and finance homework help Business Finance Assignment Help

    there is fail attached is describing everything

    completing my project under this proposal:

    Hurricanes inflict billions of dollars in economic damages throughout the United States. The potential for long-term effects becomes evident in various cases throughout the United States history dealing with such damaging effects caused from hurricanes. Such economic tolls display storm surges throughout the Atlantic coast while wreaking a havoc of tourism and agriculture industries being hit the hardest (Smith III, T. J., 2009). These hurricanes damage a lot more properties from the flooding that is left behind. Coastline storms are of the greatest hurricane occurrences and thus, causes the most economic damages done to the surrounding and impacted economies (Smith III, T. J., 2009). Hurricanes are feared along the Atlantic coasts, such as surrounding areas of Florida, while Florida has been hit the hardest from the most damaging and recent hurricane occurrences.

    Physical harm in family units, business premises, and open framework will cost the US monetary state up to $30 billion. A few structures have been pulverized and additionally streets, rails, and sewage and water frameworks. Control blackouts have additionally been far reaching in affected regions because of devastation of electrical cables (Sinigalliano, C. D., 2007). To decrease the tropical storm’s negative effect, Americans are encouraged to take preventive measures against physical harms. They should guarantee that they know their environment. For instance, they should distinguish close-by dams and levees that may represent a peril and move things to more secure spots. Individuals are likewise asked to know the rise level of their property with a specific end goal to keep things at danger of harm in safe spots (Sinigalliano, C. D., 2007).

    For a considerable length of time financial analysts have talked about whether ruinous tempests are even terrible for a nation’s economy. To a non-financial expert, the evil impacts of a tempest may appear to be natural, however market analysts have a talent for finding conceivable irrational clarifications. With regards to a noteworthy cataclysmic event, they had four contending speculations: Such a debacle may forever set a nation back; it may briefly crash development just to get back on course not far off; it may prompt much more prominent development, as new venture pours into supplant demolished resources; or, perhaps, it may yet far and away superior, invigorating development as well as freeing the nation of whatever obsolete framework was keeping it down (Sinigalliano, C. D., 2007).

    References

    Smith III, T. J., Anderson, G. H., Balentine, K., Tiling, G., Ward, G. A., & Whelan, K. R. (2009). Cumulative impacts of hurricanes on Florida mangrove ecosystems: sediment deposition, storm surges and vegetation. Wetlands, 29(1), 24-34.

    Sinigalliano, C. D., Gidley, M. L., Shibata, T., Whitman, D., Dixon, T. H., Laws, E., … & Gast, R. J. (2007). Impacts of Hurricanes Katrina and Rita on the microbial landscape of the New Orleans area. Proceedings of the National Academy of Sciences, 104(21), 9029-9034.

    [supanova_question]

    respond to the pics Humanities Assignment Help

    For our purposes, Reading Responses are focused responses to the assigned reading. These responses are the most important means for practicing and developing your ability to read and think critically. You will generally write one response each week. These responses should be typed, double-spaced, and at least one page in length. These are like journal entries relating how students respond to their reading.

    How did the reading make you think and feel? Of what did the reading remind you? How can you relate the reading to your other classes? Or your current life situations? Or history? Try to make these relatively informal but still academic. Do not give me summaries! Some of the response may quote excerpts of the reading, but keep the quotes short. And make sure to use proper formatting for quotes.

    Good Luck!

    [supanova_question]

    Access Control Policy Other Assignment Help

    Based on your team’s Week Four Learning Team Collaborative discussion, write the Access Control Policy section of the Information Security Policy. Include the following:

    • User enrollment
    • Identification
    • Authentication
    • Privileged and special account access
    • Remote access

    Format according to APA guidelines. I fully expect that this and all assignments related to the creation of the Security Policy document will be fully researched with all references cited with proper APA formating. I fully expect to see a reference section with an indication that you researched the information for this section.

    I will attach the first two assignments. They all need to flow together and be coherent. The company is Apple

    [supanova_question]

    [supanova_question]

    Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help

    It should be in C languge

    Inter-Process Communication/Synchronization via Shared Memory
    In homework #1, you learned how one process can create (a.k.a. “spawn” or “fork”) another process using the system service call fork( ). In homework #2, you learned how a thread can create another thread. As you saw in both homework #2 and again in homework #3, it’s easy to arrange for multiple threads within the same process to communicate via shared memory: All threads in a process share the same physical address space so any global variables are certainly accessible (common) to all the threads. Processes, however, normally share no memory with other processes so even a parent/child process pair whose address spaces are initially almost identical in content can’t communicate via common variables, since there aren’t any: The contents of the parent’s address space, obviously including all the variables in the stack, heap, and data sections, are initially copied into the child’s address space during the spawn (Unix does that; but Windows doesn’t), but even if so, after that initialization of the child’s space, those two physical address spaces are totally independent of one another; changes the child makes to its variables (including global variables in its data section) are not reflected in the parent’s address space nor vice versa. If we want processes to share access to some common memory as a means of interprocess communication, we have to make special arrangements, which is what you’ll do for this assignment: Use the system service calls shmget and shmat to obtain some new memory that will be accessible to multiple processes (and use shmdt and shmctl to clean up when you’re done). Here’s what I want your code to do:
    1. The parent process (only process at the start, right?) should get some new memory which will be shared with a child process that it (the parent) will create later. No magic here: In CS125 or some other C programming course, you’ve used the system service call malloc to get new memory before. Now you just need to learn to use a more complicated set of system service calls to get new memory that can be shared between processes (malloc’d memory is on the heap, remember, so it can’t be shared between processes). All we need here is enough memory for an integer (later we’ll try something more complicated 😉

    a. First use shmget to tell the OS to assign you a block of memory (to be shared among multiple processes) big enough to hold an integer; have your program print out the shared memory identifier it receives from shmget. Shared memory identifier? Just an arbitrary number that identifies some chunk of shared memory, much the way a process identifier identifies a process. A shared memory identifier is not a segment number or address. Why not? Well, for one thing, shared memory can be shared among processes running very different programs — in thisassignment, parent and child run the same code, but that need not be true in general, as you demonstrated in your program #1, when child #2 used an execv to load a new program. There’s no way to insure that separate processes could all use the same segment number for a shared memory segment— different processes may have a different number of segments in their logical address space; and if they’re not parent and child, as they will be for this assignment, they probably will have different numbers of segments in their respective segment tables when shmatcomes along and attaches a new one. Although a shared segment is indeed a segment, the shared memoryID, which must somehow be made common among all processes wanting to use this segment, is not a segment number in the MMU/address binding sense of the term; but different processes can use different segment numbers to bind/attach to the same physical address just by putting the same physical address in their (different) entries in their respective segment tables. The point of the shared memory identifier is to allow multiple processes to have a common name to use for shmat to refer to a region of memory that may be (generally will be) at different logical addresses in the different processes — hey guys, how about we all communicate via shared memory ID #37; shmat will tell each of us individually what address to use to get to this shared block of memory.

    b. Next, use shmat to get the address for your process to use to refer to the shared memory (this step is known as “attaching” the shared memory to your process). shmat adds an entry to the calling process’s segment table, often/usually assigning a different segment number in each process, but makes the base physical address of the new segment the same in the segment tables of all processes attached to this shared memory. But the protection bits in each process’s segment table could be different if some processes were only to be allowed read access while others could write as well as read.

    2. The parent process should set the new (shareable) integer to 0 and then spawn a child process (and make sure to do this in the correct order — first set the new, shared memory to 0, then spawn a child).

    3. In the parent (after the spawn):

    a. Ask the user for a (non-zero) value to store in the new integer.

    b. Once that has been accomplished, the parent should spin on that integer until it becomes zero again.

    c. After exiting from the spin, the parent should print a message saying that the shared integer is now 0 again (thus confirming successful two way communications withthe child via shared memory).

    d. Detach the shared memory from the process’s address space using shmdt

    e. Return the shared memory segment to the memory manager using shmctl (roughly analogous to the “free” function used to return malloc’d memory).

    f. Print out an “all done” message.

    4. In the child (after the spawn):

    a. Print some sort of “I’m alive” message

    b. Spin on the new integer until it becomes non-zero. Note: You caught a small break here; when a child process is spawned, it inherits any shared memory attachments of its parent; otherwise the child too would have to call shmat (as the parent did) before it could “see” the shared memory. How would the child know what shared memory segment identifier to attach to? In Unix/Linux, that variable would be “passed” to the child when the parent’s address space was copied over during the spawn; exactly the same way your child processes figured out which child they were in homework #1 (in Windows it would be more difficult). Anyway, because a child inherits its parent’s attachments (otherwise how could it’s logical address space be a copy of its parent’s?), it doesn’t need to do a shmat itself, provided of course, that the parent attached before spawning the child.

    c. After exiting from the spin (because the parent eventually puts a user-supplied non-zero value in the shared integer), print out the value just received from its parent and then re-set the shared integer back to 0 (so the parent can eventually stop spinning and finish up).

    d. That’s it for the child. You don’t need to detach the child from the shared memory (the OS does that when a process terminates, which the child will do when it runs out of code to execute after step 4c, above) and you certainly don’t want the child to destroy the shared memory segment since the parent may still need it to finish its printout. When the parent is done printing out the value the child re-zeroed, it (the parent) removes/destroys the (no longer shared) shared memory segment in step 3e, above — it better; shared memory segments are persistent, they are allowed to continue to exist after their creating process terminates (as a means, perhaps, of allowing interprocess communication from beyond the grave). The first few times I myself tried this sort of programming I eventually discovered that I had left some previously shared segments around from several years earlier. Now I clean up each year over Xmas break, just in case you folks don’t do your own cleanup properly (see Note D, below). Here (this homework) there’s no need to leave that shared memory segment lying around “orphaned” after the parent terminates; so we’ll have the parent return it (the previously shared segment) to the OS before it (the parent) terminates.
    Here’s what a sample output of mine looks like (user input in orange);
    Parent: Successfully created shared memory segment with shared memory ID # (not segment #) of 12714047 (This shared memory doesn’t get a true segment number until this process adds it to its segment table by attaching to it.)
    Parent: My pid is 29355; now spawning a child after setting the shared integer to 0
    Child: My pid is 29356, my parent’s pid is 29355; the shared integer value is currently 0; I’ll spin until it’s not 0
    Parent: My pid is 29355, spawned a child with pid of 29356; please enter an integer to be stored in shared memory: 48
    Child: The value in the shared integer is now 48; I’ll set it back to 0
    Parent: the child has re-zeroed our shared integer
    Child process terminating
    Parent: Child terminated; parent successfully removed segment whose ID # was 12714047

    Notes:
    A. This is a simple program to write; this writeup is a lot longer than the actual code itself will be. The challenge here of course is learning to use the new (and to be fair, modestly complex) system service calls. But the overall code is short and straightforward. You are welcome (encouraged, in fact) to scour the web for examples of using shmget, shmat, shmdt, and shmctl to help you figure out how to use them. I think our textbook may have an example somewhere and I’m sure there are some on the web somewhere

    1. Make sure any web example is for Linux; different OS’s can and do differ, even for things that are supposed to be standard. Note: shmget, shmat, shmdt, and shmctl are documented under “System Calls” in the Linux documentation

    2. Often, web examples are are intended to show how all the parameters to these system service calls work. That usually makes them a fair bit more complicated than we need them to be for this simple problem. I’ll deduct a point or two here if you don’t sufficiently simplify your code. But better, as far as grading is concerned, that you copy (and get working!) an overly complicated example that you don’t fully understand than you don’t get anything to work at all. Note that that’s a leniency we can afford in an academic setting; it won’t carry over to industry. “Oh yeah, the 747 crashed ’cause I didn’t really understand the system service call I used – it worked when I tested it on my desktop, though.”

    B. When perusing any examples you find, remember that identifiers in ALL_CAPS are just human-readable symbolic names (#defined in the .h files you include as per the Linux

    Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help[supanova_question]

    T Test Assignment Writing Assignment Help

    See the Resources area for links to resources that you will use for this assignment:

    • You will complete this assignment using the DAA Template.
    • Read the SPSS Data Analysis Report Guidelines for a more complete understanding of the DAA Template and how to format and organize your assignment.
    • Refer to the IBM SPSS Step-By-Step Guide: t Tests for additional information on using SPSS for this assignment.
    • If necessary, review the Copy/Export Output Instructions to refresh your memory on how to perform these tasks. As with your previous assignments, your submission should be in narrative format with supporting statistical output (table and graphs) integrated into the narrative in the appropriate places (not all at the end of the document).

    You will analyze the following variables in the grades.sav data set:

    • gender
    • gpa

    Step 1: Write Section 1 of the DAA.

    • Provide the context of the grades.sav data set.
    • Include a definition of the specified variables (predictor, outcome) and corresponding scales of measurement.
    • Specify the sample size of the data set.

    Step 2: Write Section 2 of the DAA.

    • Analyze the assumptions of the t test.
    • Paste the SPSS histogram output for gpa and discuss your visual interpretations.
    • Paste SPSS descriptives output showing skewness and kurtosis values for gpa and interpret them.
    • Paste SPSS output for the Shapiro-Wilk test of gpa and interpret it.
    • Report the results of the Levene test and interpret it.
    • Summarize whether or not the assumptions of the t test are met.

    Step 3: Write Section 3 of the DAA.

    • Specify a research question related to gender and gpa.
    • Articulate the null hypothesis and alternative hypothesis.
    • Specify the alpha level.

    Step 4: Write Section 4 of the DAA.

    • Paste the SPSS output of the t test.
    • Report the results of the SPSS output using proper APA guidelines (refer to the Unit 8 Introduction and the “Results” example from the Warner text in Chapter 5). Include the following:
      • t.
      • Degrees of freedom.
      • p value.
      • Effect size.
      • Interpretation of effect size.
      • Means and standard deviations for each group.
      • Mean difference.
      • 95% confidence interval of the difference of sample means.
    • Interpret the results against the null hypothesis.

    Step 5: Write Section 5 of the DAA.

    • Discuss the implications of this t test as it relates to the research question.
    • Conclude with an analysis of the strengths and limitations of the t test.

    Submit your DAA Template as an attached Word document in the assignment area

    [supanova_question]

    criminal critical Writing Assignment Help

    Using Microsoft PowerPoint, create a timeline, beginning in the 1960s, to demonstrate the specific changes that led to today’s paradigm of local policing. The timeline should include the following:

    • A description of the significant changes that occurred in local policing strategy, including the years in which these developments took place.
    • A description of crime conditions that led to such changes.
    • An explanation of other factors that increased the perceived need for those changes in law enforcement strategy. For instance, the cultural workforce, technology, social issues, etc.
    • An analysis of how the present state of police and law enforcement will impact the future of law enforcement. In what ways do you think community policing can be made more effective?
    • What other changes are required in law enforcement to prevent and reduce crime?
    • In what ways do you predict policing will change in the near future? Support your prediction.

    [supanova_question]

    Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model Humanities Assignment Help

    Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model. Think about the “Big Five” personality traits we studied in class. Then select a real or fictional character from literature, film, television, or public life. How could the “Big Five” model be used to understand the character’s personality?

    In a multi-paragraph essay, explain what is meant by a “personality trait” according to the “Big Five” model, define each of the “Big Five” traits, and describe the character’s personality using the “Big Five” traits. For each trait, be sure to provide evidence from the character’s thoughts, emotions, and behavior. Include details from class materials, readings, and research on personality to support your discussion.

    [supanova_question]

    Mutex Locks or Semaphores in Shared Memory Programming Assignment Help

    Mutex Locks or Semaphores in Shared Memory
    Last one of the semester. Let’s combine what we did in program #4 and program #5 and show, and then prevent, a race condition between processes rather than threads. Start with your code from program #5 but instead of simply putting an integer in shared memory, use a structure like the one that you used in program #4 to represent a 2-dimensional Cartesian point having two integer coordinates called x and y. Instead of communicating between parent and child by simply updating the integer with a user supplied value (as you did in program #5), update the racePoint coordinates as we did in program #4 (no user interaction necessary), which will create critical sections and then,as in program #4, use a stupidly placed sleep(1) call to simulate a random preemption causing a genuine race condition. Here, of course, we’ll have a race condition between two processes (over a shared resource in shared memory) rather than between two threads of the same process. Finally, just as in program #4, add entry and exit sections with a synchronization mechanism (semaphore, binary semaphore or mutex lock, whatever worked for you previously) to protect your critical sections and prevent the race condition.
    Couple of notes:
    A. Since both the parent and the child process obviously (I sure hope it’s obvious by now) need to use the same semaphore or mutex lock, it too will have to be in shared memory, no? Now I suppose you could just create a second shared memory segment for that; but that seems to me pretty inefficient. Instead, since a structure in C can contain other structures, why not put both the racePoint and the semaphore/mutex that will protect it inside a single structure and then create the shared memory to hold the “outer” structure containing the two “inner” structures your processes need to share access to; that way you don’t need an extra shmget, shmat, etc.
    B. Remember that semaphores, mutex locks, and such like have to be initialized before they can be used. In program #4, where the semaphore or mutex lock was simply declared as a global variable, that initialization could be done in the declaration itself and many of you did. I myself, for example, used the following line to declare and initialize a POSIX mutex lock named demoLock:
    pthread_mutex_t demoLock = PTHREAD_MUTEX_INITIALIZER;
    where PTHREAD_MUTEX_INITIALIZER is #defined in one of the header files as as a set of the appropriate constants inside squiggly brackets, e.g., { …, …} That wouldn’t work here, since the the memory for the synchronization structure is being obtained dynamically (via the shmget) rather than by a simple compile-time declaration, as in my example just above. So here in this program, you’ll need to use some additional system service calls from the pthread library to initialize your mutex lock correctly.
    Conceptually there’s not much new here. Aside from the half a dozen extra lines or so to get the mutx lock initialized properly, there’s not much new code to be written; you’re just mixing and matching stuff from programs #4 and #5 with a couple of fairly minor changes. But the changes involve handling pointers to components of structures inside dynamically allocated structures, which requires careful coding, so I think this program, as do most interesting programs, really begs for “build-a-little, test-a-little”. You’re obviously not required to proceed via the same sequence of stepwise refinements that I used (from the requirements engineering standpoint, that’s not a testable requirement 😉 but here’s roughly how I did it (compiling and executing after each step):
    1. Start from program #5 (the process program, not the thread one) but change the integer in shared memory to the racePoint structure from program #4 and do the spinning/communicating on just the x component, ignoring the y component completely here in the beginning (we’ll use it later though). This step just ensures our code can create and properly access a dynamically allocated C structure (not just an integer) located in shared memory.

    a. In program #4, the structure, racePoint, was simply a global variable of an anonymous structured type:
    struct { int x, y; } racePoint={0,0};
    Here, of course, it has to be placed in shared memory so you’ll need to give the structure definition a name, vis struct point { int x, y; }; so that you can refer to sizeof(struct point) when requesting your shared memory from shmget.

    b. Note that I removed the variable declaration for racePoint. Here, we don’t want to allocate storage for racePoint when we define struct point; we just want to define the struct point data type so that storage for the one we need can be dynamically allocated later, during execution, with a shmget call. If you also declare a variable at this point in your code (the compiler wouldn’t care, now would it?), you might easily get confused later and refer to it (the totally unnecessary local variable) rather than the dynamically created one in shared memory, with the result that you’ll manipulate the wrong variable and your code won’t work as intended.

    2. After attaching to the shared memory as we did in program #5, set both the x and y coordinates of the shared point to 0 Note that we’ll have to refer to the coordinates by pointer rather than by the name of the structure; e.g., racePointPtr->x, rather than racePoint.x, where racePointPtr contains the address we get when we do the shmat.

    3. fork() a child process.

    a. In the code executed by the parent process after the fork():
    i. Take out the code from program #4 that requests user input and then spins until the child resets the integer.

    ii. Replace it with the code for a critical section by copying the 3 lines from the critical section of the main thread of program #4 (suitably modified, as per item #2, above):

    1. First, set the x coordinate to 1.

    2. Then make a call to sleep(1) to simulate random preemption of the process.

    3. Then set the y coordinate to 1 (modifying the copied code to refer to both x and y by pointer).

    iii. Last thing in the parent code (after the critical section), print out the values of x and y so we can see if we got the race condition.

    b. In the child code, insert a line that spins while the x coordinate is 0 — so the child doesn’t try to enter its critical section too soon, before the parent process even executes after the fork (At this point, we’re trying to force a race condition and if the child gets completely through its critical sectrion before the parent even enters its, we won’t get one.) Next (still in the child code) put in the two line critical section that sets the x and y coordinates to 2.

    At this point, when you compile and execute your code you should see the simulated race condition: x will end up 2 while y will be 1.

    4. Put the definition of the race point structure inside an outer structure of some sort, called something stunningly original like sharedData or whatever name your sense of programming style deems appropriate:
    struct sharedData
    {
    struct point
    {
    int x, y;
    } racePoint;
    };
    This outer structure is where, in the next step, we’ll also place the mutex mechanism we’ll need, but for now (build-a-little, test-a-little) just make the necessary modifications to show that your code can still access x and y properly now that they’re inside an inner structure that’s inside an outer structure — and remember to alter your shmget to request enough storage for the outer structure, e.g., sizeof(struct sharedData), or whatever you name your outer structure

     Helpful hint: If you saved the address returned by the shmat in a variable named, say, sharedMemoryPtr, you’d now need to refer to the x coordinate as (sharedMemoryPtr->racePoint).x sharedMemoryPtr points to the outer structure; sharedMemoryPtr->racePoint designates the component of the outer structure named racePoint, which is itself a structure. So (sharedMemoryPtr->racePoint).x refers to the x component of the inner structure.

     Irrelevant aside on programming style: (sharedMemoryPtr->racePoint).x can be written without the parentheses as sharedMemoryPtr->racePoint.x and the compiler will do the right thing, but I think that’s poor style. It forces you or your readers to think explicitly about the precedence or association order of the operators involved. Better to use parentheses and make your intentions clear.

     Note that I had to put the name racePoint back in when I defined struct point, but here it’s not the name of a variable being declared (as it was in program #4) but the name of a structured component in the definition of the structured sharedData type. Components or fields have to have names, no?

    Anyway, compile and execute again; you should still see the race condition. Save this version of code somewhere; it’s one of two versions you’ll turn in for this assignment.

    5. Now put your definition of your synchronization structure inside the definition of the outer structure and add your call to initialize it somewhere before the fork(). I found it helpful to save and check the value returned by the initialization call (see my examples on using perror or strerror) since it’s all too easy at this point to write code that the compiler accepts but still have the OS nonetheless reject the system service call since it didn’t like the address you sent it. You can waste a lot of time trying to figure out why your program doesn’t work if you assume that just because the compiler buys off on the data types you use as arguments to system service calls and your program executes without blowing up that therefore the OS is actually doing what you are asking it to. That’s why system service calls return success/failure values and what perror is for. Compile and execute again to make sure you haven’t screwed anything up; although you still won’t have fixed the race condition yet.

     Programming hint: While it’s never a good idea to ignore warnings from the compiler (as opposed to errors, which, of course, can’t be ignored), when working with complex pointer accesses it is particularly vital to not ignore warnings. If the compiler thinks you’re pointing to the wrong type of thing, even though that’s only a warning, not an error, it is very unlikely that your system service calls will work correctly even though they may not notice an error. When you tell a system service call to initialize something, for example, all it knows is the address of the

    [supanova_question]

    https://anyessayhelp.com/ :

  • Writing Assignment: Read the following and think about how it might help you organize all the information in your course along with all the information in your experience that is related to the course in the light of what you will be doing with your life in the next 10 years. 250-1000 words. Use at least five key terms from the article in the link.
  • Clarification of this assignment: The above is one assignment. Those are both related to the article and the textbook.Remember in the introduction I asked you to say what you would be doing in 10 years? You will have decisions to make between now and then to meet your goals–decisions about your life.This course hopefully has given you information about those options and opportunities. It has involved a lot of information–you may have noticed; how will you take advantage of it?Hopefully you have been using formal operational thinking for a few years now and maybe even postformal operational thinking, or you will be soon–it will involve less dichotomous thinking and more relativistic thinking. So I’m asking you to take stock. Given your 10 year goals and what you have just learned, how will you handle it and make the decisions that will get you to your goal? I hope this clarification helps you do this assignment. syb
  • NOTE:. To improve your thinking and writing, create your report in a word processor and use the spell and grammar checker and then proofread your paper before you submit under Assignments. Due April 23.

    Submit your assignment in the box that opens when you click assignments or attach a file. All types of files were submitted in the previous unit and I could open them there. That way I have a space to put the grade right there and a place to comment on your work. But if you try twice and it doesn’t work, just email it to me as an attachment with your name and course on it.

    [supanova_question]

    Economic Impact of Hurricanes in the U.S, business and finance homework help Business Finance Assignment Help

    there is fail attached is describing everything

    completing my project under this proposal:

    Hurricanes inflict billions of dollars in economic damages throughout the United States. The potential for long-term effects becomes evident in various cases throughout the United States history dealing with such damaging effects caused from hurricanes. Such economic tolls display storm surges throughout the Atlantic coast while wreaking a havoc of tourism and agriculture industries being hit the hardest (Smith III, T. J., 2009). These hurricanes damage a lot more properties from the flooding that is left behind. Coastline storms are of the greatest hurricane occurrences and thus, causes the most economic damages done to the surrounding and impacted economies (Smith III, T. J., 2009). Hurricanes are feared along the Atlantic coasts, such as surrounding areas of Florida, while Florida has been hit the hardest from the most damaging and recent hurricane occurrences.

    Physical harm in family units, business premises, and open framework will cost the US monetary state up to $30 billion. A few structures have been pulverized and additionally streets, rails, and sewage and water frameworks. Control blackouts have additionally been far reaching in affected regions because of devastation of electrical cables (Sinigalliano, C. D., 2007). To decrease the tropical storm’s negative effect, Americans are encouraged to take preventive measures against physical harms. They should guarantee that they know their environment. For instance, they should distinguish close-by dams and levees that may represent a peril and move things to more secure spots. Individuals are likewise asked to know the rise level of their property with a specific end goal to keep things at danger of harm in safe spots (Sinigalliano, C. D., 2007).

    For a considerable length of time financial analysts have talked about whether ruinous tempests are even terrible for a nation’s economy. To a non-financial expert, the evil impacts of a tempest may appear to be natural, however market analysts have a talent for finding conceivable irrational clarifications. With regards to a noteworthy cataclysmic event, they had four contending speculations: Such a debacle may forever set a nation back; it may briefly crash development just to get back on course not far off; it may prompt much more prominent development, as new venture pours into supplant demolished resources; or, perhaps, it may yet far and away superior, invigorating development as well as freeing the nation of whatever obsolete framework was keeping it down (Sinigalliano, C. D., 2007).

    References

    Smith III, T. J., Anderson, G. H., Balentine, K., Tiling, G., Ward, G. A., & Whelan, K. R. (2009). Cumulative impacts of hurricanes on Florida mangrove ecosystems: sediment deposition, storm surges and vegetation. Wetlands, 29(1), 24-34.

    Sinigalliano, C. D., Gidley, M. L., Shibata, T., Whitman, D., Dixon, T. H., Laws, E., … & Gast, R. J. (2007). Impacts of Hurricanes Katrina and Rita on the microbial landscape of the New Orleans area. Proceedings of the National Academy of Sciences, 104(21), 9029-9034.

    [supanova_question]

    respond to the pics Humanities Assignment Help

    For our purposes, Reading Responses are focused responses to the assigned reading. These responses are the most important means for practicing and developing your ability to read and think critically. You will generally write one response each week. These responses should be typed, double-spaced, and at least one page in length. These are like journal entries relating how students respond to their reading.

    How did the reading make you think and feel? Of what did the reading remind you? How can you relate the reading to your other classes? Or your current life situations? Or history? Try to make these relatively informal but still academic. Do not give me summaries! Some of the response may quote excerpts of the reading, but keep the quotes short. And make sure to use proper formatting for quotes.

    Good Luck!

    [supanova_question]

    Access Control Policy Other Assignment Help

    Based on your team’s Week Four Learning Team Collaborative discussion, write the Access Control Policy section of the Information Security Policy. Include the following:

    • User enrollment
    • Identification
    • Authentication
    • Privileged and special account access
    • Remote access

    Format according to APA guidelines. I fully expect that this and all assignments related to the creation of the Security Policy document will be fully researched with all references cited with proper APA formating. I fully expect to see a reference section with an indication that you researched the information for this section.

    I will attach the first two assignments. They all need to flow together and be coherent. The company is Apple

    [supanova_question]

    [supanova_question]

    Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help

    It should be in C languge

    Inter-Process Communication/Synchronization via Shared Memory
    In homework #1, you learned how one process can create (a.k.a. “spawn” or “fork”) another process using the system service call fork( ). In homework #2, you learned how a thread can create another thread. As you saw in both homework #2 and again in homework #3, it’s easy to arrange for multiple threads within the same process to communicate via shared memory: All threads in a process share the same physical address space so any global variables are certainly accessible (common) to all the threads. Processes, however, normally share no memory with other processes so even a parent/child process pair whose address spaces are initially almost identical in content can’t communicate via common variables, since there aren’t any: The contents of the parent’s address space, obviously including all the variables in the stack, heap, and data sections, are initially copied into the child’s address space during the spawn (Unix does that; but Windows doesn’t), but even if so, after that initialization of the child’s space, those two physical address spaces are totally independent of one another; changes the child makes to its variables (including global variables in its data section) are not reflected in the parent’s address space nor vice versa. If we want processes to share access to some common memory as a means of interprocess communication, we have to make special arrangements, which is what you’ll do for this assignment: Use the system service calls shmget and shmat to obtain some new memory that will be accessible to multiple processes (and use shmdt and shmctl to clean up when you’re done). Here’s what I want your code to do:
    1. The parent process (only process at the start, right?) should get some new memory which will be shared with a child process that it (the parent) will create later. No magic here: In CS125 or some other C programming course, you’ve used the system service call malloc to get new memory before. Now you just need to learn to use a more complicated set of system service calls to get new memory that can be shared between processes (malloc’d memory is on the heap, remember, so it can’t be shared between processes). All we need here is enough memory for an integer (later we’ll try something more complicated 😉

    a. First use shmget to tell the OS to assign you a block of memory (to be shared among multiple processes) big enough to hold an integer; have your program print out the shared memory identifier it receives from shmget. Shared memory identifier? Just an arbitrary number that identifies some chunk of shared memory, much the way a process identifier identifies a process. A shared memory identifier is not a segment number or address. Why not? Well, for one thing, shared memory can be shared among processes running very different programs — in thisassignment, parent and child run the same code, but that need not be true in general, as you demonstrated in your program #1, when child #2 used an execv to load a new program. There’s no way to insure that separate processes could all use the same segment number for a shared memory segment— different processes may have a different number of segments in their logical address space; and if they’re not parent and child, as they will be for this assignment, they probably will have different numbers of segments in their respective segment tables when shmatcomes along and attaches a new one. Although a shared segment is indeed a segment, the shared memoryID, which must somehow be made common among all processes wanting to use this segment, is not a segment number in the MMU/address binding sense of the term; but different processes can use different segment numbers to bind/attach to the same physical address just by putting the same physical address in their (different) entries in their respective segment tables. The point of the shared memory identifier is to allow multiple processes to have a common name to use for shmat to refer to a region of memory that may be (generally will be) at different logical addresses in the different processes — hey guys, how about we all communicate via shared memory ID #37; shmat will tell each of us individually what address to use to get to this shared block of memory.

    b. Next, use shmat to get the address for your process to use to refer to the shared memory (this step is known as “attaching” the shared memory to your process). shmat adds an entry to the calling process’s segment table, often/usually assigning a different segment number in each process, but makes the base physical address of the new segment the same in the segment tables of all processes attached to this shared memory. But the protection bits in each process’s segment table could be different if some processes were only to be allowed read access while others could write as well as read.

    2. The parent process should set the new (shareable) integer to 0 and then spawn a child process (and make sure to do this in the correct order — first set the new, shared memory to 0, then spawn a child).

    3. In the parent (after the spawn):

    a. Ask the user for a (non-zero) value to store in the new integer.

    b. Once that has been accomplished, the parent should spin on that integer until it becomes zero again.

    c. After exiting from the spin, the parent should print a message saying that the shared integer is now 0 again (thus confirming successful two way communications withthe child via shared memory).

    d. Detach the shared memory from the process’s address space using shmdt

    e. Return the shared memory segment to the memory manager using shmctl (roughly analogous to the “free” function used to return malloc’d memory).

    f. Print out an “all done” message.

    4. In the child (after the spawn):

    a. Print some sort of “I’m alive” message

    b. Spin on the new integer until it becomes non-zero. Note: You caught a small break here; when a child process is spawned, it inherits any shared memory attachments of its parent; otherwise the child too would have to call shmat (as the parent did) before it could “see” the shared memory. How would the child know what shared memory segment identifier to attach to? In Unix/Linux, that variable would be “passed” to the child when the parent’s address space was copied over during the spawn; exactly the same way your child processes figured out which child they were in homework #1 (in Windows it would be more difficult). Anyway, because a child inherits its parent’s attachments (otherwise how could it’s logical address space be a copy of its parent’s?), it doesn’t need to do a shmat itself, provided of course, that the parent attached before spawning the child.

    c. After exiting from the spin (because the parent eventually puts a user-supplied non-zero value in the shared integer), print out the value just received from its parent and then re-set the shared integer back to 0 (so the parent can eventually stop spinning and finish up).

    d. That’s it for the child. You don’t need to detach the child from the shared memory (the OS does that when a process terminates, which the child will do when it runs out of code to execute after step 4c, above) and you certainly don’t want the child to destroy the shared memory segment since the parent may still need it to finish its printout. When the parent is done printing out the value the child re-zeroed, it (the parent) removes/destroys the (no longer shared) shared memory segment in step 3e, above — it better; shared memory segments are persistent, they are allowed to continue to exist after their creating process terminates (as a means, perhaps, of allowing interprocess communication from beyond the grave). The first few times I myself tried this sort of programming I eventually discovered that I had left some previously shared segments around from several years earlier. Now I clean up each year over Xmas break, just in case you folks don’t do your own cleanup properly (see Note D, below). Here (this homework) there’s no need to leave that shared memory segment lying around “orphaned” after the parent terminates; so we’ll have the parent return it (the previously shared segment) to the OS before it (the parent) terminates.
    Here’s what a sample output of mine looks like (user input in orange);
    Parent: Successfully created shared memory segment with shared memory ID # (not segment #) of 12714047 (This shared memory doesn’t get a true segment number until this process adds it to its segment table by attaching to it.)
    Parent: My pid is 29355; now spawning a child after setting the shared integer to 0
    Child: My pid is 29356, my parent’s pid is 29355; the shared integer value is currently 0; I’ll spin until it’s not 0
    Parent: My pid is 29355, spawned a child with pid of 29356; please enter an integer to be stored in shared memory: 48
    Child: The value in the shared integer is now 48; I’ll set it back to 0
    Parent: the child has re-zeroed our shared integer
    Child process terminating
    Parent: Child terminated; parent successfully removed segment whose ID # was 12714047

    Notes:
    A. This is a simple program to write; this writeup is a lot longer than the actual code itself will be. The challenge here of course is learning to use the new (and to be fair, modestly complex) system service calls. But the overall code is short and straightforward. You are welcome (encouraged, in fact) to scour the web for examples of using shmget, shmat, shmdt, and shmctl to help you figure out how to use them. I think our textbook may have an example somewhere and I’m sure there are some on the web somewhere

    1. Make sure any web example is for Linux; different OS’s can and do differ, even for things that are supposed to be standard. Note: shmget, shmat, shmdt, and shmctl are documented under “System Calls” in the Linux documentation

    2. Often, web examples are are intended to show how all the parameters to these system service calls work. That usually makes them a fair bit more complicated than we need them to be for this simple problem. I’ll deduct a point or two here if you don’t sufficiently simplify your code. But better, as far as grading is concerned, that you copy (and get working!) an overly complicated example that you don’t fully understand than you don’t get anything to work at all. Note that that’s a leniency we can afford in an academic setting; it won’t carry over to industry. “Oh yeah, the 747 crashed ’cause I didn’t really understand the system service call I used – it worked when I tested it on my desktop, though.”

    B. When perusing any examples you find, remember that identifiers in ALL_CAPS are just human-readable symbolic names (#defined in the .h files you include as per the Linux

    Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help[supanova_question]

    T Test Assignment Writing Assignment Help

    See the Resources area for links to resources that you will use for this assignment:

    • You will complete this assignment using the DAA Template.
    • Read the SPSS Data Analysis Report Guidelines for a more complete understanding of the DAA Template and how to format and organize your assignment.
    • Refer to the IBM SPSS Step-By-Step Guide: t Tests for additional information on using SPSS for this assignment.
    • If necessary, review the Copy/Export Output Instructions to refresh your memory on how to perform these tasks. As with your previous assignments, your submission should be in narrative format with supporting statistical output (table and graphs) integrated into the narrative in the appropriate places (not all at the end of the document).

    You will analyze the following variables in the grades.sav data set:

    • gender
    • gpa

    Step 1: Write Section 1 of the DAA.

    • Provide the context of the grades.sav data set.
    • Include a definition of the specified variables (predictor, outcome) and corresponding scales of measurement.
    • Specify the sample size of the data set.

    Step 2: Write Section 2 of the DAA.

    • Analyze the assumptions of the t test.
    • Paste the SPSS histogram output for gpa and discuss your visual interpretations.
    • Paste SPSS descriptives output showing skewness and kurtosis values for gpa and interpret them.
    • Paste SPSS output for the Shapiro-Wilk test of gpa and interpret it.
    • Report the results of the Levene test and interpret it.
    • Summarize whether or not the assumptions of the t test are met.

    Step 3: Write Section 3 of the DAA.

    • Specify a research question related to gender and gpa.
    • Articulate the null hypothesis and alternative hypothesis.
    • Specify the alpha level.

    Step 4: Write Section 4 of the DAA.

    • Paste the SPSS output of the t test.
    • Report the results of the SPSS output using proper APA guidelines (refer to the Unit 8 Introduction and the “Results” example from the Warner text in Chapter 5). Include the following:
      • t.
      • Degrees of freedom.
      • p value.
      • Effect size.
      • Interpretation of effect size.
      • Means and standard deviations for each group.
      • Mean difference.
      • 95% confidence interval of the difference of sample means.
    • Interpret the results against the null hypothesis.

    Step 5: Write Section 5 of the DAA.

    • Discuss the implications of this t test as it relates to the research question.
    • Conclude with an analysis of the strengths and limitations of the t test.

    Submit your DAA Template as an attached Word document in the assignment area

    [supanova_question]

    criminal critical Writing Assignment Help

    Using Microsoft PowerPoint, create a timeline, beginning in the 1960s, to demonstrate the specific changes that led to today’s paradigm of local policing. The timeline should include the following:

    • A description of the significant changes that occurred in local policing strategy, including the years in which these developments took place.
    • A description of crime conditions that led to such changes.
    • An explanation of other factors that increased the perceived need for those changes in law enforcement strategy. For instance, the cultural workforce, technology, social issues, etc.
    • An analysis of how the present state of police and law enforcement will impact the future of law enforcement. In what ways do you think community policing can be made more effective?
    • What other changes are required in law enforcement to prevent and reduce crime?
    • In what ways do you predict policing will change in the near future? Support your prediction.

    [supanova_question]

    Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model Humanities Assignment Help

    Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model. Think about the “Big Five” personality traits we studied in class. Then select a real or fictional character from literature, film, television, or public life. How could the “Big Five” model be used to understand the character’s personality?

    In a multi-paragraph essay, explain what is meant by a “personality trait” according to the “Big Five” model, define each of the “Big Five” traits, and describe the character’s personality using the “Big Five” traits. For each trait, be sure to provide evidence from the character’s thoughts, emotions, and behavior. Include details from class materials, readings, and research on personality to support your discussion.

    [supanova_question]

    Mutex Locks or Semaphores in Shared Memory Programming Assignment Help

    Mutex Locks or Semaphores in Shared Memory
    Last one of the semester. Let’s combine what we did in program #4 and program #5 and show, and then prevent, a race condition between processes rather than threads. Start with your code from program #5 but instead of simply putting an integer in shared memory, use a structure like the one that you used in program #4 to represent a 2-dimensional Cartesian point having two integer coordinates called x and y. Instead of communicating between parent and child by simply updating the integer with a user supplied value (as you did in program #5), update the racePoint coordinates as we did in program #4 (no user interaction necessary), which will create critical sections and then,as in program #4, use a stupidly placed sleep(1) call to simulate a random preemption causing a genuine race condition. Here, of course, we’ll have a race condition between two processes (over a shared resource in shared memory) rather than between two threads of the same process. Finally, just as in program #4, add entry and exit sections with a synchronization mechanism (semaphore, binary semaphore or mutex lock, whatever worked for you previously) to protect your critical sections and prevent the race condition.
    Couple of notes:
    A. Since both the parent and the child process obviously (I sure hope it’s obvious by now) need to use the same semaphore or mutex lock, it too will have to be in shared memory, no? Now I suppose you could just create a second shared memory segment for that; but that seems to me pretty inefficient. Instead, since a structure in C can contain other structures, why not put both the racePoint and the semaphore/mutex that will protect it inside a single structure and then create the shared memory to hold the “outer” structure containing the two “inner” structures your processes need to share access to; that way you don’t need an extra shmget, shmat, etc.
    B. Remember that semaphores, mutex locks, and such like have to be initialized before they can be used. In program #4, where the semaphore or mutex lock was simply declared as a global variable, that initialization could be done in the declaration itself and many of you did. I myself, for example, used the following line to declare and initialize a POSIX mutex lock named demoLock:
    pthread_mutex_t demoLock = PTHREAD_MUTEX_INITIALIZER;
    where PTHREAD_MUTEX_INITIALIZER is #defined in one of the header files as as a set of the appropriate constants inside squiggly brackets, e.g., { …, …} That wouldn’t work here, since the the memory for the synchronization structure is being obtained dynamically (via the shmget) rather than by a simple compile-time declaration, as in my example just above. So here in this program, you’ll need to use some additional system service calls from the pthread library to initialize your mutex lock correctly.
    Conceptually there’s not much new here. Aside from the half a dozen extra lines or so to get the mutx lock initialized properly, there’s not much new code to be written; you’re just mixing and matching stuff from programs #4 and #5 with a couple of fairly minor changes. But the changes involve handling pointers to components of structures inside dynamically allocated structures, which requires careful coding, so I think this program, as do most interesting programs, really begs for “build-a-little, test-a-little”. You’re obviously not required to proceed via the same sequence of stepwise refinements that I used (from the requirements engineering standpoint, that’s not a testable requirement 😉 but here’s roughly how I did it (compiling and executing after each step):
    1. Start from program #5 (the process program, not the thread one) but change the integer in shared memory to the racePoint structure from program #4 and do the spinning/communicating on just the x component, ignoring the y component completely here in the beginning (we’ll use it later though). This step just ensures our code can create and properly access a dynamically allocated C structure (not just an integer) located in shared memory.

    a. In program #4, the structure, racePoint, was simply a global variable of an anonymous structured type:
    struct { int x, y; } racePoint={0,0};
    Here, of course, it has to be placed in shared memory so you’ll need to give the structure definition a name, vis struct point { int x, y; }; so that you can refer to sizeof(struct point) when requesting your shared memory from shmget.

    b. Note that I removed the variable declaration for racePoint. Here, we don’t want to allocate storage for racePoint when we define struct point; we just want to define the struct point data type so that storage for the one we need can be dynamically allocated later, during execution, with a shmget call. If you also declare a variable at this point in your code (the compiler wouldn’t care, now would it?), you might easily get confused later and refer to it (the totally unnecessary local variable) rather than the dynamically created one in shared memory, with the result that you’ll manipulate the wrong variable and your code won’t work as intended.

    2. After attaching to the shared memory as we did in program #5, set both the x and y coordinates of the shared point to 0 Note that we’ll have to refer to the coordinates by pointer rather than by the name of the structure; e.g., racePointPtr->x, rather than racePoint.x, where racePointPtr contains the address we get when we do the shmat.

    3. fork() a child process.

    a. In the code executed by the parent process after the fork():
    i. Take out the code from program #4 that requests user input and then spins until the child resets the integer.

    ii. Replace it with the code for a critical section by copying the 3 lines from the critical section of the main thread of program #4 (suitably modified, as per item #2, above):

    1. First, set the x coordinate to 1.

    2. Then make a call to sleep(1) to simulate random preemption of the process.

    3. Then set the y coordinate to 1 (modifying the copied code to refer to both x and y by pointer).

    iii. Last thing in the parent code (after the critical section), print out the values of x and y so we can see if we got the race condition.

    b. In the child code, insert a line that spins while the x coordinate is 0 — so the child doesn’t try to enter its critical section too soon, before the parent process even executes after the fork (At this point, we’re trying to force a race condition and if the child gets completely through its critical sectrion before the parent even enters its, we won’t get one.) Next (still in the child code) put in the two line critical section that sets the x and y coordinates to 2.

    At this point, when you compile and execute your code you should see the simulated race condition: x will end up 2 while y will be 1.

    4. Put the definition of the race point structure inside an outer structure of some sort, called something stunningly original like sharedData or whatever name your sense of programming style deems appropriate:
    struct sharedData
    {
    struct point
    {
    int x, y;
    } racePoint;
    };
    This outer structure is where, in the next step, we’ll also place the mutex mechanism we’ll need, but for now (build-a-little, test-a-little) just make the necessary modifications to show that your code can still access x and y properly now that they’re inside an inner structure that’s inside an outer structure — and remember to alter your shmget to request enough storage for the outer structure, e.g., sizeof(struct sharedData), or whatever you name your outer structure

     Helpful hint: If you saved the address returned by the shmat in a variable named, say, sharedMemoryPtr, you’d now need to refer to the x coordinate as (sharedMemoryPtr->racePoint).x sharedMemoryPtr points to the outer structure; sharedMemoryPtr->racePoint designates the component of the outer structure named racePoint, which is itself a structure. So (sharedMemoryPtr->racePoint).x refers to the x component of the inner structure.

     Irrelevant aside on programming style: (sharedMemoryPtr->racePoint).x can be written without the parentheses as sharedMemoryPtr->racePoint.x and the compiler will do the right thing, but I think that’s poor style. It forces you or your readers to think explicitly about the precedence or association order of the operators involved. Better to use parentheses and make your intentions clear.

     Note that I had to put the name racePoint back in when I defined struct point, but here it’s not the name of a variable being declared (as it was in program #4) but the name of a structured component in the definition of the structured sharedData type. Components or fields have to have names, no?

    Anyway, compile and execute again; you should still see the race condition. Save this version of code somewhere; it’s one of two versions you’ll turn in for this assignment.

    5. Now put your definition of your synchronization structure inside the definition of the outer structure and add your call to initialize it somewhere before the fork(). I found it helpful to save and check the value returned by the initialization call (see my examples on using perror or strerror) since it’s all too easy at this point to write code that the compiler accepts but still have the OS nonetheless reject the system service call since it didn’t like the address you sent it. You can waste a lot of time trying to figure out why your program doesn’t work if you assume that just because the compiler buys off on the data types you use as arguments to system service calls and your program executes without blowing up that therefore the OS is actually doing what you are asking it to. That’s why system service calls return success/failure values and what perror is for. Compile and execute again to make sure you haven’t screwed anything up; although you still won’t have fixed the race condition yet.

     Programming hint: While it’s never a good idea to ignore warnings from the compiler (as opposed to errors, which, of course, can’t be ignored), when working with complex pointer accesses it is particularly vital to not ignore warnings. If the compiler thinks you’re pointing to the wrong type of thing, even though that’s only a warning, not an error, it is very unlikely that your system service calls will work correctly even though they may not notice an error. When you tell a system service call to initialize something, for example, all it knows is the address of the

    [supanova_question]

    https://anyessayhelp.com/ :

  • Writing Assignment: Read the following and think about how it might help you organize all the information in your course along with all the information in your experience that is related to the course in the light of what you will be doing with your life in the next 10 years. 250-1000 words. Use at least five key terms from the article in the link.
  • Clarification of this assignment: The above is one assignment. Those are both related to the article and the textbook.Remember in the introduction I asked you to say what you would be doing in 10 years? You will have decisions to make between now and then to meet your goals–decisions about your life.This course hopefully has given you information about those options and opportunities. It has involved a lot of information–you may have noticed; how will you take advantage of it?Hopefully you have been using formal operational thinking for a few years now and maybe even postformal operational thinking, or you will be soon–it will involve less dichotomous thinking and more relativistic thinking. So I’m asking you to take stock. Given your 10 year goals and what you have just learned, how will you handle it and make the decisions that will get you to your goal? I hope this clarification helps you do this assignment. syb
  • NOTE:. To improve your thinking and writing, create your report in a word processor and use the spell and grammar checker and then proofread your paper before you submit under Assignments. Due April 23.

    Submit your assignment in the box that opens when you click assignments or attach a file. All types of files were submitted in the previous unit and I could open them there. That way I have a space to put the grade right there and a place to comment on your work. But if you try twice and it doesn’t work, just email it to me as an attachment with your name and course on it.

    [supanova_question]

    Economic Impact of Hurricanes in the U.S, business and finance homework help Business Finance Assignment Help

    there is fail attached is describing everything

    completing my project under this proposal:

    Hurricanes inflict billions of dollars in economic damages throughout the United States. The potential for long-term effects becomes evident in various cases throughout the United States history dealing with such damaging effects caused from hurricanes. Such economic tolls display storm surges throughout the Atlantic coast while wreaking a havoc of tourism and agriculture industries being hit the hardest (Smith III, T. J., 2009). These hurricanes damage a lot more properties from the flooding that is left behind. Coastline storms are of the greatest hurricane occurrences and thus, causes the most economic damages done to the surrounding and impacted economies (Smith III, T. J., 2009). Hurricanes are feared along the Atlantic coasts, such as surrounding areas of Florida, while Florida has been hit the hardest from the most damaging and recent hurricane occurrences.

    Physical harm in family units, business premises, and open framework will cost the US monetary state up to $30 billion. A few structures have been pulverized and additionally streets, rails, and sewage and water frameworks. Control blackouts have additionally been far reaching in affected regions because of devastation of electrical cables (Sinigalliano, C. D., 2007). To decrease the tropical storm’s negative effect, Americans are encouraged to take preventive measures against physical harms. They should guarantee that they know their environment. For instance, they should distinguish close-by dams and levees that may represent a peril and move things to more secure spots. Individuals are likewise asked to know the rise level of their property with a specific end goal to keep things at danger of harm in safe spots (Sinigalliano, C. D., 2007).

    For a considerable length of time financial analysts have talked about whether ruinous tempests are even terrible for a nation’s economy. To a non-financial expert, the evil impacts of a tempest may appear to be natural, however market analysts have a talent for finding conceivable irrational clarifications. With regards to a noteworthy cataclysmic event, they had four contending speculations: Such a debacle may forever set a nation back; it may briefly crash development just to get back on course not far off; it may prompt much more prominent development, as new venture pours into supplant demolished resources; or, perhaps, it may yet far and away superior, invigorating development as well as freeing the nation of whatever obsolete framework was keeping it down (Sinigalliano, C. D., 2007).

    References

    Smith III, T. J., Anderson, G. H., Balentine, K., Tiling, G., Ward, G. A., & Whelan, K. R. (2009). Cumulative impacts of hurricanes on Florida mangrove ecosystems: sediment deposition, storm surges and vegetation. Wetlands, 29(1), 24-34.

    Sinigalliano, C. D., Gidley, M. L., Shibata, T., Whitman, D., Dixon, T. H., Laws, E., … & Gast, R. J. (2007). Impacts of Hurricanes Katrina and Rita on the microbial landscape of the New Orleans area. Proceedings of the National Academy of Sciences, 104(21), 9029-9034.

    [supanova_question]

    respond to the pics Humanities Assignment Help

    For our purposes, Reading Responses are focused responses to the assigned reading. These responses are the most important means for practicing and developing your ability to read and think critically. You will generally write one response each week. These responses should be typed, double-spaced, and at least one page in length. These are like journal entries relating how students respond to their reading.

    How did the reading make you think and feel? Of what did the reading remind you? How can you relate the reading to your other classes? Or your current life situations? Or history? Try to make these relatively informal but still academic. Do not give me summaries! Some of the response may quote excerpts of the reading, but keep the quotes short. And make sure to use proper formatting for quotes.

    Good Luck!

    [supanova_question]

    Access Control Policy Other Assignment Help

    Based on your team’s Week Four Learning Team Collaborative discussion, write the Access Control Policy section of the Information Security Policy. Include the following:

    • User enrollment
    • Identification
    • Authentication
    • Privileged and special account access
    • Remote access

    Format according to APA guidelines. I fully expect that this and all assignments related to the creation of the Security Policy document will be fully researched with all references cited with proper APA formating. I fully expect to see a reference section with an indication that you researched the information for this section.

    I will attach the first two assignments. They all need to flow together and be coherent. The company is Apple

    [supanova_question]

    [supanova_question]

    Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help

    It should be in C languge

    Inter-Process Communication/Synchronization via Shared Memory
    In homework #1, you learned how one process can create (a.k.a. “spawn” or “fork”) another process using the system service call fork( ). In homework #2, you learned how a thread can create another thread. As you saw in both homework #2 and again in homework #3, it’s easy to arrange for multiple threads within the same process to communicate via shared memory: All threads in a process share the same physical address space so any global variables are certainly accessible (common) to all the threads. Processes, however, normally share no memory with other processes so even a parent/child process pair whose address spaces are initially almost identical in content can’t communicate via common variables, since there aren’t any: The contents of the parent’s address space, obviously including all the variables in the stack, heap, and data sections, are initially copied into the child’s address space during the spawn (Unix does that; but Windows doesn’t), but even if so, after that initialization of the child’s space, those two physical address spaces are totally independent of one another; changes the child makes to its variables (including global variables in its data section) are not reflected in the parent’s address space nor vice versa. If we want processes to share access to some common memory as a means of interprocess communication, we have to make special arrangements, which is what you’ll do for this assignment: Use the system service calls shmget and shmat to obtain some new memory that will be accessible to multiple processes (and use shmdt and shmctl to clean up when you’re done). Here’s what I want your code to do:
    1. The parent process (only process at the start, right?) should get some new memory which will be shared with a child process that it (the parent) will create later. No magic here: In CS125 or some other C programming course, you’ve used the system service call malloc to get new memory before. Now you just need to learn to use a more complicated set of system service calls to get new memory that can be shared between processes (malloc’d memory is on the heap, remember, so it can’t be shared between processes). All we need here is enough memory for an integer (later we’ll try something more complicated 😉

    a. First use shmget to tell the OS to assign you a block of memory (to be shared among multiple processes) big enough to hold an integer; have your program print out the shared memory identifier it receives from shmget. Shared memory identifier? Just an arbitrary number that identifies some chunk of shared memory, much the way a process identifier identifies a process. A shared memory identifier is not a segment number or address. Why not? Well, for one thing, shared memory can be shared among processes running very different programs — in thisassignment, parent and child run the same code, but that need not be true in general, as you demonstrated in your program #1, when child #2 used an execv to load a new program. There’s no way to insure that separate processes could all use the same segment number for a shared memory segment— different processes may have a different number of segments in their logical address space; and if they’re not parent and child, as they will be for this assignment, they probably will have different numbers of segments in their respective segment tables when shmatcomes along and attaches a new one. Although a shared segment is indeed a segment, the shared memoryID, which must somehow be made common among all processes wanting to use this segment, is not a segment number in the MMU/address binding sense of the term; but different processes can use different segment numbers to bind/attach to the same physical address just by putting the same physical address in their (different) entries in their respective segment tables. The point of the shared memory identifier is to allow multiple processes to have a common name to use for shmat to refer to a region of memory that may be (generally will be) at different logical addresses in the different processes — hey guys, how about we all communicate via shared memory ID #37; shmat will tell each of us individually what address to use to get to this shared block of memory.

    b. Next, use shmat to get the address for your process to use to refer to the shared memory (this step is known as “attaching” the shared memory to your process). shmat adds an entry to the calling process’s segment table, often/usually assigning a different segment number in each process, but makes the base physical address of the new segment the same in the segment tables of all processes attached to this shared memory. But the protection bits in each process’s segment table could be different if some processes were only to be allowed read access while others could write as well as read.

    2. The parent process should set the new (shareable) integer to 0 and then spawn a child process (and make sure to do this in the correct order — first set the new, shared memory to 0, then spawn a child).

    3. In the parent (after the spawn):

    a. Ask the user for a (non-zero) value to store in the new integer.

    b. Once that has been accomplished, the parent should spin on that integer until it becomes zero again.

    c. After exiting from the spin, the parent should print a message saying that the shared integer is now 0 again (thus confirming successful two way communications withthe child via shared memory).

    d. Detach the shared memory from the process’s address space using shmdt

    e. Return the shared memory segment to the memory manager using shmctl (roughly analogous to the “free” function used to return malloc’d memory).

    f. Print out an “all done” message.

    4. In the child (after the spawn):

    a. Print some sort of “I’m alive” message

    b. Spin on the new integer until it becomes non-zero. Note: You caught a small break here; when a child process is spawned, it inherits any shared memory attachments of its parent; otherwise the child too would have to call shmat (as the parent did) before it could “see” the shared memory. How would the child know what shared memory segment identifier to attach to? In Unix/Linux, that variable would be “passed” to the child when the parent’s address space was copied over during the spawn; exactly the same way your child processes figured out which child they were in homework #1 (in Windows it would be more difficult). Anyway, because a child inherits its parent’s attachments (otherwise how could it’s logical address space be a copy of its parent’s?), it doesn’t need to do a shmat itself, provided of course, that the parent attached before spawning the child.

    c. After exiting from the spin (because the parent eventually puts a user-supplied non-zero value in the shared integer), print out the value just received from its parent and then re-set the shared integer back to 0 (so the parent can eventually stop spinning and finish up).

    d. That’s it for the child. You don’t need to detach the child from the shared memory (the OS does that when a process terminates, which the child will do when it runs out of code to execute after step 4c, above) and you certainly don’t want the child to destroy the shared memory segment since the parent may still need it to finish its printout. When the parent is done printing out the value the child re-zeroed, it (the parent) removes/destroys the (no longer shared) shared memory segment in step 3e, above — it better; shared memory segments are persistent, they are allowed to continue to exist after their creating process terminates (as a means, perhaps, of allowing interprocess communication from beyond the grave). The first few times I myself tried this sort of programming I eventually discovered that I had left some previously shared segments around from several years earlier. Now I clean up each year over Xmas break, just in case you folks don’t do your own cleanup properly (see Note D, below). Here (this homework) there’s no need to leave that shared memory segment lying around “orphaned” after the parent terminates; so we’ll have the parent return it (the previously shared segment) to the OS before it (the parent) terminates.
    Here’s what a sample output of mine looks like (user input in orange);
    Parent: Successfully created shared memory segment with shared memory ID # (not segment #) of 12714047 (This shared memory doesn’t get a true segment number until this process adds it to its segment table by attaching to it.)
    Parent: My pid is 29355; now spawning a child after setting the shared integer to 0
    Child: My pid is 29356, my parent’s pid is 29355; the shared integer value is currently 0; I’ll spin until it’s not 0
    Parent: My pid is 29355, spawned a child with pid of 29356; please enter an integer to be stored in shared memory: 48
    Child: The value in the shared integer is now 48; I’ll set it back to 0
    Parent: the child has re-zeroed our shared integer
    Child process terminating
    Parent: Child terminated; parent successfully removed segment whose ID # was 12714047

    Notes:
    A. This is a simple program to write; this writeup is a lot longer than the actual code itself will be. The challenge here of course is learning to use the new (and to be fair, modestly complex) system service calls. But the overall code is short and straightforward. You are welcome (encouraged, in fact) to scour the web for examples of using shmget, shmat, shmdt, and shmctl to help you figure out how to use them. I think our textbook may have an example somewhere and I’m sure there are some on the web somewhere

    1. Make sure any web example is for Linux; different OS’s can and do differ, even for things that are supposed to be standard. Note: shmget, shmat, shmdt, and shmctl are documented under “System Calls” in the Linux documentation

    2. Often, web examples are are intended to show how all the parameters to these system service calls work. That usually makes them a fair bit more complicated than we need them to be for this simple problem. I’ll deduct a point or two here if you don’t sufficiently simplify your code. But better, as far as grading is concerned, that you copy (and get working!) an overly complicated example that you don’t fully understand than you don’t get anything to work at all. Note that that’s a leniency we can afford in an academic setting; it won’t carry over to industry. “Oh yeah, the 747 crashed ’cause I didn’t really understand the system service call I used – it worked when I tested it on my desktop, though.”

    B. When perusing any examples you find, remember that identifiers in ALL_CAPS are just human-readable symbolic names (#defined in the .h files you include as per the Linux

    Inter-Process Communication/Synchronization via Shared Memory Programming Assignment Help[supanova_question]

    T Test Assignment Writing Assignment Help

    See the Resources area for links to resources that you will use for this assignment:

    • You will complete this assignment using the DAA Template.
    • Read the SPSS Data Analysis Report Guidelines for a more complete understanding of the DAA Template and how to format and organize your assignment.
    • Refer to the IBM SPSS Step-By-Step Guide: t Tests for additional information on using SPSS for this assignment.
    • If necessary, review the Copy/Export Output Instructions to refresh your memory on how to perform these tasks. As with your previous assignments, your submission should be in narrative format with supporting statistical output (table and graphs) integrated into the narrative in the appropriate places (not all at the end of the document).

    You will analyze the following variables in the grades.sav data set:

    • gender
    • gpa

    Step 1: Write Section 1 of the DAA.

    • Provide the context of the grades.sav data set.
    • Include a definition of the specified variables (predictor, outcome) and corresponding scales of measurement.
    • Specify the sample size of the data set.

    Step 2: Write Section 2 of the DAA.

    • Analyze the assumptions of the t test.
    • Paste the SPSS histogram output for gpa and discuss your visual interpretations.
    • Paste SPSS descriptives output showing skewness and kurtosis values for gpa and interpret them.
    • Paste SPSS output for the Shapiro-Wilk test of gpa and interpret it.
    • Report the results of the Levene test and interpret it.
    • Summarize whether or not the assumptions of the t test are met.

    Step 3: Write Section 3 of the DAA.

    • Specify a research question related to gender and gpa.
    • Articulate the null hypothesis and alternative hypothesis.
    • Specify the alpha level.

    Step 4: Write Section 4 of the DAA.

    • Paste the SPSS output of the t test.
    • Report the results of the SPSS output using proper APA guidelines (refer to the Unit 8 Introduction and the “Results” example from the Warner text in Chapter 5). Include the following:
      • t.
      • Degrees of freedom.
      • p value.
      • Effect size.
      • Interpretation of effect size.
      • Means and standard deviations for each group.
      • Mean difference.
      • 95% confidence interval of the difference of sample means.
    • Interpret the results against the null hypothesis.

    Step 5: Write Section 5 of the DAA.

    • Discuss the implications of this t test as it relates to the research question.
    • Conclude with an analysis of the strengths and limitations of the t test.

    Submit your DAA Template as an attached Word document in the assignment area

    [supanova_question]

    criminal critical Writing Assignment Help

    Using Microsoft PowerPoint, create a timeline, beginning in the 1960s, to demonstrate the specific changes that led to today’s paradigm of local policing. The timeline should include the following:

    • A description of the significant changes that occurred in local policing strategy, including the years in which these developments took place.
    • A description of crime conditions that led to such changes.
    • An explanation of other factors that increased the perceived need for those changes in law enforcement strategy. For instance, the cultural workforce, technology, social issues, etc.
    • An analysis of how the present state of police and law enforcement will impact the future of law enforcement. In what ways do you think community policing can be made more effective?
    • What other changes are required in law enforcement to prevent and reduce crime?
    • In what ways do you predict policing will change in the near future? Support your prediction.

    [supanova_question]

    Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model Humanities Assignment Help

    Psychologists have identified five main personality traits, often called the “Big Five” or the five-trait model. Think about the “Big Five” personality traits we studied in class. Then select a real or fictional character from literature, film, television, or public life. How could the “Big Five” model be used to understand the character’s personality?

    In a multi-paragraph essay, explain what is meant by a “personality trait” according to the “Big Five” model, define each of the “Big Five” traits, and describe the character’s personality using the “Big Five” traits. For each trait, be sure to provide evidence from the character’s thoughts, emotions, and behavior. Include details from class materials, readings, and research on personality to support your discussion.

    [supanova_question]

    Mutex Locks or Semaphores in Shared Memory Programming Assignment Help

    Mutex Locks or Semaphores in Shared Memory
    Last one of the semester. Let’s combine what we did in program #4 and program #5 and show, and then prevent, a race condition between processes rather than threads. Start with your code from program #5 but instead of simply putting an integer in shared memory, use a structure like the one that you used in program #4 to represent a 2-dimensional Cartesian point having two integer coordinates called x and y. Instead of communicating between parent and child by simply updating the integer with a user supplied value (as you did in program #5), update the racePoint coordinates as we did in program #4 (no user interaction necessary), which will create critical sections and then,as in program #4, use a stupidly placed sleep(1) call to simulate a random preemption causing a genuine race condition. Here, of course, we’ll have a race condition between two processes (over a shared resource in shared memory) rather than between two threads of the same process. Finally, just as in program #4, add entry and exit sections with a synchronization mechanism (semaphore, binary semaphore or mutex lock, whatever worked for you previously) to protect your critical sections and prevent the race condition.
    Couple of notes:
    A. Since both the parent and the child process obviously (I sure hope it’s obvious by now) need to use the same semaphore or mutex lock, it too will have to be in shared memory, no? Now I suppose you could just create a second shared memory segment for that; but that seems to me pretty inefficient. Instead, since a structure in C can contain other structures, why not put both the racePoint and the semaphore/mutex that will protect it inside a single structure and then create the shared memory to hold the “outer” structure containing the two “inner” structures your processes need to share access to; that way you don’t need an extra shmget, shmat, etc.
    B. Remember that semaphores, mutex locks, and such like have to be initialized before they can be used. In program #4, where the semaphore or mutex lock was simply declared as a global variable, that initialization could be done in the declaration itself and many of you did. I myself, for example, used the following line to declare and initialize a POSIX mutex lock named demoLock:
    pthread_mutex_t demoLock = PTHREAD_MUTEX_INITIALIZER;
    where PTHREAD_MUTEX_INITIALIZER is #defined in one of the header files as as a set of the appropriate constants inside squiggly brackets, e.g., { …, …} That wouldn’t work here, since the the memory for the synchronization structure is being obtained dynamically (via the shmget) rather than by a simple compile-time declaration, as in my example just above. So here in this program, you’ll need to use some additional system service calls from the pthread library to initialize your mutex lock correctly.
    Conceptually there’s not much new here. Aside from the half a dozen extra lines or so to get the mutx lock initialized properly, there’s not much new code to be written; you’re just mixing and matching stuff from programs #4 and #5 with a couple of fairly minor changes. But the changes involve handling pointers to components of structures inside dynamically allocated structures, which requires careful coding, so I think this program, as do most interesting programs, really begs for “build-a-little, test-a-little”. You’re obviously not required to proceed via the same sequence of stepwise refinements that I used (from the requirements engineering standpoint, that’s not a testable requirement 😉 but here’s roughly how I did it (compiling and executing after each step):
    1. Start from program #5 (the process program, not the thread one) but change the integer in shared memory to the racePoint structure from program #4 and do the spinning/communicating on just the x component, ignoring the y component completely here in the beginning (we’ll use it later though). This step just ensures our code can create and properly access a dynamically allocated C structure (not just an integer) located in shared memory.

    a. In program #4, the structure, racePoint, was simply a global variable of an anonymous structured type:
    struct { int x, y; } racePoint={0,0};
    Here, of course, it has to be placed in shared memory so you’ll need to give the structure definition a name, vis struct point { int x, y; }; so that you can refer to sizeof(struct point) when requesting your shared memory from shmget.

    b. Note that I removed the variable declaration for racePoint. Here, we don’t want to allocate storage for racePoint when we define struct point; we just want to define the struct point data type so that storage for the one we need can be dynamically allocated later, during execution, with a shmget call. If you also declare a variable at this point in your code (the compiler wouldn’t care, now would it?), you might easily get confused later and refer to it (the totally unnecessary local variable) rather than the dynamically created one in shared memory, with the result that you’ll manipulate the wrong variable and your code won’t work as intended.

    2. After attaching to the shared memory as we did in program #5, set both the x and y coordinates of the shared point to 0 Note that we’ll have to refer to the coordinates by pointer rather than by the name of the structure; e.g., racePointPtr->x, rather than racePoint.x, where racePointPtr contains the address we get when we do the shmat.

    3. fork() a child process.

    a. In the code executed by the parent process after the fork():
    i. Take out the code from program #4 that requests user input and then spins until the child resets the integer.

    ii. Replace it with the code for a critical section by copying the 3 lines from the critical section of the main thread of program #4 (suitably modified, as per item #2, above):

    1. First, set the x coordinate to 1.

    2. Then make a call to sleep(1) to simulate random preemption of the process.

    3. Then set the y coordinate to 1 (modifying the copied code to refer to both x and y by pointer).

    iii. Last thing in the parent code (after the critical section), print out the values of x and y so we can see if we got the race condition.

    b. In the child code, insert a line that spins while the x coordinate is 0 — so the child doesn’t try to enter its critical section too soon, before the parent process even executes after the fork (At this point, we’re trying to force a race condition and if the child gets completely through its critical sectrion before the parent even enters its, we won’t get one.) Next (still in the child code) put in the two line critical section that sets the x and y coordinates to 2.

    At this point, when you compile and execute your code you should see the simulated race condition: x will end up 2 while y will be 1.

    4. Put the definition of the race point structure inside an outer structure of some sort, called something stunningly original like sharedData or whatever name your sense of programming style deems appropriate:
    struct sharedData
    {
    struct point
    {
    int x, y;
    } racePoint;
    };
    This outer structure is where, in the next step, we’ll also place the mutex mechanism we’ll need, but for now (build-a-little, test-a-little) just make the necessary modifications to show that your code can still access x and y properly now that they’re inside an inner structure that’s inside an outer structure — and remember to alter your shmget to request enough storage for the outer structure, e.g., sizeof(struct sharedData), or whatever you name your outer structure

     Helpful hint: If you saved the address returned by the shmat in a variable named, say, sharedMemoryPtr, you’d now need to refer to the x coordinate as (sharedMemoryPtr->racePoint).x sharedMemoryPtr points to the outer structure; sharedMemoryPtr->racePoint designates the component of the outer structure named racePoint, which is itself a structure. So (sharedMemoryPtr->racePoint).x refers to the x component of the inner structure.

     Irrelevant aside on programming style: (sharedMemoryPtr->racePoint).x can be written without the parentheses as sharedMemoryPtr->racePoint.x and the compiler will do the right thing, but I think that’s poor style. It forces you or your readers to think explicitly about the precedence or association order of the operators involved. Better to use parentheses and make your intentions clear.

     Note that I had to put the name racePoint back in when I defined struct point, but here it’s not the name of a variable being declared (as it was in program #4) but the name of a structured component in the definition of the structured sharedData type. Components or fields have to have names, no?

    Anyway, compile and execute again; you should still see the race condition. Save this version of code somewhere; it’s one of two versions you’ll turn in for this assignment.

    5. Now put your definition of your synchronization structure inside the definition of the outer structure and add your call to initialize it somewhere before the fork(). I found it helpful to save and check the value returned by the initialization call (see my examples on using perror or strerror) since it’s all too easy at this point to write code that the compiler accepts but still have the OS nonetheless reject the system service call since it didn’t like the address you sent it. You can waste a lot of time trying to figure out why your program doesn’t work if you assume that just because the compiler buys off on the data types you use as arguments to system service calls and your program executes without blowing up that therefore the OS is actually doing what you are asking it to. That’s why system service calls return success/failure values and what perror is for. Compile and execute again to make sure you haven’t screwed anything up; although you still won’t have fixed the race condition yet.

     Programming hint: While it’s never a good idea to ignore warnings from the compiler (as opposed to errors, which, of course, can’t be ignored), when working with complex pointer accesses it is particularly vital to not ignore warnings. If the compiler thinks you’re pointing to the wrong type of thing, even though that’s only a warning, not an error, it is very unlikely that your system service calls will work correctly even though they may not notice an error. When you tell a system service call to initialize something, for example, all it knows is the address of the

    [supanova_question]

    I need basic website Programming Assignment Help

    I need basic website Programming Assignment Help

    × How can I help you?