Wednesday, March 18, 2020

buy custom Business Ethics essay

buy custom Business Ethics essay One of the principles of Caltex was that they needed to expand their business globally. They wanted to penetrate in the African market. In this case, they had to make a business deal with government of South Africa. In order to conduct this business deal they had to follow the South African law and use the correct method. The principles for the South African government were that Caltex should provide them with one thousand dollars and jobs for the South African citizens. The two parties struck a deal and the Caltex is among the leading companies globally and in the African market. I tend to believe that the best principles for this case are the Caltex Company following the South African law. Additionally, I think the South African principle for the job opportunities for its people is the best. This is because the South African country needs the economy of the country. Additionally, the Caltex Company did the most ethical thing to follow the normal protocol followed by other foreign companies that wanted to invest in South Africa. This shows that both parties have corporate social responsibility. In the world of mrketing, companies employ different strategies in order to gain the competitive advantage. It is even more distinct for companies that do produce the same product. For example, in the case, food companies have distinct marketing strategies as compared to those of drug companies. The food companies use advertisements and pamphlets as their marketing strategies but the drug companies only use advertisements. For instance, when Formula Company tried to use panaflex their sales went down and the company was under a lot of criticism. This means that drug companies only use advertisements as there marketing strategies as compared to the food companies. Price fixing is one of the marketing strategies where companies set prices for their products (Velasquez, 2006). In the case of telecommunication companies, they set prices on their products in order to attract their customers. There are ethical implications in the prices fixing of the different prices. For instance, when the companies set high prices for their products they may harm the society because they are over charging them. In this case, the company may be seen as if they are exploiting the society by overcharging them thus it is unethiical. On the other hand, when the companies set law prices for their products they may harm themselves because they might not make any profits thus running at a loss. It is important for the companies to consider the society and at the same time consider themselves so that they cannot harm themselves. In the case of Clarence Burk, his marketing strategies were ethical because he was considering the society and at the same time considering the c ompany. Unlimited goods simply mean that the goods are readily available or there are in abundance. Carrying capacity is the total amount of goods in the marketing. For instance, air is referred to as unlimited goods by the companies because air has a huge carrying capacity. Air pollution is common with companies because they fail to consider the society. Unlimited goods and carrying capacity are closely related to pollution control in the sense that when the unlimited goods like air are mismanaged they deteriorate slowly causing pollution. Therefore, in order for companies to have ethics they must consider the society by protecting the environment thus creating a relationship between unlimited goods and carrying capacity (Velasquez, 2006). Buy custom Business Ethics essay

Monday, March 2, 2020

How to Use the Command Line to Run Ruby Scripts

How to Use the Command Line to Run Ruby Scripts Before really starting to use Ruby, you need to have a basic understanding of the command line. Since most Ruby scripts wont have graphical user interfaces, youll be running them from the command line. Thus, youll need to know, at the very least, how to navigate the directory structure and how to use pipe characters (such as |,   and ) to redirect input and output. The commands in this tutorial are the same on Windows, Linux, and OS X. To start a command prompt on Windows, go to Start - Run. In the dialog that appears, enter cmd into the input box and press OK.To start a command prompt on Ubuntu Linux, go to Applications - Accessories - Terminal.To start a command prompt on OS X, go to Applications - Utilities - Terminal. Once youre at the command line, youll be presented with a prompt. Its often a single character such as $ or #. The prompt may also contain more information, such as your username or your current directory. To enter a command  all you need to do is type in the command and hit the enter key. The first command to learn is the cd command, which will be used to get to the directory where you keep your Ruby files. The command below will change directory to the \scripts directory. Note that on Windows systems, the backslash character is used to delimit directories but on Linux and OS X, the forward slash character is used. C:\rubycd \scripts Running Ruby Scripts Now that you know how to navigate to your Ruby scripts (or your rb files), its time to run them. Open your text editor and save the following program as  test.rb. #!/usr/bin/env ruby    print What is your name? name gets.chomp puts Hello #{name}! Open a command line window and navigate to your Ruby scripts directory using the  cd  command. Once there, you can list files, using the  dir  command on Windows or the  ls  command on Linux or OS X. Your Ruby files will all have the .rb file extension. To run the test.rb Ruby script, run the command  ruby test.rb. The script should ask you for your name and greet you. Alternatively, you can configure your script to run without using the Ruby command. On Windows, the  one-click installer  already set up a file association with the .rb file extension. Simply running the command  test.rb  will run the script. In Linux and OS X, for scripts to run automatically, two things must be in place: a shebang line and the file being marked as executable. The shebang line is already done for you; its the first line in the script starting with  #!. This tells the shell what type of file this is. In this case, its a Ruby file to be executed with the Ruby interpreter. To mark the file as executable, run the command  chmod x test.rb. This will set a file permission bit indicating that the file is a program and that it can be run. Now, to run the program, simply enter the command  ./test.rb. Whether you invoke the Ruby interpreter manually with the Ruby command or run the Ruby script directly is up to you. Functionally, they are the same thing. Use whichever method you feel most comfortable with. Using Pipe Characters Using the pipe characters is an important skill to master, as these characters will alter the input or output of a Ruby script. In this example, the  Ã‚  character is used to redirect the output of test.rb to  a text file  called test.txt instead of printing to the screen. If you open new test.txt file after you run the script, youll see the output of the test.rb Ruby script. Knowing how to save output to a .txt file can be very useful. It allows you to save program output for careful examination or to be used as input to another script at a later time. C:\scriptsruby example.rb test.txt Similarly, by using the  Ã‚  character instead of the  Ã‚  character you can redirect any input a Ruby script may read from the keyboard to read from a .txt file. Its helpful to think of these two characters as funnels; youre funneling output to files and input from files. C:\scriptsruby example.rb Then theres the pipe character,  |. This character will funnel the output from one script to the input of another script. Its the equivalent of funneling the output of a script to a file, then funneling the input of a second script from that file. It just shortens the process. The  |  character is useful in creating filter type programs, where one script generates unformatted output and another script formats the output to the desired format. Then the second script could be changed or replaced entirely without having to modify the first script at all. C:\scriptsruby example1.rb | ruby example2.rb The Interactive Ruby Prompt One of the great things about Ruby is that its test-driven. The interactive Ruby prompt provides an interface to the Ruby language for instant experimentation. This comes in handy while learning Ruby and experimenting with things like regular expressions. Ruby statements can be run and the output and return values can be examined immediately. If you make a mistake, you can go back and edit your previous Ruby statements to correct those mistakes. To start the IRB prompt, open your command-line and run the  irb  command. Youll be presented with the following prompt: irb(main):001:0 Type the  hello world  statement weve been using into the prompt and hit Enter. Youll see any output the statement generated as well as the return value of the statement before being returned to the prompt. In this case, the statement output Hello world! and it returned  nil. irb(main):001:0 puts Hello world! Hello world! nilf irb(main):002:0 To run this command again, simply press the up key on your keyboard to get to the statement you previously ran and press the Enter key. If you want to edit the statement before running it again, press the left and right arrow keys to move the cursor to the correct place in the statement. Make your edits and press Enter to run the new command. Pressing up or down additional times will allow you to examine more of statements youve run. The interactive Ruby tool should be used throughout learning Ruby. When you learn about a new feature or just want to try something, start up the interactive Ruby prompt and try it. See what the  statement  returns, pass  different parameters  to it and just do some general experimenting. Trying something yourself and seeing what it does can be a lot more valuable than just reading about it!