Page 2 of 2

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:08 am
by thbp
I MADE THE SAME MISTAKE YESTURDAY ON MY CALCULATOR (wich i'll post if others want me to) GOOD LORD

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:08 am
by Fallental
You know more c++ then i do!

Well

i just need to know, if you can help, where do i put my xml database and what is the code to access it and run through alll of the defs.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:13 am
by thbp
Umm i don't
just google it man google xml file creation/editing anything really and manipulate it (edit snipt what ever) to make it fit yourse (make sure you leave any copyrites though)

usually i'd leave it in a basic one file or a folder that has the list of the word as the file name then the xml is the dict (subject verb and then def) stuff like that

here

http://www.ibm.com/developerworks/xml/l ... ctlbx.html
http://xerces.apache.org/xerces-c/
http://www.codeguru.com/cpp/data/mfc_da ... php/c4317/


hope these help some (all i could find) wait for someone else to beable to answer more in depht

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 10:31 am
by hurstshifter
If you are looking to create a dictionary program where you can Search, Add, Delete entries then I would strongly recommend researching how to create a linked list. When I was learning C, the first program I made on the topic of linked lists was a dictionary. Not only will this work for you but it will also teach you a thing or two about structures and pointers. Don't f* around with xml or anything else yet.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 10:44 am
by thbp
Why may i ask,,, can one not use xml? why not?

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 11:14 am
by XianForce
thbp wrote:Why may i ask,,, can one not use xml? why not?
"Anyone" can use XML. I think hurstshifter is referring to Fallental's coding experience. Since Fallental is a beginner (right?) he/she shouldn't try using some other thing implemented with C++. He/She should focus on learning more advanced C++ topics and using them at his/her disposal.

But yeah, linked lists are a great idea for a dictionary. That would make it real easy to add commands like "/next word" or "/previous word".

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 11:34 am
by hurstshifter
XianForce wrote:
thbp wrote:Why may i ask,,, can one not use xml? why not?
"Anyone" can use XML. I think hurstshifter is referring to Fallental's coding experience. Since Fallental is a beginner (right?) he/she shouldn't try using some other thing implemented with C++. He/She should focus on learning more advanced C++ topics and using them at his/her disposal.
This

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 12:55 pm
by thbp
oh ok, just wondering i thought maybe there wa something wrong with doing it with xml

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 1:26 pm
by Bakkon
This thread makes my head hurt.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 4:30 pm
by Fallental
@hurtshifter - Thank you hurtshifter! :) thanks for the advice

@bakkon - lol i am sorry

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 4:45 pm
by Innerscope
Bakkon wrote:This thread makes my head hurt.
Agreed.

Also, you might not want to use a linked list for a dictionary because you need fast indexing. An associative array or hash table would work better. Where you would have "keys" and "values" associated with those keys.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sun Dec 20, 2009 10:04 pm
by dandymcgee
XianForce wrote:
thbp wrote:Why may i ask,,, can one not use xml? why not?
"Anyone" can use XML. I think hurstshifter is referring to Fallental's coding experience. Since Fallental is a beginner (right?) he/she shouldn't try using some other thing implemented with C++. He/She should focus on learning more advanced C++ topics and using them at his/her disposal.

But yeah, linked lists are a great idea for a dictionary. That would make it real easy to add commands like "/next word" or "/previous word".
Spoken like a true optimist. ;)

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Mon Dec 21, 2009 1:23 am
by XianForce
dandymcgee wrote:
XianForce wrote:
thbp wrote:Why may i ask,,, can one not use xml? why not?
"Anyone" can use XML. I think hurstshifter is referring to Fallental's coding experience. Since Fallental is a beginner (right?) he/she shouldn't try using some other thing implemented with C++. He/She should focus on learning more advanced C++ topics and using them at his/her disposal.

But yeah, linked lists are a great idea for a dictionary. That would make it real easy to add commands like "/next word" or "/previous word".
Spoken like a true optimist. ;)
=p haha.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Mon Jan 25, 2010 10:58 am
by LeonBlade
Start out by making your dictionary with elements inside your code.
Then once you have all that laid out, then start including the ability to read/write to an XML file.

It's obvious you are still very new to C/C++ and probably programming in general, which is fine, but you need to learn to crawl before you can walk.

When you are ready to implement XML into your project, here is how I would do it (however it may not be the best).

Code: Select all

<Dictionary>
     <Word>
          <Name>noob</Name>
          <Definition>Someone who is new to the subject at hand.</Definition>
     </Word>
    <Word>
          <Name>leet</Name>
          <Definition>Someone who is very advanced with the subject at hand.</Definition>
     </Word>
    <Word>
          <Name>cake</Name>
          <Definition>A delicious desert, which to many, is considered a "lie".</Definition>
     </Word>
    <Word>
          <Name>lie</Name>
          <Definition>Something that is not truthful; a false statement.</Definition>
    </Word>
</Dictionary>
You get the idea...
You can parse through each <Word> tag and grab that as an object and get it's <Name> and it's <Definition> tags and store those in the object.

Adapting it to your current library system shouldn't have any real problems what so ever if you know what you're doing.
You would parse through your list of words just as you would before, add definitions and append on to your XML document or remove from your XML document and then re-write back out to the file.

Who knows, maybe my means of implementing this aren't the best?
Either way, you should still take the advice of getting a system going just on it's own before adding in means of saving out and reading a file like an XML file.

Then once you have that done, and somewhat OO for the most part, you will be able to include your Dictionary header file in any project and use it.

I hope this helps... pretty much everyone else on here has already put in some good advice, I just felt the need to comment as well.
I think I'll take a go at creating something like this, I'll let you know if I come up with anything.

Re: COOL PROJECT!!!! (Need a partner or two!)

Posted: Sat Jan 30, 2010 10:31 pm
by avansc
well thbp you program like what eunuchs fuck.

there are better ways of doing this.

something like

won, def of won
\tder, def of wonder
\t\tful, def of wonderful

searching becomes uber fast. best way to do this is have 26 binary trees. and bla bla bla.. this is quite well documented in bst data structures.