The ETS Discussion Hall

Would you like to react to this message? Create an account in a few clicks or log in to continue.

Where there's a place for everything (ok, maybe not EVERYTHING, but close to everything at least).

Tech & World News, Computer Stuff, Martial Arts, Sports, Music, etc. in one single place.

Welcome to the discussion hall in Expert Technology Storehouse! The name says it all. We are a storehouse storing everything from computer stuff and knowledge (expert, BTW...), to tech & world news, martial arts, sports, music...and someday useful software as well. Want to join? We welcome new members, especially experts at stuff!

Similar topics

    Latest topics

    » Compatibility Sword
    Beginner's Guide To Multibooting EmptyTue Mar 13, 2012 6:17 pm by Coolname007

    » Adcted mu online
    Beginner's Guide To Multibooting EmptyMon May 09, 2011 1:15 am by Guest

    » The Introduction Thread
    Beginner's Guide To Multibooting EmptyFri Apr 01, 2011 8:36 pm by Coolname007

    » Count to one million!
    Beginner's Guide To Multibooting EmptySat Mar 19, 2011 12:22 pm by Coolname007

    » Funny Guy!
    Beginner's Guide To Multibooting EmptyWed Mar 02, 2011 11:25 pm by Coolname007

    » China says police killed 12 in Urumqi rioting
    Beginner's Guide To Multibooting EmptySun Feb 27, 2011 6:14 pm by fvwizard

    » Arieth Mu Online
    Beginner's Guide To Multibooting EmptyFri Feb 18, 2011 2:46 pm by Coolname007

    » MAW - Make A Website
    Beginner's Guide To Multibooting EmptyMon Feb 07, 2011 8:12 am by Coolname007

    » AVACS LIVE CHAT free chat software for mobiles and computer
    Beginner's Guide To Multibooting EmptyTue Jan 25, 2011 2:19 pm by Coolname007


    2 posters

      Beginner's Guide To Multibooting

      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Beginner's Guide To Multibooting

      Post by Coolname007 Sat Nov 07, 2009 6:19 pm

      Here's a guide I wrote up for beginners to multibooting, in the ETS Wiki:

      http://ets-wiki.wikidot.com/beginners-guide-for-easy-multibooting

      Just FYI...


      Last edited by Coolname007 on Sun Nov 08, 2009 4:07 pm; edited 1 time in total
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 12:27 am

      Looks like you spent a great deal of time on it Smile
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 12:32 am

      kairozamorro wrote:Looks like you spent a great deal of time on it Smile
      Yeah, spent the better part of the day... Wink
      Ok, maybe not THAT long, but yeah, it did take me kind of long. But I didn't work non-stop on it, though...I had breaks. IT TOOK ME SO MUCH EFFORT!! Twisted Evil

      Not really, actually...it kinda comes as second nature now that I've been helping other people with their multiboot issues for so long, at NST.
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 12:35 am

      Wish I could say the same. I worked for the better part of yesterday and some of today developing newest buld of CSword. I just couldn't stop coding and coding. Got carried away and some new features lol
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 12:36 am

      Yeah, I know what you mean...
      Coding's a lot of fun. Basketball
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 1:04 am

      Well it can be. Implementing the logging capabilities were anything but easy. Next build I'm going to try to put in some support for translations to other languages and maybe support for running with admin rights for non-UAC equipped Windows systems for limited accounts. That's going to be quite another ballpark for me What a Face .

      Say how's your learning of C++ going? Working on anything or need help with anything?
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 1:11 am

      kairozamorro wrote:Well it can be. Implementing the logging capabilities were anything but easy. Next build I'm going to try to put in some support for translations to other languages and maybe support for running with admin rights for non-UAC equipped Windows systems for limited accounts. That's going to be quite another ballpark for me What a Face .

      Say how's your learning of C++ going? Working on anything or need help with anything?
      Honestly, I haven't been spending that much time with it of late, though I know I definitely should if I ever hope to get anywhere. I mean, I've still been studying every once in a while, but not not nearly as much as I need to. I've been busy doing other things.

      But, yeah, now that you reminded me of it...I'm probably going to spend the next couple of weeks studying programming hard, before I start working again, and have even less time to study. Smile

      No specific problem I can think of right now, that you might be able to help me with...unless you know how to write code that will open up a file, find a specific word, and then delete that specific word. That problem's been bugging me a little, though I didn't really spend my undividided attention on it very much. Wink

      And yeah, I've got lots of ideas for programs...just need a lot more time on my hands (and less laziness) to implement them. bounce Right now I'm currently working on the GUI of my first real program, using QT.
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 1:23 am

      The C course week 5 I linked to on the site shows you how to open whats called a "stream" using an object variable and an fopen function which creates a handler to a file. It should be almost if not identical to how you would do it in C++. If you're going to study I'd actually go back in learn C first before moving on with C++. With the handler object you can do specific actions with the file such as read it into the program or write information to it. The way I do it in my programs is sequential access reading in the file one line at a time from top to bottom. If you want to delete something in a file you haft to read it into an array of strings or something else that well hold the contents of the file. Once that's done delete the orginal or rename it until you're ready to get rid of it. Evaluate the array and if a paticular condition is met it should skip writing that paticular element to the new output file.

      Anyway, just a basic idea of how it can be done in psudo code there for you. I'd provide some code but I can't remember the specific libraries for it at the moment (the functions might be in stdio not sure)
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 1:39 am

      Yeah, I know a little about that...
      The C++ header file is fstream

      The input object is ifstream, the output object ofstream. I've read a little about that, but I didn't think it has any capabilities of doing what I want it to do (i.e. read a specific line/word, and delete it from the file). But reading it into a string, altering it, and then replacing the contents of the file, sounds like a good idea...

      Maybe something like
      Code:

      #include <fstream>
      #include <string>

      using namespace std;

      int main() {
        char str[];
        ofstream out;
        out.open("text.txt", app)
        if (!out.is_open()) //check to see if file was not opened
          //don't use the filestream
        else
          out<< "Write a bunch of stuff.\n
                "Write a bunch of stuff 2.\n
                "This is the end of the file.";
        ifstream in("text.txt");
        if (!in.is_open()) //check to see if the file was not opened
          //do not use the filestream
        else {
          in >> str;
          for (; in.getline(str) != "This is the end of the file.";) {
            in >> str;
            if (in.getline(str) = "Write a bunch of stuff 2.") {
            //write some code which will delete that line -- this is the part i'm stuck at
            in.close("text.txt"); //close the file
            }
        return 0;
       }
      Of course, that's a poor example, but at least it helps demostrate fstream's input and output objectx.


      Last edited by Coolname007 on Sun Nov 08, 2009 5:52 pm; edited 1 time in total
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 4:54 pm

      Awh, that code box is horrible...

      Well it looks like you're getting the hang of it. You didn't close your output object though so file would remain locked until you closed the program and than the data wouldn't actually be written out. Its important and probably best practice to only have the stream open as you need it and to close it when you don't. You can't write on the in stream, only read the file in. Its the out stream you write to file from your example. This is where an array of strings for each line read in can be useful. Whenever you close you either haft to create a new object stream to access it again or reasign existing with open.
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 5:07 pm

      kairozamorro wrote:Awh, that code box is horrible...

      Well it looks like you're getting the hang of it. You didn't close your output object though so file would remain locked until you closed the program and than the data wouldn't actually be written out. Its important and probably best practice to only have the stream open as you need it and to close it when you don't. You can't write on the in stream, only read the file in. Its the out stream you write to file from your example. This is where an array of strings for each line read in can be useful. Whenever you close you either haft to create a new object stream to access it again or reasign existing with open.
      What does the code box look like from your end? Could you post a screenshot. It looks fine to me.
      No need to close the output object, because I closed the file which both objects were using (both ifstream and ofstream inherit the same class, and the close function comes from the base class).

      I wasn't trying to write on the in stream...

      The code line "in >> str" just sends the file stream to the string named "str".
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 5:54 pm

      Looks like this:

      Beginner's Guide To Multibooting Codebo10

      Damn. The screenshot actually don't look to bad, but on my screen the text is lighter than its appearing. Its like blue/green text on a blue background.
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 6:01 pm

      Ok, snipping tool does it right...

      Beginner's Guide To Multibooting Codebo11
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 6:03 pm

      Yeah, the screenshot looks the way it looks to me, and I like the look. Smile
      Strange that the text looks bluish on your screen (it looks red to me). Maybe a problem with your monitor?
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 6:03 pm

      Both screenshots show the text as red for me.
      Justin
      Justin
      PC Support Tech/Moderator
      PC Support Tech/Moderator


      Posts : 408
      Join date : 2009-07-15

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Justin Sun Nov 08, 2009 6:06 pm

      Well that's better, still not quite what it looks like... sad

      Oh well, it turns white text on blue which I can see when I highlight the text Smile
      Coolname007
      Coolname007
      ETS Director
      ETS Director


      Posts : 629
      Join date : 2009-07-15
      Location : Half-way between nowhere and somewhere

      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Coolname007 Sun Nov 08, 2009 6:09 pm

      The text looks red to me, both in the screenshots and when viewing the actual code box.

      Sponsored content


      Beginner's Guide To Multibooting Empty Re: Beginner's Guide To Multibooting

      Post by Sponsored content

        Similar topics

        -

        Current date/time is Fri Apr 26, 2024 5:34 pm