HTML: How We See the Web

Many of you are probably familiar with HTML, or at least have heard the term used before. HTML is refereed to as a markup language (HyperText Markup Language) and while it is definitely not a programming language since you do not write programs with it, it is certainly important part of the web any user should understand.

Anyone viewing this page is using some sort of web browser, such as Chrome, Firefox, or IE. Perhaps even a mobile browser on a phone or tablet. All of these browsers serve the same purpose, and that is read HTML documents and display them in a way that is user friendly.

HTML is the foundation of pretty much any webpage on the internet. It is based on putting tags around text to give content both appearance. Here is a basic example of a few common tags.

ss

On line 1, we see the document type declaration, it is often important to specify what version of HTML you are using so the web browser can most accurately display it. On line 2 is where the start of the webpage is defined, and line 14 is where it ends. Next is what is considered the main “body” of your text.

The “h” stands for heading, and the <h1> denotes not exactly the first heading, but the most important one. The second most important heading would be <h2> and on until <h6>. The heading tag is NOT used for simply making a portion of text bigger or stand out more. As search engines crawl through the web and find your page, the page will be usually be indexed based off the content in the html heading tags. This is why it is important to keep relevant information to your page in the headings.

Anytime you want a line break, add another <p> and </p> tag. This will ensure proper formatting regardless of the browser your user has.

On line 11 there is hyperlink tag denoted by <a>, but the site referenced also needs to be stated in the tag, href specifies that URL.

What this basic webpage would look like in a browser:ss2

Seems to get the job done, but I think there needs to be a lot more tags involved to get a website looking a little more friendly. In reality, there is a lot more going on than just HTML on the webpages we go on. CSS (Cascading Style Sheets) contributes a good deal to the actual design and appearance of a page, while JavaScript provides interactivity in the site.

Thanks for reading this week’s post, and I hope you learned a thing or two about HTML and how web pages are displayed.

What is “Open Source”?

Source code is what programmers edit to change the various aspects of a software application. When the source code is “open” to the public it means that anyone can look at it or even edit it. This is of course means its free for anyone to manipulate (positively) or use how they please. WordPress is a great example open source application software. Corporation owned software (proprietary software) is the exact opposite open source, it is often illegal to try to study, examine, or reverse-engineer the software licensed to the copyright holder.

Image

Commonly encountered open and closed source software applications.

Why should we care about open source? Of course free software is great (with free legal software being even better) and many open source solutions have become extremely popular and profitable. A great deal of smartphone users having devices with android based operating systems, Cal Poly’s online learning software switching from blackboard to PolyLearn (moodle). Internet explorer has been widely criticized for its gaping security holes in comparison to Firefox and Chrome.

Professionals are finding out that open source is more and more reliable than software licensed by giant billion dollar corporations. The International Space Station just recently announced a change from Windows and Linux for their computers, citing increased reliability.

A big misconception about the idea of open source is that it is only for software. The concept can be applied to just about anything, certainly including computer applications and electronics, but also any product design. Open source medicine, the development of pharmaceuticals, opening up scientific journals to avoid high costs of publication, are all on the brink of development.

Open source could very well be the future for all fields of study. Let me know what you think!

 

 

 

Benefits and Costs of C

Even if you have no experience coding, you may have heard of a programming language called C. Introduced in 1972, it is a very old but extremely popular language that is supported on nearly all devices. As you might imagine, this makes it incredibly useful. Below is a ranking of the most popular programming languages. C is first, also note that there are many other popular languages derived from C!

languagepopularity

C is considered a very powerful language, in that it is both lightweight and efficient. This is due to the fact that the language runs very close to the computer’s hardware, while other languages operate “further away” from the processor (think of it as more steps to get to the actual calculations.) Incidentally, this makes more susceptible to security breaches. (“With great power comes great responsibility.”) So if you wanted to design a server where many different people are accessing files, and you only want certain people to have access to certain files, there are better languages than C to accomplish this task. C is capable of achieving the design, there are just multiple security flaws that have been discovered over the recent years.

A recent example of C being utilized in a project is Curiosity, the mars rover. It runs 2.5 million lines of C. Imagine the great task of making sure all that code is bug free and running bug free before sending millions of kilometers to another world. Here is a link to the JPL coding standard used in this project. Potentially interesting to any computer programmers as it is full of great coding standards to follow, and just a fantastic technical document in general!

Thanks for reading this week!

Machine Speak: Why We Have Languages

