Wednesday, March 18, 2020

Adrienne Clarkson Biography

Adrienne Clarkson Biography A well-known CBC broadcaster, Adrienne Clarkson brought a new style to the role of Governor-General of Canada. Originally from Hong Kong, Adrienne Clarkson was the first immigrant and the first Chinese-Canadian to be Governor General. Adrienne Clarkson and her husband philosopher and author John Ralston-Saul kept a high profile, worked hard and traveled extensively to Canadian communities, both large and small, during her six years as Governor General. Reviews were mixed for Adrienne Clarksons tenure as Governor General. Many in the Canadian Forces, of which she was Commander-in-Chief, regarded Adrienne Clarkson fondly for going the extra mile for the troops. At the same time, some Canadians considered her elitist, and there was public criticism of her lavish spending, including taking a delegation on a $5-million circumpolar tour to Finland, Iceland, and Russia in 2003. Governor General of Canada 1999-2005 Birth Born February 10, 1939, in Hong Kong. Adrienne Clarkson came to Canada in 1942 as a refugee during the war and grew up in Ottawa, Ontario. Education BA, English Literature - University of TorontoMA, English Literature - University of TorontoPost-graduate work - La Sorbonne, Paris, France Profession Broadcaster Adrienne Clarkson and the Arts Adrienne Clarkson was a host, writer and producer at CBC Television from 1965 to 1982. Her CBC programs included Take ThirtyAdrienne at LargeFifth EstateAdrienne Clarksons Summer FestivalAdrienne Clarkson PresentsSomething Special Adrienne Clarkson also served as Agent General for Ontario in Paris from 1982 to 1987 and was Chair of the Board of Trustees of the Canadian Museum of Civilization from 1995 to 1999. Adrienne Clarkson as Governor General of Canada Adrienne Clarkson traveled extensively across Canada to meet Canadians where they live. In her first year as Governor General of Canada, she visited 81 communities and traveled 115,000 km (about 71,500 miles). She kept a similar pace for the next five years.One of the themes of Adrienne Clarksons time as Governor General was the North. In 2003, Adrienne Clarkson led a delegation on a three-week tour of Russia, Finland, and Iceland to raise Canadas profile and focus attention on northern foreign policy issues. She also spent time as Governor General in the Canadian north, including visits to the troubled communities of Davis Inlet and Sheshatshiu. Adrienne Clarkson established the Governor Generals Northern Medal to be awarded for achievements contributing to the evolution and reaffirmation of the Canadian North as part of the Canadian national identity.Adrienne Clarkson made a point of visiting Canadian troops in the field, going to Kosovo and Bosnia, spending Christmas on frigates i n the Gulf, and New Year 2005 in Kabul. Adrienne Clarkson was asked by Prime Minister Paul Martin to stay on an extra year to provide stability and experience when Parliament was faced with a minority government.When Adrienne Clarkson left office, it was announced that an Institute for Canadian Citizenship would be created in her honor, with up to $10 million in government backing.

Monday, March 2, 2020

How to Return Multiple Values From a Delphi Function

How to Return Multiple Values From a Delphi Function A most common construct in a Delphi application would be a procedure or a function. Known as routines, procedures or functions are statement blocks you call from different locations in a program. Simply put a procedure is a routine not returning a value while a function returns a value. A return value from a function is defined by the return type. In most cases you would write a function to return a single value that would be an integer, string, boolean or some other simple type, also return types could be an array, a string list, an instance of a custom object or alike. Note that even if your function returns a string list (a collection of strings) it still returns a single value: one instance of the string list. Further, Delphi routines can really have many faces: Routine, Method, Method Pointer, Event Delegate, Anonymous method... Can a Function Return Multiple Values? The first answer that comes to mind is no, simply because when we think of a function, we think of a single return value. Certainly, the answer to the above question is, however, yes. A function can return several values. Lets see how. Var Parameters How many values can the following function return, one or two? function PositiveReciprocal(const valueIn : integer; var valueOut : real): boolean; The function obviously returns a boolean value (true or false). How about the second parameter valueOut declared as a VAR (variable) parameter? Var parameters are passed to the function by reference meaning that if the function changes the value of the parameter- a variable in the calling block of code- the function will change the value of the variable used for the parameter. To see how the above works, heres the implementation: function PositiveReciprocal(const valueIn: integer; var valueOut: real): boolean;begin result : valueIn 0; if result then valueOut : 1 / valueIn;end; The valueIn is passed as a constant parameter- function cannot alter it, and it is treated as read-only. If valueIn or greater than zero, the valueOut parameter is assigned the reciprocal value of valueIn and the result of the function is true. If valueIn is 0 then the function returns false and valueOut is not altered in any way. Heres the usage: var b : boolean; r : real;begin r : 5; b : PositiveReciprocal(1, r); //here: // b true (since 1 0) // r 0.2 (1/5) r : 5; b : PositiveReciprocal(-1, r); //here: // b false (since -1 end; Therefore, the PositiveReciprocal actually can return 2 values! Using var parameters you can have a routine return more than one value. Out Parameters Theres another way to specify a by-reference parameter- using the out keyword, as in: function PositiveReciprocalOut(const valueIn: integer; out valueOut: real): boolean;begin result : valueIn 0; if result then valueOut : 1 / valueIn;end; The implementation of PositiveReciprocalOut is the same as in PositiveReciprocal, theres only one difference: the valueOut is an OUT parameter. With parameters declared as out, the initial value of the referenced variable valueOut is discarded. Heres the usage and the results: var b : boolean; r : real;begin r : 5; b : PositiveReciprocalOut(1, r); //here: // b true (since 1 0) // r 0.2 (1/5) r : 5; b : PositiveReciprocalOut(-1, r); //here: // b false (since -1 end; Note how in the second call the value of the local variable r is set to 0. The value of r was set to 5 before the function call but since the parameter in declared as out, when r reached the function the value was discarded and the default empty value was set for the parameter (0 for real type). As a result, you can safely send uninitialized variables for out parameters- something that you should not do with var parameters. Parameters are used to send something to the routine, except here with out parameters :), and therefore uninitialized variables (used for VAR parameters) could have weird values. Returning Records? The above implementations where a function would return more than one value are not nice. The function actually returns a single value, but also returns, better to say alters, the values of the var/out parameters. Because of this, you may very rarely want to use by-reference parameters. If more results from a function are required, you can have a function return a record type variable. Consider the following: type TLatitudeLongitude record Latitude: real; Longitude: real; end; and a hypothetical function: function WhereAmI(const townName : string) : TLatitudeLongitude; The function WhereAmI would return the Latitude and Longitude for a given town (city, area, ...). The implementation would be: function WhereAmI(const townName: string): TLatitudeLongitude;begin//use some service to locate townName, then assign function result: result.Latitude : 45.54; result.Longitude : 18.71;end; And here we have a function returning 2 real values. Ok, it does return 1 record, but this record has 2 fields. Note that you can have a very complex record mixing various types to be returned as a result of a function. Thats it. Therefore, yes, Delphi functions can return multiple values.