Wednesday, March 18, 2020

On Handling Exceptions in Delphi Exception Handling

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.

Sunday, March 1, 2020

The Code of Justinian (Codex Justinianus)

The Code of Justinian (Codex Justinianus) The Code of Justinian (in Latin, Codex Justinianus) is a substantial collection of laws compiled under the sponsorship of Justinian I, ruler of the Byzantine Empire. Although the laws passed during Justinians reign would be included, the Codex was not a completely new legal code, but an aggregation of existing laws, portions of the historic opinions of great Roman legal experts, and an outline of law in general. Work began on the Code shortly after Justinian took the throne in 527. While much of it was completed by the mid-530s, because the Code included new laws, parts of it were regularly revised to include those new laws, up until 565. There were four books that comprised the Code: Codex Constitutionum, the Digesta, the Institutiones and the Novellae Constitutiones Post Codicem. The Codex Constitutionum The Codex Constitutionum was the first book to be compiled. In the first few months of Justinians reign, he appointed a commission of ten jurists to review all the laws, rulings and decrees issued by the emperors. They reconciled contradictions, weeded out obsolete laws, and adapted archaic laws to their contemporary circumstances. In 529 the results of their efforts were published in 10 volumes and disseminated throughout the empire. All imperial laws not contained in the Codex Constitutionum were repealed. In 534 a revised codex was issued that incorporated the legislation Justinian had passed in the first seven years of his reign. This Codex Repetitae Praelectionis was comprised of 12 volumes. The  Digesta The Digesta (also known as the Pandectae) was begun in 530 under the direction of Tribonian, an esteemed jurist appointed by the emperor. Tribonian created a commission of 16 attorneys who combed through the writings of every recognized legal expert in imperial history. They culled whatever they though was of legal value and selected one extract (and occasionally two) on each legal point. They then combined them into an immense collection of 50 volumes, subdivided into segments according to subject. The resulting work was published in 533. Any juridical statement that wasnt included in the Digesta was not considered binding, and in future it would no longer be a valid basis for legal citation. The  Institutiones When Tribonian (along with his commission) had finished the Digesta, he turned his attention to the Institutiones. Pulled together and published in about a year, the Institutiones was a basic textbook for beginning law students. It was based on earlier texts, including some by the great Roman jurist Gaius, and provided a general outline of legal institutions. The  Novellae Constitutiones Post Codicem After the revised Codex was published in 534, the last publication, the Novellae Constitutiones Post Codicem was issued. Known simply as the Novels in English, this publication was a collection of the new laws the emperor had issued himself. It was reissued regularly until Justinians death. With the exception of the Novels, which were almost all written in Greek, the Code of Justinian was published in Latin. The Novels also had Latin translations for the western provinces of the empire. The Code of Justinian would be highly influential through much of the Middle Ages, not only with the Emperors of Eastern Rome, but with the rest of Europe.   Resources and Further Reading Grapel, William.  The Institutes of Justinian: with the Novel as to Successions. Lawbook Exchange, Ltd., 2010.Mears, T. Lambert, et al.  Analysis of M. Ortolans Institutes of Justinian, Including the History and Generalization of Roman Law. Lawbook Exchange, 2008.

Friday, February 14, 2020

Auditing Essay Example | Topics and Well Written Essays - 1000 words - 8

Auditing - Essay Example The following are the five main areas of high audit risk that face Havelock Europa Plc. The Company is said to provide equal opportunities to all employees for growth, training and career development regardless of age, sex, ethnic background or religion. They also consider the disadvantaged in the society and give them opportunities where they fit. In case an employee is disabled on course of duty, the company makes reasonable adjustments to accommodate such a member of staff. However, this information cannot be proved. According to the financial statements issued, it is hard to establish whether employees are remunerated fairly. Consolidated accounts make it difficult to establish whether employees from various subsidiaries are compensated fairly. The total number of employees for both 2012 and 2011 are given as 649 and 731 respectively, but the exact month when the new employees joined is hard to establish (Havelock Europa Plc 2012, P. 63). It is not sensible to assume all the new employees joined at the beginning of the year. Wages and salaries for the whole year ar e given, but auditors will be unable to determine the numbers of hours worked overtime that is usually not fixed. There is also likelihood that some of the employees being compensated exist only in books, the auditors may be unable to meet all employees especially those who do not work in the parent company (Porter et al 2008, p. 90). The financial statements presented show the values of noncurrent assets and inventory for both years (2011 and 2012). Non- current assets are reported on their deemed cost because any other value can only be an estimation (Havelock Europa Plc 2012, p. 82). The cost of the asset is then adjusted for depreciation every year using a specified formula. The risk arises in that the formula is only estimation and the auditor cannot be certain about those values. The notes to the financial statements also reveal the expected lives of both the tangible and intangible assets

