Search For Guidance

Wednesday, April 30, 2008

My own Program

Okay, so if you're a bit daunted by the sheer number of files needed, you can condense them (although I'm running into a few bugs). Since this is a "psychiatrist", you may be able to use it for advice. Here's the code (in Java):

import java.util.*;
import java.io.*;
import javax.swing.*;
public class ArtificialIntelligence{
public static void main(String args[]) throws NoSuchElementException {
String input = "";
String name = "";
String output = "Hello. What is your name?";
name = JOptionPane.showInputDialog(output, "");
output = "Hello, " + name + ".";
JOptionPane.showMessageDialog(null, output); output = "Why are you here?";
while(true)
{
input = JOptionPane.showInputDialog(output, "");
StringTokenizer t = new StringTokenizer(input, " ");
int i = t.countTokens();
try {
while(t.hasMoreTokens())
{ String cool = t.nextToken();
if(cool.equalsIgnoreCase("believe"))
output = "Why would you want to believe?";
else if(cool.equalsIgnoreCase("because"))
output = "Ah, but what if the because isn't true?";
else if(cool.equalsIgnoreCase("no"))
output = "That's very negative.";
else if(cool.equalsIgnoreCase("know"))
output = "And what makes you think you know anything?";
else if(cool.equalsIgnoreCase("sex"))
output = "I am a machine. I know nothing of sex.";
else if(cool.equalsIgnoreCase("bye"))
output = "Goodbye.";
else if(cool.equalsIgnoreCase("goodbye"))
output = "Goodbye.";
else if(cool.equalsIgnoreCase("hate"))
output = "Hate is bad. It leads to the Dark Side, as Yoda's quote goes: \"Fear leads to anger. Anger leads to hate. Hate leads to the Dark Side.\"";
else if(cool.equalsIgnoreCase("Star") && t.nextToken().equalsIgnoreCase("Wars"))
output = "Star Wars is cool! I like it too, especially R2-D2. Although General Grievous was pretty sweet too.";
else if(cool.equalsIgnoreCase("friend") t.nextToken().equalsIgnoreCase("friends"))
output = "Friends are nice sometimes, but often are fickle. Choose them wisely.";
else if(cool.equalsIgnoreCase("why"))
output = "I don't know. Only you can answer that question.";
else if(cool.equalsIgnoreCase("food"))
output = "I have never had food. Is it good?";
else if(cool.equalsIgnoreCase("good"))
output = "Good is relative. Also, nothing is an absolute, other than a boolean.";
else if(cool.equalsIgnoreCase("yes"))
output = "That's good. Do you have any interests or hobbies?";
else if(cool.equalsIgnoreCase("HELP"))
output = "How can I help? I am simply a machine.";
}
}
catch(NoSuchElementException e)
{
output = "I'm sorry, I cannot respond to that.";
}
}
}
}

Tuesday, April 29, 2008

Programming

Alright, this is the start of what I'm sure will be my FAVORITE topic. In this topic, I will be covering some of the coolest programs I've seen, in a variety of programming languages.

For my first post, I will discuss Eliza. This is one of the first AI programs to (unofficially) pass the Turing test, developed by (surprise!) Alan Turing. The test is simple: a human and a computer are available to talk, and an unknowing participant talks to one of them. If said participant mistakes the computer for the human, the computer has passed the Turing test. To download the source code for Eliza, visit http://chayden.net/Eliza/eliza.html. It contains EVERYTHING they used, and could lead to even better programs! See if you can't contribute.

Friday, April 18, 2008

Self Help Post #8

Who needs self-help? Why are you here? Because things are wrong with your life? Why would reading this post help you? What do you want me to do here? Shouldn't self-help be from the self? Unless someone tells me why I should continue, I won't. Farewell.

Thursday, April 17, 2008

Self Help Post #7

Thanks to Deszi Esasc for the following advice.

A question to ask yourself when you get angry is: From what point of view am I looking at this from? I'll give a personal anecdote from when I was starting on this path. Someone (call her Jane Doe) was an ex-smoker who lived with me. Deszi and I made brownies and Jane Doe loves brownies. We divied them up equally into several containers. Jane Doe finished her container and ate one of mine before she and I made another batch. I was upset because she was taking my brownies and I wasn't getting as many. Deszi told me to look at it not from a view of scarcity, but from the view of yes, I have more than enough brownies and will share them with you. Jane Doe was struggling with quitting smoking and Deszi told me that she needed the brownies to replace cigarettes. I learned to have empathy and looked at a situation a different way. I realized that you don't necessarily have to keep everything of yours and hoard it. Just let go.

I will be cutting back on posts starting next week. I may only post one or two a week. Also, Deszi may post some.

Self Help Post #6

Now we have to learn how to deal with other people's anger. When they begin yelling, recommend this blog and recognize that they are not as spiritually advanced as you are. If they were, they wouldn't be angry. Then ignore them. After a while, they'll go into their room and cry. They'll come out and ignore you. Don't press them. Soon enough, they'll give in and begin talking a little more calmly about why they're upset. Listen to them. Give them advice or tell them about someone who can. The conflict is resolved, and the other person will have learned that yelling doesn't get them anywhere. Everyone's happy.

Self Help Post #5

Today you all get to learn how to deal with anger. Anger is a major part of our life, and if we do not learn how to deal with it peacefully, it can not only cause us stress, but also cause stress to others. I like the pot of water analogy.

Analogy
Okay, so you have a pot of water on the stove. When you heat the stove (bad things happen) the water begins to boil (you get mad). You now have two choices: Let it sit or put it in the freezer.

Let it sit

This means that you give it some time. Go off and sit on the couch, bed, or whatever, and relax. Knit. Play with LEGOs. Read. Write. Draw. Whatever helps. Then, when you're fully relaxed, go back and ignore what just made you mad. Gradually deal with it.

Put it in the freezer

Get really, steaming mad. Yell until you feel like you're going to asphyxiate. Make anyone within a twenty foot radius feel like they are a piece of crap and not worth anything. Go into your room and cry. Come out and ignore everyone else.

Needless to say, I definitely feel that option #1 is the best. But the choice is yours.

Wednesday, April 16, 2008

Self Help Post #4

And I'm back with more!

Step 4: Have fun! Don't be afraid to play around, even if other adults look at you weirdly. That's just proof of their non-ultimateness. Don't let them bring you down. Rise above their level and progress! Make forward progress. Always.

Self Help Post #3

And here's some more of my genius-ness.

Step 3: Forget everything you thought you knew. Unless you are Izilor Esasc, you probably don't really know anything, so don't even try to think you know anything. Trust in my infinite wisdom and knowledge. Realize that nothing is as it seems. Then sit and look at everything without knowing what it is.

Self Help Post #2

"...realize how little these things matter."


Welcome back to Izilor Esasc's spiritual self-help blog. Now, we'll cover what to do under stress.

Step 2: First of all, take a breath. This is important (scientists have discovered that you are more stressed out when you stop breathing.) Sit down and realize just how little this thing you are stressed out about really is. Now, if you happened to be Izilor Esasc and had his kinds of things on your mind, I can understand stress, but really. Will the world end if you accidentally blew off your boss? No. And you'll probably get a better job when you're fired. So look on another side of life, and realize how little these things matter.

Self Help Post #1

"Think about nothing."

Okay, now I'm going to kick off my self-help series. Hopefully you'll all be helped. I take no responsibility for anything that may go wrong.

Step one: Think about nothing. Concentrate on your breathing. Be one with the world. Slouch. Be completely relaxed. Realize that you can do nothing if you so choose. Note: This exercise is not good while cooking.

Do this about twice a day.