Friday, March 20, 2020

Immigration Analysis Essays

Immigration Analysis Essays Immigration Analysis Essay Immigration Analysis Essay For many immigration to the United States would be a new beginning during 19th to early 20th century.There were many acts and laws to limit the number immigrating to the United States.Many of these acts were due to prejudice and misunderstanding of a culture.One such act was the Chinese Exclusion Act. Form this one act many immigration laws and acts were made against foreigners.They hoped to control the number of immigrants arriving on the American shores. The Chinese Exclusion Act of May 6, 1882 was just the beginning. This act was the turning point of the U.S. immigration policies, although it only directly affected a small group of people. Prior to the Chinese Exclusion Act there was no significant number of free immigrants that had been barred from the country. Once the Chinese Exclusion Act had been in acted, further limitations on the immigration of ethnic groups became standard procedure for more than eight decades.Irish catholic, Mexican, and other races were not allowed the same freedoms that others were allowed.Even after a family had been here for generations there were not given the same freedoms. Since the arrival of thefirst Chinese Immigrants, racist hostility towards the Chinese always existed.They were predominantly male laborers, concentrated in California.They were vital to the development of western mining, transportation, and agriculture.Other races were also discriminated against, the Irish were not allowed to get jobs or live in certain areas of the cities. By 1880, the great fear of German-speaking and Irish-Catholic immigrants was over. Employers, who still sought worker-immigrants, and not just temporary workers, looked increasingly to southern and eastern Europe. When Italians, Greeks, Turks, Russians, Slavs, and Jews arrived in the United States in numbers, however, new anxieties arose about making Americans of so many different kinds of strangers.

Wednesday, March 4, 2020

Understanding Sender Parameter in Delphi Event Handlers

Understanding Sender Parameter in Delphi Event Handlers Event handlers and the Sender procedure TForm1.Button1Click(Sender: TObject) ; begin    ... end; Button1Click OnClick event The parameter Sender references the control that was used to call the method. If you click on the Button1 control, causing the Button1Click method to be called, a reference or pointer to the Button1 object is passed to Button1Click in the parameter called Sender. Lets Share Some Code For example, suppose we want to have a button and a menu item do the same thing. It would be silly to have to write the same event handler twice. To share an event handler in Delphi, do the following: Write the event handler for the first object (e.g. button on the SpeedBar) Select the new object or objects - yes, more than two can share (e.g. MenuItem1) Go to the Event page on the Object Inspector. Click the down arrow next to the event to open a list of previously written event handlers. (Delphi will give you a list of all the compatible event handlers that exist on the form) Select the event from the drop-down list. (e.g. Button1Click) OnClick procedure TForm1.Button1Click(Sender: TObject) ; begin    {code for both a button and a menu item}    ...    {some specific code:}    if Sender Button1 then   Ã‚   ShowMessage(Button1 clicked!)    else if Sender MenuItem1 then   Ã‚   ShowMessage(MenuItem1 clicked!)    else   Ã‚   ShowMessage( clicked!) ; end; Note: the second else in the if-then-else statement handles the situation when neither the Button1 nor the MenuItem1 have caused the event. But, who else might call the handler, you could ask. Try this (youll need a second button: Button2) : procedure TForm1.Button2Click(Sender: TObject) ; begin   Ã‚   Button1Click(Button2) ;   Ã‚   {this will result in: clicked!} end; IS and AS if Sender is TButton then   Ã‚   DoSomething else   Ã‚   DoSomethingElse; Edit box procedure TForm1.Edit1Exit(Sender: TObject) ; begin    Button1Click(Edit1) ; end; {... else} begin    if Sender is TButton then   Ã‚  Ã‚   ShowMessage(Some other button triggered this event!)    else if Sender is TEdit then   Ã‚  Ã‚   with Sender as TEdit do   Ã‚  Ã‚  Ã‚   begin   Ã‚  Ã‚  Ã‚  Ã‚   Text : Edit1Exit has happened;   Ã‚  Ã‚  Ã‚  Ã‚   Width : Width * 2;   Ã‚  Ã‚  Ã‚  Ã‚   Height : Height * 2;   Ã‚  Ã‚  Ã‚   end {begin with} end; Conclusion As we can see, the Sender parameter can be very useful when used properly. Suppose we have a bunch of Edit boxes and Labels that share the same event handler. If we want to find out who triggered the event and act, well have to deal with Object variables. But, lets leave this for some other occasion.