Sunday, January 26, 2020

Event Driven Programming

Event Driven Programming P1 Describe the key features of event driven programming Event handlers The GUI is formed of a great deal of built in things such as text boxes, tool icons menus etc. When the user clicks on a mouse or presses a key on the keyboard they trigger these GUI features. This sort of interaction is called events. Windows operating systems provide the event driven program with these event triggers. The code is written so that it reacts to every event that arise through user interaction. Events are the activities which are carried out by the user when the program is being used. When the user clicks on any object then the Click event is executed. If the user repositions the mouse then the mouse move event occurs. By the similar method a program can produce Key down event, Key up event, mouse double click event. The event is perceived by a form or control. Code is initiated by a program in reaction to an event. All forms and controls in VB have a set of events already in place. If one of these events takes place, VB brings up the code in the related event process. Despite the fact that predefined collection of events are detected without human intervention by objects in VBA, it still up to the programmer to decide if and how they react to a specific event. Event procedures are written for events in order to make a control respond to an event. Different objects can trigger different event processes when an event happens, although a lot of objects recognise the same event. For instance,if a user clicks a userform, the Userform_Click event process takes place; if a user clicks a command button named CommandButton1, the CommandButton1_Click event procedure is triggered. Usually there are two different types of events. There are the events which are triggered by user interaction (clicking on a mouse, pressing a key on the keyboard) and there are System initiated events which are events produced to respond to a user action (scrolling text, highlight a button). Both of these events have to be dealt with in a UI. It is also possible that a user event triggers a system initiated event. What happens in a classic event driven application is the user opens the program and triggers an event by clicking on a button or pressing a key on the keyboard or the code in the program can trigger an event for example loading a form from the Load event procedure. The event is received by the program. If there is an event procedure in place for that particular event then the task is performed. The program then waits for another event to happen.   An event handler deals with these events. All events are parts of data from the main configuration usually the GUI toolkit. Event handlers are very important elements of event driven programming. The events are generated by the structure found on understanding lower-level interactions, which could be lower-level events themselves. For instance, by moving the mouse the program takes this to be a menu selection and timers running out. The events primarily are initiated from actions on the operating system level, for example, interrupts produced by hardware devices, software interrupt instructions, or state changes in polling. In these circumstances interrupt handlers and signal handlers relate to event handlers. An event loop is where the program takes delivery of an event, deals with the event and then waits for another event and then executes a trigger function to deal with it. Trigger functions are written to correspond to the necessary actions. The algorithm which has been prog rammed has to make sure that triggers which have been made available are performed as soon as they are required which as a result presents a software concept that imitates an interrupt driven structure. The event loop normally doesnt stop until the user closes the program. When it receives the event it initiates the suitable event handler. This will ultimately be built-in to your application as a window. You can insert controls to this which might include a text box, check box command buttons etc Every event is examined by a dispatcher so that it can decide what sort of event it is, and the event is then sent by the dispatcher to the associated handler so that the particular event can be processed. The dispatcher has to deal with a flow of input events. Once an event is transmitted it has to be looped back so that it can deal with the next event, this is done via the event loop. Several programs particularly those which control hardware could be endless and consequently would have to designate a special event to end the event stream (an end of file marker or pressing the escape key). For this to happen there has to be a quit facility in the dispatcher logic, so that an event looped can be stopped when the special event is found. In some circumstances, the dispatcher could decide that there is no suitable handler for the event. When this happens, the event could be ignored or an exception could be initiated. Events that dont have handlers would be ignored by A GUI program because GUI programs are only concerned about particular types of events. For example although it might act on a mouse click it may not act on mouse movement. In the majority of other programs if an event is not recognised then it is regarded as an error which causes an exception to be initiated. There is an event queue which is used for storing events when the dispatchers or handlers cant deal with the events as quickly as they come in. The events queue is brought in to the events stream where the stream can be temporarily held. When an event comes in it is put to the back of the queue and the dispatcher deals with the events at the front of the queue as quick as possible. Most GUI programs have an event queue. It might take longer to process larger events like mouse clicks, so at the same time this event is being dealt with other events such as mouse movement might build up in the queue however as soon as the dispatcher is ready it can quickly get rid of the meaningless mouse movement events so that the event queue is cleared out quickly. P2 What is most noticeable in event driven programming is the flexibility that it provides, and the way in which it makes an effort to be as modeless as much as it can.. Graphical user interface applications are usually programmed in an event driven way. Event Driven Programming is relatively easy to do especially in Visual Basic because they have incorporated some revolutionary tools to help us along. Drag and drop design tools, property sheets, plus click and code aids helps make EDP less of a burden. Because of the flexibility offered with Event driven programming, it is an extremely popular method, especially for creating GUI programs. With Visual Basic EDP is simple because we are given various design tools to work with in order to produce user interface components (windows and dialog boxes) On top of this we are also provided with a complete suite of Windows interface components (including command buttons, text fields, list boxes, pictures, drop-down menus and file system contr ols) which can be created at the touch of a button without the need to write any code.   The forms engine for producing the interface applies technology obtained from Cooper Software.  We can then add functionality to these interface components, which react to events. By programming in EDP we are also able to adapt procedures quickly and respond to faults. Event Driven programs are used in in Automatic Teller Machines (ATM), Point of Sale (POS) systems, certain types of smart cards, Internet kiosks and handheld devices M1 Windows Operating systems are event driven programs in two ways. In one way it is similar to EDP because it uses interrupt handlers which are used as direct event handlers for hardware events, but replaces the job of the dispatcher with CPU hardware. In Windows Operating systems, data and software interrupts are transferred to user processes which usually are written as event handlers themselves, so in short the Operating system perform as dispatchers. Microsoft Windows take action when initiated by messages which are sent to the main application thread. So that the program can receive these messages the program continuously calls the GetMessage function which is found in the event loop. This means that Microsoft Windows is event based. Once a little elective processing has been carried out, the DispatchMessage() is summoned to dispatch the message to the appropriate handler which is called the WindowProc. In Microsoft Windows a message loop is created by user-interactive procedures to react to events, the message is connected to the event and is forced on the OS. The event doesnt just have to be user interaction but can also be things like network traffic, system processing and timer activity. Windows operating systems also have an event queue (or message queue as it is in Windows) which is where the messages are kept. Messages are dispatched to a particular job among a cluster of collaborative jobs. Messages are received by a window handle object via a WinProc, all of which correspond to an independent task in that system. In order for the next message to be dispatched a task has to finish its job as quickly as possible. D1 Event driven Programs are able to set off warnings, based on business policies. With the network and applications repeatedly collecting and sharing observed events, organizations get direct access to â€Å"in-context† data on the root of the problem and the consequences if it was to happen. This facilitates combined decision-making which gives an organisation the power to avoid unfavourable situations and, finally, to enhance competiveness in numerous aspects. For example, if a sensor discovers that part of the equipment in an isolated plant has broke down. This data is linked to a customer contract which has a service-level agreement with it. A warning corresponding to the equipment which has broke down and its effect on the customer contract is dispatched to the appropriate personnel throughout the business —business analysts, plant operations, and production control personnel. At the same time, a meeting can be set up with these people so that they can consider th e effect of the fault, when it will be fixed, and how business procedures should be altered so that they are better prepare if it was to happen again in the future. Events dont just have to be triggered by user interaction but can also be triggered by other applications (application events) or by system events such as alarms or warnings. Copied Modern business processes often require the blending of automation into the work environment through the invocation of behind-the-scenes functions and procedures. Behind-the-scenes tasks can include the automatic production of output such as an invoice that prints automatically when an order is processed, a Web site that is automatically updated with current data, or an automatic e-mail with fresh report output when a transaction is completed. A solution often adopted is to write the application in the style of an event driven system. That is, something happening and to which a task should respond, is modelled as an event. The event is put together by a central thread of control, with the event and thread of execution being handed over to the appropriate task. It is now the tasks job to deal with that event and subsequently return the thread of execution back to the executive or dispatcher. In an event driven system, a task, when allowed to run, must return control when it no longer requires it or when it can not precede further. That is, the task cannot perform an operation which would cause execution to block within that task. If the task was half way through an operation and was waiting on more data, it would need to remember where it was and return. When the data it was waiting on arrived it would then continue from where it had previously stopped. The thread of execution must be given back to the dispatcher in order to allow other tasks to run and deal with their own events. The tasks therefore must cooperate with each other to ensure that all are able to get through their respective jobs. At a lower level, an event driven system can also be viewed as being a form of simulation system. In simulation systems, there is a list of jobs to be performed. The central executive or dispatcher retrieves the first job from the list and executes the code associated with the job. The code must eventually return so that succeeding jobs in the list can be executed. If it was not possible to finish an operation, the code for that job would add a new job to the end of the list of jobs such that the operation could be completed at a later time. The main difference with an event driven system is that the central executive or dispatcher must be aware of a number of primary event sources. When the dispatcher goes to retrieve the next job to execute, it must also check the event sources and if an event is waiting, create a job for the delivery of the event to the appropriate task. In a simulation system, when there are no more jobs to execute the program would terminate. For an event driven system, while ever any of the primary event sources are active and tasks are interested in events from those sources, the process will continue to execute. This means that if there were no jobs to execute in the list of jobs, the process would block and wait for an event to arrive. As the process itself is blocked, those events will of necessity be the result of some stimulus from the operating system. For example, a timer or alarm expiring, a signal being directed at the process, or data being ready for the process to read. But first, what are the business opportunities enabled by EDA and where do they exist? Consider the airline industry as a good example. Airline operators monitor weather sources, customer reservations, and air traffic control in real-time to manage their daily flight schedules. Their event-driven systems provide pricing adjustments and re-scheduling based on the real-time, complex analysis of those event streams in order to maximise their profitability and operational efficiency. This is a classic EDA benefit: optimised business operations with real-time information and increased operating margins Almost every company has a daily operational aspect that can benefit from an EDA solution. A poultry processor in the midwestern United States provides an example from the manufacturing sector. This processor utilises distributed cooling equipment throughout its plant to keep the temperature below 50 degrees as per U.S. Department of Agriculture regulations. Equipment malfunctions are very costly to the business all products within the processing area must be scrapped if the temperature rises above 50 degrees. The coolant substance is also a potentially harmful chemical, thus any leaks requires a plant evacuation. For all these reasons, the cooling equipment must be closely monitored and maintained, 247. This monitoring and maintenance is typically done on a regularly scheduled basis around the clock. That requires significant resources however, so the company implemented an EDA solution that included physical sensors to capture equipment diagnostic information across the plant. The diagnostic information is now automatically captured and analysed every few minutes, making it easy to identify pieces that are potential candidates for failure. Not only can they fix the equipment before it breaks, but they have also alleviated the need for round the clock maintenance staff in favour of a more management-by-exception approach. Greater efficiency and lower costs are not the only benefits. Companies are also using EDA solutions to generate a competitive advantage in their industries by providing unique and differentiated real-time services. EDA solutions provide excellent opportunities for companies to become a leader in their industry, through better management of their daily operations and the unique services they can provide to their customers. These solutions take advantage of existing IT investments, creating more value through the analysis and processing of events that already exist within most applications and IT systems. As EDA solutions have evolved into more standards-based and open systems, the speed and cost of implementation have also greatly decreased, making now an attractive time to invest.

