Thursday, April 7, 2011

Assignment 4.2 (continued)

Part 2

There were a couple tutorials that I really liked. I'll choose this one as the best because it shows you a basic program, which is a little guessing game.



This video goes over if statements and how to use the less-than, equal, greater-than, etc. Here's the code for the guessing game:


clear
ANSWER = $RANDOM

while [1]; do
{
echo "Enter your guess (number): "
read USER_GUESS
if [ $USER_GUESS -eq $ANSWER ]; then
{
echo "Correct guess."
exit 0
}
elif [ $USER_GUESS -gt $ANSWER ]; then
{
echo "Too high. Try again."
}
else
{
echo "Too low. Try again."
}
fi
}
done


I wanted to mention this video as well:

http://www.youtube.com/watch?v=QGvvJO5UIs4

This one was nice because it showed you how to easily create and modify text files. This was something that other tutorials didn't cover, or they had you open up a text editor, which you don't really need to do. You just type:

nano file_name.sh

and then it takes you into the file to edit it. To quit and save the file you press control X and it takes you back to the normal terminal. To run the script, you type:

./file_name.sh

Pretty simple. It also teaches you how to write a simple script that asks for user input then stores what you typed into a separate text file. Here's the code:


#!/bin/bash

clear
echo "Welcome"
sleep 2
echo "how is your day going?"
read ans

clear
echo "you typed $ans"
echo "$ans" >> ans.txt

cat ans.txt

Wednesday, April 6, 2011

Assignment 4.2

Part 1.

The best Bash shell tutorial I found was this one here:

http://www.youtube.com/watch?v=N4wKqsMJqnw

It actually doesn't go over that many commands that you can use in the Terminal, but we learned a lot of that in class. This video shows you how to be more productive when working in Bash. You can move the cursor left and right a whole word using alt F and B, respectively. You have to make sure "use option as meta key" is turned on under the preferences though. You can also search your history for any commands you had typed before using command R.

Sunday, April 3, 2011

Journal Post 10

I thought the idea of a home-made infrared camera was really cool, so I looked up some videos. This video uses a method that Joe described in class using negative strips.



This video here shows a way of seeing in the dark using red and blue sulafane cutouts placed in front of a flashlight's lens and then shining the flashlight while looking through the lens of a camera. I guess the sulafane layers are too thick for normal light to pass through, but not infrared. The video says you need an older camera to make this work though (from the 90s).

Assignment 4.1 (continued)

Part 1.

I honestly haven't been able to find any very helpful video tutorials online for Photoshop javascript, but there have been some web pages that have helped a ton. The most useful one for me was this site here:

http://www.kirupa.com/motiongraphics/ps_scripting.htm

This tutorial is actually several pages long. It goes through basic operations such as creating new layers/documents, making loops, merging layers, and making selections. After reading this and the Scripting Guide I was able to get a pretty good start on the color blind image. Neither of them were able to help me with some of the more specific problems I had though, such as coping a channel into a layer or using the channel mixer command.