Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Monday, April 29, 2013

JAVA: Genetic Algorithms {Week 12}


Chapter Nine in our text book, Nature of Code, the author discusses 3 strategies to implement genetic algorithm theories in software.  
  • The traditional computer science method
  • Interactive selection
  • Ecosystem simulation   

From my understanding, these theories are used mostly in the research side of the computing field, especially in AI and evolutionary computation.   After our class trip to ORNL last week, I imagine that most of the fields using the super computers also use evolutionary computation somewhere in their research. 



I think the fact that this chapter was my favorite chapter in the whole book, is a strong indication that I would have a lot of fun working on a team doing simulations in astrophysics at ORNL.  Or maybe in their brand new 3-D visualization lab…..  If I could just keep my head out of those clouds.  **Sigh**  

My Project for WEEK 12:  Sexy Lady Creator

Method:  Interactive Selection

Heredity and Variation:  Value ranges assigned by me (using the Nature of Code algorithm)

Selection:  "Fitness" levels are chosen by the user (after all, beauty is in the eye of the beholder)




Existing Variables:
Body Curvature
Body Height
Breast Radius
Smile Curvature
Smile Length

Other Possible Variables:
Eye Size/Color
Eye lashes
Lip thickness
Hair length/Color/Thickness
Skin Color
Personality

Notes:
This project was inspired by several subjects I have studied over the past few years including, Art History, Psychology, Statistics, and (obviously) Programming.  The basic idea I was forming with this project was an application that could be used for fun or to gather data on what people perceive as beauty.  The idea of gathering data on people's opinions of beauty is nothing new, but for some reason it never seems to get boring.   Maybe because the variables seem to change with every culture and generation.  I have read studies where scientists use pictures of real faces to survey what we think is attractive - based on overall measurements or bone structure.

My project is quite different, mainly because I use basic shapes that are "drawn" and merely imply a female figure.   I chose to use the female figure for this project (in my class of ALL guys) in hopes that I would get extra credit for the use of boobs.  :)  HaHa.  An application like this could have a much wider range of use though.  The basic concept of organizing shapes and lines in a way that is aesthetically pleasing is useful in every industry - architecture, marketing, advertising (print and web), manufacturing - people want to see beautiful things.  In my project, I was trying to focus more specifically on figuring out what design elements are aesthetically pleasing in animation.  Considering the recent reports that the global animation industry pulled in over $222 Billion last year, a fully developed application of this kind could be useful.   

I haven't done much research yet on the animation industry, but I'm sure there are studies out there on what users find pleasing in animation.  I have heard that eyes are a major factor in animation.... In fact, even Dr. Doofenshmirtz tried to use his "Big Sad Eye Inator" to rule the tri-state area in this Phineas and Ferb episode.   Here's a clip of the show for anyone who is not familiar with this hilarious series...



  

Monday, April 22, 2013

JAVA: Fractals {Week 11}

Moving right along in this Java class.... fractals.   Last semester was the first time I had ever knowingly been introduced to recursion and fractals.  At the time, calling a function from inside itself seemed messy, complicated, and cannibalistic.  I hardly understood what a function was, so I was not ready to think about how I could use recursion in my code.  I still found the Mandelbrot Set interesting and I thought the colors and patterns were very pretty, but that was as far as I could go with it at the time.

I found a random quote on Instagram one day that I don't completely understand, but for some reason it reminded me of me.  I had forgotten about it, but coincidentally, I thought of it again while looking at these fractals in class this week....
"Easily attracted, dangerous to distract me."
What does that even mean?  I don't know, but I'm sure there was a good reason it popped into my head that day, and I'm sure it relates to fractals... well, because, doesn't everything?

After this chapter, my new thoughts on Recursion: it is beautiful, powerful, and magical.  This time, looking at a section of the Mandelbrot set, I was completely intrigued by the patterns that were forming in the background space with one of the color combinations.


The strange thing is, I guess that's not really the background.... it's all fractal code, there is no background, it goes forever.  When we zoomed in and I saw the 3 dimensional effect, with the varied wobbly overlapping petals I just had to try and draw it!  I couldn't even come close.  I haven't kept a sketch book in years, and it shows. I probably could render something close (in greyscale with a pencil) if I spent some time on it.  





If I spent even more time, I could probably create a similar effect with acrylic paint too.  That's the thing though - I already know I can do those things.  I will always love working with materials with my hands, but I am in complete awe of how this effect is being produced with pixels on a screen.  That's actually one of the reasons I chose programming - it's all brand new to me.


In some ways, a screen doesn't seem that much different from paper.... except  paint is a pigment- it's a layer.  Pixels are light?   Anyways, seems like a fun new hobby for summer... you loose some you win some.



