Wednesday, February 24, 2016

Next Steps | STDIN | Pipe And Filter

Rosetta Team. When time allows we will provide examples which use a programs standard input stream (STDIN). Most frequently, STDIN is connected with the console input which comes from your keyboard. So, after mastering the exercises in the previous post which provide a simple example of producing output on STDOUT, we can read from the console and write on it also.

Once we understand these operations of input and out in the languages in this Rosetta, we write a program which reads input and writes output. This allows for gathering data from the user, processing it, and then producing results. One can envision this process as pushing information through a pipe, altering it as it passes through filters within the pipe, and collecting the results as it exits the pipe. This notion of conducting pipes and transformative filters is a common architectural pattern found in the everyday computer programming tasks of software engineering.

Happy Coding. Hunt. Peck. Think. We will supply the STDIN examples soon.

Friday, February 19, 2016

The Value of STDOUT in Web Development

Rosetta Team. This is a short note for those of you not familiar with the fundamentals of web development. The previous examples which describes printing data on the STDOUT stream that usually appears on the computer's console might seem very simple. One will likely notice that in more than one of the languages that he command for this is simply "print". Although seemingly trivial, this example shows the commonality among many programming languages; however, it shows some unique differences in console printing approaches when one considers the object-oriented languages JAVA and C#. These require the use an object's method when printing instead of a stand-alone procedure.

The true power in the development potency of the previous example on STDOUT is this, it is the primary stream for sending an HTTP (HyperText Transfer Protocol) response. When developing web-scripts such as servlets and CGI (Common Gateway Interfaces), one will simply structure an HTML (HyperText Markup Language) response. This is the content which the client browser will display from the "prints" on the STDOUT stream from the web-script. Subsequently, the web server with is networking software handles sending the browser this HTML content in an the form of an HTTP response. This is the Power of Print!

Keep Learning. Keep Striving. Happy Coding. The Rosetta Team.

Monday, February 15, 2016

Standard Ouput | STDOUT | Files | Hello, Rosetta!

Rosetta Team. Last month, we promised that we would start compiling and chronicle some common programming tasks in various popular modern languages. This week, we are providing the most fundamental program that any computing student has learned. This is the "Hello!" program. The goal of writing a "Hello!" is testing the most basic of computing functions, output. In every computing environment, output streams exits. A program might be supplying output and places it in numerous locations: text files, data bases, the screen, and etc. The most common of these is the screen. Most frequently, the screen is the "standard" location for all program printing commands. As such, this stream of data flow is called standard output and abbreviated as stdout.

It is worth mentioning at this time that stdout is treated like a file although the output appears on the screen. As with text files, one can place information in stdout and redirect another output stream so it fills the stdout file with data. In fact, all of the data sources and sinks on a computing device are treated like files for programming purposes. For the most part, they can all be opened, closed, read, and written.

This week we are supplying a classic "Hello!" program in a few different common modern programming languages: JAVA, C#, The LAMP Trio (PERL, PHP, and Python), plus Ruby.

The Hello, Rosetta! programs require that one has the proper compilers, interpreters, and run-time engines installed on one's computer. Otherwise, they will not function.

JAVA source file
JAVA class file
PHP source file
PERL source file
Python source file
Ruby source file
C# source file

Note: All of these languages are interpreted except for JAVA which is first compiled producing *.class files that are then interpreted by the java run-time engine and C# which produces the Microsoft Common Language Invariant (CLI) or a binary *.exe file depending upon the application.

Most of our JAVA programs will be created in NetBeans or Eclipse. The C# programs will be created with Visual Studio. The PHP, PERL, Python, and Ruby programs will be scripted in a text editor.

This Code Rosetta is not necessarily a programming tutorial, but could be possibly used as such. Its ultimate goal is providing professional engineers with samples of logically equivalent programs in various languages. This will promote polyglot programming and the porting of valuable computing solutions. The first few months of examples should be fundamental and simple.

Happy Coding!