Wednesday, March 18, 2020

Free Essays on Happily Ever After

Happily Ever After Written in caustic response to an annoying academic, Nadine Gordimer supplies penetrating social commentary on South African apartheid in her short story, "Once Upon a Time." The author creates an underlying uneasiness and obvious irony while following the traditional style reminiscent of bedtime stories, with modern South African reality filling in for magical kingdoms. Rather than reform the unbalanced societal structure of apartheid, a white family chooses to ignore the issue and simply add security measures to their suburban home. The family’s attempt to live happily ever after during a time of social unrest is the Gordimer’s sarcastic metaphor for the white South Africans and the self-inflicted harm caused by their own lopsided social system. The story begins with an anecdote reeking of symbolism. The author wakes in the middle of the night, unsure whether she's heard the sound of an intruder's footstep. She imagines herself the victim of an invasion (24) just as the wife imagines herself the victim of intruders opening her gates and streaming in (26). Time takes the author’s terror away, and she â€Å"is to be neither threatened nor spared† (24), realizing it is the creaking of her house built on â€Å"undermined ground† (24). The wife does not see that her imagined intruders are not the real threat preventing her from sleeping soundly at night, but instead it is the very apartheid under which her family seeks shelter. The author informs the reader that her neighborhood is built on gold mine shafts, which are collapsing inward deep under the surface of the ground and â€Å"bringing uneasy strain to the balance and counterbalance of brick, cement, wood, and glass that hold it as a structure† (24). White-dominated South Africa arose on the wealth of ... Free Essays on Happily Ever After Free Essays on Happily Ever After Happily Ever After Written in caustic response to an annoying academic, Nadine Gordimer supplies penetrating social commentary on South African apartheid in her short story, "Once Upon a Time." The author creates an underlying uneasiness and obvious irony while following the traditional style reminiscent of bedtime stories, with modern South African reality filling in for magical kingdoms. Rather than reform the unbalanced societal structure of apartheid, a white family chooses to ignore the issue and simply add security measures to their suburban home. The family’s attempt to live happily ever after during a time of social unrest is the Gordimer’s sarcastic metaphor for the white South Africans and the self-inflicted harm caused by their own lopsided social system. The story begins with an anecdote reeking of symbolism. The author wakes in the middle of the night, unsure whether she's heard the sound of an intruder's footstep. She imagines herself the victim of an invasion (24) just as the wife imagines herself the victim of intruders opening her gates and streaming in (26). Time takes the author’s terror away, and she â€Å"is to be neither threatened nor spared† (24), realizing it is the creaking of her house built on â€Å"undermined ground† (24). The wife does not see that her imagined intruders are not the real threat preventing her from sleeping soundly at night, but instead it is the very apartheid under which her family seeks shelter. The author informs the reader that her neighborhood is built on gold mine shafts, which are collapsing inward deep under the surface of the ground and â€Å"bringing uneasy strain to the balance and counterbalance of brick, cement, wood, and glass that hold it as a structure† (24). White-dominated South Africa arose on the wealth of ...

Monday, March 2, 2020

Aliasing a Method in Ruby Takes Simple Programming

Aliasing a Method in Ruby Takes Simple Programming To alias a method or variable name in Ruby is to create a second name for the method or variable. Aliasing can be used either to provide more expressive options to the programmer using the class or to help override methods and change the behavior of the class or object. Ruby provides this functionality with the alias and alias_method keywords. Create a Second Name The alias keyword takes two arguments: the old method name and the new method name. The method names should be passed as labels, as opposed to strings. Labels are used to refer to methods and variables without directly referencing them. If youre a new Ruby programmer, the concept of labels may seem odd, but whenever you see a label like :methodname, just read it as the thing called methodname. The following example declares a new class and creates an alias for the on method called start. #!/usr/bin/env rubyclass Microwavedef onputs The microwave is onendalias :start :onendm Microwave.newm.start # same as m.on Change the Behavior of a Class There may be times when you want to change the behavior of a class after its been declared. You can alias and add new methods to an existing class by creating second class declaration that has the same name as the existing class declaration. You can also add aliases and methods to individual objects using a syntax similar to the inherited class syntax. The behavior of any class can be changed by creating an alias for any method and then creating a new method (with the original method name) that calls the method with the alias. In the following example, a microwave class is declared and an instance is created. The second class declaration uses the alias method to change the behavior of the on method in order to add a warning message. The third class declaration is used to change the behavior of the specific microwave instance to add an even more stern warning. When aliasing a method multiple times, be sure to use different method names to store the old method. #!/usr/bin/env rubyclass Microwavedef on  Ã‚  Ã‚  Ã‚  puts Microwave is on  Ã‚  end endm Microwave.newm.onclass Microwave  Ã‚  alias :old_on1 :ondef on  Ã‚  Ã‚  Ã‚  puts Warning: Do not insert metal objects!  Ã‚  Ã‚  Ã‚  old_on1  Ã‚  end endm.on# Message for this specific microwaveclass   Ã‚  def onputs This microwave is weak, add extra timeold_on2endendm.on # Displays extra messagem2 Microwave.newm2.on # Does not display extra message