Saturday, May 23, 2020

On Handling Exceptions in Delphi Exception Handling

Heres an interesting fact: No code is error free — in fact, some code is full of errors on purpose. Whats an error in an application? An error is an incorrectly coded solution to a problem. Such are logic errors that could lead to wrong function results where everything seems nicely put together but the result of the application is completely unusable. With logic errors, an  application might or might not stop working. Exceptions can include errors in your code where you try to divide numbers with zero, or you try using freed memory blocks  or try providing wrong parameters to a function. However, an exception in an application is not always an error. Exceptions and the Exception Class Exceptions are special conditions that require special handling. When an error-type condition occurs the program raises an exception. You (as the application writer) will handle exceptions to make your application more error-prone and to respond to the exceptional condition. In most cases, you will find yourself being the application writer and also the library writer. So you would need to know how to raise exceptions (from your library) and how to handle them (from your application). The article on handling errors and exceptions provides some basic guidelines on how to guard against errors using try/except/end and try/finally/end protected blocks to respond to or handle exceptional conditions. A simple try/except guarding blocks looks like: try ThisFunctionMightRaiseAnException();except//handle any exceptions raised in ThisFunctionMightRaiseAnException() hereend; The ThisFunctionMightRaiseAnException might have, in its implementation, a line of code like raise Exception.Create(special condition!); The Exception is a special class (one of a few without a T in front of the name) defined in sysutils.pas unit. The SysUtils unit defines several special purpose Exception descendants (and thus creates a hierarchy of exception classes) like ERangeError, EDivByZero, EIntOverflow, etc. In most cases, the exceptions that you would handle in the protected try/except block would not be of the Exception (base) class but of some special Exception descendant class defined in either the VCL or in the library you are using. Handling Exceptions Using Try/Except To catch and handle an exception type you would construct a on type_of_exception do exception handler. The on exception do looks pretty much like the classic case statement: try ThisFunctionMightRaiseAnException;excepton EZeroDivide dobegin//something when dividing by zeroend; on EIntOverflow dobegin//something when too large integer calculationend; elsebegin//something when other exception types are raisedend;end; Note that the else part would grab all (other) exceptions, including those you know nothing about. In general, your code should handle only exceptions you actually know how to handle and expect to be thrown. Also, you should never eat an exception: try ThisFunctionMightRaiseAnException;exceptend; Eating the exception means you dont know how to handle the exception or you dont want users to see the exception or anything in between. When you handle the exception and you need more data from it (after all it is an instance of a class) rather only the type of the exception you can do: try ThisFunctionMightRaiseAnException;excepton E : Exception dobegin ShowMessage(E.Message); end;end; The E in E:Exception is a temporary exception variable of type specified after the column character (in the above example the base Exception class). Using E you can read (or write) values to the exception object, like get or set the Message property. Who Frees The Exception? Have you noticed how exceptions are actually instances of a class descending from Exception? The raise keyword throws an exception class instance. What you create (the exception instance is an object), you also need to free. If you (as a library writer) create an instance, will the application user free it? Heres the Delphi magic: Handling an exception automatically destroys the exception object. This means that when you write the code in the except/end block, it will release the exception memory. So what happens if ThisFunctionMightRaiseAnException actually raises an exception and you are not handling it (this is not the same as eating it)? What About When Number/0 Is Not Handled? When an unhandled exception is thrown in your code, Delphi again magically handles your exception by displaying the error dialog to the user. In most cases, this dialog will not provide enough data for the user (and finally you) to understand the cause of the exception. This is controlled by Delphis top level message loop where all exceptions are being processed by the global Application object and its HandleException method. To handle exceptions globally, and show your own more-user-friendly dialog, you can write code for the TApplicationEvents.OnException event handler. Note that the global Application object is defined in the Forms unit. The TApplicationEvents is a component you can use to intercept the events of the global Application object.

Tuesday, May 12, 2020

Teaching ESL Locally - 2504 Words

