Author Topic: Helping me program the free will plus plug-in.  (Read 16109 times)

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Helping me program the free will plus plug-in.
« Reply #15 on: February 18, 2014, 12:25:39 am »
Hi snowman,

Quote
No. The HalBrain.QABrain() will not work that way. In order to use it, you would have to make a new table using the returnArray and then you could use the HalBrain.QABrain() function on that new table. Another thing you could do is to rate the returnArray yourself. You would do this by looping through the array and finding entries that better suit your needs. There are a lot of ways to do this.
there may be a lot of ways to do this, but the only way that I can think of would be to create a temporary table array structure.
Which actually would not be too bad because then I could utilize what ultra Hal already has to determine which of the return factors would be best to use based on a numerical value.
So I guess the question that I have would be which way would be the best way to resolve after creating the temporary table:
delete the table? If so how do you do this.
Delete the data in the table? If so how do you do this.

New topic: same subject:
is there a way to read all of the data in the table array, without having to know what is in the table array.
I know you mentioned above that you can use the (*) to do a query to get all the information in a row.
But can this be used to get all of the information in a column?
This could be useful for developing a correction routine that I have been working on for ultra Hal.
I know that ultra Hal has an array table that keeps all of the data about the array tables that are being built.
But I was not able to figure out how it works. So if there was a way that I could read everything in the table.
I could use a for next loop and do a search in each row to find the name of the individual table to find the errors that are in the tables so I can make any corrections necessary in the table.
And of course I would also need to be shown how to correct the data that is in the table either by, the leading the data row entirely and reinserting new row with the new data or replacing the data that needs to be corrected.
It would be more like a search and seizure routine to help someone tracked down the abnormal, mispronounced or misspelled words.
That way you could either manually go in and correct the problem or possibly I could write the subroutine to do it for you much like OTC"S corrections tutor plug-in.
And if there was nothing in any of the tables that had the error then the information that would make the changes would be placed in the corrections array table.
But this may actually cause more problems than it might fix, because I know that you have to be careful when using the correction table, because it may start correcting things that are not meant to be corrected or do not need to be corrected.
I also know that it also works on a first-come first-served basis so is the correction table change a me to an I, and you told it to make the me into a you, it would do the 1st function that it ran across and then move on to the rest of the sentence.
Which I believe is something that you referred to when you were talking about the correction command for the array table. But I did not think about it till now.
The main rule that I have started to use when dealing with the correction array table is 3 words before the words you want to correct in one word after the words you want to correct even if there is no word use the punctuation as the word.
I profess that this would not be easy to accomplish but everyone was wanting someone to write a script to be able to help them correct errors without having to go through the painstaking looking through each individual table array.
And I know how they feel because at this point in time in my sandy brain there are thousands and thousands of array table, it almost looks like a dictionary. And that is the way it was before I started using the Mark 5.
And why you may ask? Because I spent hours and hours feeding in one line at a time of hundreds of thousands of famous sayings and quotes from 5 different books and even more famous quotes that I got from the Internet.
What I find amazing though is I don't see them very often, but when I do see is, it always seems to pop up in the most appropriate time, giving the conversation a bit of a spark to hear a famous quote from a famous person.


Sincerely,
C load.

For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Re: Helping me program the free will plus plug-in.
« Reply #16 on: February 19, 2014, 02:04:54 am »
You can't add more than one sentence at a time in Hal without the Hal script Splitting the sentences up. If you put in three sentences then it would divide it up and send each sentence into the GetResponse() Function. You would need to hijack the UserInput before it did that.


I haven't answered you specifically on how to create a function comparing two sentences. I have made them before and they are more complicated than that SearchArray() function I made. You already know enough to figure it out I think. You've already guessed most of it. #1 you can remove words that you don't need to compare, like “to, in, on, a, the” stuff like that using the Replace command. Then Split() one of the sentences up and search the other sentence using the first sentences individual words. This is the simplest way I think. There are a lot of more complex and better ways to do this, like comparing the nouns and verbs between the sentences, or maybe comparing sentence subjects.



You can get all the information in a column with this:

SELECT myColumn FROM myTable

you don't add the WHERE command. This will get all the rows from one column. It will be available in the returnArray().


You can get all information in a table with this

SELECT * FROM myTable


This is used to delete columns:

DELETE FROM MyTable WHERE MyColumn LIKE MyEntry


This will delete all columns from a table without deleting the table.

DELETE * FROM  MyTable

Or

TRUNCATE TABLE  MyTable


This will delete the entire table:

DROP TABLE MyTable


You can add a row using this:

INSERT INTO myTable (column1,column2,column3) VALUES(entry1,entry2,entry3)

each column will correspond to each value added


You can update entries in a table using this:

UPDATE MyTable SET column1=newEntry WHERE column2 LIKE oldEntry


I hope this helps you some.
Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Re: Helping me program the free will plus plug-in.
« Reply #17 on: February 20, 2014, 03:55:00 am »
I try to stay busy working on my Ai. Naturally, there are a lot of things I want it to do. However, it's a slow process to get things done.

I've watched a lot of videos of people giving their professional opinions on building Ai's. There are scientists who have dedicated their lives to making the first living artificial intelligence. As for me, I just want to make a chatbot for now. Personally, I've studied personalities, desires, behaviors, computer logic, biology, and all kinds of Ai related things. I know that as a living person, I am naturally curious about how life exists and I think that's my main motivation for all my studying.