Local Fractal Artist:
I ran across the website of a fractal artist in East Tennessee - Steven Lareau - He has been working with Mandelbulbs - a 3-D version of Mandelbrot!  I thought it was pretty cool and I love to share the work of local artists, so check it out if you can.


Fractal Tree Branching

(click picture to see in action)



 My fractal field needs more work.  This will be all for now.




Tuesday, February 19, 2013

JAVA: Oscillation {Week 4}

I just wanted to make a quick post about Week 4 before I post my Project.... Week 4 was really awesome! Chapter 3 starts off with trigonometry (?).  I don't have much to say about that, except that I need/want to brush up on my math skills so I can use these concepts efficiently.   But, even with my lowly Pre-Cal skills (and our amazing textbook), I was able to create some really cool things!!!

Here's a sneak peek at something I am using in my project. 
(Click the picture to see the action)


Friday, September 14, 2012

JAVA Week 3

I think it's safe to say I am official nerd now.  I am working on my Java homework on a Friday evening, because I want to. Yay Nerds. This week we are working on conditionals.... "if" and "else" statements.  The flowcharts came to me very quickly and easily this time.  The first problem was to write a program that has the user hold the Finch in one of four positions and the Finch tells his position.  I started out trying to get one if statement to work, before I put the other four in the program.  That was a good idea, because my first one wouldn't work.   After spending an hour looking over my notes and the professor's notes and even watching a  NetBeans tutorial, I was finally reminded about the "no semi colon after an if" rule.  


 

After I fixed that, it was smooth sailing and everything worked beautifully.  A little while later, my mom stopped in and was intrigued by the Finch and really wanted to see what I wrote for it.  I ran the program in NetBeans, so (as some of you know) all the text is printed out in a little window at the bottom of the screen - which confused her right off the bat.  After we got past the lame interface issue, we successfully ran the program and she said, "Is that all it does?"  I replied, "Yeah, it tells you which way it is facing."  She laughed and said, "Well who the hell cares about that?"  All she really cared about was whether or not I could fix the Java Updater error she was getting on her desktop.
Beginner programmers get no love.  

Wednesday, September 12, 2012

JAVA Week 2.5

The main concepts of week 2 were declaring variables, assignment statements, operators, and output.  Very simple, basic, functions.  These concepts were really easy to understand when we were doing text only sample programs on the board - I totally felt like I understood everything.  So, I was really frustrated when I was struggling to apply them to our Homework assignment with the Finch.
In the examples the professor does on the board, the programs are made up, so, the programs do whatever he says they can do.  The Finch has a library, so it can only do what  the library says.  Also, there were a few key statements necessary to control the Finch, that weren't discussed in the examples on the board. One of them in particular was the "scan.nextInt" command. 

It was very difficult for ME to go from writing a text program that figures sales tax to telling the Finch to get information from it's sensors and then move it's wheels based on that information.  I know the text examples were supposed to easily and gently introduce us to Java syntax, but...... It confused me to have meaningless programs explained verbally on a whiteboard and then make me try to figure out how to apply those concepts in a platform I have never seen, using a "library" that I didn't truly understand.  I think that I would have caught on quicker if he had started off writing Finch programs in NetBeans and let us follow along.   

I finally got it today. (I think)  Now, looking back at the homework problems, I see how easy they are.  I see how the professor tried to make it easy and spell out exactly what he wanted us to do, even giving us hints on how to make the program work.  I am actually excited now to start the Week 3 homework to see if I really do understand it!   I am so glad we are using the Finch and I am glad that this class is going to be challenging.  






Sunday, September 2, 2012

JAVA Week One


It is only my first week of school and I love my CS classes already.  The Professor for my Java programming class is using the Finch Robot instead of a text book.  I am actually surprised that any computer science teacher would use a textbook.  I took CAD for 2 years and I don't remember opening a textbook ever.  The Professor would work on her computer and we would follow along.  Then we would get a sheet of dimensions and draw on our own.  I guess the difference is, architecture is objects and programming is mostly text.  Also, teaching how to USE a program must be different than teaching how to CREATE a program.  I think the Finch will be way more fun to practice programming - instead of just running text programs in that dreary Net Beans.

I have a feeling everyone says this, but I think it's not the actual "programming" that interests me.  All this Java, language, detailed, syntax crap kind of makes me feel bored.  I feel like I can look at a list of Java syntax and memorize what it's function is.  Yay Syntax.  Not me - it's those algorithms that fascinate me.  I can't believe how much I struggled with the extremely simple problem solving exercises we did in class Wednesday - but it was SO fun!  That's what I want to do! I want to help people come up with amazing programs that will make their organizations function more efficiently.  I want to design the program and the applications and organize the information and make it all look pretty and be really easy to use.  Somehow, I have the feeling that the same job everyone else wants too.  :)

I'll post a picture of my finch on my blog next week.