Assignment 1 1. Private Schools – Depending on the school, qualifications range from a certificate TESOL course to a university/college degree. Tutoring position (company or private) – A degree or/and TESOL certificate would be required to work at a tutoring company while private tutoring, a TESOL certificate is recommended. Home Stay Family – A TESOL certificate is recommended and an available room is required. Community Centres – May required having experience, university/college diploma and TESOL certificate, depending on the centre itself. 2. All positions will depend on the individual company/school/centre with regards to qualifications. For home stay families, it is regulation to have an available room and although a†¦show more content†¦Post advertisements on websites, like Gumtree, etc. Get your name out there by word of mouth. Out of the possibilities available, which ones are you eligible to pursue at the moment? I would be able to only be eligible for homestay and private tutoring as of now, but once I complete the TESOL course I may be able to be eligible for private schools depending on their requirements. Where do you hope your ESL career will lead you? I’m hoping to become a private tutor locally which would make enough income for me to survive on one job alone instead of multiple careers. List 5 important delivery methods for ESL teachers. Direct instructions using actions Lecturing Class discussions Group work Individual instructions Assignment 2 1. In an average ESL classroom, 95 – 100% of students would be the same nationality. A multicultural classroom will have students that have different ideas, understandings, attitudes and perception of learning and classroom environments, this might be a disadvantage as teachers must work extra to become more understanding and flexible of each individual and their culture. 2. The benefit of a multicultural classroom for teaching methods is that most of the student can’t talk in the same language and can only communicate by English. This is highly beneficial as students would want to socialise with the other students, by only being able to communicate in English, they will be ableShow MoreRelatedThe Academic Achievement Gaps Between Ell Students And Native English Language Learners1241 Words   |  5 Pagesher to not be able to score on those tests. When they are inappropriately place in those special education it limits their growth academically.(3) Placement tests tend to put ELL students in ESL programs which, for the most part, are socially isolating for the students. They spend most of their day in the esl classroom, and in the cafeteria they are most likely to be sitting at a table with other ELL students away from the native english-speakers. If they are placed in regular classrooms, they areRead MoreAdvantages And Disadvantages Of Technology In Education1218 Words   |  5 Pagesand the education providers should look forward to. I would like to extend my views regarding the problems that may arise during and due to the usage and overdependence of technology for teaching purposes and precisely in ESL context, especially when the students are unable to adapt the new technique of teaching. Also, I may provide few suggestions so as these difficulties shall be overcome. TESOL Classroom With the help of internet, one can survive without a single book in the library and yetRead MoreTeaching Reading to English Language Learners5240 Words   |  21 PagesINTRODUCTION 1.1 Background of the study Teaching reading to English Language Leaners requires some strategies and preparations on the part of teachers, which includes the preparation of the lesson plan. However, an effective lesson plan teaching reading to English Second Language (ESL) students or English Foreign Language (EFL) students requires having a structure (Teaching Reading to ESL Students to Teaching ESL to Adult, NY). The good news though about teaching reading to English Language LearnersRead MoreOrganization Background Of Literacy Connections Essay2221 Words   |  9 Pagesfrom learning to read to reading to learn. Approximately 36 million adults in America are considered to be illiterate; about 14% of the entire adult population cannot read or is limited to reading at the basic or below basic proficiency levels. Locally, this means thousands of adults in our community who are unable to live independently. For adults who struggle with reading, the impact is felt in a number of ways: they unable to obtain a good paying job, make good health decisions, or read to theirRead MoreUnderstanding 21st Century Skills† in English Language Classrooms3761 Words   |  16 Pagesof the 21st century Skills movement which is helping to redefine the goals of general education for today’s world. â€Å"21st Century Skills† is commonly refers to a growing global movement for redefining the goals of education, to transform every day teaching and learning practices, and to expand the range of measures that are being implemented for student achievement, all in order to meet the new demands of th e 21st Century. In other words the main thrust of this movement is to make learners a productiveRead MoreThe District Handbook1897 Words   |  8 Pagesin learning† has been the district’s vision. This, coupled with its mission statement: â€Å"To impart the knowledge and skills that will empower all students to pursue their maximum potential to confidently contribute to and benefit from our society locally and globally,† inform their policies and attitude towards all students, especially English Language Learners. In a Frequently Asked Questions portion, the District answers the question of whether students will fall behind due to learning an extraRead MoreWhy Latinos Children Are Failing in Education? Essay1329 Words   |  6 Pagespolitics that has one approach to deal with the world, but a different standard to measure success locally. In the video the Afro-American students were prohibited of speaking their â€Å"mother tongue† language when there a re many researches that prove that students that learn to read and write in their maternal language do better in school. As Sue Blain, in her article â€Å"Multilingualism `masks deficient teaching of reading`† supports this fact by quoting the dean of education at the University of WesternRead MoreSituation of English Language Teaching3790 Words   |  16 PagesEnglish Language Teaching Situation in Pakistan Analysis) â€Å"†¦a single shelf of a good European library was worth the whole native literature of India and Arabia† (Attitude Motivation Macaulay 1935 Ms. Mehwish Haider 1 English Language Teaching Situation in Pakistan Table of Contents Introduction †¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦...3 Definition of Second language †¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦.†¦Ã¢â‚¬ ¦...†¦.4 Definition of foreign Language †¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦4 Different needs toRead MoreBullying in Schools6210 Words   |  25 Pagesusing the measure of central tendency was performed to show the mean average of collected responses. The mean takes into account, or includes, each and every score in its computations. The third grade students enrolled in English as a Second Language (ESL) and Bilingua l classrooms. The researcher will use random selection to choose forty third grade students from four classes. The Primary School Student Survey (PSSS) will be used to measure student’s experiences, perceptions, and attitudes towards bullyingRead MoreCultural Comparisons Of Mexican And Caribbean Islander Immigrants3636 Words   |  15 Pagesâ€Å"English-only† rule in his school resulted in anxiety and nerves. These emotions make it nearly impossible to focus on learning. (M. Martinez, personal communication, July 2, 2015) [primary]. Latino children may also have trouble with the different teaching styles found in America. For example, students are used to strict teachers who demand both silence and respect in Mexico may struggle to read the signals of teachers who want to make learning fun (Valdes, G. 1998) [primary]. â€Å"They wrongly assumed

