User Tools

Site Tools


opus:spring2013:psechris:start

Paul Sechrist's Spring 2013 Opus

And I'm Pretty Damn Proud of It!

Introduction

My name is Paul, welcome to my opus. See my journal for up to date information on what I have been working on. See my projects for details about the projects I have completed and am working on.

C/C++ Journals

Week 1

January 25, 2013

Accessed Putty and Lab46. Updated Opus. Downloaded files from Joe's Section.

Week 2

January 28, 2013

Killed tentacool at 10:29 AM by asking to define pointless. success.

Week 3

February 06, 2013

realized my signed ints were incorrect. I will have to find out why.

Week 4

February 10, 2013

In working on my datasize program, i used the sample code Matt gave us here on the lab46 site, rather than the code from the board in class. After trouble shooting a few errors from compilation(simple undeclared values), i recompiled and ran. I found that the low and high values had switched for my signed values. Used the simple solution of switching the output label on each line. Should go back and find real error if i find time.

February 13, 2013

I guess since i slept in till one i should probably work on some of this class before lab.

Matt

1:45 PM-3:00 PM

Binky

wathed the binky video…. it was….interesting…

Chars not ints?

so when you give c a number it is mapping to ASCII and reading a letter, and vice-versa. we can see by the functions under neath the first printf set, that be adding, subtracting, or multiplying letters, we can alter their ASCII value.

Pointers1:

When we store 'a' or 'b' we actually store the ASCII value. so they are being stores as a=97 and b=98. so when we dereference we are actually pointing 'b' to 'a', so it now contains a's address. but 'b' itself has its own address as it is a separate variable. So if we change 'a' at all, 'b' will contain whatever we change 'a' to. on the other hand changing 'b' does not change 'a' at all. in order to change 'b' without breaking the program, i think we would have to return b to its original state.

Pointers2:

This one im a little confused about and hope matt explains in class. I looked up malloc and it is a memory allocator. but im not sure why 0 is what is returned.

Week 5

February 19, 2013

Joe

11:00 PM-12:15 AM

Hello World

Finally got to writing the first project for Joe's class. Thanks to some of Matt's lectures, I got this done in 15 minutes. I did have a little bit of trouble figuring out how to display the input as letters rather than what i believe was either size or memory address. but i referred to my pocket reference and figured out the troubles in my program.

Adder

Again, Matt gave us some notes on this project so it is relatively easy. however i think i am having trouble figuring out how to call and store variables from the CL. I couldn't get it to work i dont quite grasp what i did wrong. I think I'm having a lot of problems with pointers and data types and such. so thats a problem.

February 20, 2013

Joe

In Class

Adder

Figured out my issues with the adder. My main problem was naming variables as num0 and num1. I'm thinking this makes the compiler think the variables are arrays or something of that sort. good lessons learned today.

Matt

12:15 PM - 12:45 PM

Getting Input 1

The Program does not run correctly, time to troubleshoot. I noticed the fprintf set at the bottom dont have stdout so ill add that. and that worked. now ill run it.

In Lab

Getting Input 1

fscanf reads a return(new line char) whenever looking for a char. to fix this we use fgetc(stdin).

Getting Input 2

now fgetc is reading the return character. we used getchar() to fix this problem.

Array Input
For The Record

I looked for a “collapse” or “hide” feature for dokuwiki for about 3 hours, but i do not think matt installed one as he said he did. However many good options do exist on the dokuwiki web site.

February 22, 2013

Joe

In Class

Strings

Things to do with characters/strings

  1. Print them
  2. Input them
  3. Compare
  4. Assign a string
  5. Convert
    • String to char
    • char to string
    • String to number
    • number to string
    • number to string
  6. Look/Search
    • Look for a character within string
    • Look for a sub-string, a string within a string
  7. Seperate
    • at some character
    • at some substring
    • at first position
    • at last position
    • at any position
  8. Combine
    • char, char
    • char, string
    • string, string
  9. insert
    • char, string
    • string, string
  10. remove
    • char, string
    • string, string
  11. rearrange
  12. replicate
  13. replace

Allegedly, this is what we will work on building this semester? I'll believe it when I see it.

Equivalency

== is equivalence
= is assignment
int a = 3;
int b = 3;
b = a
b == a

Matt

In Lab

If Statements
  • Ask the user to enter a number
  • place entered value into a variable
  • display a message accordingly
    • if value < 50 “You suck”
    • if value == 50 “Way to ruin the joke.”
    • if value > 50 “Well, someone's over compensating.”

srand(time(NULL)); x=rand()%99+1;

Week 6

February 27, 2013

Matt

3:00 AM-3:30AM

Guessing Game

Damn these pocket guides are useful. if you ever need something its like “BOOM! RIGHT HERE!” except i dont understand loops still. heres to Joe teach us in class….one can dream.

March 1, 2013

Matt

Lab

DeBugger

