Girls? What girls? (Lucky Seven Project "Aside" #2, part 1)

March 18th, 2010

Tonight I’m going to a session hosted by PERL (UMW’s all-female computer science club) and the computer science department. I have to leave class a bit early in order to get there on time, so I’m going to blog about it as part of my project. Plus, I think it’s a very relevant issue for beginning programmers to take note of, as well as any other member of the field.
The session is called “Voices of Experience: Talking with Women in Technology.” If you go down to Trinkle’s basement and look into the labs, you’ll probably notice something. I stand out a bit. Why? Do I have three eyes? Do I wear a funny hat? Nope. I just happened to get an X chromosome from each of my parents, and somehow I’ve found myself a minority in my chosen field. So, tonight there are going to be a bunch of women talking about their experiences as computer scientists. It should be fun 🙂
I’m planning to write about what I hear tonight, and maybe I’ll compare their experiences to my own.
And if you want to skip part of class with me, uh, er, come…
It’s at 7 PM in Trinkle B6. There’s free snacks and stuff.

Apples to Apples, or How to Compare Stuff ("Lucky Seven" Project #3)

March 16th, 2010

Programming almost always involves comparing some value to another. It’s a fact of life, er, coding (Is there a difference?), and it’s not difficult to do. You compare things in your head all the time, and I’m sure you’ve compared numbers in math class before. Now let me show you how to compare things in Javascript.
(I’m also going to include some logic stuffs, which also isn’t difficult. I’ll give examples for everything, so don’t worry.)
By the way, the == operator tends to confuse beginning programmers until they’re ripping their hair out, but there’s no reason to fear it. Just make sure you understand the difference between == and =. Ask me questions about it if you don’t 🙂

>
I know you took algebra in middle school. This means the same thing, “greater than,” and is used to compare two values.
So…
9>7 is obviously true.
(Yes, this stuff sounds ridiculous right now.)

<
Same thing. This one means "less than."
7=
“Greater than or equal to.”
This is the same thing as the > with a line under it, which you’ve probably seen before.
9>=5, and 9>=9

<=
"Less than or equal to."
And this is the same thing as the < with a line under it, as you probably guessed.
5<=9, and 5<=5

!=
This is how you say "not equal" in Javascript.
This is probably the first one that you don't recognize. The exclamation point, sometimes called "bang" in computer science jargon, is the symbol for "not."
5!=2

==
This is how you say "equals" in Javascript. BEWARE! This is not how you make a variable (more on those later) equal to something else, for example x=5. If you say x==5, x won't equal 5. x==5 is checking to see whether or not x already equals 5.
5==5
if 5==5
then say that they are equal
otherwise (else)
say that they are not equal

NOT

x+2=6
therefore,
x==4
DON'T DO THAT. IT'LL MAKE ME CRY. And you 😀

&&
This is how you say "and" in Javascript.
if (you don't ever show up for class)&&(you don't ever study)
you're probably going to fail

if (you like what you're reading)&&(you like to have fun)
major in computer science

Note that both of these conditions MUST be true in order for the next line to happen. If you like to have fun but you hate what I talk about in my tutorials, don't bother majoring in computer science. If you never show up for class but you study lots, you might just pass. Yes, I know these examples aren't that great, but if you'd like then I can pull out my old discrete math textbook and find you some better ones that will give you a good idea of how these logic things work.

||
This is how you say "or" in Javascript.
if (you are reading this)||(you want to make me feel good about myself)
comment on some of my stuff /*Just kidding… Maybe.*/

if (you have red paint)||(you have yellow paint)||(you have blue paint)
you have a paint that is a primary color
//Note that you can compare more than two things, like in this example.

Unlike the &&, only ONE of these conditions has to be true. Both and/or all of them can be true, but it's not necessary in order for the second line's conditions to be true or carried out.

I know that this post doesn't have much in it words-wise, but comparisons are actually pretty important for what you're going to be doing. Make sure you're familiar with them, and post comments if you want better examples or if anything is unclear.

HTML and You ("Lucky Seven" Project #2)

March 16th, 2010

As I mentioned in my introduction to this project tutorial, the best part of using Javascript is that you can go straight from Notepad to your browser of choice. If you have your own web space–and everyone in Digital Storytelling does–it’s easy to use Javascript to make interactive, interesting web pages for your site. Javascript interacts with HTML and CSS to make pop-up windows, rollover images, text boxes, and even simple games for your site.
I figured I’d explain how to put up a new web page on your site for three reasons:
1. I really just wanted to get it out of the way because I’ll forget later.
2. I also wanted to get it out of the way because I’d much rather be coding 🙂
3. Apparently there are people in this class who haven’t been able to get their home page up, and this will help cut down on some of the intimidation and give you a template to work from.
So here’s my step-by-step guide to getting your stuff straight for the future.

STEP 1
Stop worrying. Web design is fun, not frightening. Open up a basic text editor. I’m almost certain you have one on your computer. If you don’t, well, I have no idea what you did with it, but you can download them online for free. Windows users, you’ll use Notepad; Mac users, try TextEdit. This is NOT a job for Word. Word does not like computer code. Not only will it give you red lines all over, but you also won’t get much done as far as making a website goes. Just don’t do it.

STEP 2
Now that you’ve got your text editor open, you’re ready to start with HTML. HTML is what makes your web pages pretty, and I’m going to give you the basic template for every web page out there. I’m also going to go a bit farther and explain what each part is for. When you see text /*between a set of slashes and asterisks, like this*/ it means that everything between and including those slashes and asterisks doesn’t actually belong in your HTML file. All of that text is my explanation, and you should get rid of it before you upload your HTML file so that it’s a visible part of your site. Otherwise, it’ll look ugly and everyone will laugh at you. (Just kidding, but you need to get rid of them.)
Why did I choose those stupid symbols to mark what I’m going to tell you? Well, I didn’t. Take notes now; this is the first thing I’m going to teach you about writing code.
Whenever you see /*text between slashes and asterisks*/ or
//a single line of text that’s preceded by two slashes
then you should know that the text is invisible to the computer as it starts reading and executing the Javascript code. These are called comments, and every good programmer uses them.
But why are they important if the computer never sees them? Comments make things easier for humans to understand when they try to read through hundreds of lines of programming languages. You’ll get a better understanding of what I mean once you get started with this project. If you work on this project on Monday, have a lot of studying to do, and then pick back up with the project on Thursday, then trust me, you’re going to wonder what in the world you were doing last time you sat down to code. You’ll wonder what this does, why you decided to add that, and you’re going to get frustrated. Comment as you work. The slash-asterisk style of comment is generally used for several lines of comments or only a small portion of a line, while the double slash comment is used for a single line (and everything on that line will be commented out). Simply put in one or the other and write yourself a bunch of notes on what you’re doing. You’ll start to get a feel for what you need and want to comment as you start working.
Now that you’re familiar with comments, you can see the backbone of an HTML file. So, here it goes:

/*The first bracket lets the computer know that you’re starting to write HTML. The bracket things are called tags.*/

/*All of your fun Javascript stuff is going to go in here!*/

<br /> /*Whatever you put in here will show up at the top of your browser window, where the minimize and close buttons are. Try to keep it short, sweet, and to the point; there’s a limit to where it’ll simply get cut off. */<br />

/*Everything that you want people to be able to see on your page goes in here. For this project, you’ll probably write a little bit about your game, like instructions for how to play and what the goal is.*/

/*In case you didn’t notice, each tag needs to have a closing tag to tell the computer that a part is done. For example, a tag follows this comment so that the computer knows that the HTML is all finished.*/

Now here are some fun pictures to help you along!
This is a bare bones web page:

NOTE: I’m having difficulty getting this to work for some reason, so I’m going to complete this tutorial at a later date. I’ve been trapped in front of a computer screen for a majority of the past two days working on a do-or-die programming project (There’s really no exaggeration there.), and I’m honestly not in the mood to mess with this stuff right now. Plus, I’m really, really sick. I’ll try to get the next part of this project up soon–I know I’m behind–and finish with this one ASAP. Sorry for the delays and brutal honesty.

Demented Aliens Attack

March 13th, 2010

Paul worked on this too. Thanks to Nine Inch Nails for the awesome background music 🙂

Demented Aliens Abduct Someone

Just to remind you that we’re not THAT disturbed, here’s the video for the song in our sound story:
“Pinion” by NIN
(Warning: The video kinda sorta really can be, uh, weird the first time you watch it.)

Confessions of a C++ Programmer (A Lucky Seven Project "Aside")

March 12th, 2010

Most people are under the impression that linguists are always fluent in dozens of languages. Some of them actually are, but not all of us. I used to be very good with Latin back when it was my major, but I’ve recently started to stumble over words that I swear I knew when I was in 8th grade. I’ve sadly come to the conclusion that the old saying, “use it or lose it,” is too true.
I don’t really consider myself multilingual as far as natural languages go, but I know a good handful of programming languages. Right now, I’m working with C++. I love it, even when it gives me nasty errors. But just like Latin, my memory of Javascript (the first programming language I ever learned) has rapidly faded. I haven’t used it seriously in almost a year, and I’ve forgotten a lot of things. I actually think the last time I wrote a decent program with Javascript was over the summer, when I wrote the Lucky Seven game that you’re going to make over the next few weeks.
This project is going to be a great refresher for me because I’m going to have to dig out my knowledge of Javascript syntax from under the rules of C++. I’m having fun going through all of my old 110 notes to remember just how to do something (even things that aren’t going to be included in this project) and looking at all of the programs I wrote back then.
And you know what? I think I’ll read some Latin tonight.

(The second part of this project is coming soon. I’ve got it almost written, but it’s on one of my computers and I’m stuck in the Unix lab for the day. Fun fun.)

Introduction ("Lucky Seven" Project #1)

March 2nd, 2010

For my digital story, I’ll be teaching you how to make a number guessing game using a programming language called Javascript. Even if you don’t consider yourself the type of person who would be interested in coding, I hope you’ll follow along and create a fun game that you can put on your web site. I think that it’ll be challenging for non-programmers, but hopefully not overly frustrating.
I wrote the game, which I call “Lucky Seven,” last summer. It’s not a difficult program to understand, nor is it a long one. The language I used to write it is called Javascript, which is an interesting language that I taught myself in junior high and then studied in my first computer science class at UMW. It works in a browser alongside HTML and CSS to make awesome web pages, but it’s much different than either HTML or CSS. What’s the difference? Javascript is a programming language, a language used to write algorithms that a computer can “understand” and execute, while HTML and CSS merely make things look nicer. Javascript doesn’t require some of the “extras” that other languages would, which is why I think it’s a good first programming language. The biggest bonus to using Javascript for this project in this class is that you put it in an HTML file and you can put it on your site. Hopefully I’ll put a sample of the game on my own site soon so that you can see it. One downside to Javascript is that it doesn’t get compiled; I also consider that a bonus because you don’t have to go out and download a compiler, but… Compilation is basically converting a programming language into something the computer really “understands,” and if you’ve done something wrong… Well, the computer isn’t so polite about it. You don’t get cryptic error messages and core dumps with Javascript, but instead it will mess up and leave you with nothing to work from. If you intend to follow through with this project and build your own “Lucky Seven” game, I have to warn you that you’re probably going to run into a few errors. To remedy this, I suggest using Firefox (at least when you’re working on this project, if you don’t want to/already use it full time) and downloading an add-on called Firebug by clicking here. (I swear I’m not rick-rolling you guys again.)
Firebug is a debugger for Firefox that will help you find errors in your Javascript code. I personally hated using it back in 110 because it can be very confusing and I like to solve problems by myself. (Yes, I am stubborn.) I’m still very willing to help if you need clarification on anything and I’d love to help you debug, but I still suggest using Firebug for those simple “oops, forgot a semicolon, my bad,” laugh-it-off types of errors. I code almost every single day, including weekends, and sometimes I’m too frustrated, too tired, too busy, or too something to give prompt help. That doesn’t mean that you shouldn’t leave me a comment that I didn’t explain something very well or that you have some crazy bug that you can’t figure out. I absolutely LOVE to help people and don’t mind explaining something in multiple ways if it’ll help someone understand, but I also believe that making mistakes, finding them, and correcting them is one of the best ways to learn (and the only way for a person to learn how to program).
I was going to write something awesome about what computer programming really is, but I honestly don’t think it’s necessary. Computer programming is all about writing algorithms. Computer programming is the art of bossing computers around. Computer programming is fun, challenging, and something everyone should try.
And if you follow this project and like what you see, consider taking CPSC 110. I can’t guarantee you’ll learn Javascript, but you’ll learn some of the same basic information in another language. It’s good for a math gen ed and great for a budding CompSci major 🙂

Final Proposal

February 26th, 2010

I’ve decided to create a series of Javascript tutorials for my digital story.
My plan is to start with the basics. I’d like my first post to be about computer programming and Javascript in general. Then, I’d like to progress with various aspects of basic programming–the Javascript “alert,” if statements, looping, variables, and anything else that I feel would be important to learn. Once I’ve given everyone an idea of how to start coding, I’d like to walk everyone through building a number guessing game called Lucky Seven that I wrote over the summer. I don’t have an example of it online, but I might put it on my site later on, especially as an aid for anyone who wants to follow along and make their own version.
Lucky Seven is a very easy game to play (If you’re clever, you can guess the number just about every time–but it can be made more difficult.) and a very easy game to code. It’s not even a lot of code.
I want to include a quick tutorial on making an HTML file that you can upload to your site early into the project, which would also benefit anyone who hasn’t been able to set up their site’s home page. After all, I didn’t choose Javascript for no reason. Javascript works with a browser, so there’s no need for anyone who follows my blog to download a compiler. Compilers are proof that computers can hate 🙂 (Just kidding, but they certainly don’t show mercy when you’re begging for your work to compile…) But that’s not the only thing, either. Anyone who completes the project can put it on their site and show it off to the rest of the class. The game page can be decorated in all sorts of creative ways, which will be lots of fun for people who like web design to try.
If I finish the tutorial before the class ends, I’m sure I can pull some other fun projects from my sleeves.
Right now, I’m thinking I’d do 1-2 posts per week, depending on my work load (Double majoring is awesome if you’re a masochist.). It would be very easy for me to work ahead if I feel like I’ll be busy, then simply post what I’ve already written later on to stay on schedule. If people actually bother to follow along with this (and they should, it’ll be really easy and fun! *wink wink*), they’ll probably have occasional issues because Javascript can be very, uh, temperamental. Because there’s no compiler, it’s not going to tell you where errors are occurring. For people who have Firefox, I’ll encourage them to download an add-on called Firebug, which is free, helpful, and only slightly frustrating. It’s a debugger for Javascript. For people who don’t want that hassle and/or don’t want to switch browsers, I’d be willing to and/or feel responsible for their suffering and give some individual help. I can give further instructions for that as well if it is necessary–I actually enjoy the process of debugging when my grade isn’t on the line 🙂

Pictures From Flickr

February 23rd, 2010

These are just some pictures that I like that I took from Flickr. As you can tell, I really like animals. I love to photograph my dogs and horses especially, but I can never take good pictures of my fish, so I’m really jealous of people who’ve mastered the art of taking pictures of moving animals underwater. I think that’s why I saw so many fish pictures that I liked (more than this, but the post got long enough).

pleco

By c080 from Flickr

I really like the background of this one because it’s so glowy and green. The fish is in focus and his outline and spots are very sharp compared to the plants in the background, which are just a blur of colors. I’m also a huge fan of plecos, and I have one named Nikki who looks a lot like this one 🙂

horse in snow

By Ben Kimball from Flickr

I love horses playing in fields and in snow. The horse is a dark bay, but the snow makes him look flecked. He stands out against the snow, and it’s just really fun to see him leaping into the air.

Fall Off Horse

For some reason, this one didn’t want to show up. I just put a link. And I swear I’m not trying to Rick Roll you again.

By New2mac from Flickr

And I also love good pictures of people falling from their horses. No, I’m not a sadist. There’s just something about catching such a brief, unexpected moment and doing it well. I’ve been riding and training horses long enough that I’ve had some pretty epic falls, and seeing photos like this makes me think about that brief moment where your mind is racing to prepare for impact and you feel like you’re defying gravity and just hanging in the air. They actually give me a sort of “hanging” feeling.

This one is also a little different because, if you don’t look closely, you might first think that it’s just a picture of a woman jumping her horse. You have to look a second time to see that she’s bracing her arms against her horse’s arching neck with no contact on the saddle. The swinging stirrup leather and gleaming iron was the first thing that gave it away.

green spotted puffer

By jupalada on Flickr

Green spotted puffer fish are such cute fish, it’s hard not to love their comical faces. They’re also such a pretty, unique color. I love how this one is on a completely black background, which seems to bring out his spots and enhance his color. Awwwwww.

Dog Drinking Drops

For whatever reason, this one didn’t show up either, so there’s a link.

By Norby on Flickr

I love how the dog’s brown spots are almost the same color as the wooden floor. I also like how the water is dripping and the dog is licking it up. His pink tongue is cute 🙂 The drops also divide the picture, and the nails in the floor do the same. They intersect, and I just think it’s really interesting for some reason.

Just keeping notes…

February 21st, 2010

I was looking for photos on Flickr that interest me, and I found a photo of a book cover. It was called “The Emotion Machine” by Marvin Minsky. If I ever get the time to read again, I definitely want to track down a copy of that one. The description of the book has convinced me that I’ll be fascinated by the whole thing and never want to put it down.

In this mind-expanding book, scientific pioneer Marvin Minsky continues his groundbreaking research, offering a fascinating new model for how our minds work. He argues persuasively that emotions, intuitions, and feelings are not distinct things, but different ways of thinking.
By examining these different forms of mind activity, Minsky says, we can explain why our thought sometimes takes the form of carefully reasoned analysis and at other times turns to emotion. He shows how our minds progress from simple, instinctive kinds of thought to more complex forms, such as consciousness or self-awareness. And he argues that because we tend to see our thinking as fragmented, we fail to appreciate what powerful thinkers we really are. Indeed, says Minsky, if thinking can be understood as the step-by-step process that it is, then we can build machines — artificial intelligences — that not only can assist with our thinking by thinking as we do but have the potential to be as conscious as we are.

I just can’t stop thinking about just the ideas presented in that short summary. I’d look at the local library, but unfortunately the computer science section is limited to various Dummies guides for people who can’t figure out/want to know EVERY LITTLE THING about random software. And I did a catalog search for books on artificial intelligence. Nothing. Pshhh.
(So basically this whole thing was a blog-to-self to see if I can find a cheap copy online later.)

Digital Story Proposal

February 16th, 2010

I’m leaning towards adopting a persona and blogging as another person for a while. I really liked the idea we saw in class of Project 1968, where the women pretended to be people blogging from that era. I’m really not a history person, so I’d probably take a more modern approach. I don’t really know what kind of person I’d want to be, however. I thought of simply taking on a pseudonym and writing from another CompSci student’s eyes, but I might change my mind depending on whether or not I can think of a more exciting role for me to play. I do think that I’d have enough material to write about on a regular basis; even if my past and current experiences aren’t enough, I can always…uh, alter reality 🙂

February 14, 2010–Studied for Data Structures exam…on Valentines’ Day.
February 15, 2010–Got up at 6:30 AM and went to the Unix lab to work on some code. It wouldn’t compile. Again.
February 16, 2010–Someone in my Data Structures class followed up on that promise to burn the Unix lab to the ground if his project didn’t compile.

Maybe not quite like that (much more content, hopefully nothing as silly as some of the ideas I already have), but that’s the main idea.
If that doesn’t work out for me, I thought I might just do a set of nonfiction (probably how-to) posts relating to some topic that I’ll think of in the future.

EDIT:
I have a pretty fun idea for a how-to sort of thing and I think I’d have a lot of fun doing it. I was thinking I could do a series of posts on basic programming that build into designing a really simple number guessing game that I wrote over the summer. If that won’t keep me busy for the rest of the class, I could always do a couple of games/projects that people can add to their sites. After all, now we all have our own web space and we can put our own Javascript games on our sites when we’re finished.
Now I just have to either find the code for the game or write it again (hopefully I can find it :)) and split it into chunks.