• Lucid Dreaming - Dream Views




    Page 5 of 7 FirstFirst ... 3 4 5 6 7 LastLast
    Results 101 to 125 of 165
    1. #101
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4
      Quote Originally Posted by ninja9578 View Post
      A dos console and unix consoles are completely different. Macs can run windows console programs, you need to compile seperately for mac and windows
      Then how do I do it just for windows?

    2. #102
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      Quote Originally Posted by slash112 View Post
      system("PAUSE") means that when I run the program, it doesn't close as soon as it finishes. But it lets you close it by pressing any key.
      Don't do that
      I'm not sure exactly what you mean by "closing" (you mean the terminal window?)
      but good programs finish as soon as they're done, and do not hang for user input unnecessarily

      Say you release a program that takes input from stdin does something and outputs to stdout, exiting 0 on success and any other value on error, errors get sent to stderr

      I would like to be able to say something like

      Code:
      slash112_program || echo "Error $?"
      or
      Code:
      cat some_file | slash112_program | less
      hanging the program for input at the end breaks program flow
      anyway....

      Quote Originally Posted by slayer View Post
      How to I package together my code into an exe or something both windows and macs can open?
      You can't (well, you can, but it's way more trouble than it's worth)
      Either make the various platform & architecture packages yourself
      or the easy route - just release the code
      If the program's useful, people will package it up for their platform / architecture of choice
      (\_ _/)
      (='.'=)
      (")_(")

    3. #103
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by slayer View Post
      Then how do I do it just for windows?
      It does that for you

      Go to the folder with your Code::Blocks file, then go to bin/Debug. A .exe file should be in there

      If you use standard C++, it will compile on any platform with no change in code Firefox compiles on every major platform, using the same code, with very little preprocessor.
      Last edited by ninja9578; 01-13-2010 at 03:23 AM.

    4. #104
      A Natural The Invisible Man's Avatar
      Join Date
      Nov 2008
      Gender
      Posts
      365
      Likes
      8
      "C++ will let you shoot your foot without warning you. In fact, it will even load the gun for you."

      ~ Allegro User


      Can you see me now?

    5. #105
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      Ynot. I'll give you an example. If the program asks you to input something, you would put it in. You would get an instant response, and then the terminal window would instantly shut the moment after the new text is displayed. This is not what you want.

      It's not that I need it at this level, I don't need any fancy way of closing the program at this level. It is just purely for having it there.

    6. #106
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      If you use standard C++, it will compile on any platform with no change in code Firefox compiles on every major platform, using the same code, with very little preprocessor.
      There are a lot of things you need system calls for, though, like GUI and scanning directories and such. So Firefox must be using preprocessor directives, or libraries which uses them.

      Quote Originally Posted by slash112 View Post
      Ynot. I'll give you an example. If the program asks you to input something, you would put it in. You would get an instant response, and then the terminal window would instantly shut the moment after the new text is displayed. This is not what you want.
      Console programs are normally opened from the terminal, though. And if you do that, then the terminal doesn't close and you'll see the output. It's just if you open it by double clicking on the executable that you won't see the text, but then that's no how the programs are supposed to work. If you want those kinds of programs you need GUI.

      Funny thing, I've got C++ as a university subject this year. Of the things we'll learn this year, there was only one thing I haven't done before.
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    7. #107
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by khh View Post
      There are a lot of things you need system calls for, though, like GUI and scanning directories and such. So Firefox must be using preprocessor directives, or libraries which uses them.
      I said little preprocessor. I've looked at the Firefox code because I reverse engineered a chunk of it. All of this stuff uses a NPWindow object, almost all of the preprocessor is in there.

      Console programs are normally opened from the terminal, though. And if you do that, then the terminal doesn't close and you'll see the output. It's just if you open it by double clicking on the executable that you won't see the text, but then that's no how the programs are supposed to work. If you want those kinds of programs you need GUI.
      But stick with the terminal while learning, GUIs can be a pain.

      Funny thing, I've got C++ as a university subject this year. Of the things we'll learn this year, there was only one thing I haven't done before.
      But I'm sure that you'll learn better technique and optimization techniques that you currently don't know. Assuming the professor is competent, I had a professor in college who was a good C++ programmer in 1995, but he stuck to those techniques, so we were taught no modern designs. C++ coding changes very quickly, if you don't stay on top of it, you can fall behind quickly.

    8. #108
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      I can't wait till I get to GUIs. That will be kick ass.

    9. #109
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      C++ is a nightmare with GUIs because the language isn't designed for it. I just spent 3 full workdays creating a frame, a dynamic set of menus, a status bar, and a web preferences pane.

      Luckily, there are graphical ways to do it in 5 minutes, which is what I recommend using when starting out. The only reason I don't use that is because I need more control over them.

    10. #110
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      Haha, wow.

      But still... it would be worth it.

      I applied to a computer games course which consists of programming in C++ (I think...) and 3d modelling. I want to get into that (although I applied to physics too, at the time I wanted that more)

      But yea... I'm just learning this so I have a bit of knowledge before going there (If I get in)

    11. #111
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      I said little preprocessor. I've looked at the Firefox code because I reverse engineered a chunk of it. All of this stuff uses a NPWindow object, almost all of the preprocessor is in there.
      Ah, okai.

      Quote Originally Posted by ninja9578 View Post
      But stick with the terminal while learning, GUIs can be a pain.
      Yeah, I know. I tried learning GUI a while back, but I simply gave up on it for a while. I didn't have a clue about what I was doing, or what the code elements meant or anything. Figured I'd just write a console program with some of the same functionality and port it when I was ready :p


      Quote Originally Posted by ninja9578 View Post
      But I'm sure that you'll learn better technique and optimization techniques that you currently don't know. Assuming the professor is competent, I had a professor in college who was a good C++ programmer in 1995, but he stuck to those techniques, so we were taught no modern designs. C++ coding changes very quickly, if you don't stay on top of it, you can fall behind quickly.
      Yeah, I hope so. There must be things I've missed, since I've mostly thought myself what I know. But I think he must be a good programmer, he's taught that specific course for the two year it's run, and he taught the Java course the engineers attended instead. He ought to be good by now.
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    12. #112
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Good Java Programmer != Good C++ Programmer, very different designs.

      Also, almost all of your functionality can be done using the console. I'm currently tearing apart an application so that the functionality is completely disjoint for the main window. The window runs by itself and loads the functionality as a dll.
      Last edited by ninja9578; 01-13-2010 at 07:06 PM.

    13. #113
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      Good Java Programmer != Good C++ Programmer, very different designs.
      Yeah, I'm aware of that, but he's an experienced programmer, he's used quite a few different languages, so I'm guessing he'd want to teach the language properly. Also, he started introducing "best practise" rules the second lesson (accurate ones). That's a good sign.
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    14. #114
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      If you have Ubuntu, I'll show you how to create a simple GUI program if you want. I can do it on Windows too, but I like using the wxWidgets library for that, and that's impossible to compile on Windows, I've tried and failed at that many times. I'm not looking forward to the next major release because I'm planning on recompiling it as a dynamic library.

    15. #115
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      If you have Ubuntu, I'll show you how to create a simple GUI program if you want. I can do it on Windows too, but I like using the wxWidgets library for that, and that's impossible to compile on Windows, I've tried and failed at that many times. I'm not looking forward to the next major release because I'm planning on recompiling it as a dynamic library.
      Yeah, that would be nice. I've got Windows and Ubuntu as dual boot. Me and a friend once thought about making an application with wxWidgets, but... we never quite got there.
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    16. #116
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      wxWidgets works perfectly fine on Windows Vista... Code::Blocks with wxSmith does a lot of the work, but it's perfectly possible to code everything by hand with a wx Template.

    17. #117
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Then you're lucky. wxWidgets is a very complex build, and it requires a lot of external libraries which do not come with the source. It's really annoying to build.

    18. #118
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      If I'm not mistaken all I had to do was download the source [I think there is a windows version or something...?] and then tell code::blocks where it was and it compiled it for me. Now all I have to do it fire up a template or use wxSmith ^_____

    19. #119
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Here's a list of things to learn before tackling GUIs

      methods
      header / functional files
      classes / structs
      static vs dynamic methods
      overloading methods
      overloading operators
      scope
      pass by reference vs pass by value
      polymorphism / inheritance
      inline functions
      macros
      pointers
      reference / dereference
      casting
      opaque pointers
      callback functions
      static libraries vs dynamic libraries
      preprocessor

      If you know those, then you know .01% of C++
      Last edited by ninja9578; 01-14-2010 at 10:40 PM.

    20. #120
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      the other 99.99% is divided evenly between exceptions and trying to understand the Boost libraries.....
      (\_ _/)
      (='.'=)
      (")_(")

    21. #121
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      And STL

    22. #122
      Member SkA_DaRk_Che's Avatar
      Join Date
      Dec 2009
      Posts
      244
      Likes
      48
      Hey Ninja, i dont know too much about programing and that type of stuff so 1 basic and dumb q.

      What kind of applications do you most commonly use programming for? What possible uses does it have?
      Quote Originally Posted by Siиdяed View Post
      Talking about women and sex --> instant testoteroney arguments among pasty white internet shut-ins everywhere.

    23. #123
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      every action, every task
      everything that is possible on a computer
      starts out life as source code written in a programming language

      Quote Originally Posted by Soros View Post
      What kind of applications do you most commonly use programming for?
      all of them
      Quote Originally Posted by Soros View Post
      What possible uses does it have?
      everything
      (\_ _/)
      (='.'=)
      (")_(")

    24. #124
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      I think Soros was asking me specifically

      I professionally write a variety of programs that revolve around our custom GUI format. It's basically a GUI engine, coupled with our database that allows us to build very complex gui apps and websites, really fast. I write the backend engine that runs the thing and communicates with the server.

      I also write games from time to time if I'm practicing a new technique or something.
      Last edited by ninja9578; 01-15-2010 at 02:40 PM.

    25. #125
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      I was just wondering. How would you make it so that you just press a key and it would do something. For example:

      if spacebar is pressed
      cout << "OMG you pressed space!"


      How would you code that first line? And would you need to set a variable for it?

      Same with any key, like the left arrow key, or whatever. Just something where you press the key without having to hit enter too.

    Page 5 of 7 FirstFirst ... 3 4 5 6 7 LastLast

    Bookmarks

    Posting Permissions

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