Saturday, February 1, 2020

Pitfalls Essay Example | Topics and Well Written Essays - 250 words

Pitfalls - Essay Example This primarily happens due to the selection of wrong statistical methods or wrong size of survey population or both. It is highly expensive to select a large survey population and conduct interviews/form fill-ups extensively. So samples are smaller than the target population. However, sophisticated methods like purposive sampling may help, but still it is important to accommodate as many respondents as possible in a given survey population. 2. Making conclusions from non random samples too can prove to be a dangerous tendency. Samples must me random. Suppose, a woolen garment manufacturer conducts a survey only in the colder countries of northern Europe. In this way, they will calculate high demands existing in the global market, if they don’t randomize. In order to randomize, they will have to interview customers in temperate regions (e.g. southern Europe) and arid regions (e.g. Sub Saharan Africa). Then only a realistic view of market demand for woolen garments can be obtained. Hence, randomization is necessary to prevent biasing, especially in the case we need globally applicable inferences. 3. Attaching importance to rare observations is a clever strategy but risky practice. If rare observations are given as much importance as random observations, general behavior of the majority of the target population may be interpreted wrongly. It is a far better idea to mark rare observations as exceptions so that they can be studied separately by the means of statistical segregation in a more controlled business environment. 4. Using poor survey methods is the worse mistake. Survey methods are crucial. For example, when research involves exploration of natural resources, data has to be collected with the help of researchers who have trekking/exploration/fieldwork expertise. In the case of intellectual property research, we would need researchers who can research on databases and patent archives. That will involve extensive Internet/library research expertise. In

Friday, January 24, 2020

Two Wrongs Dont Make A Right? Essay -- essays research papers

Two Wrongs Don't Make a Right? The question of whether capital punishment is right or wrong is a truly tough choice to make. Capital punishment (death penalty) is legal because the government of the United States of America says that it is all right to execute another human being if their crimes are not punishable by other means. There are many different forms of capital punishment. Some of the most popular ones have been hanging, firing squad, electrocution (the chair), the gas chamber, and the newest lethal injection. In the readings of George Orwell, Edward I. Koch, and Jacob Weisberg, there are incites to capital punishment that are not usually thought of or expressed aloud. Also in the movie "Dead Man Walking," the act of lethal injection, a form of capital punishment, is presented and made visual for one's eyes. Both the readings and the movie hit on emotions that some people have never thought about feeling. With the many people in the world there are many different feelings on capital punishment. Upon reading George Orwell's "A Hanging," the reader can obviously see that the writer is against capital punishment. Orwell brings out many of the points that are considered for argument against the death penalty. Orwell writes "It is curious; but till that moment I had never realized what it means to destroy a healthy, conscious man. When I saw the prisoner step aside to avoid the puddle, I saw ...

Thursday, January 16, 2020

Proper Ways of Getting Student Visa

