Tuesday, November 26, 2019
How to Make a Delphi Login Form
How to Make a Delphi Login Form The MainForm of a Delphi application is a form (window) that is the first one created in the main body of the application. If you need to implement some kind of authorization for your Delphi application, you might want to display a login/password dialog before the main form is created and displayed to the user. In short, the idea is toà create, display, and destroy the login dialog before creating the main form. The Delphi MainForm When a new Delphi project is created, Form1 automatically becomes the value of the MainForm property (of the global Application object). To assign a different form to the MainForm property, use the Forms page of the Project Options dialog box at design time. When the main form closes, the application terminates. Login/Password Dialog Lets start by creating the main form of the application. Create a new Delphi project containing one form. This form is, by design, the main form. If you change the name of the form to TMainForm and save the unit as main.pas, the projects source code looks like this (the project was saved as PasswordApp): program PasswordApp; uses Forms, main in main.pas {MainForm}; {$R *.res} begin Application.Initialize; Application.CreateForm(TMainForm, MainForm) ; Application.Run; end. Now, add a second form to the project. By design, the second form thats added gets listed in the Auto-Create Forms list on the Project Options dialog. Name the second form TLoginForm and remove ità from the Auto-Create Forms list. Save the unit as login.pas. Add a Label, Edit, and Button on the form, followed by a class method to create, show, and close the login/password dialog. The method Execute returns true if the user has entered the correct text in the password box. Heres the full source code: unit login; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TLoginForm class(TForm) LogInButton: TButton;pwdLabel: TLabel;passwordEdit: TEdit;procedure LogInButtonClick(Sender: TObject) ; publicclass function Execute : boolean;end; implementation{$R *.dfm} class function TLoginForm.Execute: boolean;beginwith TLoginForm.Create(nil) dotry Result : ShowModal mrOk; finally Free; end;end; procedure TLoginForm.LogInButtonClick(Sender: TObject) ;beginif passwordEdit.Text delphi then ModalResult : mrOK else ModalResult : mrAbort; end; end. The Execute method dynamically creates an instance of the TLoginForm and displays it using the ShowModal method. ShowModal does not return until the form closes. When the form closes, it returns the value of the ModalResult property. The LogInButton OnClick event handler assigns mrOk to the ModalResult property if the user has entered the correct password (which is delphi in the above example). If the user has provided a wrong password, ModalResult is set to mrAbort (it can be anything except mrNone). Setting a value to the ModalResult property closes the form. Execute returns true if ModalResult equals mrOk (if the user has entered the correct password). Don't Create MainForm Before Login You now only need to make sure the main form is not created if the user failed to provide the correct password. Heres how the projects source code should look: program PasswordApp; uses Forms, main in main.pas {MainForm}, login in login.pas {LoginForm}; {$R *.res} beginif TLoginForm.Execute thenbegin Application.Initialize; Application.CreateForm(TMainForm, MainForm) ; Application.Run; endelsebegin Application.MessageBox(You are not authorized to use the application. The password is delphi., Password Protected Delphi application) ; end;end. Note the usage of the if then else block to determine if the main form should be created. If Execute returns false, MainForm is not created and the application terminates without starting.
Saturday, November 23, 2019
How to Bring Clarity to Business Writing
How to Bring Clarity to Business Writing Clarity in business writing allows your ideas to be easily understood, free of add-on words that make a sentence murky and convoluted. There are several rhetorical strategies to achieve clarity, but here are three techniques that best sweep away the bloat to let your ideas shine. Business Writing Clarity Strategy #1: Unsmother Your Verbs Focus on verbs.They are the action of a sentence, and the best opportunity to enhance clarity. Imagine watching a Bruce Willis movie that shows Bruce napping or knitting or whittling on a park bench for 90 minutes... Bored yet? So too are readers if your writing has little action or wimpy verbs. Unsmother your verbs. Smothered verbs are so common in business writing that they feel correct when you use them. However, a smothered verb adds nothing but bloat and the tone feels both timid and boring to a reader. This article will explain smothered verbs in detail. You will cut at least 25% of unnecessary words by simply unsmothering verbs. Let the verb do its job in a sentence without smothering add-on words. The impact on business writing clarity is amazing. Business Writing Clarity Strategy #2: Avoid Adverbs Choose powerful verbs that connote meaning, which don't need a second modifying word to do their job! For instance: "The attendant shouted loudly." "The attendant shouted," is a perfect sentence. "Loudly" is inferred and extraneous. "The executive ran quickly into the boardroom." "Ran quickly" is wasteful. Pick a better verb. "The executive sprinted into the boardroom" is concise, visual, and lively. Business Writing Clarity Strategy #3: Recognize the Power of Short Words. Years back, some business writers felt they conveyed their intelligence more by dropping long words, when short words actually worked better. Rhetorically, this has never been good writing. Long words donââ¬â¢t make you sound intelligent unless used very skillfully and judiciously. In the wrong situation theyââ¬â¢ll have the opposite effect, making you sound pretentious and arrogant. Theyââ¬â¢re also less likely to be understood and more awkward to read. I've always loved Hemingway's response when Faulkner criticized him for his limited word choice: Poor Faulkner. Does he really think big emotions come from big words? He thinks I donââ¬â¢t know the ten-dollar words. I know them all right. But there are older and simpler and better words, and those are the ones I use. Example: Fine, but can be improved: It has never been a good writing practice to use big words indiscriminately. Better: It has never been a good writing practice to use big words needlessly. ("Needlessly" is shorter and simpler than "indiscriminately.") Best: It has never been a good writing practice to bloat with big words. (More powerful verb "bloat" instead of vague verb "use" eliminates the need for modifying adverb "needlessly.") Remember this maxim:Write to express, not to impress. Good business writers use short words well. Richard Lederer sings the praises of the short word to enhance clarity in his book, The Miracle of Language: Here is a sound rule: Use small, old words where you can. If a long word says just what you want to say, do not fear to use it. But know that our tongue is rich in crisp, brisk, swift, short words. Make them the spine and the heart of what you speak and write. Short words are like fast friends. They will not let you down. Read more about the power ofshort words. A clear business report allows an executive to easily understand a recommendation. A clearbusiness email allows all the readers to quickly understand. A proposal that clearly expresses your value wins the sale. Apply these clarity principles, and we're all able to understand each other better. Enjoy this article? Subscribe to this blog.
Thursday, November 21, 2019
BOOK REVIEW THE MAN WHO KNEW TOO MUCH BY LEAVITT, DAVID Essay
BOOK REVIEW THE MAN WHO KNEW TOO MUCH BY LEAVITT, DAVID - Essay Example In his book The Man Who Knew Too Much: Alan Turing and the Invention of the Computer (Great Discoveries) the author David Leavitt presents his view on mathematics where he discusses the inability of the subject mathematics to penetrate the popular culture. He presents his idea through the life of Alan Turing, the famous mathematician and self-proclaimed homosexual, who decoded the 'enigma' machine during the WWII. The writer argues that where other subjects like literature and law can be discussed with common nonprofessional mathematics on the other hand seems to be subjected for only few that according to the author may be represented as bliss of sixth sense. It is painful for the mathematicians to feel all lonely and is not able to discuss matters of their subject with the commoners as that would not be understandable by anyone. This is a sense of isolation and though however beautiful that the world of mathematics the writer considers this isolation to be difficult to handle. Nevertheless, he is optimistic that with the development of the human intelligence, ultimately all would master the art of mathematics and though he himself refers it as an utopian thought he cannot stop thinking that mathematics should be perceptible by all or at least all should try for that.
Tuesday, November 19, 2019
Social Policy Essay Example | Topics and Well Written Essays - 1500 words
Social Policy - Essay Example It has been playing a curial role in meeting the health demands of the population. There are several intersectoral initiatives that have been taken to address the issue of health care in the UK. This has been influenced by the changes taking place in the health environment in the world and in the continental Europe. The changes have been implemented at the national levels with a trickle down effect felt in the lower level. The UK government has considered health care to be one of its important factor in the development of the social and economic life of the people. Most of the initiatives which are taken at the n atonal level are implemented through the NHS which is then implemented at the local government level. One of the current initiatives that have been implemented in the UK is the individual budget which is to start working in 2009. Under this program individual will be given more autonomy in the management of the funds that they receive from the social care system. This has also been extended to the health care system where individual will be given autonomy to decide on how they are going to use their money. Most of those patients who have been receiving their medical care through the NHS under the social care system will not be given autonomy to decide on the most appropriate health care providers that they will be attending. (Buttler, 2004) This initiative is expected to give the users of the social health care more independence in management of their health care needs. Unlike in the paste where the have been receiving their health services through the NHS they will be able to access these services even from the private practitioners. (Holmes, 2007) Another current heath care initiative that is likely to have an impact on the social care system is the health screening for over 40s. Under this initiative, the government twill be screening those who are over 40 years fro health complications that they may be facing. This initiative is expected to counteract the spreading wave of lifestyle diseases that continued to threaten the life of the aging population. This is a national program that will be expected to identify vulnerability to the vascular disease that has continued to claim the lives of many people in the UK. It is expected that the initiative will help to prevent up to 9500 heath attacks and strokes which occur every years and this could lead to saving of more than 2,000 lives. In the UK, vascular diseases in collection including heart disease, stroke, diabetes, and kidney diseases affects the lives of more than four million and leads to loss of more than 170,000 people every year. Vascular disease have also been shown to account for more than half of the mortality rate gap that exist between the rich and the poor as result of the gap in their lifestyles. Education There are several changes that have also taken place in the UK social care system as far as education is concerned. One of the problem that had been experienced in the education sector for along time had been the problem of inclusion education. The current move by the government to work for inclusive education in which children learn in the same class regardless of their disability has been seen as one of the most important way of helping all children access classroom. (Harwin, 2004) Another plan that took effect in 2003 saw the sending
Sunday, November 17, 2019
Extended School Day Essay Example for Free
Extended School Day Essay Imagine you are a seven-year-old whoses parents work until five each night. When you come home after school there is no one home with you. What could you get into? You might know right from wrong but you still might get yourself into some trouble. Just out of plain curiosity you might get into something or an accident could happen without you even being involved in it. But I say there is a way to stop this from ever happening. I think we should either keep schools open longer or introduce more after school programs. Many advantages would come from either of these ideas. For one the parents would not have to be in a state of worry about whether their child is safe at home or in trouble. Plus you always have that added guilt about not being able to help your kids with their homework. Now with either longer days or more after school programs a lot of stress could be taken away from your family. No more having to pay for sitters which could stress out a families finances. Also the dangers of the kids being home and getting into trouble would be cut down severely. And also with the longer days or more after school programs parents would be able to get home, at least one parent would be home, to pick their kids off the bus. I wanted to suggest some programs I feel would help out with the problem at hand. These programs would be a reading and math after school program. One program I would suggest is a reading after school program. It is said that today, too many children fail to read at a level we would expect for the grade they are in. In a study done in 1998, the National Assessment of Educational Progress found that, thirty eight percent of our nations fourth graders failed to read at the basic level. That fact alone says we must enforce more after school programs. Now they also found that sixty-four percent of African American and sixty percent of Hispanic American fourth graders read below the basic level. This shows we need to not only put these programs in suburban schools but also city schools. Research has shown that students who are behind in reading can catch up to grade level with additional reading instruction and tutoring after school and in the summer. And that is what I am trying to put in effect. We all know that to succeed in school all students need good reading skills, and thats just a fact. Another program that I think is good is a mathematics after school Program. I has been found that students who take rigorous mathematics courses are much more likely to go on to college and into promising careers than those who do not. And with technology becoming more prevalent in the workplace, the need for employees with mathematics backgrounds has greatly increased. In my research I have found that far too many students finish middle and junior high school without developing a solid foundation in algebra and geometry. Research done by the international comparative assessments said that U. S. student achievement in mathematics falls below the average in the middle grades. We need to help improve this. I think some other important facts help support my case for the longer school day and the after school programs in this little chart. Some reasons why the public supports after school programs: *Over 28 million school-age children have both parents or their only parent in the workforce. *At least 5 million children and possibly as many as 15 million are left alone at home each week. *Many children, especially low-income children, lose ground in reading if they are not engaged in organized learning over the summer. *Experts agree that school-age children who are unsupervised during the hours after school are more likely to receive poor grades and drop out of school than those who are involved in supervised, constructive activities. *Statistics show that most juvenile crime takes place between the hours of 2:00 and 8:00 pm, and that children are also at much greater risk of being the victims of crime during the hours after school. Here is another chart showing that after school programs enhance a childs academic achievement. *Participants in after-school programs:* *Show increased interest and ability in reading *Develop new skills and interests *Show improved school attendance, increased engagement in school, and reduced dropout rate *Turn in more and better quality homework and can spend more time on task. *Are held back or placed in special education classes less frequently *Show higher aspirations for the future, including intention to complete high school and go to college. These facts are real. This is why I picked trying to make a longer day and more after school programs. And with these two programs the numbers will go up. I plan on adding more programs to what I have wrote in here. But I think implementing a longer school day and these after school programs should help not only the parents of these children but the children themselves.
Thursday, November 14, 2019
Chicken Soup for the Teenage Soul :: essays research papers
Chicken Soup for the Teenage Soul Chicken Soup for the Teenage Soul is the first of seven editions of the Chicken Soupseries. It is loved and admired by everyone that reads it. It has become a popular book all over the world. The author, are various people-was a struggling single mother when she started the Harry Potter series. She spent time in a cafà © in England to write the books. She did a fabulous job, she has been the recipient several awards for the series, and the first book will be transformed into a movie, which should be released in November of 2001. I thoroughly enjoyed reading Harry Potter, and I plan on reading the rest of them. From what I have read in just the first book I am sure that I will enjoy all the rest. The author has a very creative way of writing that is easy enough to understand, but also involved so that the reader isnââ¬â¢t bored stiff. This is partially why I feel that it has had such great success. Another big reason for its success is because it can be read and enjoyed by all ages. If you are young, you can relate to the first years; if you are older you can think back and it brings out the child in you. This magnificent story is about an eleven year old boy who has been deprived of practically everything all his life. Harry Potter lived in a cupboard under the stairs with his ââ¬Å"muggleâ⬠relatives. Muggle refers to humans who lack any sort of mystical power. His Uncle Vernon and Aunt Petunia treated him very poorly because they refused to accept him for whom he is: a very famous child with great potential as a wizard amongst the magical world. As he grew up he never got anything of his own, even on special occasions. He received his spoiled cousin Dudleyââ¬â¢s old clothes, which were all too big for Harry. At school Harry was bullied around, at home he never got a full dinner, and his birthdays were often forgotten. Needless to say, he lived a very depressing life. à à à à à Fortunately things changed. Harry received an envelope in the mail, but Uncle Vernon did not allow him to read it. Another letter came; once again Harry was not allowed to read it. More and more letters came, it was apparent to Harry that someone was trying to contact him and would not stop until he got the message.
Tuesday, November 12, 2019
Principles of Decision Making Essay
ââ¬Å"Our economy is the result of millions of decisions we all make every day about producing, earning, saving, investing, and spendingâ⬠by Dwight Eisenhower (UBR, Inc. , 2007). What are the principles behind an individualââ¬â¢s decision making? According to Mankiw, the four principles of individual decision making are as follows: ââ¬Å"people face trade-offs, the cost of something is what you give up to get it, rational people think at the margin, and people respond to incentives. â⬠People face trade-offs by having to give up something to get what they want or need. This is no surprise for most people who learn early in life that few things are free. A trade off is when you put more into one and less in the other. As an example of a trade-off, many times college students give up spending time with their families and friends in order to do homework and accomplish their long-term goal of earning a degree. Because of ââ¬Å"trade-offs, making decisions require comparing the costs and benefits of alternative courses of actionâ⬠(Mankiw, 2007, p. 6). The cost of something is what you give up to get it. This clearly emphasizes that there are always costs to every decision that we make. These are what we called opportunity costs. An opportunity cost is what we have to give up to gain something else. It does not always have to be about financial matters but also situational issues. If individuals make the decision to return to school, they not only have a cost of monetary impact on life but also a cost of time because they have chosen to study over their alternatives of working or socializing. Rational people think at margin. A rational decision maker ââ¬Å"takes an action if and only if the marginal benefit of the action exceeds the marginal costâ⬠(Mankiw, 2007, p. ). Economic decision makers act in a rational manner. This means that decision makers prioritize the end results of their actions. They decide based on their wants and needs. ââ¬Å"Rational people systematically are purposefully do the best they can to achieve their objectives, given the opportunities they haveâ⬠(Mankiw, 2007). According to Mankiw, marginal changes are just slight adjustments to what is already being done by comparing the marginal cost and marginal benefit of something. This could be an individual going to the store to buy sugar. If the store has two brands of the same size that are of different prices, a person will buy the least expensive because there is no benefit to purchasing the more expensive sugar. Also, if a person desired to achieve higher grades, it is most likely that he would spend longer hours studying and reviewing his/her course. Also, if there were two competing companies, one offering a large compensation with benefits, the other lacking resources to render incentives, it is assumed that the applicant would prioritize the more productive company. In deciding what is profitable in any economic situation, a decision maker has to assess the costs and benefits of any specific course of action. An example of a decision comparing the marginal benefit and the marginal cost associated with that decision occurs when purchasing a marked-up, last minute cruise line ticket for a very important business transaction. The other alternatives are to either drive a car, ride on a plane or wait seven days to pay a much lower fee. The marginal benefits of less travel time, increased comfort and being able to meet the deadline on time all outweighed the marginal cost of the increased fee. The decision made was based on personal incentives and satisfaction. Of course, if the cruise line ticket fee had been higher than traveling by car, I would have chosen driving to have more vacation time and be able to reduce cost. Truly, marginal benefit and marginal cost help in making financial decisions. Our personal budgeting skills will improve as we measure the costs of a financial decision. We will also consider the affordability of the products and services. The principles of economics affect decision making, interaction, and the workings of the economy as a whole because all people make decisions based on what they want and is best for them personally. For instance, the marginal costs and benefits are a vital part of economics because they help provide the relevant measurement of costs and benefits at a specific level of production and consumption. Even if we do not realize it, we all make decisions based on our marginal evaluations of the alternatives. Like in buying a car, we consider not only affordability but also convenience. Economics plays a very significant role in many different aspects of peopleââ¬â¢s lives. Every decision people make from how much they work, spend, save, and invest plays a role on their economy. Economics is something people use in a daily basis without even realizing it. Applying the said principles in decision making will allow us to plan and organize our goals in a rational and distinct manner. Knowing the cost of doing something will bring us awareness and make us more cautious as we implement our plans. It enables us to identify the trials and hardships that we have to face before reaching our goals. Exploring more about trade-offs brings us to the reality that in every aspect of our life, we have to consider giving up something before achieving what we really want. For example, big or small businesses have to consider the trade-offs in order to gain higher profitability. That is why some companies decrease manpower to reduce cost. On the other hand, doing this means depriving many workers the opportunity to earn for their families. The principles of economic decision making widens our perspective and guides us in implementing productive ideas.
Subscribe to:
Posts (Atom)