Wednesday, December 14, 2016

CST 205 Final Entry

In CST 205, I learned the syntax of programming in Jython. I also learned how to manipulate images, sound and strings in code. Each week sharpened my programming skills and helped me learn key computer science concepts. I was able to strengthen my problem solving skills as several of the labs tested this.

This class definitely relates to my future career. I was able to make two simple text based games and the ability to problem solving for this is essential to my future career. I hope to enter the video game industry as a game developer so this was right up my alley. Videogames are full of images, text, and sounds so I believe that this course has allowed me to scratch the surface of the skills necessary in the industry.

I would advise future students to stick with JES 4.3. I originally started with 5.0 but felt it was too buggy and ended up extending the length of time to work on a project. Until 5.0 is fixed I would recommend all students stick with JES 4.3. Also, keeping and sticking to a calender is essential to turning in work on time and not getting behind. Students should commit at least 14 hours a week to this class. I did get behind a bit during the last week as it was during the holidays and ended up posting this a day late. My recommendation is for the first 6 weeks to keep to your schedule or you will be behind all course long. A suggestion for the course would be to have more tutorial or better in depth instruction on implement Python with html. I had never coded in html and it took me a long time to figure out how to get a variable written in python implemented in html.

Wednesday, December 7, 2016

CST 205 Week 6

CST 205 Week 6

This week I learned about dictionaries in Python. This seems to be a very usefull tool. A dictionary represents a mapping of keys to values. An example would be for mapping english to spanish words such as: 
>>> eng2sp = dict()
>>> eng2sp
{}
And then to add an item we would just use:
>>> eng2sp['one'] = 'uno'
To create multiple key-values you would do something like.
>>> eng2sp = {'one': 'uno', 'two': 'dos', 'three': 'tres'}
The order of key value pairs is random.
o see whether something appears as a value in a dictionary, you can use the method values, which returns a collection of values, and then use the in operator:
>>> vals = eng2sp.values()
>>> 'uno' in vals
True
I learned about using try and except in python to catch exceptions and allow the user to fix
the problem or end it gracefully. These are used similarly to if else statements.

Using the pickle module in Python, allows you to use other data types other than Strings and bytes in
databases. It translates almost any type of object into a string suitable for storage in a 
database, and then translates strings back into objects. 


Tuesday, November 29, 2016

CST 205 Week 5

CST 205 Week 5

I read a chapter about tips on debugging. I found it very useful. I especially liked the idea of printing variables to see what the are doing at the beginning of loops and recursive functions. It gave good tips on creating many functions to minimize debugging time on large groups of code. Reading this chapter helped put a perspective that readability and simplicity of code is essential in order to make debugging easier. Finally the tip of taking a break is good as frustration only gets worse when in front of the computer.

Top down programming is creating a program by first starting with the overall scope of the project and moving to smaller pieces of the project. Bottom up programming is just the opposite where you move from the smallest tasks first that a part of the whole to end up with compiling them together for the finished product at the end. Either choice can be effective if different scenarios; the key is to always have a plan in place.

Here are some good sources for debugging that I found:

https://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/


https://zapier.com/engineering/debugging-python-boss

https://www.youtube.com/watch?v=g49UECaIDOs

This week we worked as a group to make a text based game. This assignment was right up my ally as I am wanting to enter a career in game development. Although the assignment was simplistic it gave  a good understanding of the collaboration necessary in creating a quality game. We could easily have expanded upon this game and taken months to achieve the desired product. We used a top down approach in the game design. First designing the overall rooms and layout of the house and then dividing up the sections among team members to complete. We then met to collaborate and mold all of the pieces together. This assignment was fun, challenging, and educational.

Wednesday, November 23, 2016

CST 205 Week 4

CST 205 Week 4

It was fun to finish my midterm project. I chose to make a Matrix filter to show what a picture may look like if view from the Matrix movie. This was a fun project.

It was interesting learning about sound as I have never known in depth how sound was converted digitally. The section on string manipulation was a good refresher and necessary for our hangman project. I am not sure why volume is lost when manipulating sound in Jython. I found this week to be challenging as there was a lot to do coupled with creating a video for lab #10. The sound labs were fun as I got to search for sounds that interested me. The hangman lab was a bit challenging. I was able to utilize for and while loops to achieve the desired affect for the game. This problem challenged my problem solving abilities and I look forward to future problems like this.

Wednesday, November 16, 2016

CST 205 Week 3

CST 205 Week 3

This week I learned about how to use Github to upload documents and share with teamates. I had heard of Github before but never used it. This will be an effective tool in colaboration among team mates for group projects.
The project to create a Thanksgiving card was a fun way to showcase everything I have  learned so far in the course. I was able to utilize make Negative(), pyCopy(), chomakey(), and a custom makeOrange() filter. A challenge was figuring out how to get text to skip to a next line inside the addText() JES function. It was discovered that \n does not work for this. I had to improvise and create a for loop to get the text the way I wanted it. 
I was also able to showcase all the functions I have created so far with a portfolio project. I am glad I have this for a reference to what I have done.
Finally our team met and decided who would be paired with who to work on our mid term projects. Joel and I are paired together and began working on the CSUMBY function as well as a custom Matrix function. I look forward to finishing this project next week.

Tuesday, November 15, 2016

Image Portfolio

Image Portfolio

Rose Colored Glasses


















This function takes an image and adds a rosy hue to it. To achive this effect, I manipulated the green and blue values of each pixel. Each green value became 40% of the red value for that pixel and each blue value became 80% of the red value for that pixel. Here is the corresponding code:

def roseColoredGlasses(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    setGreen(p, r * .4)
    setBlue(p, r * .8)
  repaint (pic)
  writePictureTo(pic, "D://Downloads//School//CST 205//Week 1 Pictures//Rose.jpg")

Negative


























This functiong takes an image and creates a negative image of it. To achieve, this effect I took the RGB values for each pixel and subtracted each value from 255 to get the negative RGB value. During this exercise, I learned that each RGB value ranges between 0 and 255. Here is the corresponding code:

def makeNegative(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    r = 255 - r
    setRed(p, r)
    g = getGreen(p)
    g = 255 - g
    setGreen(p, g)
    b = getBlue(p)
    b = 255 - b
    setBlue(p, b)
  repaint (pic)
  writePictureTo(pic, "D://Downloads//School//CST 205//Week 1 Pictures//Negative.jpg")

Better Black and White


























This function takes a color image and converts it to a black and white image. To achieve this effect, I took the RGB values for each pixel and then weighted them so that R = 29.9%, G = 58.7%, and B = 11.4%. I then added these values up and divided by 3 to get a luminace value for the pixel. The luminace value is then used to set the RGB value for the pixel because all RGB values for a pixel must be equal to achieve a gray scale. Here is the corresponding code:

def betterBnW(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    g = getGreen(p)
    b = getBlue(p)
    luminace = ((r * .299) + (g * .587) + (b * .114))
    setRed(p, luminace)
    setGreen(p, luminace)
    setBlue(p, luminace)
  repaint (pic)
  writePictureTo(pic, "D://Downloads//School//CST 205//Week 1 Pictures//BlackandWhite.jpg")

Bottom to Top Mirror





























This function takes an image and mirrors it horizontally by taking the bottom portion of the image and applying it upside down to the top portion of the image. The loop on the y axis starts at the center of the image and works it's way down to the bottom of the page. The loop on the on the x axis works left to right across the x axis. It then takes the pixel and copies it tothe pixel the middle of the page working its way up. Here is corresponding code:

def horizontalMirrorBottomTop(picture):
  pic = picture
  y2 = getHeight(pic)/2
  for y in range(getHeight(pic)/2, getHeight(pic)):
    y2 = y2 - 1
    for x in range(0, getWidth(pic)):
      p = getPixel(pic, x, y)
      p2 = getPixel(pic, x, y2)
      col = getColor(p)
      setColor(p2, col)
  repaint(pic)
  writePictureTo(pic, "D://Downloads//School//CST 205//Week 1 Pictures//horizontalMirrorBottomTop.jpg")

Shrink





















This function takes an image and creates a copy of the image that is half the size. This is done by omitting every other pixel in the image and applying it to the new canvas that is half the size of the original. Here is the corresponding code:

def shrink(picture):
  pic = picture
  mypic = makeEmptyPicture((getWidth(pic)/2) + 1, (getHeight(pic)/2) + 1)
  x2 = -1
  for x in range(0, getWidth(pic), 2):
    x2 = x2 + 1
    y2 = 0
    for y in range(0, getHeight(pic), 2):
      p = getPixel(pic, x, y)
      p2 = getPixel(mypic, x2, y2)
      col = getColor(p)
      setColor(p2, col)
      y2 = y2 + 1
  show(mypic)
  writePictureTo(pic, "D://Downloads//School//CST 205//Week 1 Pictures//shrinkBurger.jpg")
  return mypic

Collage

























This function utilized all I had learned about image manipulation in Python so far to create a collage of images. Several functions were used to create this collage. They include: makeCollage() function, Copy() function, pyCopy(), makeBlankPic(), verticalMirror(), horizontalMirror(), qaudrupleMirror(), rotatePic(), shrink(), roseColoredGlasses(), makeNegative(), artify(), and chromakey() functions. This project was not difficult just time consuming as much time was spent in the planning phase of getting the images put in the right spot on the new canvas. Here is the corresponding code:

# This function creates a collage of manipulated images on a 9.5 X 11 inch canvas
def makeCollage():
  background = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//grey_background.gif")
  vmirror = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//Star Wars Background.jpg")
  vmirror = verticalMirror(vmirror)
  hmirror = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//Tortuga Hall.jpg")
  hmirror = horizontalMirror(hmirror)
  rotatemirror = rotatePic(hmirror)
  qmirror = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//Y.jpg")
  qmirror = quadrupleMirror(qmirror)
  grouppic = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//Group Photo 2.png")
  shrunk = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//O.jpg")
  shrunk = shrink(shrunk)
  tpic = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//T.jpg")
  tpic = roseColoredGlasses(tpic)
  negative = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//Earth.jpg")
  negative = makeNegative(negative)
  otter = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//otter.jpg")
  otter = artify(otter)
  falcon = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//Falcon.jpg")
  mountain = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//Mountain.jpg")
  greenscreen = chromakey(falcon, mountain)
  blank = makeBlankPic()
  pic1 = pyCopy(background, blank, 0, 0)
  pic1 = pyCopy(vmirror, pic1, 33, 33)
  pic1 = pyCopy(rotatemirror, pic1, 2000, 33)
  pic1 = pyCopy(grouppic, pic1, 1600, 1000)
  pic1 = pyCopy(qmirror, pic1, 1250, 125)
  pic1 = pyCopy(shrunk, pic1, 143, 2033)
  pic1 = pyCopy(tpic, pic1, 33, 800)
  pic1 = pyCopy(negative, pic1, 1250, 1750)
  pic1 = pyCopy(greenscreen, pic1, 550, 2500)
  pic1 = pyCopy(otter, pic1, 1700, 2400)
  writePictureTo(pic1, "D://Downloads//School//CST 205//Week 1 Pictures//Collage.jpg")
  explore(pic1) 

# This function creates a simple copy of an image in  a larger background
def Copy():
  pic = get_pic()
  mypic = makeEmptyPicture(getWidth(pic)*2, getHeight(pic)*2)
  x2 = (getWidth(mypic)/4) - 1
  for x in range(0, getWidth(pic) - 1):
    y2 = getHeight(mypic)/4
    x2 = x2 + 1
    for y in range(0, getHeight(pic) - 1):
      p = getPixel(pic, x, y)
      p2 = getPixel(mypic, x2, y2)
      col = getColor(p)
      setColor(p2, col)
      y2 = y2 + 1
  show(mypic)
  return mypic
  
# This function creates a simple copy of an image in a larger background with given parameters
def pyCopy(source, target, targetX, targetY):
  oldpic = duplicatePicture(source)
  newpic = duplicatePicture(target)
  x2 = targetX
  for x in range(0, getWidth(oldpic) - 1):
    y2 = targetY
    x2 = x2 + 1
    for y in range(0, getHeight(oldpic) - 1):
      p = getPixel(oldpic, x, y)
      pixeltarget = getPixelAt(newpic, x2, y2)
      newcolor = getColor(p)
      setColor(pixeltarget, newcolor)
      y2 = y2 + 1
  return newpic
  
# This function makes a blank image of a sheet 8.5 x 11 inches
def makeBlankPic():
  return makeEmptyPicture(2550, 3300)
  
# This function creates a mirror image of a picture vertically down the middle
def verticalMirror(picture):
  pic = picture
  x2 = getWidth(pic)
  for x in range(0, getWidth(pic)/2):
    x2 = x2 - 1 
    for y in range(0, getHeight(pic)):
      p = getPixel(pic, x, y)
      p2 = getPixel(pic, x2, y) 
      col =  getColor(p)
      setColor(p2, col)
  return(pic)
  
# This function creates a mirror image of a picture horizontally across the middle
def horizontalMirror(picture):
  pic = picture
  y2 = getHeight(pic)
  for y in range(0, getHeight(pic)/2):
    y2 = y2 - 1
    for x in range(0, getWidth(pic)):
      p = getPixel(pic, x, y)
      p2 = getPixel(pic, x, y2)
      col = getColor(p)
      setColor(p2, col)
  return pic
  
# This function creates a quadruple mirror of an impage
def quadrupleMirror(picture):
  pic = picture
  x2 = getWidth(pic)
  for x in range(0, getWidth(pic)/2):
    x2 = x2 - 1 
    for y in range(0, getHeight(pic)):
      p = getPixel(pic, x, y)
      p2 = getPixel(pic, x2, y) 
      col =  getColor(p)
      setColor(p2, col)
  y2 = getHeight(pic)
  for y in range(0, getHeight(pic)/2):
    y2 = y2 - 1
    for x in range(0, getWidth(pic)):
      p = getPixel(pic, x, y)
      p2 = getPixel(pic, x, y2)
      col = getColor(p)
      setColor(p2, col)
  return pic
 
  
# This function rotates a picture 90 degrees and creates a copy of it
def rotatePic(picture):
  pic = picture
  mypic = makeEmptyPicture(getHeight(pic), getWidth(pic))
  for x in range(0, getWidth(pic)):
    x2 = getWidth(mypic)
    for y in range(0, getHeight(pic)):
      x2 = x2 - 1
      p = getPixel(pic, x, y)
      p2 = getPixel(mypic, x2, x)
      col = getColor(p)
      setColor(p2, col)
  return mypic
  
  
# This function creates a copy of a picture that is half the size
def shrink(picture):
  pic = picture
  mypic = makeEmptyPicture((getWidth(pic)/2) + 1, (getHeight(pic)/2) + 1)
  x2 = -1
  for x in range(0, getWidth(pic), 2):
    x2 = x2 + 1
    y2 = 0
    for y in range(0, getHeight(pic), 2):
      p = getPixel(pic, x, y)
      p2 = getPixel(mypic, x2, y2)
      col = getColor(p)
      setColor(p2, col)
      y2 = y2 + 1
  return mypic

# This function makes the picture have a pink hue
def roseColoredGlasses(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    setGreen(p, r * .4)
    setBlue(p, r * .8)
  return pic
   
# This function makes a negative image of the picture
def makeNegative(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    r = 255 - r
    setRed(p, r)
    g = getGreen(p)
    g = 255 - g
    setGreen(p, g)
    b = getBlue(p)
    b = 255 - b
    setBlue(p, b)
  return pic
      
# This function creates a customized posterization of an image
def artify(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    g = getGreen(p)
    b = getBlue(p)
    if r < 33:
      setRed(p, 33)
    elif 32 < r < 99:
      setRed(p, 66)
    elif 98 < r < 133:
      setRed(p, 99)
    elif 132 < r < 177:
      setRed(p, 133)
    elif 176 < r < 199:
      setRed(p, 177)
    elif 198 < r < 233:
      setRed(p, 199)
    elif 232 < r < 256:
      setRed(p, 233)
    if g < 33:
      setGreen(p, 33)
    elif 32 < g < 99:
      setGreen(p, 66)
    elif 98 < g < 133:
      setGreen(p, 99)
    elif 132 < g < 177:
      setGreen(p, 133)
    elif 176 < g < 199:
      setGreen(p, 177)
    elif 198 < g < 233:
      setGreen(p, 199)
    elif 232 < g < 256:
      setGreen(p, 233)
    if b < 33:
      setBlue(p, 33)
    elif 32 < b < 99:
      setBlue(p, 66)
    elif 98 < b < 133:
      setBlue(p, 99)
    elif 132 < b < 177:
      setBlue(p, 133)
    elif 176 < b < 199:
      setBlue(p, 177)
    elif 198 < b < 233:
      setBlue(p, 199)
    elif 232 < b < 256:
      setBlue(p, 233)
  return pic
  
def chromakey(picture1, picture2):
  pica = picture1   # Green Screen
  picb = picture2   # Background
  pixels = getPixels(pica)
  pixelsB = getPixels(picb)
  for p in pixels:
     r = getRed(p)
     g = getGreen(p)
     b = getBlue(p)
     if (r + b) <= g:
       xA = getX(p)
       yA = getY(p)
       pixB = getPixel(picb, xA, yA)
       newColor = getColor(pixB)
       setColor(p, newColor)
  return pica

Red Eye Reduction























f





















This function takes an image and reduces the red eye in the image. Being one of the first functions to create, it was a bit challenging as it was not understood yet about reducing the red in a given section of an image. Instead applied the red eye reduction to the entire image which is why there is black pixelation in the bottom right portion of the image. Here is the corresponding code:

def redEye(picture):
  picture = picture
  redRem = makeColor(235,115,132)
  orang = makeColor(521,227,107)
  orang1 = makeColor(184, 131, 45)
  yelo = makeColor(253,249,211)
  aqua = makeColor(51,204,255)
  red1 = makeColor(155, 42, 45)
  red2 = makeColor(198, 79, 86)
  for x in range(0,getWidth(picture)):
    for y in range(0,getHeight(picture)):
      px = getPixel(picture,x,y)
      color = getColor(px)
      if distance(color, redRem) < 50.0:
        setColor(px,black) 
      if distance(color,yelo) < 50.0:
        setColor(px,black) 
      if distance(color, orang) < 80.0:
        setColor(px,black)
      if distance(color, orang1) < 50.0:
        setColor(px, black)
      if distance(color, red1) < 50.0:
        setColor(px, black)
      if distance(color, red2) < 50.0:
        setColor(px, black)
  show(picture)
  writePictureTo(picture, "D://Downloads//School//CST 205//Week 1 Pictures//redEyeRabbit.jpg")
  return(picture)

Color Artify

































This function creates a customized posterization of an image. It utilizeds if  and elif statements to determine a RGB value range and if it falls within a certan range sets the value accordingly. Here is the corresponding code:

def artify(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    g = getGreen(p)
    b = getBlue(p)
    if r < 33:
      setRed(p, 33)
    elif 32 < r < 99:
      setRed(p, 66)
    elif 98 < r < 133:
      setRed(p, 99)
    elif 132 < r < 177:
      setRed(p, 133)
    elif 176 < r < 199:
      setRed(p, 177)
    elif 198 < r < 233:
      setRed(p, 199)
    elif 232 < r < 256:
      setRed(p, 233)
    if g < 33:
      setGreen(p, 33)
    elif 32 < g < 99:
      setGreen(p, 66)
    elif 98 < g < 133:
      setGreen(p, 99)
    elif 132 < g < 177:
      setGreen(p, 133)
    elif 176 < g < 199:
      setGreen(p, 177)
    elif 198 < g < 233:
      setGreen(p, 199)
    elif 232 < g < 256:
      setGreen(p, 233)
    if b < 33:
      setBlue(p, 33)
    elif 32 < b < 99:
      setBlue(p, 66)
    elif 98 < b < 133:
      setBlue(p, 99)
    elif 132 < b < 177:
      setBlue(p, 133)
    elif 176 < b < 199:
      setBlue(p, 177)
    elif 198 < b < 233:
      setBlue(p, 199)
    elif 232 < b < 256:
      setBlue(p, 233)
  repaint(pic)
  writePictureTo(pic, "D://Downloads//School//CST 205//Week 1 Pictures//Artify.jpg")

Green Screen











































This function takes a green screen image and another image and replaces the green screen portion with the second image. To achieve this an if statement is used to determine if the red plus blue value of a pixel are less than or equal to the green value of the pixel. If it is it replaces that pixel which should be the green screen portion with the pixel from the other image. Here is the corresponding code:

def chromakey(picture1, picture2):
  pica = picture1   # Green Screen
  picb = picture2   # Background
  pixels = getPixels(pica)
  pixelsB = getPixels(picb)
  for p in pixels:
     r = getRed(p)
     g = getGreen(p)
     b = getBlue(p)
     if (r + b) <= g:
       xA = getX(p)
       yA = getY(p)
       pixB = getPixel(picb, xA, yA)
       newColor = getColor(pixB)
       setColor(p, newColor)
  show(pica)
  writePictureTo(pica, "D://Downloads//School//CST 205//Week 1 Pictures//Chromakeyexample.jpg")

Thanksgiving Card




















































This project utilized several functions to merge an image onto a green screen image and copy the turkey image on top. The turkey image had to go through the makeNegative() function so the black background merged with the main canvas black background. It then used a function to create an orange hue to align with Fall colors. Text was added in a for loop to get it to appear on seperately lines. This was a challence as it was discovered that the addText() function in JES does not accurately utilize \n to go to a next line in a string passed to it. Here is the corresponding code:

#This function creates a Star Wars themed Thanksgiving Card
def thanksgivingCard():
  import java.awt.Font as Font                   #Import font
  card = chromakey()                             #Basis for greeting card
  turkey = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//turkey1.jpg")
  turkey = makeNegative(turkey)                  #Make negative image of turkey picture to blend in
  card = pyCopy(turkey, card, 324, 437)          #Apply turkey to card
  str = ['This Thanksgiving,', 'Choose Between', 'The Dark Side', 'or the Light', 'Side of the', 'Turkey!', 'Happy Thanksgiving!']
  myFont = makeStyle("Broadway", Font.BOLD, 34)
  myFont2 = makeStyle("Broadway", Font.BOLD, 42)
  y = 34                                         #Initial y value for text
  x = 0                                          #Horizontal x value
  for t in range(0, 6):                          #Loop for adding text
    addTextWithStyle(card, 424 + x, y, str[t], myFont, white)
    y = y + 34
    x = x + 15
  addTextWithStyle(card, 750, 204, str[6], myFont2, white)
  card = makeOrange(card)                        #Create an orange hue effect
  show(card)
  writePictureTo(card, "D://Downloads//School//CST 205//Week 1 Pictures//GreetingCard.jpg")

#This function takes a green screen image and applies a background to it
def chromakey():
  pica = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//falcon1.jpg")  #Green Screen
  picb = makePicture("D://Downloads//School//CST 205//Week 1 Pictures//darthmonochrome.jpg")   # Background
  pixels = getPixels(pica)
  pixelsB = getPixels(picb)
  for p in pixels:
     r = getRed(p)
     g = getGreen(p)
     b = getBlue(p)
     if (r + b) <= g:
       xA = getX(p)
       yA = getY(p)
       pixB = getPixel(picb, xA, yA)
       newColor = getColor(pixB)
       setColor(p, newColor)
  return(pica)
  
# This function makes the picture have an orange hue
def makeOrange(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    setGreen(p, r * .65)
    setBlue(p, 0)
  repaint (pic)
  return pic
  
# This function creates a simple copy of an image in a larger background with given parameters
def pyCopy(source, target, targetX, targetY):
  oldpic = duplicatePicture(source)
  newpic = duplicatePicture(target)
  x2 = targetX
  for x in range(0, getWidth(oldpic) - 1):
    y2 = targetY
    x2 = x2 + 1
    for y in range(0, getHeight(oldpic) - 1):
      p = getPixel(oldpic, x, y)
      pixeltarget = getPixelAt(newpic, x2, y2)
      newcolor = getColor(p)
      setColor(pixeltarget, newcolor)
      y2 = y2 + 1
  return newpic
  
# This function makes a negative image of the picture
def makeNegative(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    r = 255 - r
    setRed(p, r)
    g = getGreen(p)
    g = 255 - g
    setGreen(p, g)
    b = getBlue(p)
    b = 255 - b
    setBlue(p, b)
  return pic

Line Drawing

































This function creates a black and white drawing like image of a given picture. To achieve this first the image is turned into a black and white image. Then it runs through each pixel and creates a luminaance function using lambda. The luminance is the average of the RGB value for that pixel. It then calculates the luminance to the right of the pixe, below the pixel and for the pixel itself. If the absolute value of the luminance between the right pixel and below pixel is  > 4 and the absolute value of the luminance between the pixel below and the original pixel is  > 4, then its sets the color to black. Otherwise the color gets set to white creating a sketch pencil drawing effect. This function was easy enough to create. I just had to toy with a correct absolute value to achieve the desired effect. Here is the corresponding code:

def lineDwg(pic):
  #turn B&W
  pic = betterBnW(pic)
  picture = duplicatePicture(pic)
  width, height = getWidth(pic) , getHeight(pic)

  for y in xrange(height - 1):
    for x in xrange(width - 1):
    
      px = getPixel(picture, x, y) # original pixel
      right = getPixel(picture, x + 1, y)#right pixel
      below = getPixel(picture, x, y + 1)#below pixel
    
      #get luminance
      luminance = lambda px: (getRed(px) + getBlue(px) + getGreen(px) )/3
    
      LR = luminance(right)#luminance to right pizel
      LB = luminance(below)#luminance below pixel
      LO = luminance(px)#luminance of original pixel
      #pixel edge
      if abs(LR - LO) > 4 and abs(LB - LO) > 4:
        #return b&w image
        setColor(px, black)
      else:
        setColor(px, white)

  show(picture)
  writePictureTo(picture, "D://Downloads//School//CST 205//Week 1 Pictures//lineDwg.jpg")
  
# This function makes a more suitable black and white picture
def betterBnW(picture):
  pic = picture
  pixels = getPixels(pic)
  for p in pixels:
    r = getRed(p)
    g = getGreen(p)
    b = getBlue(p)
    luminace = ((r * .299) + (g * .587) + (b * .114))
    setRed(p, luminace)
    setGreen(p, luminace)
    setBlue(p, luminace)
  return (pic)
  

Wednesday, November 9, 2016

CST 205 Week 2

CST 205 Week 2

The TED talk on the Key to Success being grit was very informative. I have found this to be true in my own life. When there were failures in my life, I can look back and see that a passion and determination were not present at the time which led to failure. With maturity I have learned that "grit" and passion are even more essential to success than intelligence or IQ.

I learned about looping across a range of pixels. Here is how the pseudocode looks for this:

for each x from 0 to x - 1:
    for each y from 0 to y - 1:
        manipulate pixel

or in code

for x in range (0, getWidth(pic)):
    for y in range (0, getHeight(pic)):
        do-stuff-to-pixel(pic, x, y)

The writePictureTo() function allows you to store the manipulated picture in your hard drive. The first variable is the variable for the picture and the second variable is the file location on the hard drive.
In Python you can use the pass statement to skip the body of a conditional statement. This is usually used to keep a placekeeper for a conditional statement to come back to later.

This week I did a lot of photo manipulation using for loops. I found some of the exercises to be challanging and others to be failry easy. I found that a good approach to the challenging problems is to really make a good effort to do thorough pre planning and pseudocode for the exercise. Sometimes I get caught up in the programming and just start without setting up pseudocode. For a harder problem, this can actually make the task last longer. I will adjust my methods for future labs.

Tuesday, November 1, 2016

CST 205 Week 1

CST 205 Week 2

We want to digitize media as a way of preserving it and ease of transferability. Digital data can in theory be copied over and over again without any loss of the original data. Digitization is the process of converting a information into binary code. Digitization occurs by discretization and quantization. Converting a series of digital integers to an approximate analog output is called DA conversion. Some drawbacks of digitization is that there is a loss in quality even if minute compared to the analog source. Also digitization is dependent on technology whereas analog media usually is much easier to produce and store without electricity.
Increasing an images sampling frequency will increase its resolution. Bit depth is the number of bits used for a pixel. A 1 bit image has 2¹ or 2 tones. An 8 bit image has 2⁸ or 256 tones. Dynamic range is the range of tonal difference between the lightest and darkest of the image.

Formulas for File Size
File Size = (height x width x bit depth x dpi²)/8
File Size = (pixel dimensions x bit depth)/8
1 Kilobyte (KB) = 1,024 bytes or 2¹º
1 Megabyte (MB) = 1,024 KB
1 Gigabyte (GB) = 1,024 MB
1 Terabyte (TB) = 1,024 GB

File Types
TIFF- lossless or lossy, big files, used mostly as lossless, used mostly in digital cameras
PNG - lossless, looks for patters in the image to compress the file size; images with large areas of uniform colors, allows for partial transparency
GIF - uses 256 colors, if an image has more colors it compresses to 256 colors, finds patters of colors and creates an abreviations, ie. white, white, white would store as 3 white, for images with less than 256 colors
JPG - discards informationt that the eye is least likely to notice, stored as 24 bit color, most web photographs
RAW - lossless, 3 or 4 times smaller than TIFF, proprietary
BMP - old microsoft format

Python Learning
In Python, comments are made with the # symbol.
To define a function you use, def function_name():
To end the function you enter an empty line
An example of a stack diagram:

I found this week to be pretty straight forwad. I had fun learning about digital media and manipulation of image files. I can't wait to see what the next weeks bring.


Sunday, October 23, 2016

CST 300 Week 8

CST 300 Week 8

Part 1

Here are some review of fellow student's videos:


This video topic is well covered and the presentation is clear. The quality of the research is very good. The quality of the video is good for an amateur video. The video is engaging and interesting but there is no moving media in the video.There is evidence of team work as multiple speakers can be heard in the video. The video is appropriate for a professional audience.


This video topic is well covered and the presentation is clear. The quality of the research is very good. The quality of the video is very well put together. I liked the use of interjecting the speaker's videos throughout the presentation. The video is engaging and interesting with its subtle background music. There is evidence of teamwork through the videos produced by the team members. The video is appropriate for the general public.


This video topic is well covered and the presentation is clear. The quality of the research is extensive and good. The quality of the video is extremely professional. It is clear that there is talent behind the video. The video is extremely engaging and interesting through its use of embeded videos, music, and excellent flow. I do not see too much evidence of teamwork. The video is appropriate for a professional audience.

Part 2

This class has helped me to articulate my goals. I had an idea of what I wanted to do with my Computer Science degree. This course solidified my passion of getting into game development with the industry analysis paper. It also gave me a framework of what I need to be working on for the next 2 years. 
The course provided excellent lessons in how to effectively communicate with fellow group members on future projects. Our team was able to set weekly meetings every Sunday on Google Hangouts. We then colaborrated through email and Google Docs. To make our collaboration more effective, everyone should read the assignments before the scheduled meetings and make sure to make all meetings. When this is not done it can provide strain on the group.

Saturday, October 22, 2016

Xtreme Videos on Unity 3D Game Engine

Here are links to the videos our team, Xtreme, collaborated on. The videos are about the Unity 3D Game Engine.

Xtreme short video on Unity

Xtreme long video on Unity

Tuesday, October 18, 2016

CST 300 Week 7

CST 300 Week 7

Part One

During our team meeting on October 9, we were able to each come up with a topic for our final video project. We then randomly chose which topic would not make the cut as our team has 4 individuals. We then met on October 16 to discuss planning for the video project. Our topic is the developing in 3D on the Unity Game Engine. We met as a group on Google Hangouts. During the meeting we compiled two outlines on Google Docs. One outline was for the short video and then the other outline was for the long video. We then divided up the outline so each of us could work on a section of it. Mokhlis would create a script and slides for the introduction and conclusions. Ryan would create a script and slides for how developers use the engine. I would create a script and slides for examples of Unity in use. Joel would then be the narrator in the final video. We plan to meet again on October 20th and 22nd to finish compiling the video. We plan on making our video a powerpoint presenation. The process is smooth; however, it is necessary for all group members to attend meetings to make the process even more efficient.

Part Two

In viewing some Ted Talks videos, it is clear that an effective presenation lies in confident presentation coupled with communication skills. The speakers rarely use words such as "um" or stutter. They are confident in their presentation and appear to have rehearsed it before. In review of the readings and other videos, here are some key take aways I got from them. One is to know your audience. A speech for the same topic may be completely different for two different audiences. Another is to not clutter your powerpoint with too much information or animations. The presentation should be simple and easy to follow.

Tuesday, October 11, 2016

CST 300 Week 6

CST 300 Week 6

Part 1

During our team meeting on Sunday we were able to discuss possible capstone ideas. Joel and I were interested in developing a game. Mokhlis had an interesting idea in developing an intelligent tourist system. Ryan is interested in developing an application related to education. Other than game making, I found the intelligent tourist system stood out to me as I would be interested in that as I love to travel and explore new places.

Part 2

I found the career guide to be a good refresher on how to go about entering a career in Computer Science after I graduate. This year my focus is on networking. I hope to attend a developer conference or two to begin networking in the field. I believe I am "professionalized" as I have been working in the banking industry for over 10 years. Banking and professionalism go hand in hand. The job offers section was helping in providing feedback to not accept the first job offer and to also ask for more money.
The key first step in the application process is researching employers. I should make a list of potential employers and research each of those employers individually to gain a clearer understanding of each organization and what they are looking for. Otterjobs is a good first start in finding potential employers. I plan to bookmark this page and visit often during my last year of study. To gain employer contacts I plan to attend game developer conferences and build a network there. As far as an internship, I am not sure as this is a good option for me unless it has a good salary as I am currently making a pretty good salary. If a good opportunity for a paid internship arises, I will definitely pursue it during my last year of study. I have attended job fairs before and found them not to be successful for me. Personally I have found networking and direct contact to be effective in searching for a job.
Our team came together on Sunday to pick topics for our final presentation projects. We chose as topics: intelligent tourist systems, unity game engine, and programming in education. Next week our peers will vote on which topic for us to work on.
The readings on Python was a good refresher as I hadn't worked with it since December of the previous year.
It felt good to update my resume for my "dream job" as it felt attaining it more tangible.

Tuesday, October 4, 2016

CST 300 Week 5

CST 300 Week 5

Part 1


Part 2

3 Possible Capstone Ideas
1. Design and develop a computer game
2. Create an emergency contact website that authorities may use to quickly contact designated family
3. Develop instant messaging/ email application in which the user's draw messages to each other

Part 3

I found the tips for creating a youtube video not particularly helpful. This is not because it was not put together in a good manner but rather that I have found youtube to be intuitive and did not need a tutorial to figure out how to use it. This may be helpful to others who may have never done video editing before or struggle with the concept.
The information regarding internships was informative. It gave me some tips that I was unaware of and helped me to think if an internship is write for me. It would be hard to give up my current job for an internship now as I have a well paying job that supports my family; however, one closer to graduation may be beneficial as it can help me to get a foot in the door of the industry.
I also found the information for graduate school good but at this time I do not see myself attending graduate school as it may put a burden on my family. I did briefly look at SMU Guildhall which is a grad school in Computer Science for game development. The program looks fantastic but I just don't think I could attend grad school and not work at this time. Perhaps things will change 2 years from now.
The explanation regarding inference and assumptions was quite succint. An inference is an interpretation of an assumption. It also gave some insight on how to think critically by examining personal assumptions and infering ideas around them.

Tuesday, September 27, 2016

CST 300 Week 4

CST 300 Week 4

Part 1

My educational goal: To complete the program with a 4.0 GPA in the program by Summer of 2018 and retain enough knowledge to score in the 85th percentile or higher on the ETS Computer Science test.

Part 2

My career goal: To gain a position as a software developer no less than 3 months after graduation within the video game or financial industry with a starting salary of at least $60K annually.

Part 3

In review of the ETS® Major Field Test for Computer Science, I feel confident in taking the test in 18 months. I browsed over the sample test and was able to get 8 out of 16 right. Considering I have 18 months of pure immersion in Computer Science I feel confident I can increase this to a 90 percentile or higher.

Part 4

In reading the article The 7 Career Goals You Need to Succeed, it is clearly important to write down your specific goals if you wish to succeed in your career. A key first step is self assessment. You need to look at where you are now and where you want to go. Another important step is to track your accomplishment so you can re-evaluate how you are doing at working towards your goal and tweak what needs tweaking. It is also important to set personal goals as well so you don't get overworked by focusing just on your career. 

This week I learned about the 5 types of claims. These are claims of fact, definition, cause, value, and policy. I also was reminded of the importance of equally representing logos, ethos, and pathos within a argumentative paper. 

The article on bias argumentation was informative. It provided the three most common fallacies in presenting arguments and why they are common. It also set as a reminder that the mere knowledge of these fallacies when presenting an argument can lead a presenter to provide arguments without these fallacies as they are more prone to think with an open mind.

The article on soundness vs validity gives a solid background in examining my sources for my ethics paper. It allows me to examine an argument to make sure it is a valid and sound argument that may be used in my paper.

My ethics paper has to do with the effects of moral choices in video games. During my research, I learned the exact opposite of what I assumed. It had been a while since I had looked at this topic in depth and found it was easier to find articles regarding the positive effects, or lack of negative effects regarding immoral acts and violence in video games than finding articles showing negative effects with regards to this. It seems that recent studies have shifted the mindset from how I remember this conversation 10 years ago; however, there is still a thriving debate for both sides.

Tuesday, September 20, 2016

CST 300 Week 3

CST 300 Week 3

Part 1

In reading the article Managing Time for Success in College at https://www.uwgb.edu/tutoring/resources/managing.asp , I would agree that time management is one of the most important resources. This is especially true when it comes to studies. I have incorporated many of these ideas already in my study plan. One thing I do differently is I write down important items on the calendar and tend to leave off less important items as these can be adjusted to other time slots. I liked the idea of visualizing where you will be after graduation to help stay engaged in studying. I have always found myself to be a night owl, so setting my study times during the night is only natural for me. One distraction that I have found while studying in this course has been that when I was doing research for my paper, I would tend to get interested in an idea and then spend more time than is necessary looking at it and end up going of in a tangent. I think study breaks would help with this as I can re-evaluate what I am doing and refocus on what I need to study.

Part 2

I have learned that project managment is an essential tool working on team projects. Without a solid plan and management of that plan a project can go astray quickly. There are four phases of the project life cycle. These are study, design, development, and operation. Ethics also is important as we are the future leaders in the industry. I learned that ethics, morality, and law all have different meanings and what may be legal in one situation may not be ethical or moral in another. I was able to work on my final draft for my industry analysis. It's amazing on how the revision process can really make your paper better even when you feel your draft was a solid paper.

Part 3

In review of the article What every computer science major should know at http://matt.might.net/articles/what-cs-majors-should-know/ , I would agree with the article. The writer has a clearer understanding of what is necessary to learn for a computer science major than I have currently as I have never worked in the industry. A computer science major should attain both knowledge and skill as this is a technical field. A portfolio is the number one way to show off skills attained during an individuals studies. There were many terms in this article in which I did not know what they meant. I plan on saving this article to my favorites and refer back to it as a reference of the terms and skills I have learned and what will be needed outside of school to read up and practice.

Tuesday, September 13, 2016

CST 300 Week 2

CST 300 Week 2


Part 1: Review and Reflect Learning Strategy

The top 3 areas that I am good at with regards to studying are making a schedule and adhering to it, outlining reading material with a highlighter, and the "memory dump" technique. Working in a client environment in banking, I constantly am making schedules on my work calendar. Transfering this strategy to my studies has come easily. Using a highlighter instead of underlining visually makes the topics that you need to re-read or concentrate more on more appealing. When taking tests I have always used the "memory dump" technique. I did not know there was an actual term for this strategy.

The top 3 areas that I am weak in are organinzing references before starting to write, where to keep notes, and reciting after reading sessions. When collecting references for my industry analysis paper in this class, the online sources were randomly placed in my favorites folder and the books were laid out on my desk. Had I had a more organized approach to this, the process of writing the paper would have been more efficient. Also I have been found to keep notes in places other than the notebook they belong in. This can lead to disorganization and loss of efficiency in finding the notes. Also I have never really thought about reciting after reading. I will try to employ this strategy in my future study session.

Part 2: Preview Time Management Skills


Part 3: Project Management Basics

A project is a temporary endeavor that may create a unique item and has a completion. Project management is effectively planning a project from inception to completion. Some effective tools for creating an efficient project managment schedule are creating a hierarchical structure chart and gannt chart. A hierarchical structure chart can organize the scope of a project as a visual representation of the project making it easier for team members to understand why a particular piece of a project is necessary to the entire project completion. A gannt chart can show whether a project is being managed effectively or may need some guidance to manage it better.

Part 4: Check Out Previous Capstones

Steebly

This project was an application that allows its user to develop their programming project on multiple devices and collaborate among team members. User's can access, edit, and compile their code on pc's, android devices and other platforms. It supporst multiple languages. The project and idea of the project seemed well done. The presentation was also thorough and informative. Given the scope of this project, it seems only logical that it can be improved on and tweaked with more time.

Pickup

This project is an application that allows its user's to say they have joined a specific sports pick up game or are available for a game at an athletics court or field. The interface of the project looked good; however, during the presentation the presenter said that there were some bugs still with the application. I thought the presenter did a good job presenting and even used humor to engage the audience. One setback of using humor was he also used it to point out the flaws in his application.  The project can be improved with more testing to sort out the bugs encountered during the presentation.

CERES

This project is an open source management tool for small businesses so that staff can modify, create, and delete inventory, services, and events. The idea of the project seemed well done. As it was tough to see the actual interface I can't comment on the content within the project. The presentation was informative; however, the speakers could have seemed more enthusiastic regarding their project. Not being able to see the interface, I cannot comment on whether the project can be improved.

Week 5 Summary

First, Thomas Friedman's article. I couldn't agree with this statement more. Americans can't just sit back and expect that innovation will just come. We have to actively pursue it. Getting more people education in technology is essential in today's global economy if we wish to stay the leaders in technology.

The capstone video gave some good insight on what to expect for that. Since we are online, I wonder how the presentations will work. Given I haven't written a formal paper in 10 years it was refreshing to catch up on APA format.

The writing assignment for the industry analysis has further strengthened my focus in my ultimate goal of entering software development within the video game industry. I was able to find textbooks in programming specifically for games that will help me on my free time to create a portfolio. I also was able to attain key tips to help me get my foot in the door as well.

I like that we are having 2 peer reviews for our papers. This gives different perspectives to help further our writing skills and create a well thought out analysis. My login for Dashboard did not work for the weekend, and I see that others' logins were disrupted as well. I am glad that the faculty gave an extension for the peer review to accomadate for this.

I was a little bummed that I missed a question on the peer review guidelines quiz. Next time I will read each question more thoroughly and not rush through it.

All in all it was a good week. Catch you on the flip side!

Friday, September 2, 2016

Collective Resume

Ɨ
joscortez@csumb.edu | rlocke@csumb.edu | moawad@csumb.edu

Objective

Offer our expertise in software development through our staff of skilled, diverse individuals with experts from the fields of banking, management, accounting, linguistics, and software development.
Professional experience
Relationship Banker                JPMorgan Chase Bank, N.A.                                                           
07/2010 - Present
Frisco, TX
Build and strengthen personal banking relationships with Chase high balance clients/ business owners

Branch Manager                 First Convenience Bank                                     
06/2006 - 07/2010
Irving, TX
Follow established procedures; plan, direct, and organize sales and daily operational activities of assigned Branch/Center to include lending, new accounts, teller operations, and customer needs

Maui Language Instructor.       University of Hawai’i
05/2010 - Present
Maui, HI
Conduct courses to international students in the English language, providing examinations and assess students in English.  Other duties include classroom management as well as office duties.

Financial Data Analyst             Edgar-Online                           
01/2013 - Present
Phoenix, AZ
Review Form 10-K, Form 10-Q, and disclosures for XBRL tagging
Apply knowledge of current SEC requirements for evolving XBRL compliance requirements and address client questions related to their specific compliance requirements
Perform analysis of company provided HTML necessary for Financial Statements and Notes to be mapped as designed within the XBRL tools

Indirect Tax Analyst                 Amazon.com                           
10/08-11/10
Seattle, WA
Analyzed customer documentation for validity of exemption status and process sales tax refunds
Communicated with third party sellers, customers, and Customer Service regarding the calculation of transaction taxes
Performed daily customer service resolution through monitoring and answering customer tax related contacts or inquiries
Worked with other customer support teams to ensure a consistent and high-quality level of support
Prepared the monthly reports for management and sales tax team                            
Computer language Proficiencies
Java
C++
Python
SQL 2012
Assembly Language
Professional Skills
Team Management/ Banking Operations / Time Management / Multi-tasking
Sales
Customer Service
Filing / Editing (Photoshop) / Microsoft Office Applications / Data Entry / 10 key (70+ WPM)
Software Development on Eclipse IDE, jGrasp
Cultural Diversity Awareness
Japanese and Egyptian Language Proficiencies
Accounting Packages: XBRL and Peachtree
Education of team members
California State University                    Monterey Bay, CA                       08/2016 – Present
Working to achieve Bachelor of Computer Science degrees

Texas A&M University                     College Station, TX                              08/2001 –12/2005
Major: Bachelor of Science in Psychology
Minor: Business
1-year experience in Java and C++ Programming

University of Southern California          Los Angeles, CA                                09/2014 - 05/2016
Major: Master of Arts in Teaching- TESOL (Teaching English to Speakers of Other Languages Program)

Maharishi University of Management    Fairfield, IA                                         06/2011 - 12/2012
Major: M.B.A. Accounting

University of Washington                      Seattle, WA                                        03/2008 - 06/2009
Post Graduate Accounting Program









Ɨ Source:abfreegames.com/team-logo