Saturday, January 18, 2020

Philip Larkin Here

He can see everyday life during his journey, â€Å"traffic†, â€Å"workmen at dawn†. He also describes his runner into hull by the use Of the widening Of the river Hummer, which runs through Hull. It shows that he started his journey where the river was thin and at its source and has followed the winding path to its mouth. At the end of the first stanza, Larkin uses a mixture of impressions to describe the nature around him, â€Å"gold clouds† and â€Å"shining gull marked mud†.Larkin is using this mixture of positive words to describe a negative scene to portray a kind of beauty, Larkin tells the reader how it is, he is an observer. In the second stanza, Larkin describes the town, which shows that Larkin is near the ND of his journey. Larkin begins his portrayal of the town by using a list of descriptive words such as â€Å"scattered streets†, â€Å"barge filled waters, â€Å"spires and cranes†. These different descriptive words show the ac tivity of the port and portray a sense of confusion (scattered and crowded).Hull is a very busy port town and used in exporting lots of goods and has been like that for many years, which is why Larkin is able to use the historic nature of the town in his poem, † slave museum†, â€Å"residents of raw estates† (the word raw here suggests new, which shows how the port has probably been regenerated after the destruction caused in the war and the increase in demand for houses). Larkin is also telling the reader the time period in which he is writing in, â€Å"grim head-scarred wives†, generally worn by working class women; however the word grim puts a more depressing look on things.The time period is also portrayed in the description of the buses, â€Å"flat faced trolleys†, the new style of bus, with a flat face instead of curved. Also the list of different items t the end of stanza 2 show the boom in Britain after the Second World War with new technolog ies and the explosion of materialism. In stanza 3, the first line Larkin says â€Å"urban yet simple†, this can either be interpreted in a negative way or a positive way. It could show how Larkin looks down on them and feels as though he is better than them which is negative, however, it could be portrayed as though Larkin is admiring their lifestyle in a nicer, positive way.Larkin describes the port as â€Å"fishy-smelling pastoral Of ships† the word pastoral is a strange word to use however it is a link to the country side (pastoral farming) and is also a possible reference to how the port has hanged over the years and got bigger and more used and so that is why it is â€Å"fishy-smelling'. Thee city does not define Larkin, he is not part of a â€Å"cut- priced crowd† or want â€Å"mortgaged half-built houses†, in fact, most of what the city is representing is the opposite of what Larkin actually wants, which is why the last stanza is all about an isol ate place.In the last stanza of the poem, we start to understand how Larrikin preferable state isolation/loneliness â€Å"loneliness clarifies† which shows that Larkin is saying that you only really know who you are when you are alone. In the fourth stanza is where we find the first full stop of the poem which can be indicated as the train Larkin has been on has come to a halt. The caesuras in the first two lines of stanza four also help to emphasis the quietness and loneliness of the area where Larkin lived the rest of his life.We get other indications of loneliness and isolation in the poem â€Å"Mr. Balance', where a man used to live in a flat by himself with only the bare essentials in it. â€Å"Here silence stands† the alliteration of the â€Å"s† sound and the caesura help to emphasis the stillness and how the poem now comes more static compared to the movement of the previous three stanzas. The rhythm is changed by these caesuras which create a longer se ntence which also makes the poem feel slower and more static.Beyond the main madness of the town, Larkin is able to find more description of beauty which would normally be missed because he has no distractions in this isolate place â€Å"Hidden weeds flower, neglected. By the end of the last stanza, Larkin has moved from his new home to the beach where he stands, looking out over the water â€Å"ends the land†, â€Å"facing the sun† which indicates owe Larkin is now at peace, away from normal everyday madness, he is one with the elements and has no fear in facing the sun like he does with other commitments.This is also emphasizes with the soft alliteration sounds used to describe the area he is in â€Å"shapes and shingle†, â€Å"air ascends†. Larkin uses very clever use of language in the last stanza as he almost tries to paint a big picture on his canvas for his readers to see which is clearly indicated in the line â€Å"bluish neutral distance† , he tries to describe colors to clearly show the natural beauty. And the final line of the poem, really sums up Larrikin love of isolation and loneliness with the phase â€Å"initiative, out of reach† which are very unsociable words, however that perfectly describes Larrikin personality.The last stanza is different to the previous stanzas because Larkin talks about cosmically and elemental objects rather than the materialistic objects by describing the sea, sun, flowers instead of plate glassed doors and flat faced trellises. There is a rhyming scheme used throughout this poem which is very subtle and consist of very few perfect rhymes and more half rhymes.

