Thursday, March 28, 2013

The One With the Mirrored Pictures

Hey all!
Here are some mirrored pictures of my cat, Peanut. Hope you enjoy her adorable chubbiness!

Tuesday, March 12, 2013

The One With the Possible Modern Art

Hello all,

We've been getting into some pretty awesome things with modifying pictures lately.

Here's an example of a program that changes the colors of the 4 quadrants of pictures, and then further adds more modified lines and diagonals across it. Here it is again tested on my grandma--she seems to be a good test subject:

As you can see, there are many modifications (4 for the quadrants, one for the horizontal line, and another for the diagonal). 
Hope you enjoyed! Good night all.


Tuesday, February 19, 2013

The One with the Bag of Pixels

Hello all,

Instead of modifying just particular pixels, now we have learned to modify all of the pixels in an image by changing the values of the colors associated with each pixel.

I decided to take a rather bright water color painting I made of my grandma and tone it down to a nice cool color. I did this by taking the average of all three color values (red, green, and blue) and set the original "blue" value to this new average. After that, I divided the value of red by a factor of 1.2 and multiplied the green values by a factor of 0.8.

Here is the before and after:




















And to show this modification with another picture, here is a passion flower example:

See you in class!

Thursday, February 14, 2013

The One With Starchild

Hello!

So we're finally working with pictures (hooray!!) and I went through about 1000 lines of code to change a bunch of pixels to black, (0,0,0). I took an old Polaroid of me as a child and turned me into
... dun dun dun...
Starchild! Woot.
Here are the before and after pictures:


Hope you enjoyed!

Saturday, February 2, 2013

The One with the Arguments

Hey everyone,

So we're learning more about simple functions. The thing that I had the hardest wrapping my head around was that nothing really major needed to be changed to create a function with multiple arguments, they just had to be separated by commas. I expected the process to be a bit more difficult, and I'm still trying to figure out how much more I can do with more than one argument. So far (obviously) I know I can compute areas, perimeters, and other related calculations of simple geometric shapes.

See you all in class Tuesday!

Thursday, January 31, 2013

The One with the Cats

Hi everyone!

So, it's our second week of classes and things are picking up speed! On Tuesday in class we learned how to make very simple functions with one argument, using "def". After completing all of Dr. Kay's prompts, I started brainstorming about what kind of problem I would make up and solve using a simple function.

That's when I realized I have no creativity in programming yet. At all. Or maybe I do, and I just don't know quite enough to really let it blossom yet because my solution to fixing things on my computer is the 'hand-computer-to-competent-friend-and-plead-for-help' method. So, since I love cats and mine was snuggled up next to me, I had this bright idea to make a function that spit out a random fact about cats if you input a number 1-5. After probably an hour of determination (after I got out of work at 10:30 Wednesday night) and trying to look up python programming tips I decided to modify my idea to one that I wouldn't need Dr. Kay's help with.

I made a function that has an argument that gets multiplied by one of my favorite numbers, 76,863. I know it is completely pointless, but I did get to include a little bit on cats based on my earlier frustration. I guarantee no one else would have come up with my exact solution to multiplying a number by 76,863! And hey, I practiced programming. A whole bunch. Here it is:

 def disapprovingCatFace(anyNumber):
   numberFixed = anyNumber*76863
   print "I am a disapproving cat and I did not like your choice of number (or word). I have multiplied it by 76,863 because that's an awesome number. Here it is: ", numberFixed
   print " /\_____/|"
   print "|      o        o      |"
   print "= __X__ ="
   print "Also, that's my face. Bye now!"


and in Python, it looks lovely!



Sunday, January 27, 2013

The One with the Introduction

>>> print "Hello, world!"

Hello, world!

This is my blog about learning how to use the scientific programming language of Python using the Jython Environment for Students. This blog will track my progress and give insight about the information I pick up from class each week. So far, Dr. Kay has given us a nice introduction to some very basic commands we can use in Python and has instructed us on how to trace our code.

In case you were curious, the blog is named "African Rock Python" after, (drum roll....) the African Rock Python, pictured here in this quick oil pastel sketch:
See you all soon!