Proper ways of getting student visa in any country is very difficult but if anyone knows the terms there will be no problem at all. How a student will complete every process in a proper way. Maximum students face some tout people or we can say some tout agencies whose main purpose is to steal money from other and specially they target the poor students most of the time. The student face hoodwinks and lost everything because they didn’t know the proper way. Sometimes they face difficulties like unknown environment, money problem, house problem, college/university problem and etc. So if a student has a good knowledge of getting correct student visa, which is very important. That’s because we are researching on this topic to collect maximum amount of correct and helpful information from different sources. Thesis Statement In our research paper, we are going to discuss about the basic requirements for a student of student visa, different types of process of getting visa, and visa consultant’s suggestions and interviews. We also include the terms and condition of getting visa of some particular country like Australia, UK, Turkey. While applying for a student visa we need to know what the basic requirements of a country are. There are lots of regulations but the basic or core requirements are the same for every country in the world. Education qualification, Additional qualification, Financial solvency are the three basic requirements of a student visa. While collecting information about student visa process we found this type of information from one of chosen person for interview was a Visa secretary and Public Relation Officer of Embassy of the Republic of Turkey, Sk. Haider Ali. He is working there for 24 years and an experience person at visa section. He told us â€Å"To apply for a student visa, the enthusiastic student must know the requirements; those are Education qualification, Additional qualification, Financial solvency. † We search this kind of information in the first step. † So first thing the student’s should remind of, he or she has to be well educated. Then they must provide their education certificates. At first, giving student visa there was few rules which student had to follow, there are still rules but moderated by time by our government. A good who has very good result in his or her educational life, they will have the advantage of apply for the student visa but recently that rule is changed by collaborating both our government and the embassies of the world in our country. The recent rule is that, student can apply but in a range. For example, In German scholarship or student visa, student who have scored 4. 50 in his higher secondary school certificate is the minimum requirement. Above 4. 5 the students can apply. Then they will check the student’s documents and will call for interview for final selection. There they will select the best candidate who will have scholarships or student visa. Actually student of Bangladesh search for scholarship rather than student visa because they can get benefits as a scholarship student. Then the second basic requirement is the additional qualification. Additional qualifications means that the students extra qualities like, different types of certificates, language efficiency, IELTS, TOFEL, GMET, etc. are. Student must have a IELTS or GMET to get scholarship. Different countries ask for different score. For example, Australian Embassy asks 7. 0 as a minimum IELTS score for interested student applied for scholarships. After that, it comes financial solvency. Each and every country and embassy ask for financial solvency because if the student faces some difficulties his/her parents must have enough financial support in case of emergency. This process is mandatory for each and every student who want to apply for student visa or scholarships. For example , one of the Australian Embassy’s policies is that the student’s parents have to show 22 lakh taka in their financial solvency. When a student wants to go abroad for higher study they must know the basic requirements of a student visa. But only knowing them is not enough. They must have to know the proper ways of getting it. The best way to know about any kind of scholarships or student visa availability is to visit the Embassy of the country which a student is willing to go. Then they should ask everything about requirements and other necessary things which will be needed. The steps they will tell the students are the correct. But some cases there are some agencies working with the embassy. Such as USA Embassy, UK Embassy, Italy Embassy and some other Embassies have their registered visa agencies in our country. The students can go there and find important information. Students must come to embassies to collect proper information about this kind of agencies. In this case, students face hoodwinks. For not knowing the correct information they face many problems. Fraud people steal money from them and don’t show after a few days later. So the students first go to the embassy for information, then they should ask about their having any kind of agencies. So students should be careful about this. Going to the embassy directly is the best way but there is another way of getting student visa. The agencies, they are setting a business here. Actually, some of this agencies are authorized by the government. They help the government and the students to get visa. Their job is to provide information about scholarships or student visa and the culture and other important things to the students. They collect passport and other important document from the students and send it to the embassies for visas. After that, they tell the students who get to face an interview and take them to the interview. A agency like BSB Foundation is well known to all by now. They have link to every embassy but they are able to help students sending them to Malaysia, Singapore, Thailand, Japan and few other countries in the world. Overseas Student Consoling Services Bangladesh, Atlas Education Consultants and different agencies are also well known in our country. There is another way a student can apply for student visa. Although, a student get to face an interview most of the time when they apply to a university and they invited him/her. Like that, student get the chance to apply before giving interview. The process is simple. Every year the embassies agencies or different countries universities or colleges come to visit Bangladesh and arranged study fair to offer them to visit their universities or colleges for higher study. There student get the most of the advantages. Students are selected their by the faculty members of the offered universities or colleges. Then, they send their documents to the embassy for visa process and they found much easier than other processes. But these kind of fairs arranged very few in our country. Specially USA, Australia, Malaysia, Singapore, India, Sweden, Germany, etc. country arrange study fair most of the times. So it is another way of getting visa and it is proper way too. But students who are interested to apply for a student visa, they must know the information very well. The suggestions are simple, if they want to go abroad, they should apply for the scholarships and visit the website of their own chosen universities or colleges. If they want to go on their own money rather than scholarships, they might face so many problems. Student visa has many formalities. Although there are rules and regulations but students face difficulties. Many students don’t get the chance to apply for. It depends on the embassies. Few of the embassy don’t hesitate giving student visa. But most of them don’t want to give because after giving student visa, they go abroad and start business there of their own which is illegal. Because of this reason embassies don’t want to give student visa. They give student visa but not to everyone. As a matter of fact, some agencies are doing this kind of illegal business. They stay near embassies which are very popular are very crowded, they ask every single person. There students got stuck. Because they don’t know they are authorized or not. Then they face hoodwink. Many agencies tell the students that they are legal but ultimately they are not. They provide visas to the students but when they go abroad they don’t find anything they were told that they will find, The students who face hoodwink, they don’t find themselves studying but working for their food. So students must be careful about this kind of situation. They must collect information and solid information. What we are telling is the way and alerting the students how they will face problems. So that, they should be careful about getting visa. But recently that hoodwink is reducing because of our government. They are trying everything to stop because most of the fraud people are from the government. The most effective step was to create the MRP (Machine Readable Passport). For this, a very little chance of facing trouble for the students. In that passport everyone’s information is given by a number. Inputting that number they will see every detail information about a person. For that every embassies are asking the students to bring MRP Passport before visiting embassy. Due to shortage of time and some difficulties we were unable to take interviews. Actually we didn’t get permission to take interviews. But we were able to take an interview. His name is Sk. Haider Ali. He is Visa Secretary & PRO of Embassy of The Republic of Turkey and a experience person at this sector and rules. We ask him, â€Å"Sir, What are the basic requirements you search in students who want to go to your country with student visa? He answered, â€Å"To apply for a student visa, the enthusiastic student must know the requirements, those are Education qualification, Additional qualification, financial solvency. † We search this kind of information in the first step. † Then, â€Å"Do you search any kind of information about the student’s background? † He replied, â€Å"No, we don’t because when a student applies to us they have to bring the certificates of his/her education, they must attach those documents from Education Ministry and Foreign Ministry. If they attached the documents, that means his/her documents or certificates are clear. † We also asked him, â€Å"Can students face difficulties when they will go there to study? If, then what kind of difficulties they might face there? † He again answered, â€Å"Basically who ever go there don’t face many problems. The problems they might face is to cope with the environment because it is new to them, and they might also face food problem and house problem. If they got scholarship then they won’t be facing these problems. â€Å"What kind of suggestion do you want to give to the students who want to get student visa and want to go abroad? † We again asked. â€Å"The main suggestion is that, who ever want to go to abroad they first come to the embassy and ask what will be important and want kind of documents they need to show to us. Another one is that there is a lot of tout people around us, so be careful and be safe from them. If they find you, t hey won’t let you leave without giving them lot of money. † He replied.