Friday, January 10, 2020

Obesity and Genetics

Obesity is characterized by a high amount of body fat or adipose tissue. This condition is common, but varies from individual to individual. There are other factors that play a role in obesity other than eating too much of the wrong foods, not exercising, or age, and gender. This factor is genetics. People with genetic risk factors that affect energy metabolism and result in an inborn susceptibility to gain weight are much different than a person who loses weight normally. Most people don’t understand that obesity can be caused by a genetic disorder that they have no control over. People that suffer from obesity are looked down upon by society because people consider them lazy or unable to control themselves around food, when actually they may eat healthier diets than an average size person does and exercise more frequent as well. People that are obese are greatly discriminated against, their denied employment because their considered a health risk, their also denied positions that are public related such as bus’s and cabs, airplanes, as well as amusement parks, and people treat them as social failures because of this. Obese people can’t walk outside of their homes without being gawked at or harassed and hurt verbally. This making it harder for them to cope with their disorder and just to avoid the criticism most isolate them self’s from the world, psychologically leading to depression, feelings of rejection, or shame, and anger issues, as well as unhealthy living and socialization skills. Motivation is dissipated and social interactions may become limited as a result. References: Obesity and Genetics. (2005, January 1). Retrieved from http://www.medicalmoment.org/_content/risks/jan05/286751.asp