gcc -g -o - lets you compile for debugging.
gdb ./ - lets you run debug
list - shows code
break main or (line) 2 - sets break point, program pauses here
run - runs program
step (s) - Runs next line after break
next (n) - runs next line after break
print i - prints value of i
set(i = 12) - sets the variable to a different value
continue © - continues program
display j - displays variable every step
print &x - prints mem address
x mem address - displays content of a memory address
bt - lists functions that have been used
help - shows help

Week 7

March 4, 2013

Joe

9:30 PM-1:00 AM

Exponentiation

ok so I've take Joe's advice on starting over and breaking the problem down first. so i will make 4 programs in order to get the exponentiator. starting with counting, then adding, then multiplying, then exponential.
the counter was easy, and the adder wasn't to hard either. i misplaced a less than sign and an equals sign, but i reread my pseudo code and got it fixed.
multiplier is a bit more difficult. I wanted to try using if statements to show result of multiplication of 0 and 1, similar to what i need to do in exponentiator.

I would love if we could talk about creating a library of functions similar to the one used in CSCS 1240. There must be a way but a class discussion on its syntax and implementation in different programs would be nice. i believe joe was going to talk about this topic this week.

figured out the if statements thanks to the project we did in lab last week. also found out mingw has a debugger. so that should be helpful.
my problem was when i was starting the value of my product as the first input number. just moved it to after mult 1 had been defined.
now onto the big daddy.
initially i couldn't do anything higher than cube. i realize this is because i now need to change the number being multiplied(in 10^3, i need to change it from 10*10 the first time round to 100*10 the second time around.) so I tried to set the max times multiplied by the product in order to get the correct value, but i multiplied to much. I am going to separate the max value of the addition and multiplication function.

SUCCESS!!!!!!!!!!!

so what needed to be changed is the number of times the addition occurs. fuck yes. its AC2 time. #IMGHOST
JK i worked on my opus a little bit too, not worth a new header though. now im ghost.

March 6, 2013

Joe

12:00 PM-12:35 PM

Roots

I was thinking about the opposite side of the functions Joe has had us create such as, count down, subtract so on, so I'm creating programs that will do these by counting.
countdown was a cake walk. as was subtractor. however divider will be much more difficult.

Matt

Lab

Multiple Functions
1
int inc( int num)
{
     num++;
     return(num);
}
1
int inc(int);
int main()
{
int n;
n=0
n=inc(n);
return(0);
}
1
int add(int num1, num2)
{
     int i;
     for (i=0; i<num2; i++)
     {
          num1=inc(num1);
     }
     return(num1)
}


random thought. to combine repos maybe set thg to have the source be lab46 and bitbucket, i believe that exists and same for lab46.

6:00-6:45 PM

Repositories

I restructured my repositories so that all my files for both lecture and lab are accessible.

Week 8

March 11, 2013

Joe

Class

Strings

side note: saw a review on chegg for CSCS 1240 said something along the lines of “Had one of the best professors, he was a bit rantish but he always got the punch line at the end.”
Functions:

  1. Declare - once
    • Name
    • Input Type
    • Return Type
  2. Define - once
  3. Use(call) - many times

retType function( in1Type, in2Type…);
retType function( in1Type in1Name, in2Type in2Name,…){…}
= function(argName, anyValue)

March 13, 2013

Matt

Lab

fopen man - used to open, read, write, or append a file.

March 15, 2013

Matt

Lab

Structures
struct person{
char name[80];
int age;
float hieght; 
};
struct person people[8];
people[3].age=37;

use box diagram syntax here
Name
age
height

typedef struct person P;
P people[8];

that replaces
struct person people[8];

Week 9

March 18, 2013

Joe

Class

Logic Lib
  • not
  • and
  • or
  • xor
  • halfSum
  • halfCarry
  • fullSum
  • fullCarry

March 20, 2013

Joe

Class

this is empty on purpose…

Matt

215- end of lab

guessing game

pointers and shit. idk why. my head go boom.

drawing doodles.

pacman swag.

March 22, 2013

Matt

Class

House

Week 10

March 25, 2013

Joe

11PM-1AM?

LogicLib

Decided to completely redo my logic lib rather than changing syntax on the old one. this one will also include math. Im also trying to fix the divider function i wrote a while back.

I believe there to be some sort of mathical thingy ma do like in the expo function with changing the number being added i believe. but maybe im just fucking up the syntax. my short term fix was to just add 1 to the prod but, that doesnt work when i want the remainder as well.

apparently thats called a greater than or equal to sign.

for now im not going to deal with returning the remainder as well. i dont know how to do it. possible question to joe/matt.

Also got a root program working, it would be cool if i could use floating points in these functions and find exact answers.

March 28, 2013

Matt

1230AM-245AM

GD SWAG

Made triforce in lab, http://lab46.corning-cc.edu/~psechris/triforce.png and i made the Red White and Blue Star, twas a bitch. http://lab46.corning-cc.edu/~psechris/star.png

Spring Break

Seeing as how I worked my ass off for like 10 weeks, and Matt was so kind as to give us a week off, I took advantage and did not touch any homework. because you know what? I deserved it.