Wednesday, May 6, 2020

Annotated Refernces list final Free Essays

Organizational and media stress among professional football players: Testing an Achievement Goal Theory Model This article includes a study that was to investigate media and coach- athletes stress that would be experienced by the professional football players by examining or testing the goal theory model. The study was about 82 football players that had to complete some questionnaires. In conclusion the study shows that the coaches of the professional football players are advised to reduce the emphasis on performance that would reduce the stress. We will write a custom essay sample on Annotated Refernces list final or any similar topic only for you Order Now The information in this article is objective because it was all based on some issues that happened with professional football players. The goal of this article would be showing how much these players receive. Hint the article would be useful for me in writing the paper. The article relates very much to my topic which is about stress for athletes, so I will be able to write more about what causes these athletes to have stress. Stress-Related Breathing Problems: An Issue for Elite Swimmers The article talks about a problem that elite swimmers might have stress because of breathing problems. The article showed a study that number of swimmers who have this problem is increasing. The study in the article showed 24 elite swimmers in two different swim clubs in Norway. The study explains that swimmers Will have breathing problems when they have higher intensity in their workouts and going to school above that would cause more stress in their daily life. I believe that that information is all objective because the article showed a study that occurred to some swimmers. How to cite Annotated Refernces list final, Papers

Saturday, May 2, 2020

Coke Blak Case Analysis free essay sample