Thursday, January 2, 2020

Great Depression and Its Causes - 1256 Words

The causes of the Great Depression of the 1920s and 1930s has been argued about for generations. Most people agree on several key topics and that it was the severity and length of time the Depression lasted that was actually the most remarkable. Hoover made many noteworthy attempts to try and solve this crisis, yet in the end it was President Roosevelt and his New Deal, that brought many Americans hope for the future. The first factor in the start of the Depression was the lack of diversity in the American Economy. It relied strongly on only a few basic industries, notably the construction and automobile industries. In the 1920s those 2 industries began a rapid decline: construction became scarce and fell from 11 billion to under 9†¦show more content†¦It was known as the RFC, the Reconstruction Finance Corporation a government agency whose purpose was to provide federal loans to troubled businesses, banks and railroads. Struggling industries could now take out loans, with t he belief that the economic benefits would extend to all Americans creating more jobs than spending. This was the first time the Federal government became involved with the economy during a time of peace. Yet, the new agency failed to deal directly and forcefully enough with the real problems facing the economy from the Depression. It really only lent money to the institutions with sufficient collateral and those public works projects that promised to pay for themselves like public housing and toll bridges. The worst four months of the Depression happened in 1933, in the four months between Franklin Roosevelts nomination to the presidency and his candidacy. Unemployment hit 25%, hundreds of banks failed and the inaugural date was moved ahead 2 months to January 20 where it remains today. Roosevelt was elected on his promise of a so called New Deal, yet not telling Americans what it was. The New Deal was a legislative package of various acts to try and stimulate the economy and creat e new jobs. The first New Deal was to provide Relief, Recovery and Reform. Relief to provide jobs, recovery legislation for business and industries to recover from hard times and reform to pass legislation to stop another disasterShow MoreRelatedCauses Of The Great Depression1319 Words   |  6 Pageshaving classic satisfying life concluded when the Great Depression ushered in the negative trend that would impact the U.S. economy in 1929. Therefore, what happened? In this essay, we will discuss what the Great Depression was for the Americans, the causes of the Great Depression, and the U.S.’s recovery from the Great Depression. The Great Depression One of the terrifying times in the U.S. history is the Great Depression. The Great Depression is an economic phenomenon, which according to theRead MoreCauses of the Great Depression2012 Words   |  9 Pages The causes of the Great Depression in the early 20th century is a matter of active debate between economists. Although the popular belief is that the main cause was the crashing Stock Market in 1929 caused the Great Depression, There were other major economic events that contributed just as much as the crash, such as American’s overextension of credit, an unequal distribution of wealth, over production of goods, and a severe drop in business revenue. As these events transpired the state of economicRead More Causes of the Great Depression Essay1143 Words   |  5 PagesCauses of the Great Depression Throughout the 1920’s, new industries and new methods of production led to prosperity in America. America was able to use its great supply of raw materials to produce steel, chemicals, glass, and machinery that became the foundation of an enormous boom in consumer goods (Samuelson, 2). Many US citizens invested on the stock market, speculating to make a quick profit. This great prosperity ended in October 1929. People began to fear that the boom was going toRead MoreCauses of the Great Depression Essay1108 Words   |  5 PagesThe United States has experienced recessions about every twenty years (give or take) since the beginning of the Industrial Revolution. Nothing that had happened before was quite this serious, chaotic, or as long lasting as the Great Depression. The crash was felt far beyond those on the trading floors. Speculators who borrowed money from the banks to buy their stocks could not repay the loans because they could not sell stocks, because no one else would buy them. This caused many banks to fail,Read MoreCauses of The Great Depression Essay701 Words   |  3 Pages Imagine a society where over 25% of the population was unemployed. That is what it reached during The Great Depression (â€Å"The Great Depression†). During the depression unemployment rates were the highest they have ever been. It is highly speculated to this day on what exactly caused The Great Depression. Most historians agree it was a chain of events, one after another, that brought our country into chaos. Some events were more impactful than others. These events caused pandemonium amongRead MoreEssay on The Causes of the Great Depression697 Words   |  3 PagesThe Causes of The Great Depression History Imagine waking up one morning, only to find out that all your investments and savings are gone. So if your bank that you invested all your money in collapsed, you didn’t get any money back. This is what happened to millions of Americans during the 1930s. This era was called the great depression. The great depression was one of the worst economy issues we have ever had in history. It was a hard time for everyone. The great depression started in 1929Read More The Cause of the Great Depression Essay552 Words   |  3 PagesThe Cause of the Great Depression The economic expansion of the 1920’s, with its increased production of goods and high profits, culminated in immense consumer speculation that collapsed with disastrous results in 1929 causing America’s Great Depression. There were a number or contributing factors to the depression, with the largest and most important one being a general loss of confidence in the American economy. The reason it escalated was a general misunderstanding of recessions byRead MoreCauses Of The Great Depression And The Great Recession2292 Words   |  10 Pages1. Examine the causes of the Great Depression of the 1930s and consider what similarities and differences can be drawn with the problems from the financial and economic crisis which began in 2008. Introduction 2007-2009 in America has often been described as the worst economic crisis since the Great Depression in 1929. There was lots of debate whether the economy was slipping back to double dip recession but there is considerable evidence that the economic crisis in 2008 is worse than the crisisRead MoreCauses of the Great Depression Essay651 Words   |  3 PagesIn the 1920s, American economy had a great time. The vast majority of Americans in 1929 foresaw a continuation of the dizzying economic growth that had taken place in most of the decade. However, the prices of stock crested in early September of 1929. The price of stock fell gradually during most of September and early October. On â€Å"Black Tuesday† 29 October 1929, the stock market fell by forty points. After that, a historically great and long economic depression started and lasted until the start ofRead More Causes of the Great Depression Essay743 Words   |  3 PagesCauses of the Great Depression The Great Depression also called Depression of 1929, or Slump of 1929, began in 1929 and lasted until 1939. It was the longest and most severe depression ever experienced by the industrialized world. Though the United States economy had gone into depression six months earlier, the Great Depression may said to have begun with a catastrophic collapse of the stock market prices on the New York Stock Exchange in October 1929 call the Stock Market Crash of 1929.