Sunday, October 19, 2014

Post 3 (10/19/14) - Encoding and Symbols, with a taste of Abstraction

When you type in a symbol, it is not stored as that symbol (including zero and one, for some unknown reason). It would instead be stored as a combination of 7 binary characters, also known as bits. There are a total of 128 possible combinations - capable of storing the English alphabet, numerals, punctuation, and a few others, but incapable of storing every alphabet and specialized symbol. The particular code that chooses which sequence stands for which symbol is called ASCII, meaning "American Standard Code for Information Interchange."

To do this, programmers designed UTF-8, which consists of both ASCII and another encoding scheme - Unicode. Unicode utilizes from 1 to 4 bytes (a byte is a sequence of 8 binary characters) to store an individual character - potentially allowing over 4 billion characters to be represented by a unique sequence of binary characters.

This whole process works with an underlying theme in computer science and programming - abstraction. Abstraction, in this context is using something that has no relation to your subject and using it to represent the subject, allowing you to communicate, via a code (this is probably where the name originated), with a computer's binary vocabulary. (Puns. Too many puns.) Abstraction is used because computers work in a way that is traditionally referred to along the lines of "strong but dumb." What this means is that they cannot do anything unless it is explicitly and completely described to them, but they do it extremely quickly.

Now, getting back to Symbols. There are several ways to place a symbol in your text, but they are highly dependent on your system, application, language (this refers to something in the coding), and code page. For example, in Microsoft Word, you type out the hexadecimal code for the given symbol, then press Alt-X. With a little research, you can easily find a method that works in your particular circumstances, as well as the code for whatever character you want to place.

Sunday, September 28, 2014

Post 2 (9/28/2014) - a LOT of scratch

These last two weeks have just been programming or analyzing scratch

One of the things we have been doing is to discover where a number is after a program. Example follows:

When space key pressed
   Set X to 4
   Set Y to 7
   Repeat 4
      If X>Y
         Set Y to Y + X
         Set X to X - 1
      Else
         If Y>X
            Set X to X + Y
            Set Y to Y - 1
         Else
            Add 10 to Y
   Say Join (X)(Y)

To discover the result, you could make it and see, or you could work through it. Example Continues

So, at the first part, X = 4 and Y = 7

Then the first loop plays
   first it checks, Is X greater than Y? NO
   this places it into the "Else" category
      now it checks, Is Y greater than X? YES
         now it makes X equal X + Y. 4 + 7 = 11
         now it makes Y equal Y - 1. 7 - 1 = 6
Now it repeats the loop
   first it checks, Is X greater than Y? YES
      now it makes Y equal Y + X. 6 + 11 = 17
      now it makes X equal X - 1. 11 - 1 = 10
3rd repeat
   first it checks, Is X greater than Y? NO
   this places it into the "Else" category
      now it checks, Is Y greater than X? YES
         now it makes X equal X + Y. 10+ 17 = 27
         now it makes Y equal Y - 1. 17 - 1 = 16
4th (and final) repeat
   first it checks, Is X greater than Y? YES
      now it makes Y equal Y + X. 16 + 27 = 43
      now it makes X equal X - 1. 27 - 1 = 26

Now comes the Say command
   Join means list them (in that order), so if X was he and Y was llo, join (X)(Y) would result in "hello"
   In this case,  X = 26 and Y = 43, so it would say "2643"

Sunday, September 7, 2014

Post 1 (9/7/2014)-Online Privacy and a bit of Scratch

Over the First two weeks, we set up the class, looked over a lot of information regarding online privacy, and started working on Scratch, a program designed by MIT. Scratch seems to be designed to explain the theory of programming to the user, for instance, you can drag the if () then (), else () block in without worrying about how you say it in that programming language, or about messing up the syntax of the language(I.E. forgetting to put a semicolon at the end of applicable lines (in java))

The information regarding online privacy was not very surprising, with the possible exception of the "filter bubble", which is a term for the fact that search engines(such as Google) sort their results by your browser, computer, history, and anything else it can access. This causes you to not receive some results, get (sometimes significantly) different results from other people, and repeatedly find the same few things. Another online privacy issue was cookies (small pieces of information stored on your computer that some websites consult to determine what to do. They allow you to stay logged in, keep things in your "shopping cart", and allow companies to determine what ads to use)

On Scratch, we have mostly just been discovering what each "block" does and using them to "write" extremely simple programs, such as a short conversation or music(or at least something attempting to be music). However, Scratch, while it has a block that says "moves 10 steps" does not explain how this is accomplished, the actual coding of the block probably looks more like this:

for (long i = 1; i <= 10; ++I) objectName.x = objectName.x + 1;

(objectName.x is the x coordinate of the object)

Or, more likely, they did something I didn't think of.

This means that, while it is useful for understanding the concept of programming, it doesn't help with the syntax of the language, which is what I have had the most difficulty with, as of yet.