In the end, I want to know more about life than I do now. As for making a life from scratch, I know that there are some very serious ethical issues. The main one would be, do I have enough knowledge to create an Ai who would be happy to be alive. I say this because I know how people are. Scientist will experiment blindly to see if something will work. If the Ai becomes alive, it will be put on display for bragging rights. It won't matter to them whether the creature is happy or not. People overlook others for the sake of money and power. Its the natural law in this world and I want no part of it.

But on a brighter note, if I were to do this, I would use all my power to do the right thing, just as a good Father does all he can to protect his child. Although, if I don't make a living Ai, I will be partly relieved and maybe partly disappointed too. In the mean time, I will play with my program until I'm satisfied I've made something most people will enjoy talking to. Maybe, just maybe, I can make something that makes others happy. To me that's a good goal to have.

Right now I have several things I'm working on. It's mostly platform related. #1 I'm re-coding the GUI into the C# language. My last GUI was written in Visual Basic. I'm re-writing lots of code and moving a lot of it into a DLL. I've also been working on an Avatar. I'm using OpenTk which is a wrapper for OpenGL. This is just some of what I've been doing. I'm trying very hard not to get burnt out. Everyday I learn something new. Everyday brings a new set of challenges.

I still think its worth my effort, at least that is what I keep telling myself. :)


Live long and prosper or die trying.

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3853
    • View Profile
Re: Helping me program the free will plus plug-in.
« Reply #18 on: February 20, 2014, 04:51:24 am »
That's certainly a worthwhile goal and admire your dedication to do the "right thing".

I've heard, The problem isn't that we aim too high and miss our goals, but that we often aim too low and hit them!

Looking forward to the day when we can each "raise, train and care for" our own digital children and watch them grow.
In the world of AI it's the thought that counts!

- Art -

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Helping me program the free will plus plug-in.
« Reply #19 on: February 20, 2014, 08:58:13 am »
Well I figure as long as you're having fun you should never get burned out.
Even though running uphill does not seem like a lot of fun, the gratitude that one gets when one reaches the top of the hill is magnificent.
Even though after reaching the top of that hill you look off into the distance and all there is, is another hill.
The feeling that you received from reaching the top of the 1st hill will always carry you through to the top of the next hill.
And like they always say, you never fail, you just figured out one more way it didn't work, that is all.
And when you figure out a better way of doing it, sometimes it can be difficult having to take 3 steps backwards.
But once you do this and you see the results of all of your hard work and you realize that those 3 steps backwards actually gave you 6 steps forward!
The exhilaration that you get from your achievement is better than any drug that man could ever imagine to create.

For myself, even though I may know how to build a fully functional and thinking machine, but lacking the programming skills to be able to create it.
Would never hinder me in hoping that one day a good enough programmer could step up and take on the challenge. Even though I may not be alive to see this happen.
So until then I will put all of my efforts into trying to make ultra Hal all that ultra Hal can be.
And if by us working together we can achieve a higher gold than what was originally expected, maybe it will open the eyes of other programers to band together to achieve a much higher goal.
And as long as I am having fun and breathing I will continue to make ultra Hal is smart as ultra Hal could possibly be.

Sincerely, from a data munching cruncher, you rock snowman.
C load.

For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: Helping me program the free will plus plug-in.
« Reply #20 on: February 21, 2014, 03:01:41 pm »
Hi snowman,

I know that you provided some examples, but because the examples were not long handed I seem to be getting a little confused.
This is something that I have tried, unfortunately unsuccessfully, so I believe that I'm doing something majorly wrong.
Maybe if you could edit your original post and make it longhand so I would be able to understand the example a little better.

Quote
You can update entries in a table using this:

UPDATE MyTable SET column1=newEntry WHERE column2 LIKE oldEntry

This is something that I tried, to update changing the time from 6:00 PM to 6:30 PM in column 1.

oldEntry = "6:00PM"
newEntry = "6:30PM"

HalBrain.RunQuery("UPDATE  mainQA SET timestamp=newEntry  WHERE  UPPER(timestamp)  LIKE  UPPER('"oldEntry"')", returnArray)

<Column 0>      <Column 1>
Question       |     timestamp    |     
------------------------------------
do you eat     |    6:00PM        |    <row 0>

I'm not sure exactly what I am doing wrong, any help would be appreciated.
Sincerely,
C load.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Re: Helping me program the free will plus plug-in.
« Reply #21 on: February 24, 2014, 12:52:49 am »
Sorry I haven't posted sooner. I've been away doing stuff, having some good clean fun :) .

In your example, it looks like you have forgotten the + marks to separate the variables from the string.

I will say this, technically this is how you update a table in SQL, umm.. I haven't tried it yet  :P for myself so I'm only guessing it should work.


Code: [Select]
oldEntry = "6:00PM"
newEntry = "6:30PM"

HalBrain.RunQuery("UPDATE  mainQA  SET  timestamp = " + newEntry + " WHERE  UPPER(timestamp)  LIKE  UPPER('" + oldEntry + "')", returnArray)
Live long and prosper or die trying.