Page 1 of 2 12 LastLast
Results 1 to 25 of 27

Thread: Cue Card Program

  1. #1
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default Cue Card Program

    Since I know how to use pascal enough, I thought I would work with Java to try and create a CueCard like program for studying.

    So far, it can not really do much :
    • Add/Delete questions
    • Load multiple text/quiz files.
    • Displays help menus for every interface.


    Todo:
    • Ability to run through, flipping cards etc
    • Perhaps a GUI if I feel like learning
    • Create a static system for the stream, rather than passing around the param.
    • allow for multiple commands in one line, adding questions w/ options etc.
    • answering questions, rather than just looking at answer.
    • Create a debugging system to change what is shown and what isn't.
    • Create a library like structure allowing for porting to a GUI.
    • Allow for quicker addition of questions
    • Add passing of parameters to commands. Should be fairly simple.
    • Word wrap for longer answers/questions. (Its annoying to read otherwise..)
    • Re-add Listing of cards, will have more options now, including custom formatting
    • List all questions, with different formatting.
    • Quiz based on questions inputted. (Random ordered)


    Completed: (Just makes me feel better.. )
    • Move project to an SvN
    • Re-create addCard stuff, will be a separate menu allowing to continuously add cards and can be terminated. Also, will allow editing of cards.
    • Add deleteing of cards
    • Re-add loading of cards
    • Restructure program, OOP
      • ideas to do this, creating a better structure etc.
      • Create a string array of acceptable options with indexes associated with them, these indexs will be used in a switch..case piece in another function.
      • pass these integers when the string is called and call the associated section.



    To run it:
    1. Check out from:
      Code:
      http://java-cuecards.googlecode.com/svn/trunk/
      This will give you the latest version.
    2. cd to the directory from a terminal/command line.
    3. ** Ignore this step if you trust that I'm not messing with your computer** Run: "javac CueCardProgram"
    4. Run: "java CueCardProgram"
    5. Tell me what you think
    6. Type ``h'' or ``help'' to get a list of commands in any interface!


    Remember, this is still very much a work in progress. Please post bugs errors and the like. I cannot guarantee the stability of it either. The older revisions (< 9) are stable for use and allow adding questions etc. Its what I'm using to study (You have to javac CueCardApp.java and java CueCardApp instead of CueCardProgram.java, etc).

    Comments, and issues pleaseeee.
    Last edited by Nava2; 12-11-2009 at 07:02 AM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  2. #2
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did as you said, but so idk

    EDIT: I tried to look at the code but when I opened the .txt it came up like in 5 lines and no entering so Idk if that made the error or if thats just a coding style
    Last edited by All that is man; 12-06-2009 at 12:20 AM.

  3. #3
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by All that is man View Post
    Did as you said, but so idk

    EDIT: I tried to look at the code but when I opened the .txt it came up like in 5 lines and no entering so Idk if that made the error or if thats just a coding style
    That error was my bad, I added it in and I'm still getting used to useing different syntax.. = is assigned rather than equal to.

    The newline issue could be because I wrote it on linux and Windows uses a different char for new line.

    Upped a new version. Has quizzing and loading from multiple files etc.
    Last edited by Nava2; 12-06-2009 at 01:25 AM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    I believe that you have to use \n\r for cross-platform compatibility.
    Ce ne sont que des gueux


  5. #5
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Floor66 View Post
    I believe that you have to use \n\r for cross-platform compatibility.
    That is correct. At least, that's what Windows uses for new lines, and I think the other operating systems are smart enough to parse it correctly as well.

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by senrath View Post
    That is correct. At least, that's what Windows uses for new lines, and I think the other operating systems are smart enough to parse it correctly as well.
    I'm not writing that in every line when I'm coding though.. I can do it for when I put \n but he is talking about when he opened the .java file.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  7. #7
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    I'm not writing that in every line when I'm coding though.. I can do it for when I put \n but he is talking about when he opened the .java file.
    Oh, he was? Eh, I use Notepad++ so I didn't notice any problems with newlines.

  8. #8
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not trying to be a hassle just trying to help But...

  9. #9
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    It works if you load from a file. But it doesn't properly grade you. It always says 0% when you finish.

  10. #10
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by All that is man View Post
    Not trying to be a hassle just trying to help But...
    Thanks! I will never complain about someone helping me! I was trying to access the length of a ``null'' array. One sec I can fix that..

    Code:
    kevin@n2-laptop:~/drjava/k/cuecardsstuff/Cue Card Quizzer - r2$ java CueCardApp 
    Choose a working file:
      
    Couldn't find .
    File could not be read.
    Enter a command:
    a
    Adding Question
    Question?
    What is sex?
    Answer?
    Peniz + vag
    Added question number 1
    Enter a command:
    OH HAI SRL
    *Side note: I am well aware of my immaturity sometimes.*
    Last edited by Nava2; 12-07-2009 at 12:02 AM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  11. #11
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Thanks! I will never complain about someone helping me! I was trying to access the length of a ``null'' array. One sec I can fix that..

    Code:
    kevin@n2-laptop:~/drjava/k/cuecardsstuff/Cue Card Quizzer - r2$ java CueCardApp 
    Choose a working file:
      
    Couldn't find .
    File could not be read.
    Enter a command:
    a
    Adding Question
    Question?
    What is sex?
    Answer?
    Peniz + vag
    Added question number 1
    Enter a command:
    OH HAI SRL
    *Side note: I am well aware of my immaturity sometimes.*
    lmfao

    i r teh 1337 bugz findr?

    lots more


    It could just be because I only have 2 questions maybe?
    Last edited by All that is man; 12-07-2009 at 01:44 AM.

  12. #12
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by All that is man View Post
    lmfao

    i r teh 1337 bugz findr?

    lots more


    It could just be because I only have 2 questions maybe?
    Yes and no, I just keep forgetting to remove the line where it writes out which indexs are being switched

    Okay, removed that, fixed an annoying error I had..

    I really need to restructure this entire thing to make it work better..

    Perhaps I should host it on an SVN too Might make my life easier.

    E: Now its hosted on google code! Much easier for me to update
    Last edited by Nava2; 12-07-2009 at 02:11 PM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  13. #13
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If your planning to recode, then you should look into applying a composite array or/with stacks =) Would be quite a bit more efficient + great learning experience with creating your very own customized lists.

    Quickly browsing through your code, here are some suggestions I put together:

    1) Since public class CueCard is really being read as public class CueCard extends java.lang.Object, the toString() method should be an override. (@Override public string toString()) ~ It works without it, but there are some good benefits that come along with declaring as an override in the beginning. (You can find some good reasons at: http://preview.tinyurl.com/yd2jznm)

    2) Your readFile method kinda made me smile =) You could simply used a java.awt.List and push the new lines onto the list and then obtain them at the end. Would literally cut your method down by half. Something like:
    java Code:
    java.awt.List list = new java.awt.List();
    String line = null;
    while((line = reader.readLine()) != null)
        list.add(line); /* adding line to a list */

    return list.getItems(); /* will return all the items in the list as a String array */

    But overall its a pretty good job



    ~NS

  14. #14
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Nadeem View Post
    If your planning to recode, then you should look into applying a composite array or/with stacks =) Would be quite a bit more efficient + great learning experience with creating your very own customized lists.

    Quickly browsing through your code, here are some suggestions I put together:

    1) Since public class CueCard is really being read as public class CueCard extends java.lang.Object, the toString() method should be an override. (@Override public string toString()) ~ It works without it, but there are some good benefits that come along with declaring as an override in the beginning. (You can find some good reasons at: http://preview.tinyurl.com/yd2jznm)

    2) Your readFile method kinda made me smile =) You could simply used a java.awt.List and push the new lines onto the list and then obtain them at the end. Would literally cut your method down by half. Something like:
    java Code:
    java.awt.List list = new java.awt.List();
    String line = null;
    while((line = reader.readLine()) != null)
        list.add(line); /* adding line to a list */

    return list.getItems(); /* will return all the items in the list as a String array */

    But overall its a pretty good job



    ~NS
    Since he's not already using java.awt, and there is no GUI, he should probably use an ArrayList instead of java.awt.List.

  15. #15
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Nadeem View Post
    If your planning to recode, then you should look into applying a composite array or/with stacks =) Would be quite a bit more efficient + great learning experience with creating your very own customized lists.

    Quickly browsing through your code, here are some suggestions I put together:

    1) Since public class CueCard is really being read as public class CueCard extends java.lang.Object, the toString() method should be an override. (@Override public string toString()) ~ It works without it, but there are some good benefits that come along with declaring as an override in the beginning. (You can find some good reasons at: http://preview.tinyurl.com/yd2jznm)
    To me, it appears as though the override stuff is a bit over my head. I don't know how interfaces etc work yet. I'm still learning

    2) Your readFile method kinda made me smile =) You could simply used a java.awt.List and push the new lines onto the list and then obtain them at the end. Would literally cut your method down by half. Something like:
    java Code:
    java.awt.List list = new java.awt.List();
    String line = null;
    while((line = reader.readLine()) != null)
        list.add(line); /* adding line to a list */

    return list.getItems(); /* will return all the items in the list as a String array */
    What is the benefit of doing it your way vs mine? Is it just to make it smaller?

    But overall its a pretty good job
    thanks



    ~NS
    Quote Originally Posted by senrath View Post
    Since he's not already using java.awt, and there is no GUI, he should probably use an ArrayList instead of java.awt.List.
    Currently, I'm trying to create just a library which only requires an InputStream and an OutputStream. This way, it will function using either a GUI or commandline depending how it is loaded.

    I'm still a large beginner with java, and my issue is not for lack of ideas and know how, but how to actually go about and do it.


    I added new files into the SvN, they don't work. But they show some of my ideas and I'm trying to implement them. I don't really understand stacks, but I'm pretty sure I'm making a sudo one and there is probably a better option than what I am doing.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  16. #16
    Join Date
    Aug 2006
    Posts
    74
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You are taking a hybrid OOP, and procedural programming approach. Although it may be easier to code that way, your code looks messy and unclean. It also lacks flexibility.

    Pure OOP FTW

  17. #17
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by arash View Post
    You are taking a hybrid OOP, and procedural programming approach. Although it may be easier to code that way, your code looks messy and unclean. It also lacks flexibility.

    Pure OOP FTW
    Perhaps you could explain what you mean?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  18. #18
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    Perhaps you could explain what you mean?
    Maybe he's referring to your use of static methods? Generally, unless there is a really good reason for a method to be static, it shouldn't be.

  19. #19
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by senrath View Post
    Maybe he's referring to your use of static methods? Generally, unless there is a really good reason for a method to be static, it shouldn't be.
    Oh, I'm getting rid of those
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  20. #20
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I just keep learning:
    MASSIVE CHANGES:
    Fully OOP oriented.
    Currently supports:
    + Will have multiple menus which store where they are in a stack
    + Help menu is much easier to read, and easily updated.
    + Quiz's will behave much nicer.

    Todo:
    + Create addCard stuff, will be a separate menu allowing to continuously add
    cards and can be terminated. Also, will allow editing of cards.
    + Add passing of parameters to commands. Should be fairly simple.
    + Add deleteing of cards
    + Add loading of cards
    + Add Listing of cards, will have more options now, including custom formatting.

    So, it doesn't really work right now, the old version *should* still work, but
    this new one works for everything I listed, but nothing I put in todo.

    I'm excited, and if you want to help contribute, please post ideas etc. For now,
    I don't want anyone else working on the project so I can continue to learn. When
    I feel as though I've learned enough and I'm just improving, I will add more
    people!

    Woot woot.

    ~Kevin
    Any advice is really appreciated.

    Anyone know a better way to keep track of the current cards other than a static array? I would really rather not pass it around. Creates a pain in if I do so.

    Also, any advice for bettering my structure? I do plan on removing it all out of newDevelopment :P

    P.S. senrath, Nadeem, you have msn?

    Edit:
    Moar updates, no more old, just new! (: Ditched the old style completely. Quickly moving everything over into the new version.

    Rev 9 still works, just you have to run javac CueCardApp.java then java CueCardApp.

    Please use this people
    Last edited by Nava2; 12-11-2009 at 07:04 AM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  21. #21
    Join Date
    Nov 2009
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    1. nice work mate; best wishes
    2. so you're the guy from #rsbotjava eh?
    3. (@the guy suggesting java.awt.List) NO... AWT's List is for UI WIDGETS, not general utility. i think you mean java.util.List.

  22. #22
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by oksuper_ View Post
    1. nice work mate; best wishes
    2. so you're the guy from #rsbotjava eh?
    3. (@the guy suggesting java.awt.List) NO... AWT's List is for UI WIDGETS, not general utility. i think you mean java.util.List.
    1. Any more comments?

    2. Nope.. who you talk `bout.

    3. What would be the difference? awt is for GUI and util is for utilities aka commandline?

    Not really sure the difference.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  23. #23
    Join Date
    Nov 2009
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    1. Any more comments?

    2. Nope.. who you talk `bout.

    3. What would be the difference? awt is for GUI and util is for utilities aka commandline?

    Not really sure the difference.
    1. nope
    2. there was someone in #rsbotjava a little while ago asking for help with:
    Code:
    if (line = null)
    which is identical to the output of javac in a screenshot of the command prompt console earlier in this thread.
    3. the difference is that java.awt.List is not a general, miscellaneous utility class; it is a graphical UI widget/component... this is a picture of it:

    on the other hand, java.util.List IS a general utility collection; hence why it is generic. it is not for 'commandline', i have no clue as to where you would ever be able to deduce that from existing documentation.

  24. #24
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by oksuper_ View Post
    1. nope
    2. there was someone in #rsbotjava a little while ago asking for help with:
    Code:
    if (line = null)
    which is identical to the output of javac in a screenshot of the command prompt console earlier in this thread.
    3. the difference is that java.awt.List is not a general, miscellaneous utility class; it is a graphical UI widget/component... this is a picture of it:
    on the other hand, java.util.List IS a general utility collection; hence why it is generic. it is not for 'commandline', i have no clue as to where you would ever be able to deduce that from existing documentation.
    More of a guess.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  25. #25
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I need something to be productive with small bursts of time, so if I worked on this more (probably a complete rewrite) would anyone want it?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •