Wednesday, November 30, 2011

    <?php



if (isset($_POST["submit"])) {
    $intFirstLoad = 0;
    $strTitle = $_POST["strTitle"];
    $strFirstname = $_POST["strFirstname"];
    $strSurname = $_POST["strSurname"];
    $strUsername = $_POST["strUsername"];
    $strPassword = $_POST["strPassword"];
    $strPassword2 = $_POST["strPassword2"];
    if ($strFirstname != NULL && $strSurname != NULL &&
        $strUsername != NULL && $strPassword != NULL && $strPassword2 != NULL) {
        echo "<p>Greetings $strTitle $strFirstname $strSurname</p>";
        echo "<p>Your username is $strUsername and your password is $strPassword and $strPassword2</p>";
    }
}
else
    $intFirstLoad = 1;
?>

<h2>Enter stuff..</h2>

<form action='<?php echo $_SERVER["PHP_SELF"]; ?>' method='post'>

<?php if ($strTitle == "Select..." && $intFirstLoad == 0) echo "Not Selected" ?>
</p>
<p>
<label for="strFirstname">Firstname: </label>
 <input type='text' name='strFirstname' id='strFirstname'/>
<?php if ($strFirstname == NULL && $intFirstLoad == 0) echo "Not Entered" ?>
</p>
<p>
<label for="strSurname">Surname: </label>
<input type='text' name='strSurname' id='strSurname'/>
<?php if ($strSurname == NULL && $intFirstLoad == 0) echo "Not Entered" ?>
</p>
<p>
<label for="strUsername">Username: </label>
 <input type='text' name='strUsername' id='strUsername'/>
<?php if ($strUsername == NULL && $intFirstLoad == 0) echo "Not Entered" ?>
</p>
<p>
<label for="strPassword">Password: </label>
 <input type='password' name='strPassword' id='strPassword'/>
<?php if ($strPassword == NULL && $intFirstLoad == 0) echo "Not Entered" ?>
</p>
<p>

<p><input type='submit' name='submit'/></p>

Thursday, November 17, 2011

I have the homework section of my site up, as I  cannot turn in assignments without uploading it to my personal webspace, and since I was making a site, and would like practice, I though "eh, why not?"

I do not intend to keep each item I post on their, I will make a page for end of term papers and such, but not assignments worth 5 points.
http://webspace.globeuniversity.edu/arthur.taylor/

php code as follows

<p>Using loop constructs, produce a PHP script which will output a calendar for a normal February (28 days).<br />  You will need to define variables to contain the start day of the month (Sunday, Monday, etc.) and the number of days in the month.<br />
For each day of the month that is an even number, print the value in bold text. Begin the Month on Saturday </p>

<?php
// File: exercise9-6.php

$intStartDayOfMonth = 6;    // Tuesday Start of Month
$intDaysInMonth = 28;       // Days in Month
?>
<table border = '1'>
<tr><td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>
<tr>
<?php
for($intCurrentWeekDay=0;$intCurrentWeekDay<$intStartDayOfMonth;$intCurrentWeekDay++)
    echo "<td></td>";
$intDay = 1;
while($intDay <= $intDaysInMonth) {
if ($intDay % 2)
echo "<td>$intDay</td>";
else {
echo "<td><b>$intDay<b></td>";
}

 
    $intDay++;
    $intCurrentWeekDay++;

    if ($intCurrentWeekDay == 7) {
        $intCurrentWeekDay = 0;
        echo "</tr><tr>";
    }
}
for(;$intCurrentWeekDay<7;$intCurrentWeekDay++)
    echo "<td></td>";
?>
</tr></table>

Thursday, November 10, 2011

Website!!!

I've decided instead of making an app, to make a website for my self instead, this way I dont have to learn a new language, which I dont have the time to learn at the moment, and I can use this site as a portfolio to show off other projects I've done or the app if I come back to it.


Other than that, had mid terms this week, and we started php in the web tech class.(only done bitwise arithmetic so far)

Tuesday, November 1, 2011

nov 1st

So one of my friends from work who goes to the U of M was telling me about how he and a group of others came up with an idea for a mobile app, which got me thinking "what can I do that I can put in my portfolio". Something that I think will be easy enough, but still a strong enough concept that I can say "I did this" and still be proud of it, is a World of Warcraft add-on.

The first thing I have to do is learn quite a bit of Lua, which is the language that Blizzard uses to program add-ons.

Second, my initial idea is to make a program that adds all auctions that you have up for auction on the auction house and print how much money you would get if everything would sell at that point.


On other notes we start PHP next Monday, at the moment we are working on javascript.
Our first project was to create a table with the numbers 1-10 and their squares, then add all the  numbers in the column at the bottom of the page.
http://webspace.globeuniversity.edu/arthur.taylor/unit4.html

Thursday, October 27, 2011

whats going on...

I've been extremely busy the last 3-4 weeks, but everything has cooled down at least for the moment.

So what ive been up to then....

If I havnt said yet, for my Web Tech class, we are making a web site for the VFW(post 5555). At the moment im in charge of gathering pictures, and more of a non-assignment item, gathering information. At the present time we have a mock up of the home page, and I think someone is working on making mock ups for each page on the navigation bar. But anyway were having the person from the VFW come back so we can talk about what he wants on each page.

2 Ideas that I would personally like to pull off are a facebook page; I noticed that when the rep from the VFW was showing us a few other pages he liked a few had facebook pages.
The other is a meetup page, this comes from seeing that they have a lot of random events going on, and a meetup page would help them organize who is coming and who may be going , however, someone mentioned a calender might be better for that goal, which it may, but we will have to see how the rest of the site turns out.

I decided to drop Programming 2 and do an audit of Programming 1. I feel that I need to get a better understanding of the fundamentals of C++ before I can move on to more advanced things like searching and sorting.

We have been talking about many things in intercultural communications. For the last 2 weeks the topic has been on religion and its part in society, we had to write a paper on one of 3 different choices, mine was on negative portrayals of religion in film. I went further and focused on Atheism because the text book that I am using mentions them once by name and secularists twice(and make the mistake of saying secularists say "there is no god")

There was also an error in our text book that read something like "Moses was the founder of Judaism" My instructor asked me and another student(about another error he found) to write letters to the authors of the book about the errors we found in the book.

That is all for the moment

Tuesday, October 11, 2011

10/9

The semester started on Monday last week.

Programming 2: we started on recursion in the first week, its a rather simple concept, Its more/less a min loop, but instead of starting at the first case, it starts with the last case. An example is in the previous post; what we wanted to do for that assignment is find the greatest common divisor.
We first had to define the largest and smallest numbers in the list to find the modulo, the if statement asks "if this "smaller" number is bigger than this "larger" number then redefine "larger" and smaller(smaller and larger being the parameters) we then put larger against smaller for the modulo, if the answer we got was 0 we returned it as is, if it wasnt, we redefined larger to smaller and smaller to rem and then returned it.





Wednesday, October 5, 2011

10/5

Recursion program to find the greatest common divisor(update latter)

#include <cstdlib>
#include <iostream>

using namespace std;

int gcd(int a, int b);

int main(int argc, char *argv[])
{
    int larger;
    int smaller;
    int temp;
   
cout << "Hello, "
     << endl;
cout << "This program will calculate the greatest common divisor"
     << endl;


cout << "Please enter a first number number: "
     << endl;
cin >> smaller;
cout << "Please enter a second number: "
     << endl;
cin >> larger;

cout << gcd(smaller, larger) << endl;


   
    system("PAUSE");
    return EXIT_SUCCESS;
}

int gcd(int smaller, int larger)
{   
   
     int temp;
     int rem;
    
     if (smaller > larger)
     {
                 temp = larger;
                 larger = smaller;
                 smaller = temp;
}
     rem = larger % smaller;
     if (rem == 0)
      //if rem >9000....
        return smaller;
     else
         return(smaller, rem);
        

}

Wednesday, September 14, 2011

9/14

I got my laptop back today. A circuit in the hard drive severed, which made it unusable; so I did a fresh install of windows 7. Also something I didn't do was have a back up, which is pretty much a given for anyone in IT...guess I'm not in IT....
At the moment I have a few programs are up and running, mostly personal items, bur all the updates, drivers and such are done.

If I havn't put it down yet, I got my new schedule for school; my classes for this semester are as follows: Web technologies, programming 2 and inter-cultural communications.

I'M rather looking forward to it, in Web tech I'm going to start PHP. Its one of the languages I've seen almost universally through out applications. I was talking to a few friends who are in the IT field, and 2 of the 3 said that C++ is out of date as far as programming goes, and that most companies use ASP .net or Java(Script).
Inter-cultural leads to most psychology classes, which if anything is something like a minor for me(we dont have minors at MSB)


Note:
Since my old drive is fried I lost all my previous school work. I do beileve that I have a paper copy of my report on social media, I'll have to look around.

Note 2:
I start next semester on Oct, 8th. And I now have a hard drive to back up my laptop...

Wednesday, August 31, 2011

8/31!!

So I took my laptop in, as I thought it wasn't anything I could fix...the LCD was, for lack of a better word, broken. The other issue that was wrong with it is that when you started up the computer it would cycle between the gateway screen and a courser, their looking looking into what is causing this, they think it may be something to do with the hard drive. I originally thought it may have something to do with the bios...

As for the summer, I didnt do much with programming; I did finally install a sound card in my desktop as well as get a second monitor...which is something I've been wanting to do for awhile now. I 'll upload a picture(maybe) sometime.

Friday, August 26, 2011

8/26!!!

Its been awhile....
My laptop took a dive into the floor, I took it apart to see if anything hardware related was broken, or I could fix, but it doesn't look like it so im taking it into a tech shop Monday.

Class is starting in about 5 weeks...I got my schedule a few days ago. I have Web technologies, Programming 2 and Intercultural Communications. Its rather different than last semester, where I had 2 Business classes on campus and one IT class online.

I'm looking forward to this semester since I have all 3 classes on Campus, one im pretty sure will be taught by a instrucer I've had before(Richard Cummings) and one which is a pre-req to psychology classes, which I would consider something of a minor...but we dont have established minors at MSB.

Tuesday, June 21, 2011

June 21

Been very  busy between research papers and presentations I had to make for school, I'll get a post on what ive been doing late this week or early next week.

Tuesday, June 7, 2011

We have been discussing arrays in the past week.
Our assignment was to create a program that took the first and last name of the user and output it in reverse order.



 
   

   
    cout << "please enter your first name: " << endl;
    char str1[30];
    cin >> str1;
   
   
    cout << "please enter your last name: " << endl;
    char str2[20];
    cin >> str2;
   
   
    cout << "Your name before manipulation: " << str1 << " " << str2 << endl;
   
   
    cout << "your name after: " << str2;
    strcpy(str2, str1);
    cout << " " << str2 << endl;
   
   
comments:
I could have eliminated 2 separate lines for the cin input, and just did,
cin >> str1 >> str2
char str1[30];
char str2[25];

or something close to that.
I also feel it kind of redundant the way we have to reverse order.
Cout str2 and then copy the value of str1 into str2 and output it again.
A better way I think is we could just cout >> str2 >> str1
This eliminates extra code, along with if you have to use str2 again latter on the in the program you can use it as the "real" value of str2
   
   
   
   
 

Wednesday, June 1, 2011

June 1!!!

We user defined simple data and string types(last week) this week we are working with arrays.

In Chapter 8, there is a discussion of the "Rock, Paper, Scissors" game. Discuss how this game works, and how a C++ program that models this game will use a variety of types.

(may have done this wrong)

First it defines the object rock, paper, and scissor.
After that the function prototypes are defined.

Displayrules are called upon entering the game and display the Cout statements on page 446. 

Objecttype gets the keystroke that the user entered through a switch structure. It uses both uppercase and lowercase to decide. To passes the object that was selected to gameresults.

Gameresults, this calls winningobject to decide how the game should go; or, the truth table for the game.

After the truth table is found, it proceeds through game results first to see if the game is a tie, then it outputs each player’s choice. It then compares each player’s objects that they chose to the winningobject, via the convertenum function, and outputs the winner.

The convert enum function converts each of the enum defined(rock, paper, scissors) to something that can be recognized by C++(a cout statement)

Display results outputs the number of games played and who many times each player has won a game, the wins for player one is stored in wCount1 and the wins for player 2 is stored in wCount2. The loop for incrementing each counting sequence is in the main body of the program.






comment by instructor: Great job in breaking this down here, with "enum" in this case, would this be a function? How would this be defined?




my response
If I understand your question correctly, no, the:
enum objectType {rock, paper, scissors}
is no a function.

enum does nothing more than create a user defined data type.
So instead of
char rock, paper, scissors;
you have enum ObjecType {rock...ect

This is the reason you have to have a new function to "read" the data in the enum. Which is where the convert enum function comes into play(on page 449)

To define an enum data type use the following code:
enum TypeName {value1, value2, ect}

Monday, May 23, 2011

5/23

This unit expanded on the various types of variables. Discuss the difference and usage of local variables, global variables, static variables and automatic variables. Post some snippets of code illustrating their use. 

Local variables : are used within a block such as 

int main()
{

int num = 20;
cout >> “please enter a number” >> endl;
cin << num << endl;
}

Or in a function (maybe)
Int number (int num)
{
Cin << num
}
This sets num to 20 for the main() function 
They cannot be used outside of their block they are initialized in.
We have used these in just about every program so far.
If we think of them as a tv show, they are characters that come in for one episode or the main theme of one episode.

Global variables: These are variables that are initialized before the main program body 
Example:

#include 
using namespace std;
int num = 20;
int main()
{
cout << num << endl;
This initializes num to 20 for the entire program.

To use the tv example, they are the main characters or main plot of the show
We have used them, not as much though

Static variables: These are almost the exact same thing as global variables, except you can declare them within a block by using:

Static datatype identifier
Or an example
Static int = 20;
Another thing to note is that as long as the program is “going”
A good example is X on page 392
Void test()
Static int x = 0;
X = X + 2;
Cout << “inside test x = “ << x << endl;
Inside test x = 2
Inside test x = 4
Inside test x = 6
Ecrt..
What this does is increase x by 2 each time it executes around .
We have not used these that I am aware of.


Automatic variables: The book describes these as pretty much the same as local variables. The only addition from local variables that is mentioned is that they are initialized to 0.
From other wibsites that I found they said that they are not normally used by “human” programmers but program generators

Wednesday, May 18, 2011

I think its 5/18...

Choose one of the many topics that we have discussed so far in this course. Selection structures, repetition structures, functions, I/O etc. What have you learned about these? Have there been any surprises?


Functions in C++ are a bit different than what I expected them to be. I assumed that they were saved in a different area and when you call them you have to add the path into that call.
The prototype deals with the situation quite nicely though. I understand many people’s concerns and confusion about having to declare the variables for that function so late in the program, or that it is considered good practice to put the functions after the program. I rather like it though, for myself it seems cluttered to have something opposed to the main function coming before it.

I feel I can do better on repetition structures, I never was good at them, have a hard time deciding what loop to use and how get the loop to do what I want it to do and how many times.




My midterm discussion board for programming 1

I've decided to post some things for my business classes as well, but only major project.


For business communications we are to do a 15-20 min presentation on a topic regarding communications, this is a 2 person assignment.


We have chosen social media as our topic, I dont have much more, we just got it 2 days ago.


There is not much for intro to business, unless I can find out how to upload to a pdf doc(our final project is a paper on a any topic(mine = what defines a good leader) that has to be 5-10 pages) I'll look into it. 




For my programming 1 class our project of the week is to create a program to count the number of vowels in a sentence using void function. I think I'm almost done with it but have 1 issue with the counting loop. 

Monday, May 9, 2011

2 POSTS TODAY!!!!

So I have midterms this week, which means there will not be much to post. However we are to use the discussion board to write the following(I will be uploading my response):
Choose one of the many topics that we have discussed so far in this course.  Selection structures, repetition structures, functions, I/O etc.  What have you learned about these?  Have there been any surprises?



TODAY!!!.. IS ^THAT^ DATE!!!!

I finished my programs about 2 days ago...

first one, we were supposed to a add on a few things to an example in the book. The example was to find a a palindrome(dont know if that is spelled right). One addition that my instructor put on us is to not accept user input. soooooo...here is the code....
#include <cstdlib>
#include <iostream>
#include <cmath>

using namespace std;

bool isNumPalindrome(int num);

int main(int argc, char *argv[])
{
 cout << "answers in binary" << endl;
 cout << "the answer is: " << isNumPalindrome(646) << endl;
          
          
    system("PAUSE");
    return 0;
    
    
    
}




bool isNumPalindrome(int num)
{
     int pwr = 0;
     
     if (num < 10)
        return true;
     else
     {
         while (num / static_cast<int>(pow(10.0, pwr)) >= 10)
         pwr++;
         while (num >= 10)
         {
               int tenTopwr = static_cast<int>(pow(10.0, pwr));
               
               if ((num / tenTopwr)  != (num % 10))
                  return false;
               else
               {
                         num = num % tenTopwr;
                         num = num / 10;
                         pwr = pwr - 2;
                         }
                         }
                         return true;
                         }
                         }

some things I feel I could have dont is put in a switch system so that it output "the number is not a palindronme" or "it is a palindrom" instead of binary
something like

      switch (something here)
    case 0:
           cout << "num is not a palin" << endl;
    case 1: 
           cout << "num is a palin" << endl;

the above isnt perfect; just psudocode.

we were to make two other functions, one that output a double when it was passed an int variable

and the other was to simply install a prototype

first


#include <cstdlib>
#include <iostream>

using namespace std;

double check (int a, double b, double c);
int main(int argc, char *argv[])
{
 
    check(1, 2.2, 2.3);
    system("PAUSE");
    return EXIT_SUCCESS;
}

double check(int a, double b, double c)
{
          cout << "please enter a number" << endl;
          cin >> a;
          cout << "please enter a decimal number" << endl;
          cin >> b;
          cout << "please enter another decimal number" << endl;
          cin >> c;
         
}

quick note, the above didnt have to output anything


second 
double findabd ( int a, double b)
{

return (double)
}
not much to say on that one

Thursday, May 5, 2011

5/5

So I've been hit with a recent wave of the "holy crap I have a lot of homework"s
But this week in programming we're going through functions, the first part is value returning functions(next week is void functions).
We have to write one program and 2 individual functions, I'll get those up when I get the last one finished, one is complete, one is a bout 75% done and I'm wondering why the compiler says things are undeclared in my last one.

Sunday, May 1, 2011

5/1

so my parents thought it would be cool to go on vacation during the school week -_-

anyway ive been working on 2 different programs in that time


#include <iostream>
#include <cmath>

using namespace std;

int main ()
{
int num;
int x;
int root;
bool prime;

cout << "Please enter a number: ";
cin  >>  num;
cout  <<  endl;

root  =  pow(num, 0.5);

for  (x=2;  x <=  root;  x++)
{
if (num % x == 0)
{
cout << "number is not prime" << endl;
prime = false;
}
else
{
cout << "number is prime" << endl;
prime = true;
}
}


   
   
    system("PAUSE");
    return EXIT_SUCCESS;
}


for this one you are input a positive number and the output is supposed to tell you if the number you input is a prime number(if you cant tell this week is loops)


#include <cstdlib>
#include <iostream>
#include <iomanip>


using namespace std;



int main(int argc, char *argv[])
{
    int counter;
    int num;
    int zero = 0;
    int even = 0;
    int odd = 0;
    int N = 10;
    int sum = 0;
   
    cout << "please enter " << N << " integers, "
         << "posative, negative, or zeros."
         << endl;
       
    cout << "the numbers you entered are:" << endl;
   
    for (counter = 1; counter <=N; counter++)
    {
                 cin >> num;
                 cout << num << " ";
               
               
                 switch (num % 2)
    {
    case 0:
         even++;
         if (num == 0)
            zero++;
           while (num == even)
           {
                 sum = sum + num;
                 cin >> num;
                 }
         
         break;
         case 1:
         case -1:
              odd++;
         }
              }
       
         cout << endl;
         
         cout << "there are " << even << " evens, "
              << "which includes " << zero << " zeros. "
              << endl;
         cout << "the number of odd numbers is: " << odd
              << endl;
       

   

   

   
   
   
    system("PAUSE");
    return EXIT_SUCCESS;
}

this one was tough, you have to enter a set of numbers and then have it output the sum of the even numbers and odd numbers and how many zeros there are

Friday, April 22, 2011

4/somethig

So im still working on the project I was before, below is what I have at the moment:


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
  
  
    int num1, num2, num3;
    int a, b, c;
    int greater;
  
  
  
    cout << "input your first number: ";
    cin >> num1;
    cout << endl;
  
    cout << "input your second number: ";
    cin >> num2;
    cout << endl;
  
    cout << "input your third number: ";
    cin >> num3;
    cout << endl;
  

  
  
  
    if (num1 > num2 && num3)
     cout << num1 << endl;
    
    
      
    else if (num2 > num3)
         cout << num2 << endl;
  
    else if (num2 > num1)
         cout << num2 << endl;
  
    else if (num3 > num1)
         cout << num3 << endl;
        
    else if (num3 > num2)
         cout << num3 << endl;
      
      
      
          
    if (num2 > num1 && num3)
     cout << num2 << endl;
      
  
        else if (num3 > num2)
         cout << num3 << endl;
        
    else if (num3 > num1)
         cout << num3 << endl;

  
    else if (num1 > num3)
         cout << num1 << endl;
        
    else if (num1 > num2)
         cout << num1 << endl;

        
        
    if (num3 > num1 && num2)
     cout << num3 << endl;
    
         else if (num2 > num1)
         cout << num2 << endl;
        
    else if (num2 > num3)
         cout << num2 << endl;
  
    else if (num1 > num2)
         cout << num1 << endl;
        
    else if (num1 > num3)
         cout << num1 << endl;
  


  
    system("PAUSE");
    return EXIT_SUCCESS;
}

the issue im having now is that lets say that num1 is smaller than num2 but not num3, the program sees that num1 is not greater than num2 and num3 and prints num2 or num3, whatever comes first in the program. It does this for each block of code.


What I really wanted to do is use >! inside an IF statement: if (num1 > num2 && num1 <  num3)
but it doesn't seem to work like that =( 

im proboly going to work on other stuff tomorrow (business communications) since it needs to be in by Monday and other than this one program im a week ahead in programming 

Thursday, April 21, 2011

4/21

So Ive been working on the following assignment the last 1-2 weeks:

Write a C++ program that prompts the user to input three numbers. 
The program should then output the numbers in ascending order.

Ive been having a lot of problems with it. After I find the first highest number I have to then find the number below that, which has been the main issue.


Ive tried redefining the variable used for the first number and then asking if this or that number is <= to it.


I think I'm getting very close to figuring it out at the moment.





#include <cstdlib>
#include <iostream>


using namespace std;


int main(int argc, char *argv[])
{
    
    
    int num1, num2, num3;
    int a, b, c;
    int greater;
    
    
    a = num1;
    b = num2;
    c = num3;
    
    
    
    cout << "input your first number: ";
    cin >> num1;
    cout << endl;
    
    cout << "input your second number: ";
    cin >> num2;
    cout << endl;
    
    cout << "input your third number: ";
    cin >> num3;
    cout << endl;
    
    if (num1 > num2 && num3)
     cout << num1;
     cout << endl;
       
       
       else if (num2 > num1 && num3)
        cout << num2;
        cout << endl;
            
            
       else(num3 > num1 && num2)
            cout << num3;
            cout << endl;
            
       if (num3 > num1 && num2)
          cout << num3;
          cout << endl;
          
          else
          cout << num2;
          cout endl;
            


    
    
    
    system("PAUSE");
    return EXIT_SUCCESS;


}






The issue I'm having now is that the compiler I'm using is saying that there is a syntax error before every "else" statement (end o line)

Tuesday, April 12, 2011

4/12

made a few programs....
1. Write C++ statements for the following:
a. Reading 1 line of input and storing the result in the variable myVariable 
b. The square root of x - y. 
c. The value of 3.62 raised to the 3rd power.
d. The value of 81 raised to the .24 power.
e.  Ignoring the first 40 characters or all characters until the character 'B' is found, whichever comes first. 
f. Displaying "Hello World" to the screen. 


#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>

using namespace std;

int main(int argc, char *argv[])
{
    ifstream inData;
    ofstream outData;

    string variable2;
    int myvariable;
    int variable;
  
    inData.open("test.dat");
    outData.open("testavg.out");
  
    outData << fixed << showpoint;
    outData << setprecision(2);
  
    outData << "data" << endl;
  
  
    inData >> variable2;
    outData << "student name: " << variable;
  

    
  
    inData.close();
    outData.close();
  
  
  
    cout << "input variable: ";
    cin >> myvariable;
  
  
  
    system("PAUSE");
    return EXIT_SUCCESS;
}

Friday, April 8, 2011

week of...4/3

made some C++ programs(very simple ones)


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
  
    string name;
    string color;
    int age;
  
    cout << "what is your name: \n";
    cin >> name;
    cout << endl;
      
    cout << "what is your favorite color: \n";
    cin >> color;
    cout << endl;
  
    cout << "oh..and what is your age: \n";
    cin >> age;
    cout << endl;
  
    cout << "name: " << name << endl;
    cout << "color: " << color << endl;
    cout << "age: " << age << endl;
  
    system("PAUSE");
    return EXIT_SUCCESS;
}





#include <iostream>

using namespace std;

    const int SECERT_NUM = 11213;
    const int PAY_RATE = 18.35;
    

int main()
{


    int one, two, SECERET_NUM;
    int hours = SECERT_NUM + 3;
    double first, second, three;
  
    string paycheck;
  
    one = 18;
    two = 11;
    first = 25;
    three = 3;
    second = first * three;
    paycheck = hours * PAY_RATE;
  

    cout << first << " " << second << SECERET_NUM << endl;
  
    cout << "wages = " << second << endl;
  
  
  
    system("PAUSE");
    return EXIT_SUCCESS;
}


note
above should have double for the "const"



The C programming language is generally considered a structured programming language, while C++ is object-oriented. What enhancements were made to C++ to make it object-oriented? What types of applications are better suited to structured programming? object-oriented programming? 





The difference(s) is Polymorphism: Instead of writing logic as “if this do XYZ; if that do ABC” we define the shape and it draws itself


Encapsulation: it’s the ability to group/bundle data and code in one place to hide from the outside world 


Inheritance: this gives you the ability to extend objects/structure that are already in place.
Say you have Cup object. In structured code, you can have it be either empty or full.
In OOD you can have it be full, empty, (replacing full with )pop, water, cool aid, anything you want.


It’s really up to the programmer what they want to do, you can do almost anything in structured that you can in OOD, but OOD makes it so much easier because of the things that were implemented(see above)








after thinking about it for a bit more, I have to agree with one of the other students, things such as payroll would be better for constructed and games would be better for OOD

reason
if you have a payroll, you have don't have any or very little objects, and because of that you dont have to add any/few functions for them to interact with other objects if there are any
in gmaes, you have so many things that need to be defined, user characters, fireballs, monsters, user to user actions. It would take you a very long time to do in constructed


Monday, April 4, 2011

4/5

started new semester today, only IT class I have is programming 1

I'm more than likely going to have to put python on hold for a bit to get through this semester.
Programming 1 seems a bit more demanding than the previous classes so far.


week one
assignment: to come(basically write a program in c++)

Saturday, April 2, 2011

4/2

"working with errors" in python


worked with the TRY: and EXCEPT: commands vs adding extra code to handle errors.

long story: try and except are better. You can handle unexpected errors that may come up and you dont have to add extra code for every error in your code, which makes your code harder to read and even harder to fix if someone else were to read it.

Wednesday, March 23, 2011

3/23



Configuring a second IP
  1.         Click network connections
  2.         Go to local area connections, click Properties, internet protocol version 4
  3.         Click advanced, click add
  4.         Type in your new IP address, with the correct subnet mask
  5.        To test if you added it right, open a command prompt and type ipconfig


Creating a forward lookup zone
  1.        Open DNS manager in administrator tools
  2.        On the left hand, expand your server
  3.        Right click your server, and “new zone”
  4.        Use whatever setting you want
  5.        When you have to name your zone, to make it easy, name it “your server name”-external.com
  6.        Right click the new zone on the left hand side panel  and click New host(A or AAAA)
  7.        Type your “server name”-ext
  8.        Clear the create associated pointer record
  9.        Add the new host and click ok
  10.        To test and make sure your zone added right, open a command prompt
  11.        Type ping “your server name”-ext.”your server name”-external.com


Adding a host to your FLZ
  1.      If you try to ping your servers –ext you will not get a reply
  2.        Go to your network and sharing center
  3.        Click manage network connections
  4.        Right click local area connections and properties
  5.        Click TCP/IPv4(double), advanced
  6.        Go to the DNS tab
  7.        Click Append these DNS suffixes, add, type “your server name”-external.com
  8.        Click add twice
  9.        Type “your server name”, and add one more time
  10.    Bring your server to the top by clicking the up arrow twice
  11.  To test and make sure you did it right open a command prompt and type ping “your server name”-ext



Creating a standard primary zone

1.       Open DNS manager in administrator tools
2.       Right click Forward lookup zone and new zone
3.       Keep the zone type the same, but clear “store the zone in active directory”
4.       Name the zone anything you want
5.       Click next twice
6.       Make sure do not allow dynamic updates is checked when you get to it
7.       Click finish
8.       Right click and make a new host
9.       Name it anything you want
10.   Put in a valid IP address
11.   Create a PTR record and add host and done
12.   To test and see if the zone took, open a command prompt and type nslookup “your host name.your server name”

Raising function level
  1.        Go to active directory domain and trusts in administrator tools
  2.        Right click your server and raise domain function level
  3.        In the box that comes up click the “select an available domain function level.”
  4.        Then select windows server 2008 and raise don’t worry about the warning button



Transferring schema master role
  1.        Open a MMC and add the active directory schema snap in if you don’t have it already
  2.        Right click active directory schema
  3.        Click change active directory domain controller
  4.        Click your server and ok
  5.        Right click active directory schema and operations master, then change
  6.        Yes, ok, close



Transferring infrastructure master role
  1.        Go to active directory users and computer in the administrator tools
  2.        Change domain controller
  3.        Click your server and OK
  4.        Right click active directory users and computer(again), all tasks and operations master
  5.        Go to the infrastructures tab, then change, point to the server you want to inherit the master role
  6.        Yes to confirm and OK to finish

Tuesday, March 22, 2011

3/22







active directory 

installed a CA CS role on my domain
backed up a CA
made a template

things to note
-could not  set up auto-enrollment. The first domain controller has some policies in which it restricts me from  accessing the group policies on the GPM console, was to late in the class  to do anything about it.
-because of the above could not set up web enrollment or archive a key manually

notes to self
-get pic of back up folder 

edit:
while looking through the python website I came across this
since python 3.2 just came out on feb 20 this is pretty relevant 

Monday, March 21, 2011

3/21


installed a module in python, and set up a distribution cycle


^^^^
my module in action, called from a file

the coding of my module


Im having an issue with syntax, the book im using says to use the following code:

else:
      for tab_stop in range(level):
            print("\t", end='')
     print(each_item)

however IDLE is giving me a syntax error
ive rearranged the code every way I can think, and cant get it to work, if anyone knows whats up could you contact me.

that is 2 '   ' to make it clear


edit: 3/27
I figured the issue out. Idle was running python 2.6.6 and I was coding python 3.2