Coca-Cola is the world’s largest non-alcoholic beverage manufacturer. The company has been in existence for more than 120 years and offers more than 3,500 products in more than 200 countries. Within the past 10 years, the carbonated beverage industry has experienced a decline in sales. This drop in sales is most likely associated with more knowledgeable consumers and the facts presented that link obesity to the high amounts of sugars in these beverages. In the earlier 2000s, Coca-Cola saturated the market with an abundance of new products, such as Coke Zero, Coca-Cola with Lemon, Coca-Cola Vanilla, and Coke Blak. Many of these new brands did not receive good reviews and have since been pulled from the shelves to become an idea of the past. In this analysis, I will specifically be looking at the short lived lifecycle of Coca-Cola’s Coke Blak and some possible reasons as to why this product is didn’t make the cut. Coke Blak was introduced as a â€Å"carbonated fusion beverage†, which is a coffee flavored coke. The target population of this product was a sophisticated individual in their late 20s and 30s in search of a new experience. Coca-Cola marketed Blak as having, â€Å"Coke effervescence with coffee essence†. II. Key Issues: There were many issues that Coca-Cola faced externally that would discourage consumers from experimenting with any new products that were released during the early 2000s. A push for healthier living had begun and consumers were more apt to purchase non-carbonated beverages such as juice, bottled water, tea, and coffee due to the association of obesity with high fructose corn syrup. This resulted in a decline in sales for the entire carbonated beverage industry. Coca-Cola’s response to this dilemma was to saturate the market with products that they fused with flavors such as lemon, lime, vanilla, and raspberry. Many of these products were short lived and for sometime hurt the Coke brand. Pepsi, Coca-Cola’s largest competitor, had taken its role as the non-carbonated beverage leader and showed their superior business strategy through the acquisition of other products such as Frito Lays (Howard, 2005). Pepsi had previously attempted the idea of a carbonated coffee and failed. Something that may have hurt the Coke Blak campaign was the many failures of its flavored coke just before releasing Blak. The oversaturated market of underperforming Coca-Cola products could have lead to the subsequent demise of its future ideas. III. Causes: With all the issues that surrounded the Coca-Cola brand, there were problems internally that caused Coke Blak to enter the market destined for failure. There could be a number of reasons that lead to Coca-Cola’s decision to pull Blak from the shelves. Coke Blak hit the shelves in 2006 in Europe, the US, and Canada. The European version of Blak was only sweetened by sugar while the American version replaced the sugar with aspartame, acesulfame potassium and high fructose corn syrup to alter the taste to fit the American palate. From the reviews, this product lacked taste needed to generate repeat buyers. The sophisticated population that the product targeted wasn’t impressed by the research put into the product. Aside from the taste, the packaging wasn’t very attractive. Coca-Cola used a short, skinny, 8-ounce glass bottle which was a good touch for the sophisticated audience that it aimed to reach. But they failed by covering this glass bottle completely with plastic shrink wrap, which added a cheaper feel to the bottle and obscured the view of the contents. The black and brownish gold label looked different from any other Coke product and wouldn’t impress the loyal Coca-Cola drinkers. Sight and taste are the two senses that a beverage manufacturer has to capture to remain relevant and Coca-Cola missed on both. Also, the small bottle of Coke Blak was overpriced. Blak was priced close to $3. 00 per bottle. This is the price that consumers expect to pay when going to the local Starbucks to get a â€Å"tall† coffee. The idea that a consumer would neglect a beverage that they know and love to pay the same for an attempt to compete is asinine. With the failure to market, miss on taste, bad presentation, and lofty price tag, Coke Blak was destined to fail, but many alternatives exist to get Blak out of the red and back in the black. IV. Alternative Solutions: Coca-Cola had the opportunity to control the market, but many other steps could have been taken to do so. Seeing that other manufacturers had failed repeatedly trying to perfect the concept, they had the chance to conduct extensive taste tests and research the reasons that similar products like Pepsi-Kona and Mazagran (Pepsi and Starbuck’s ‘sparkling’ coffee) failed, in the past (Melody, 1995). Their results should have lead them in the direction to possibly collaborate with a well known coffee distributor to perfect this new unusual blend of coke and coffee, such as The J. M. Smucker Company that owns Millstone and Folgers and manufactures for Dunkin’ Donuts. Collaborating with a middle grade coffee distributor carries too well known names and helps to keep costs low and affordable for the consumer. Another missed step in the process was the packaging of Coke Blak. The failure to appeal to its consumers could have turned out to be catastrophic for the product. Coca-Cola failed to leave the brand recognizable to its loyal consumers. Incorporating red into the label and enlarging the ‘Coca-Cola’ on the bottle would entice Coke drinkers to buy the drink and possibly inform the company on what should be done to perfect the taste. That brings me to my next point, to improve the quality of Coke Blak. Since Coca-Cola failed to do the necessary market research, they could have offered the product at a discount and encouraged consumers to go on a preset blog or call in to give their opinions. This step would require monitoring and take even more time to get a completely finished product on the shelves, but a good thing is worth the effort and could prove to be profitable for Coca-Cola. This step would also be showing the customer that Coca-Cola values customer input and are willing to make the necessary changes to satisfy the demand of its consumers. The least innovative approach to this dilemma would be to totally get away from a carbonated coffee idea. From the success of Starbucks, Dunkin’ Donuts, and other coffee retailers, we know that consumers love their coffee. From Coca-Cola’s success, we know that consumers love their cokes, but in this equation 1+1? 2. The coffee connoisseurs and coke lovers do not want a combination of the two. Coca-Cola could however branch out and gain a share of the coffee industry by venturing away from the carbonated beverage to produce a beverage for the enjoyment of coffee drinkers that still prefer to see the Coca-Cola name. V. Best Solution: Personally, I am a risk taker, so the challenge of combining the two appeals to me. However, there is no easy way for Coke to handle this. Much work is needed on the part of the manufacturers and the sales marketing team to ensure that the voices of the consumers are heard. A combination of the alternative solutions listed above is needed to make the promotion of Coke Blak more successful than its original release. By now knowing what caused the initial failure of Coke Blak, it would prove to be a less daunting task of combining a carbonated drink with a coffee flavor because the areas that need to be focused and prioritized are essentially already laid out. Realizing that the Coca-Cola brand is not prepared to enter the coffee industry alone is the initial step towards improving Coke Blak. They would need to join forces with a well known, yet affordable coffee distributor, such as Folgers. Folgers is affordable and equipped with a variety of different blends that may present a better combination with coke. Coca-Cola would need to retain the largest share in this collaboration to preserve the name, while including Folgers on the label. After extensive testing and the two companies feel that they have produced a quality product, they should bring in a control group made of individuals that enjoy both coke and coffee to get a response on the combination. Once the companies have received a positive response from their control group, they should move to packaging. Utilizing the well known red label and enlarging the ‘Coca-Cola’ on the bottle would entice loyal Coke drinkers to try the beverage. The drinks should be distributing in larger bottles, such as a 10 or 12 oz. The glass bottles would continue to attract the sophisticated consumer without the plastic shrink wrap. This would allow the customer to see the drink and show confidence in the product. After mastering the packaging, the companies would then be able to move to the final phase of the product reproduction, the pricing. Coca-Cola and Folgers are both affordable brands and this should be a main factor when properly pricing Coke Blak. They would need to price this product in a way that remains affordable to the everyday convenience store shoppers. Overpricing would reduce their target market. They would have to price in a way that the consumer would choose their product over the many other competitors’ products. A good starting price to consider would be $1. 89. This keeps the price comparable to its other products and less than the competitor’s products. VI. Conclusion: Coca-Cola failed to combine the two and may have presumably abandoned the idea of doing so. However, if they were up to the challenge of making another attempt to reproduce the product they would be able to take advantage and learn from their previous mistakes. In order to combine the two, coffee and coke, and maintain the â€Å"Coke effervescence with coffee essence†, Coca-Cola would need to focus on mastering the taste, packaging, and price of Coke Blak.