When you tell a computer to do something, you are actually giving it a set on instructions. From the eyes of the CPU, these instructions cannot even be slightly ambiguous. As you may or may not know, computers use something called binary to store, transfer, and alter data.

What is binary? More than just a string of ones and zeros, binary represents fundamentally something either existing or not i.e. true or false. This system of counting is called base 2, it is much simpler than the counting system we use, base 10.  Here is a list of the first 10 numbers in binary.

  • 0 = 0000
  • 1 = 0001
  • 2 = 0010
  • 3 = 0011
  • 4 = 0100
  • 5 = 0101
  • 6 = 0110
  • 7 = 0111
  • 8 = 1000
  • 9 = 1001

In practical everyday use, a base two system has very little use. But to a computer, it is very useful, as it can easily assign value to anything using only two physical states, on or off. Obviously the base 10 system of counting is better to us, but is it really the best? Other types of counting systems include hexadecimal (base 16 counting system popular in memory chips), and there is even a small but growing group of people who believe counting in base 12 is the most advantageous.

Binary Clock

How a digital clock would look in binary. (Cr: wikipedia.org)

Assembly language the instructions to the computer, telling the processor where to put data or alter data. Unfortunately, this is very specific to each type of device, and extremely unreadable to people. When programmers write code, it obviously can not be in assembly because they would want it to work on more than one specific device. That is where the compiler comes in. A compiler, which is a type of program in itself, literally serves as a translator as it trans-codes a source language to an object language (think of the object language as the binary counterpart of the English based programming language).

Thanks for reading this weeks post on binary and assembly language, I hope you come back next week where I will discuss an extremely common programming language called C!

Unified Modeling Language

English: An UML Use case diagram.

A restaurant, shown by a type of UML. (Photo credit: Wikipedia)

As you can imagine, there are dozens and dozens languages that we can program in, and even though some are much more common than others, with a couple being extremely widespread in their use, it is never guaranteed that potential collaborators will have knowledge in the same types of code. More importantly, somebody with very little or no experience with actual programming still might want a way to communicate their ideas in a way that could be more easily implemented by a software engineer. This is where Unified Modeling Language (UML) comes in.

UML is the accepted way to model software in industry, it has a set of standards to help visualize the design of a project. To the average person, these specific standards are probably not important (Learn more!), but there are some basics to it that could be useful for everyone.  The goal is to visualize object oriented programming, meaning their is a well established hierarchy for the desired task.

To use a simple example, take a basic art program that uses different kinds of shapes. First of all to establish the hierarchy, we can declare that all shapes are indeed shapes, but think of how to distinguish rectangles from circles from squares or even lines. At the very top is shapes, on the second level is rectangles and circles, below the rectangles should be squares since they are only a type of rectangle. But how do we classify triangles? First you might think to add another type for them, but in reality triangles and rectangles are both polygons, introducing another parent shape into the diagram. As we can see decisions have to be made when designing UML, and while the best route to take is not always clear, it always pays off to have a clear plan ahead of time.

Thanks for reading and check back next week for a discussion on how the operating system and computer communicate!

Intro to Programming Languages

You might be asking yourself, “Why should I care about differences between programming languages or even how they work?” You might argue that it has no real use to your career/goals, but I would say that with the ever increasing reliance on computers in almost all occupations, everyone should know at least a little background information on how computers operate internally.

This blog will mainly serve as a guide to the practical applications of various programming languages, as well as delivering some basic background information on how they work. Today will serve as a simple introduction to computers and programming languages and what will come later in future blog posts.

A computer operates on the basic principle of giving an input (ultimately done by a user) and receiving a, hopefully correct, output.  What goes on in between, while unknown to most, is certainly not a mystery. The operating system (Windows 8 or OS X for example) orders tasks by importance to be sent to the physical computer, and cycles through them extremely quickly. This is the reason why computers are so useful, because of how fast they listen to and complete instructions.

Instructions to a computer are very difficult to write in a way humans can understand, as they are most likely done in binary, or strings of ones and zeros. This is where programming languages come in, it serves as a great way for us to communicate our instructions to the computer. While coding, it is extremely important to be very exact. If you were telling somebody how to create a peanut butter and jelly sandwich, you could very simply tell them to spread some jelly and peanut butter on their favorite type of bread. A computer would need much more specific directions i.e. first open the jar by turning the lid counter-clockwise, but what is counter-clockwise to a computer? This would also have to be defined, and as you see, could get quite complicated.

But what could be the benefit in detailing out these very fine instructions? Keeping this analogy, a computer would be able to create more sandwiches in an hour than you might ever dream of in your lifetime.