Thursday, March 19, 2020
Communication Theories essays
Communication Theories essays Social Penetration Theory: Irvin Altman and Dalmas Taylor The theory of social penetration is at the basis of every formation of a new relationship. This theory is an interaction between persons who slowly learn about each other at first formally and then informally. Social penetration is defined as revealing ones self to others, this process is cautious and slow and some are more cautious then others. In order to find out more about a person you must slowly gain their trust and equally reveal information about yourself. Altman and Taylor refer to this theory as an onion with many layers. Slowly we begin to peel away and understand more and more about the person as the chose to reveal them. However as a person reveals these layers we become more vulnerable to that person we tell them to. These layers are only accessible once the person reveals them self, any other way could destroy the possibility of a relationship. An interesting point is that once the layers are revealed and you learn more about a person it is acceptable to talk about something already revealed. This is how people establish a relationship when they can establish a form of trust and understanding about one another. Which therefore allows each other to communicate on a personal level. I personally experienced this theory at the beginning of this semester, at the time I was not aware of the theory but now have relatable experiences to the theory. I had experienced and in some ways still am social penetration with my roommate. We were going to be living in the same room together for a year so appropriate interaction had to take place. We started off simple with family members, who people were in pictures we were putting up, and favorite bands and artists. Slowly we began to form a friendly relationship. We progressed with significant memories of home, family status, and jobs we had over the summer. Then we began to learn about sensitive t...
Tuesday, March 3, 2020
Using the Each Method in Ruby
Using the Each Method in Ruby Every array and hash in Ruby is an object, and every object of these types has a set of built-in methods. Programmers new to Ruby can learn about how to use the each method with an array and a hash by following the simple examples presented here. Using the Each Method With an Array Object in Ruby First,à create an array object by assigning the array to stooges. stooges [Larry, Curly, Moe] Next, call the each method and create a small block of code to process the results. stooges.each { |stooge| print stooge \n } This codeà produces the following output: Larry Curly Moe The each method takes two arguments- an element and a block. The element, contained within the pipes, is similar to a placeholder. Whatever you put inside the pipes is used in the block to represent each element of the array in turn. The block is the line of code that is executed on each of the array itemsà and is handed the element to process. You can easily extend the code block to multiple lines by using do to define a larger block: stuff.each do |thing| print thing print \n end This is the same as the first example, except that the block is defined as everything after the element (in pipes) and before the end statement. Using the Each Method With a Hash Object Just like theà array object, theà hash objectà has anà eachà method that can be used to apply a block of code on each item in the hash.à First, create a simpleà hash objectà that contains some contact information: contact_info { name Bob, phone 111-111-1111 } Then, call theà eachà method and create a single line block of code to process and print the results. contact_info.each { |key, value| print key value \n } This produces the following output: name Bob phone 111-111-1111 This works exactly like theà each methodà for anà array objectà with one crucial difference. For a hash, you createà twoà elements- one for theà hashà key and one for the value. Like the array, these elements are placeholders that are used to pass eachà key/valueà pair into the code block asà Ruby loopsà through the hash. You can easily extend the code block to multiple lines by usingà doà to define a larger block: contact_info.each do |key, value| print print key value print \nend This is the same as the first hash example, except that theà blockà is defined as everything after the elements (in pipes) and before theà endà statement.
Subscribe to:
Comments (Atom)