## Friday, January 27, 2012

### The Way of the Programmer: A Warning. Also, numbers

Happy Pirate Hat Friday, everyone:

The Way of the Programmer can be dangerous for those who are impatient. A program doesn't program itself; you have to program EVERYTHING in the program. You need to be extremely patient with your program. Multiple versions must be made for even a simple little thing. However, once you finish your program, it would be like you slew a giant octopus with a toothbrush, like me.
I'm serious, you can't think it will be easy. That is not the way of the programmer! Stop doing it! If you think it will be easy, you will easily fall to the long process of programming. Just saying.

Now, today's lesson will be on integers.Yeah, that's right. Numbers.

Integers: A WHOLE new experience
Alright, integers are whole numbers. No decimals, no fractions, just positive and negative whole numbers. Now, you can make a decimal like an integer, but we will get into that. Now, integers only goes through the interval of (-2 billion, 2 billion), just about. Generally, this will be what you need for the job.

How do I declare an Integer?
Code that like this will get the job done:D
int myInt;
For initializing, do this
myInt = 42;
No quotation marks or anything, unless you are setting it to another variable.

Double: Double the fun, twice the work
A double is like an integer, but it includes a decimal, fraction, and other fun stuff

A prime example of a double is money. You can have 35 dollars, yes, but it's better to have 73.35 dollars. Doubles go farther in bounds than integers.

How do I declare a double? I don't understand! I'm literally tearing my hair out! Now I'm bald! What is going on???
Hahaha, silly new programmer. The way you declare a double is like an integer.
double myDouble;
Initializing just has a similar way, as well.
myDouble = 42.424242
Next time, we will talk more specifically on math.