Wednesday, January 8, 2020

Leadership Theories Transformational Leadership Essay

Describe the role of leadership types within teams. What are some of the primary reasons teams fail? What can be done to ensure team success? Give a personal example of team success. Support your discussion with appropriate leadership theories that apply. Transformational Leadership can play a role in creating a successful team. It can also be the process that changes and transforms people dealing with emotions, values, ethics, and standards. Transformational Leadership is the process whereby a person engages others and creates a connection that raises the level of motivation and morality in both the leader and the follower (Northhouse , 186). This applies to a team because you always have to be able to connect and motivate others†¦show more content†¦Communication is the key to success. A team without communication could never be successful. Communication is important because the group needs a clear goal and also they need to have shared objectives. For example, in footb all a defense needs to be on the same page; if two players on the defense are on different pages then the defense will not be successful. You need everyone to share the same objective in order to succeed, not just a few people but all as one. To ensure a team’s success, everyone on the team has to be accountable. Everyone has a job on the team to contribute to becoming successful as a whole. Also you need trust in order to become successful; you have to be able to trust in your team that they will give their all for the team. Compare and contrast at least three major theories of leadership, fully describing the major elements of each. Your response should include your analysis of the strengths and weaknesses of each model, including how they might apply in actual situations. The three types of leadership I will be comparing are Transformational, Servant, and also Authentic leadership. Authentic leaders are self-actualized individuals who are aware of their strengths, their limitations, and their emotions. They also show their real selves to their followers. They also don’t hide their mistakes or weaknesses out of fear of looking weak. Authentic leaders are able to put the mission and the goals of the organization ahead of theirShow MoreRelatedTransformational Leadership And Authentic Leadership Theories1598 Words   |  7 PagesTheories Out of all the different leadership theories I learned about this semester I really feel that I best relate to transformational leadership and authentic leadership theories. During the development of my personal theory I found that these theories tended to list many similar traits, and values that aligned with my own. Additionally, both authentic and transformative theories place a significant amount of emphasis on the relationship between the leader and her/his followers. The success andRead MoreThe Leadership Theory And Transformational Theory1482 Words   |  6 Pagesexecutive, it is important to know these traits and leadership styles in order to be successful in the business and medical world. There are a number of different leadership theories, models, and styles that could be useful towards becoming a successful leader. The situational theory, contingency theory, and transformational theory are the three leadership theories that stand out the most to me. As a future healt hcare executive, shadowing these leadership approaches will help me become the successfulRead MoreLeadership Theories/ Approaches (Situational and Transformational Leadership)2362 Words   |  10 Pagescome to people on this is to achieve Leadership but to be able to do it, it is imperative to understand its meaning, its strengths, its weaknesses and all concepts that may help individuals and organizations to approach it in their modern world. Thanks to these needs, many researchers have been looking for answers and ways to represent what is leadership significance. The purpose of this essay is to analyze and discuss two theories/approaches of leadership, in order to gain a better understandingRead MoreLeadership Theory, Transformational, And Transactional Theory2421 Words   |  10 Pages Leadership Theories Unit 3 PSF8603 - Management and Leadership Theory Instructor Steven Kline Capella University Ann-Marie Cameron Introduction There are a few leadership theories, but for this research I will only focus on four of these theories. The theories that will be discussed are Situational leadership theory, Contingency theory, Transformational, and Transactional theory. The theory Transformational is pondered by several to be the theory improvement for transactional leadershipRead MoreThe Theory Of Transformational Leadership Perspective And Parenting Essay1583 Words   |  7 PagesThis literature investigates leadership theories to gain a clearer image and pathway definition of the relationship between leaders and followers, and in doing so we uncover the extent of the effect this relationship has on the whole organisation. Consequently, the essay explores the theory of transformational leadership perspective and parenting. Therefore, a leader in many ways can be portrayed as a parent because transformational leadership is not just about right now but rather about rightRead MoreSituational Leadership Theory, T ransformational, And Transactional Theory2386 Words   |  10 PagesIntroduction There are a few leadership theories, but for this research I will only on four of these. The theories that will be discussed are Situational leadership theory, Contingency theory, Transformational, and Transactional theory. The theory Transformational is pondered by several to be the theory improvement for transactional leadership theory, and it appears to have a cumulative number of research studies that are supporting the benefits of this theory. So, I will also compare and discussRead MoreTransformational Leadership And Leadership Theory Essay1417 Words   |  6 PagesTransformational Leadership Theory was introduced in 1978 by political sociologist James Mac Gregor Burns and expanded by industrial psychologist Dr. Bernard Bass. In this theory, Burns differentiated two styles of leadership: transformational leadership and transactional leadership. In transformational leadership, it is a process where both the leaders and the followers elevate motivation and morality. The transfo rmational leaders pay attention to the needs and motives of followers and help themRead MoreLeadership Theories : Transformational Leadership2251 Words   |  10 Pagesfrom the different theories of Leadership, I found Transformational Leadership the best theory to identify with. Before going further with this theory, I want to state the most accurate Leadership definition for me. Leadership is a development of social influence and an exchange of values, behaviors, and power delegation between leaders and followers, where leaders maximizes efforts of the followers to achieve a collective goal (Kruse, 2013). Moreover, Scholars has divided leadership into different areasRead MoreLeadership Theories Of Transformational Leadership4045 Words   |  17 PagesA1. Leadership Theories As the CEO of Zappos.com, an online retailer that specializes in the sale of shoes, Tony Hsieh has seen the company grow from a struggling start up to a billion dollar business. Because of his leadership, Zappos.com was listed as 86 on Fortune Magazine’s list of best companies to work for in 2015. Hsieh’s method of leadership was analyzed against the common theories of leadership and it was found that transformational leadership was the most closely aligned with Hsieh’s approachRead MoreThe Theory Of Transformational Leadership Essay3267 Words   |  14 PagesBass (Bass Steidlmeier, 1999) condenses many of the criticisms of transformational leaders, stating that they risk succumbing to the temptation of self-promotion, since the process sometimes revolves around impression management, or controlling the flow of information to influence people’s perceptions. He purports that this is incompatible to the maturation of collaboration, consensus-building and participative decision-making, and adds that self-promotion and a focus on self-interests can shift