Week 11

April 8, 2013

Joe

Class

LogicLib
  • not
  • and
  • or
  • xor
  • halfSum
  • halfCarry
  • fullSum
  • fullCarry
  • addBiray
  • stringToArray
  • arrayToString
  • latch

April 11, 2013

Joe

1200 AM - 130 AM

LogicLib

I worked on the string to array function as it somewhat pertained to the hex editor as matt pointed out to me harry and john. but i am still unsure of how to successfully complete the function, and therefore the program.

Week 12

April 17, 2013

Joe

Class

Hex Editor

[This is a place holder for the flow chart joe did in class today.] (also i dont know how to make a flow chart on here. but that would be cool. we need ot make arrays accessible by both row and collom. 2d array? and that is what must be displayed for the buffer. that way if we want to edit or whatever, we can call specific pieces of the buffer to edit or change. trippy.

Matt

Lab

GD C++

So if we wanted to do a gd image creator using classes, we would need to start basic, such as the lines or the fill. then go to specific way the shapes are made. in main we could ask for color or size.

April 19, 2013

Joe

200PM - 330PM

Hex

joes test code annoys me a lot. its making life difficult. so i got it to run by the end of lab but it stops after one loop of the buffer. not sure why. my head hurt. i quit.

930PM-1130PM

hex

alot of thngs done. not a chance in hell this will be done by the end of the semester.

Week 13

April 24, 2013

Matt

100AM-200AM

EoCE

just pwning matts simple tests. the force is strong with me.

Joe

1200PM-1245PM

Hex, per usual

i figured out that my display wont fun though the display loop. not sure why….. Something with my extra spave every 4 hex values loop is broken, but now even as it displays, random values are printed. also the first hex value is not printing out. i believe that has to do with my initbuffer. AHA! my fgetc of fptr to check for EOF causes the first value to not be read. i guess i need to reset the fptr location after i check for EOF…..but how….fgetpos, fsetpos??

200PM-600PM

Hex

fixed the skipped value, as well as my value error. i then fixed the display issues to make it more appealing. next i need to do next.

1200AM-300AM

Hex

working on the user interface of the program. using a case switch in order to pick next command. next works…. trying to get a command not found working as well as a prev command. after that ill tackle the big daddy of the editing. but we'll save that for much later.

Week 14

April 30, 2013

Matt and Joe

1230PM-200PM

Repositories

You know…. I really wish i had figured all this bull shit out like 3 months ago. but oh well. It occurs to me after dealing with 2 days of bullshit 2 repository issues that i could have combined the two repos for the lab and class section alot quicker than i had and probbly saved abouyt 4 hours of my life. but noh well. it was a good learning experience.

EocE

in other news i rewrote the second project and am in the testing phase. and it almost works

Rest of the Week

Matt and Joe

Wrap up

I speant my week finishing my EoCE, Hex Editor, and logiclib.

Goodbye

Good By C/C++ I will miss you as a class but i look forward to building on my skills in future courses. Farewell to all i hope all your dreams come true. Drive Fast, Take chances. And may the wind always be at your back, and the sun always upon your face, and may the wings of destiny carry you aloft to dance with the stars.

Matt Quotes

January 23, 2013 “Think of Joe as a wild stallion.”

Febuary 1, 2013 “'We are wizards; we do magic.' - Something Joe said never”

March 6, 2013 “You know what the Joe approach would be, 'Let's write the code for the entire C Standard library before we write hello world!'”

Joe Quotes

this is besides the basic, “OH!” drawn out dramatic *GASP!* and of course the over excited jumping about.

January 25, 2013 “Remember, I'm just one issue away.”

February 8, 2013 “I pretty much could care less what you get done in the end”

March 8, 2013
Casper: “Exactly!”
Joe: “OOOOOOOOOOOOOOHHHHHHHHHHHHHHHHHHH DON'T GO DOWN THAT ROAD!!!!!! RAWRRRR SAJFAIBF AEOIRNSJAF AHHHHHH!”

“Why do you cast something in magic.”
“What does casting a spell do?”
“What is true about all spells”
“It does something to change the appearance of something”
Yes, you have read this right. Joe used magic as an example of what casting is in c programming.

March 13,2013
“Keep in mind that there is probably a reason why I'm not in elementary education.”

March 20, 2013
Joe: “SO!! That leaves you with two questions on your mind!” (covers up projector screen dramatically)
Student: “What is Joe doing?”
J: “OK, you have three questions on your mind.”
S: “Does he know we can see the words on his hands?”

Joe: “I have a certain affection for things that get abused”
By request, I'll put this in context“
J: “I like GoTo”
J: “GoTo gets abused”
S: “and you like goto?”
J: “I have a certain affection for things that get abused”

April 4, 2013
“The really cool buffets have the plate holders with the springy things.”

opus/spring2013/psechris/start.txt · Last modified: 2013/08/25 12:16 by 127.0.0.1