-The Rich Man known as Thursday (Who isn't really rich, but pretends to be)

## Monday, January 23, 2012

### The Way of the Programmer: String Theory??? lol no.

Happy Inspirational Monday, everyone.

You can do it.

I'm sorry that I haven't been posting recently. I've been busy mangling a sour cream beast inside the mouth of a giant octopus. It was a very sour experience, I must say.

Anyways, back to my lesson. Let's talk about strings. Strings are connected lines of characters, such as the following:
Now, strings are very important. Sometimes, they are crucial to the very fabric of the program itself. Other times, you won't use them as much as you would integers or other things. I prefer using strings because you can use print them onto the computer in many instances. It also makes it look much more organized.

Generally, you declare a string by saying:
String stringName;
You initialize it in your constructor by saying something like this:
stringName = "This is my string. I like it very much.";
Now, you can do a lot with strings. You can use many things to strings, but we will only talk about a little bit of it today.

Somethings we can do:

• Print multiple times with the string
• Organize the string alphabetically
• Get number of characters
• Make it print many times while making a random letter disappear.

Now, I don't mean to frighten you, but next time, we're going to talk about numbers, math, and begin getting into Loops and Arrays. Now, you can do it.

-The Rich Man also known as Thursday (Note that I am not actually rich, but I have a sense of a rich gentlemen).

## Thursday, January 5, 2012

### Programming (in Java): Adding more classes and methods to Hello World

Mmnyes, Money.

Happy Rich Man Thursday today, everyone:

Now that we finished "Hello World", we are almost done with using the "Hello World" program. Open Eclipse and go into the project we called "Hello World". Now, right click your source code folder and create a new class, name it HelloWorld or something other than what you named the first.

The good stuff we learn today:
1. Constructor
2. Data Member
3. Method

 What the new class should look like
Now, in between the squiggles (Again, {}), type in:
public HelloWorld()
and put a new set of squiggles after that. This is your constructor, which allows you to call it from another class, thing, etc.etc. Above your constructor, you will need to create a string. Now, in order to do this, above the constructor, type in
String
and then type in the name. Remember to end the line with a semicolon! Really important to do that. It is like having periods after your sentences. You miss one and your professor in english or teacher in language arts gets upset, or something along those lines.

What is a string, you ask? Well, a String is a thread of text. It is a Data Member, which are like "int"s, "double"s, and "char"s. Data members contain your basic data, such as numbers, text, a true/false result, or just a single letter, depending on the type.

Now, inside the squiggles, you need to initialize the string. Before, you declared it. Initializing is to set something to a specific value. For this example, inside the squiggles, you will type the name of the string you assigned it, set it equal to, in quotes, whatever you want the string to be. For example, my name for my string is "helloWorld", so I would initialize it by saying: helloWorld = "Hello, World!";

Underneath the squiggles, we need to create a new method. Methods are a chunk of code you want to be repeated, in which you can call it from another method or class and allow it to run. For example, if there was something that I wanted to code that took a number, multiplied it by 2, and it was to be used multiple times, then I would make it into a method.

So, now that we know what a method is, type in "public void helloWorldPrint()" or something along those lines. You need the public, the void, and the two parentheses, but you can change the name of the method. Create a new set of squiggles underneath the method and, inside the squiggles, you want to use the same code we used like last time. That's right, "System.out.println". This time, however, we do something different. Type in the following code:
System.out.println(helloWorld);
Or whatever you called your string name. When this class is called, it will output whatever your string was, which was preferably "Hello World!". Yes, I know this is repetitive, but we only need 2 more lines of code until we are done forever! In fact, with finishing this, you should have a class that looks like this:
 (Looks in the oven) and this is what it should look like
Please note that the package name things should only be there if you created a new package. Otherwise, this class is done. Now, we need to go to our original. Delete the
System.out.println("Hello, World!");
and add these lines of code:
HelloWorld worldlyHello = new HelloWorld();
worldlyHello.helloWorldPrint();
Now, what you are doing is creating a new instance of the class and calling the method from the class you created.
Now, this is what it should look like:
 (Opens a conveniently placed oven right by the one currently opened) And this is how your other one should look like.
Now, press run and you should be done.

Please comment with any concerns or problems, and I will try to respond.
Mmnyes, so long, young ones, and I will see you next time.
-The Rich Man who is called Thursday (Not really rich, again)

## Wednesday, January 4, 2012

### Programming (in Java): Eclipse, you, and your very own "Hello World" project.

Mwah hahahahahahaha!
Happy Evil Laugh Wednesday, everyone:

In this post, I am going to talk about some of the basics of programming. We will begin with Java, and, if we are lucky, we may continue on to C# and other languages.

First thing, make sure you have something to code with. I prefer Eclipse(No, not twilight), created by Oracle. There is also Netbeans, which can help with further GUI things. However, we will be doing the majority of our work here, in Eclipse. Here is the link to the Eclipse download list, as well as part of the Oracle website: http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html. Also, make sure you have Java downloaded on your computer. If you do not, the download should be on the same website.

Next, extract the files, it will be good for you. Once everything is set up, open Eclipse, and it will probably ask you for a location to put all your things. I prefer to put it in a default location, but you can put it anywhere you want.
Now, we are going to get into the classic, simple program of "Hello, World!" (Trust me, it's not fun, but it's essential). Find the package manager, which should look like this
 Where the magic happens...
Now, right click the side that has the tab that says, "Package manager", and select "New". This should lead into a great many things, such as "Project..." and probably "Java Project". If Java Project is shown, then just click it. If not, click "Project..." and find it. Please note that "Project..." does not mean that the person who typed it was depressed or anything, but it is just leading on to other things. Now, when you try to create a project, it looks like a form that you need to fill out. It's not paperwork, it's just a program. Now, type in "Hello World" into the package name. It should now look like this:

Click 'finish' after you have come up with your name. Now, you can right click 'src' (your source code) and create a new Package name and Class name.

This is the part where I will describe how to do the programming of this program.
Hello World:
Well, the Hello World program  is very simple. When you go onto the 'Create a new class' screen, which should look like this:
 Click the circled button for a very quick way to finish
Now, the button that has 'public static void main(String[] args)' is very important. Clicking it will input the code in the actual class, so I recommend you click it, or you could type it. Once you do that, a class should appear, entitled after what you named it.  If you did click on the button, as I recommended, your product should look like below:
 If you look on the bottom part of the page, you see the word 'Warnings (3 items)'. You don't have to worry about these yet, but you should really worry about these things. I mean, they are warning you about something, almost always bad or questionable. For example, if you had a boulder coming towards you at 150 mph, it would be really nice for a warning once in a while. These are like that, but better, as they can't kill you, but can significantly cause problems in various areas.
Type in System.out.println("Hello, World!"); in between the two squiggles, open and close ( { } I call them squiggles). It should look like this:
 You are almost finished! Aren't you glad that you don't have to look at this 'amazing' program anymore???
Alright, now, click run. In the "Project" box, it should say, "Hello, World!".

And that is what Hello World is. I think I should win a medal because this over explains how to program it.

=-The Rich Man known as Thursday (Note that I am not actually rich, but it's just an attitude towards everything)

## Monday, January 2, 2012

### Why I haven't posted and what we are generally going to post

Happy Inspirational Monday, everyone.

I have something to say to you.

You can do it.

Alright, back to our discussion

I haven't posted for a while. You can probably guess why. I have been busy fighting wild robots on some unknown planet in a different universe that were trying to eat all the cheese on our planet. As you can see, there is still cheese on this planet, I have technically saved the universe once again
Now, what I will post about is a variety of programming tutorials (Such as Java, so that all may learn the Ways of the Programmer), Starcraft 2 matches (Yes, I'm a n00b, as I am just Plat), and some other random things.

Programming tutorials will talk about basics (simple stuff like "Hello, world!" to fun stuff like File I/Os to other great fun programming things).  I will talk about common errors and other crazy stuff.

Starcraft 2 matches will probably be shown and talked about, including my own matches. I will give advice based on how I either fail or succeed, and how I could have played better.

Random things may include inside jokes, origins to the days of the week (For example, Evil Laugh Wednesday), and other strange things.

I shall do some things that will be quite entertaining, so stay tuned.

-The Rich Man known as Thursday (Please note: I am not actually a Rich Man. I only act like one. :P )