Thread: Forum Auto-Responder

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    10

    Forum Auto-Responder

    I have had the idea of cross linking a FAQ with message boards, so that responses can be given to questions that have been previously answered.

    Can I get a hand with this?

    I am willing to learn c++ if someone can walk me through it.
    I have some fortran and html, logic and variable college.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    usually a C++ board is for people who KNOW c++... but ill help u get started.

    first project : make a program that says "hello world". if u can do it ill help u. if not ur hopeless

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    10

    am I warm?

    #include <iostream.h>

    void main(void)
    {
    int borp;

    borp = 2;

    switch (borp)
    {
    case 1 : cout << "One." << endl;
    case 2 : cout << "Hello" << endl;
    case 3 : cout << "World" << endl;
    default: cout << "!!!!!!!?" << endl;
    }

    }
    Last edited by rev_happy; 03-23-2002 at 06:04 AM.

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    that is likely to compile, but depending on the desired outcome may not give desired results.

    This board has a FAQ button in the upper right hand corner of the screen and there is a FAQ board as well if you go back to CBoard and scroll down the board options.

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    easier and more practical way :
    Code:
    #include <iostream.h>
    
    int main()
    {
            cout<<"Hello World";
    }
    you trying too hard

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    And here is how you would make yours work:
    Code:
    #include <iostream.h> 
    
    void main(void) 
    { 
    int borp; 
    
    borp = 2; 
    
    switch (borp) 
    { 
    case 1 : cout << "One." << endl; 
    case 2 : cout << "Hello" << endl; borp = 3;
    case 3 : cout << "World" << endl; 
    default: cout << "!!!!!!!?" << endl; 
    } 
    
    }

  7. #7
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Denethor, hate to break it to you, but what you added is useless. The commands will continue to go through because there is no break used.

  8. #8
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    if you wanted all those to display you could go:

    PHP Code:
    #include <iostream.h> 

    void main(void

         for (
    int borp=1;borp<4;borp++)
         {
              switch (
    borp
              { 
              case 
    cout << "One." << endl
              case 
    cout << "Hello" << endl;
              case 
    cout << "World" << endl
              default: 
    cout << "!!!!!!!?" << endl
              }
         } 


  9. #9
    Señor Member
    Join Date
    Jan 2002
    Posts
    560
    Nope. It should be
    Code:
    #include <iostream.h> 
    
    int main(void) 
    { 
         for (int borp=1;borp<=3;borp++)
         {
              switch (borp) 
              { 
              case 1 : cout << "Hello" << endl; break;
              case 2 : cout << "World" << endl; break;
              default: cout << "!!!!!!!?" << endl; break;
              }
         } 
         return 0;
    }

  10. #10
    Registered User
    Join Date
    Mar 2002
    Posts
    10

    Lightbulb it DOES compile

    the output looks like this:

    hello
    world
    !!!!!!!!?

    This program contained a logic flaw that made it look like it returns a improper response, but it does work, I compiled it on a jave editor just to be sure.

    Now I passed this simply test, and didn't try at all, in fact, you made it simple enough to have a little fun, that's all. I wan't trying hard, just being a smart ass and challenging your minds!

    I can't beleive this brought three responses, and only one thought about the original question.

    It is too complicated for me, but I imagine with a little guidance, I will get it done.


    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    The idea is a simple one though, eliminate FAQ's entirely, by turning users into FAQ holders.

    So lets say I hold a list of my answers to FAQ in this suggested program. I log on to a board, the program loads recent queeries, searches them and returns a match to my faq #3

    The program then logs in as me, and posts a reply.

    if I see a queery that matches a stored response, but did not match because the title was different, I can link that title to the correct answer

    if I see a new queery I can answer. I answer it, and update my faq list to include the new faq #400

    I would like it do be able to "tree" responses, so that any common responses to my answers on #3 or #400 can be tracked and posted when applicable

    I would like to search multiple boards.

    I would like to be able to update #3 or #400 on my list, and auto update all the #3's and #400's on every board at once.

    so lets say your problem was FAQ #3:
    How do I write a program that output's "hello world"
    I would start the autoresponder, and since I have an answer,
    it would respond with my answer
    Other people with the same autoresponder and question would respond with their answers
    Any response to my program that states"You are wrong"
    would be met with my autoresponse #3.1 "Compile it"
    If someone replies "It won't work"
    I would be notified of an unanswerd response, and would just make and title matching "It won't work" return answer #3.1
    I could change my response to match DeEntheors, since his is the most efficient, and it would change #3 to reflect that update
    And I could set this to log in, post and update at seven different c++ boards.

    I hope this little program helps us all,
    Rev Happy

  11. #11
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    My philosophy is if you can think of it, you can do it. It may take you twenty years of study/attempts, but then nothing in life is free.

    Can such a program as your last post describes be written---probably, but it would be difficult to do. The biggest hurdle I see is how to find "matches". Unless we all turn into robots so our use of language is exactly the same there will be an (almost) infinite number of ways to ask (and probably answer) the same question. How the computer distills a given question down to a basic, standard question that can be accessed using a FAQ list would be impressive. (search engines would be the best current approach I know of and look how many "responses" they "find" to a simple question/search parameter.) Also, there is variety of possibilities as to how to do even simple procedures such as formatted ouput, use of files, or even how to put "hello world" on the screen. So once you distilled the question down then you would have to have some agreed upon mechanism to describe what the "best" response would be.

    If you wish to pursue such a program, good luck. You will undoubtedly learn a lot along the way. Maybe you'll even come back and share some of that new knowledge here on the board.

  12. #12
    Registered User
    Join Date
    Mar 2002
    Posts
    10

    Excellent answer

    And you are correct, that is the hardest part. But the solution to that, as stated above, is to have the user match up the right answer to the right question.

    Therefore, if someone else asked the same question a different way, you don't have to re-answer, you would just apply the pre-existing answer to the new form of the question.

    The program would just match the right answer to a pre-set list of the same question.

    And here is how I hope to begin:One step at a time.

    If one or more of you is willing to help, I am told this one step would take a little more then a few hours.

    I know of a un-cookied message board. It has a simple form to post a message. If we can create a program that automatically posts a message to this board, it is the first step.

    the variables are:
    message board address

    post referance

    title of post
    body of post
    email on post
    name on post

    the message board address will be constant in this step
    the post referance will be constant in this step

    the e-mail and name are not required and inconsequential

    the title and body will be a constant in this step as well.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    so the first step would be a program that refers to a form
    fills in the title and body
    preveiws it and posts it

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    The second step would be to have it check for that post on the board first, so as to not post duplicates(if find(title)=yes then do not post)

    The third step would be to set up for multiple posting to the same board, on different topics(post referance)

    The fourth step would be to set up for multiple boards at the same site(message board referance)

    and then so on.

    Can anyone help me do this?

  13. #13
    Registered User
    Join Date
    Mar 2002
    Posts
    10

    first hack at it

    PHP Code:
    #include <iostream.h>
    #include <fstream.h>
    #include <string.h>

    struct qtype {
       
    char board [80];
       
    char title [80];
       
    char body  [80];
    }

    void getboard (qtype item);
      { 
    ifstream sourcefile ("board.txt");
        
       if (
    sourcefile.fail())
          
    cerr << "Error opening board.txt...";
       else
          (while ! 
    sourcefile.eof());
             
    strcpy (item.board);
             
                 
       
    sourcefile.close();
       return;
    }

    void gettitle (qtype item);
      { 
    ifstream sourcefile ("title.txt");
        
       if (
    sourcefile.fail())
          
    cerr << "Error opening title.txt...";
       else
          (while ! 
    sourcefile.eof());
             
    strcpy (item.title);
          
                 
       
    sourcefile.close();
       return;
    }

    void getbody (qtype item);
     {  
    ifstream sourcefile ("body.txt");
        
       if (
    sourcefile.fail())
          
    cerr << "Error opening body.txt...";
       else
          (while ! 
    sourcefile.eof());
             
    strcpy (item.body);
          
                 
       
    sourcefile.close();
       return;
    }
     
    void output {
       
    cout << board << endl;
       
    cout << title << endl;   
       
    cout << body  << endl;
          
    }

    return 
    0
    Ok, this is in hopes to prove to you all that Im serious.

    It is supposed to load the seperate parts from board.txt, title.txt and body.txt and print them on the screen.

    I am not sure if it compiles. I also do not know how to referance the form, and fill in the blanks wit title and body yet.

    So if there is advice handy, does this compile, in not, why not?
    and how do I open the form, and fill in the blanks, and press preveiw, and then press post?
    Last edited by rev_happy; 03-27-2002 at 04:44 AM.

  14. #14
    ‡ †hë Ö†hÈr sîÐè ‡ Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    If you want to solve a large problem. BREAK IT DOWN.
    I won't write the code b/c i'm in the middle of class, but do a little design first.

    1.) What's the problem to solve?

    Making an auto-responder to a web based form.


    2.) What will be the main functions of this application.

    To post a reply to a question ask ONLY when that question has returned a large number of results from a search quary.

    Steps To Take:
    1.) When a new post is made, run it throught a search.
    2.) If the search had a high number of relvent returns, then post a reply stating that.

    A program like this would not be hard to code at all.
    The main idea is to keep it simple.
    Don't turn a complex problem into a NIGHTMARE.

    btw sorry about the spelling. I'll run spell check when i get home.
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

  15. #15
    ‡ †hë Ö†hÈr sîÐè ‡ Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    Opps forgot to talk about the search method.
    Ok. I have a very good search function that i will post later.
    Its my personal code so please respect that!!!
    I'll have to port it tonight b/c its writen in php.

    So you have a new question to search for an answer to.
    Here is how i would do it.

    Step 1) filter useless words out of the question.
    Step 2) search for words that match and determine there relevance*.

    Step 3)total the number of matching words and there relevancey* and average them.

    Ok. comfused let me explain.

    *Relevancey ---
    Take words in the title and in the first line of the post and give them a rating. say 2. everything else will have a rating of 1

    For each post searched the total rating( tRaing) -all the found match's rating added together-
    And divide that by the total number of matches found. Then order them by ratio. Number of matching words divided by the total number of words


    I've writen this in a hurry so if i let anything out just let me know
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code: An auto expanding array (or how to use gets() safely).
    By anonytmouse in forum Windows Programming
    Replies: 0
    Last Post: 08-10-2004, 12:13 AM
  2. ASP.net forum that supports Access
    By Grayson_Peddie in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 12-18-2003, 01:44 AM
  3. The Contest Forum has switched
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 08-16-2002, 03:10 PM
  4. Assembly forum
    By Garfield in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 11-18-2001, 08:03 PM