Last Good Quote: Son's are the seasoning on our lives. - Someone on Facebook

Thursday, July 26

Random Link: Foxmarks

Allows you to sync bookmark across different computers.

If you use Firefox on more than one computer, you'll want Foxmarks. Install Foxmarks on each computer, and it will work silently in the background to keep your bookmarks synchronized. As a bonus, log in to my.foxmarks.com from any computer anywhere to access your bookmarks.

Wednesday, July 25

Creating AI - Who Knows

In the last article I talked about a program that would learn like a new born baby. This article may or may not make sense if you have not read the last one.

For a new born baby life consists of inputs, actions and expectations. I have already discussed inputs. I would like to discuss actions and expectations.

The actions that a new born can take are fairly limited. It can cry, coo, sleep and poop. Breaking those into generalities; a baby gives negative and positive feedback, recharges and discharges.

SideBar: For the sake of my sanity we will leave pooping and discharging out of the rest of this conversation. (Let's act older then 6 here boys and girls)
Our "Baby Program" has the ability to give negative feedback, *waaa*, and positive feedback, *coo*, so far so good. Now comes the hard part deciding when to do what.

When does a new born make it's first choice? When it first realizes it's hungry of course. The baby's belly begins to hurt and then he needs to do something about it.

You could say that the baby is driven to want to be feed. And he is driven by the pain he feels.

Our "Baby" program has no built in wants. In addition to this is has no built in pains either. I believe we need to implement some more rules.

Our program will have one want, it wants to learn how to do things it has not done before. When it is not learning anything new it suffers from pain.

How will we implement this?

Rule: When there is no input, take an action (output) that you have no expectation for and perform it.

Rule: All actions (outputs) will have a reaction (input) associated with them.

Rule: Each time an reaction (input) is added to a reaction relationship it should strengthened that relationship.

Rule: Different inputs to the same outputs get linked as things that are alike.

Doing this will allow the program to learn or gain an expectation from an action. As a side rule we should note that if the program takes an action and gets no immediate input from the action, that is not saved as a reaction.

An Example Interaction:
> Baby: *waaa*
  • Baby wants to learn something new, this is an action that he does not have an expectation for.
> User: What's wrong?
  • At this point, the Baby adds saying "What's wrong?" to it's action list
  • It also links "What's wrong" as a reaction to *waaa* with a strength of 0
> Baby: *cooo*
  • Baby wants to learn something new, this is an action that he does not have an expectation for.
> User: Oh you like me, huh
  • At this point, the Baby adds saying "Oh you like me, huh" to it's action list
  • It also links "Oh you like me, huh" as an reaction to *cooo* with a strength of 0
So a million conversations go by....Baby never gets any relationship with a strength above 0 until one day someone repeats some thing that the Baby has heard before.

>Baby: Yo, how you doing?

> User: Oh you like me, huh
  • Baby adds one to the relationship "*cooo*" -> "Oh you like me, huh"
Well I seemed to have gotten myself lost...maybe I will try this again soon.

Feel free to comment and help me out.

Creating AI - The Baby

In a previous post, I discussed an article I read which compares how humans think to how machines think. In the next set of posts I'm going to explore this concept a bit.

Sensory Input

It all starts with sensory input. So what sensory inputs does a program have? I can think of a number of them but I will limit myself to text for the time being. (I reserve the right to branch out though!)

Let's look at how a new born baby starts to recognize things. I think the first thing a baby recognizes is momma's milk. (some might say it's momma nipple, but let's keep it PG13, huh *hey geekboy get your mind out the gutter*)

A baby drinks milk for the first time, he doesn't know what it is but he knows he likes it. The taste and smell of milk gets stored in it's memory as well as the fact that he likes it. (Hey look it's a boy!) At this point life consists of smells and tastes that are milk and not milk. Anything that is milk he likes, the jury is out on anything else.

Following that logic, when the "baby" program encounters text it stores it in it's memory, however it knows nothing about it or what do with it.

Side Bar: It's important to note that the baby did not store multiple memories of the milk. Therefore the "baby" program will not store multiple versions of the same text.

Sounds simple so far...
Side Bar: I've always noticed that nature uses simplistic methods to create complex results, thus a side objective with this program is to keep the rules extremely simple.

With that in mind, the following logic is applied to all sensory packets that come into the program.
Each saved object will have a "goodness" attribute

If the program get a "bad" vibe from the object, subtract one

Otherwise add one to it's goodness attribute


I know, I know the brighter bunch of you are screaming...How does a program get a "BAD VIBE" this guys is full of .... Well hold on a second, put that issue to the side for a second, I promise I'll come back to that in the next session.

Using these rules what would the following set of inputs give me? Assuming that "b" gives a off a "bad vibe".


IN MEMORY
--------------------
a a: +1
a a: +2
a a: +3
b a: +3, B: -1
a a: +4, B: -1
b a: +4, B: -2
a a: +5, B: -2



OK, final step, we will now give the baby program two responses, one negative..."waaaa", and one positive *cooo*. Using the above mentioned rules interaction may look like the following:


IN OUT
--------------------
a *coooo*
a *coooo*
a *coooo*
b *waaaa*
a *coooo*
b *waaaa*
a *coooo*


At this point the baby progam has learned to like the letter "a" and dislike the letter "b"

Here is a basic summary of the rules our "Baby Program" follows:
Rule 1: Incoming text is saved and assigned a goodness value of 0

Rule 2: If text gives off a "bad" vibe from the object, subtract one

Rule 3: If text gives off a "good" vibe from the object, add one

Rule 4: If goodness value is positive, output *cooo*

Rule 5: If goodness value is negative, output *waaa*
The next section will go into how the "baby" program gets a good or bad vibe from input.

Random Links

Here's a detailed explanation of how to use css to create sprites from a sprite sheet.

If you don't know what that is, it's not for you.

How Do You Solve Problems?

I was reading a very interesting article by Steve Pavlina called How the mind really works, if you haven't visited his site please do!

He was examining how the human mind solves new problems that it has not encountered before. He then compared that to how computers handled new problem solving. I found this to be very interesting.

I'm going to list a couple of comment he made and add some thoughts to them:

"The reason [we can still recognize patterns in a split second that a computer can’t figure out with days of continuous processing] is the unique way human beings store and process patterns. "

Store and Process. I can agree with this. I am curious to know if there are systems that attempt to mimic the way human's store information. I know there are neural nets, but from all I read they appear to mimic the thought process rather then the storage of information.

I am curious to know if there are systems out there that try to mimic the way human's store information. I know there are Neural Nets out there but from what I have read they appear to mimic the thought process rather then the storage of humans.

Your mind stores and processes information in what are called invariant representations.

Your mind strives to identify and save general patterns


Just to clarify, he goes on to state that the memory is stored in some sort of "fuzzy" pattern. This pattern is what is known as a invariant representation. This does not change, we just re-categorize it.

Your entire life’s worth of knowledge is stored in your mind as associatively linked, hierarchically organized, invariant representations.



An interesting exercise would be to come up with a system that could store and retrieve information stored in this fashion


You don’t need to process the complex sensory data from the car the same way you did the first time you saw a car.


This line made me think, the mind must have a way to take a complex set of data and distill it down to a general representation. Perhaps when we encounter something for the first time we make many representations for it. We then delete the incorrect one's until a particular one fits the mold. All the representations that we deleted are then stored as "like" representation. "It looks like a car but not quite." Maybe this is the way the mind goes from the representation of something unknown to the representation of something known.

There must be some basic representation models that we start from and we build our entire library from these...IE: All items fall into an Alive or Not Alive representation.

I think the reason your mind stores the unexpected experiences in far greater detail than the routine ones is to give it the opportunity to later process those memories into invariant forms.

I thought that this line of thought fits easily into my thinking.

Another way of saying this is that the more intelligent you become, the less you’re surprised by reality.

A great quote. If it fits a representation I know then it will not surprise me that it exists.

To sum it all up, a great article to get you thinking about how you think.

Odd Sight While Driving Home

So I'm driving home yesterday. My normal route home takes me threw a rougher neighborhood. Definitly not "da hood" or anything, it's just run down and you can see a number of odd characters about.

Anyway, As I'm driving, I pass a guy with a broken broom handle in his hand, about 3 feet worth of pole, his shirt is ripped. He has this scowl on his face and he's walking very strongly. (I know odd use of the word but it catches what I saw)

About half a block down, I see this woman, dressed relativly nicly, she's holding a baby in her arm and she's doing this odd half run, skip and fast walk thing. And I notice that she keeps looking over her shoulder.

My gut instinct says that something's not right but as I glance in the rear view mirror I see her smiling and laughing.

Hummmm, I drive about 3 blocks and then I turned around. (Don't ask me why, I ain't that much of a fighter) I drive back and she's gone. ???? However the mad guy has turned down a side street and is walking in another direction.

As I drive down the three blocks again, I notice a daycare and a bus station. I concluded that she must have been running late and was trying to get to the daycare and catch the bus? I guess...It was an odd situation, I'll probably never know what happened. Oh well.

Here's a link on how to make a citizen arrest. (If I ever need to)

Random Links

Just a bunch of interesting links I found:

Visual View of Hot Sites
A bit confusing but interesting

Wierd Words
Amusing, if you have time.

How to make a Citizen Arrest
Might have come in handy

LastFM
Online Radio, I'm always looking for good stations.

Monday, July 23

How Do You Like to Learn?

http://www.metamath.com/multiple/multiple_choice_questions.html

Take a short test the best way to learn new things.

My results:
The Visual/ Nonverbal Learning Style
You learn best when information is presented visually and in a picture or design format. In a classroom setting, you benefit from instructors who use visual aids such as film, video, maps and charts. You benefit from information obtained from the pictures and diagrams in textbooks. You tend to like to work in a quiet room and may not like to work in study groups. When trying to remember something, you can often visualize a picture of it in your mind. You may have an artistic side that enjoys activities having to do with visual art and design.

Friday, July 20

A Group is it's own worst enemy

Summary of web article: http://www.shirky.com/writings/group_enemy.html

This article was written in 2003 and deals with how online group dynamics work.

How is a group its own worst enemy?

You are at a party, and you get bored. You say "This isn't doing it for me anymore. I'd rather be someplace else. I'd rather be home asleep. The people I wanted to talk to aren't here." Whatever. The party fails to meet some threshold of interest. And then a really remarkable thing happens: You don't leave. You make a decision "I don't like this." If you were in a bookstore and you said "I'm done," you'd walk out. If you were in a coffee shop and said "This is boring," you'd walk out.

You're sitting at a party, you decide "I don't like this; I don't want to be here." And then you don't leave. That kind of social stickiness is what Bion is talking about.

And then, another really remarkable thing happens. Twenty minutes later, one person stands up and gets their coat, and what happens? Suddenly everyone is getting their coats on, all at the same time. Which means that everyone had decided that the party was not for them, and no one had done anything about it, until finally this triggering event let the air out of the group, and everyone kind of felt okay about leaving.

Important Facts:
  • You cannot completely separate technical and social issues.
  • Core Group - Members are different than users - "the group within the group that matters most."
  • The core group has rights that trump individual rights in some situations.
  • Design Handles the user can invest in
  • Design a way for there to be members in good standing. Who is in the Core Group
  • Barriers to participation
  • Find Ways to spare the group from scale

Thursday, July 19

Email Brevity

The art of brevity. Try getting all your email responses to be in five sentences.

five.sentenc.es

Things to Remember: Negotiating

In negotiation, the one thing that really strengthens your position is the ability to walk away from the deal.

Negotiating from a position of real need is a bad, bad situation. You are almost certainly going to lose. The other party will push until they find your threshold of pain.

Read More...

Google Gadgets Venture

Google is offering a competition. They will seed a few small business who wish to develop google gadgets.

Read More

Wednesday, July 18

Link: Ways to speed up your computer

Here is a screencast showing some ways that you can speed up start up and shut down times.

I have an emachine at home, I just put in a new motherboard and it keeps looking up after about 15 min of use. This may be a good way to fix that.

Daily Cup of Tech: Screencast

Random: Cast Spells at Your Computer

An article on how to make your computer do things by saying a magical spell. Neat idea, I may install it!

Instructables

Random: "Where did I come from"

So my son, who is 8 years old, has been asking me about "relationships" and where he came from.

I got this great recommendation from a friend.

"Where did I come from" by Peter Mayle

I'll let you know how it works out.

Journal: Seeing the Forest AND the Trees

There are two types of developers. One likes to focus on the details, optimization and algorithms to solve a problem. The other likes to view the problem from a distance and figure out a better solution.

Any development solution has to be looked at and developed from these two perspectives. First is a large view or the "whole picture" as soom of us like to say. The other is the details, the nitty gritty of the problem. All good developers have the ability to "zoom" in and out, changing their perspectives as needed.

What accured to me is what perspective do we tend to naturally fall into. Give yourself this scenario: Let's say you are half way through a project and you starting a new day. Do you start with the "whole picture" and "zoom" in? Or do you find out where you left off, do a little coding and "zoom" out to make sure you have the whole picture in mind?

I like to zoom in. I tend to start my day by looking at things from the big picture and zooming into the detail.

I don't think either way is necessarily better, they are just different.

Monday, July 16

Interesting: Web Based Web Crawler

Interesting bit of code, I would like to "play" with and see how it works.

http://snippets.dzone.com/posts/show/3853

"This is based on Web crawler code I found on this site. This version allows your to run the crawler from a Web page, instead of from a command line, and output the results to the Web page. This would be useful for someone who wants to harvest links for a search engine or for someone who works for a Web security company and wants to harvest suspicious URLs for inclusion in a database."

PHP Code: Validate Email Address String

A bit of code that will use reqular expressions to
validate an email address.

URL: http://snippets.dzone.com/posts/show/4022

<?

function validate_email($email){

$exp = "^[a-z\'0-9]+([._-][a-z\'0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$";

if(eregi($exp,$email)){
if(checkdnsrr(array_pop(explode("@",$email)),"MX")){
print("$email is ok.
");
}else{
print("$email is ok. But domain is not.
");
}
}else{
print("$email is not ok.
");
}
}

validate_email("shantanu.ok");
validate_email("shantanu.ok@gmail.com");
validate_email("shantanu.ok@fsjaldkfjlsfjsljflsfjsldk.com");

?>

PHP Code: Get Root Folder

The following snippet will return the root path of a file. This is usfull when running an include within an included file. Sometimes you don't know what directory it will be excuted from

ULR: http://snippets.dzone.com/posts/show/4210

function
getCurrentDirectory() {
 $path = dirname($_SERVER['PHP_SELF']);
$position = strrpos($path,'/') + 1;
return substr($path,$position);
}

Link: Display Images in Folder

Displays all the images in a folder

From Snippets:

http://snippets.dzone.com/posts/show/4259

Great Quote

Found this great quote:

The statistics on sanity are that one out of every four Americans is suffering from some form of mental illness. Think of your three best friends. If they're okay, then it's you.
-Rita Mae Brown

I don't have any friends I would say are crazy just different. Does that make me the crazy one?


New Game: Blade Warriors

Haven't posted in a while, I figured I'd let all seven of my readers know what was going on.

I built a new game called Blade Warriors. It came out of some of the previous blog entries.

It's got a couple of cool things going on. There is an isometric grid being displayed. This grid is built with javascript and css. I used a familiar layering technique.
  • Build the floor first
  • Each tile is it's own div with a unique id (IE: tile_x_y)
  • Lots of complicated mathmatics to get the exact positioning right, I just kinda played with the numbers till they all fell into place.
  • Once the floor is built I then place objects on top of the tiles
  • Once the objects are there I placed the unit images on top
The game runs well right now, I'm working on getting some users to come to the site but it seems when ever I make a post I get a small increase in users and then it drops back to around 50 people a day.

I'm going to go back and examine my analytics log and see what's happening there.

Followers