Windows Server Programming and Hacking

Discussion in 'Programming and Scripting' started by Christopher Evers, Feb 10, 2015.

  1. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    I have graduated from school with a Computer Networking degree and have found myself in a small town with little to no use for the degree. I am now wanting to move into putting programming under my belt as well. I have the drive and want, the problem is I don't have the direction. I have no clue where to go and how to learn programming. doing the work is not the problem, I have no objection about that at all, I cant figure out what to learn first, what to read first, what to focus on or how to do it all. Its like wanting to become a great Olympic swimmer and just being thrown in the pool for the first time to splash and thrash with no direction. I don't want any one to do the work for me but I need a mentor i guess you could say. Please let me know your thoughts on this. I am open to hearing anything, constructive preferably.
     
    whoosh likes this.
  2. zirkoni

    zirkoni Honorable Member

    Joined:
    Oct 8, 2009
    Messages:
    215
    Likes Received:
    10
    Every serious programmer should know C/C++ because they are used everywhere. On the other hand, they might not be the easiest languages to begin with. Script languages like Python or Ruby are gaining popularity and are supposedly easy and fast to program with. Java is also quite popular and easy. Or you could try something very different. For example, Haskell which is a functional programming language (C, C++, Python, Ruby, Java are all imperative languages).

    It really depends on what you want to do. Just choose one language and stick with it (one I mentioned or something else). After you have learned one language it's easier to learn another. The Internet is full of tutorials you can read/watch to learn. Here's one for C++ http://www.cplusplus.com/doc/tutorial/

    The best way to learn a programming language is to start programming with it.
     
    whoosh likes this.
  3. ussnorway

    ussnorway Windows Forum Team
    Staff Member Premium Supporter

    Joined:
    May 22, 2012
    Messages:
    2,529
    Likes Received:
    312
    I got into web design because it doesn’t matter how far “out in the sticks” you live when making html layouts but you are correct that location plays the main role for example there is little point to opening a computer shop if your town already has 5 of them… even if they are space cadets.

    If you want to go down this path I'd start with;
    1. Adobe Muse,
    2. Then wordpress and Dreamweaver.

    3. The next step is taking control of the server... prob hyper-v (free) is a key word when talking to a client about up-dateing their servers.

    p.s. Knowing how to set up a business dns for a client’s server is really the main advantage my education gives me.
     
    whoosh likes this.
  4. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    Thank you for the replys. I am interested in C/C++ and am looking into that. I hadn't thought about web designe though. I could do that. I have a few different versions of Visual Studio now and am going to start dabbiling with Basic and C++. Now I guess I need some people to work with. Get ideas for projects that I can work on to get a grasp and learn the languages. One of my part time bosses says that if I learn to take C++ programming and output to HTML/XML, he will give me a full time position. that wold be awesome, cause I would have time to do other things as well.
     
    whoosh likes this.
  5. patcooke

    patcooke Microsoft MVP
    Staff Member Premium Supporter Microsoft MVP

    Joined:
    May 16, 2010
    Messages:
    5,454
    Likes Received:
    268
    C/C++/C# are all C variants which will give you some sound basis from which to grow. In addition to learning the language you need to learn a lot of programming concepts and good practices. None of these come easily and will take a lot of time, commitment and determination. You will also need an IDE (Integrated Development Environment) in which to develop and test your programs. These are mostly seriously expensive but I use an excellent one called Unity wwhich you can get for free. There have been stacks of tutorials developed for it, many of them linked in with the package. Download Unity here:

    http://unity3d.com/

    You may use the IDE to develop for a range of platforms such as Android which has two major prerequisies called the Java Development Kit (JDK) and the Android Software Development Kit (SDK). These will need to be downloaded, installed and configured before Inatalling the IDE. Configuring the SDK will need to be done with some guidance as to which component you need to download - see this guide here:

    https://developer.android.com/tools/help/sdk-manager.html
     
  6. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    Sweet, the reception is really awesome. thank you all for your input and constructive insight. I remembered that I got copies of Visual Studio from my teachers at ITT, and I made a little Hello World program. I finished it and it seems to be working as intended. I am includeing the zip of the program VS directory in this post. I would like to see what you think about my first atempt to program 100% on my own and with out any other help, beyond Google. This one was made with Visual Studio 2005.
     

    Attached Files:

    whoosh likes this.
  7. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    :angry_smile: I don't understand this. :angry_smile:

    Code:
    #include <iostream>
    #include <string>
    #include <conio.h>
    
    using namespace std;
    
    /// Prototype functions ///
    
    string playerX();
    string playerO();
    void  gamePlay();
    
    int main(){
    ///Start new game ///
      cout << "Welcome to Tic-Tac-Toe" << endl;
      cout << ".Press F0 to continue." << endl;
      _getch();
    //  system("cls");
    
      playerX();
      playerO();
    
      gamePlay();
    
    return 0;
    }
    
    string playerX(){
    /// Declare and initialize ///
      string namex = "";
    
    /// Get user names ///
      cout << "Player X: ";
      getline(cin, namex, '\n');
    
      return namex;
    }
    
    string playerO(){
    /// Declare and initialize ///
      string nameo = "";
    
    /// Get user names ///
      cout << "Player O: ";
      getline(cin, nameo, '\n');
    
      return nameo;
    }
    
    void gamePlay(){
      cout << playerX() << " and " << playerO();
    }
    
    Then when I run it I get this...

    [​IMG]
     
  8. patcooke

    patcooke Microsoft MVP
    Staff Member Premium Supporter Microsoft MVP

    Joined:
    May 16, 2010
    Messages:
    5,454
    Likes Received:
    268
    You will understand it after you've worked through a few C tutorials. It's a bit like declaring that you don't understand something written in German if you've never learned to speak the language. Try googling "C++ tutorial". You'll get masses of hits - find one that seems to suit you and works slowly through it. It is not an overnight process - youwill spend weeks learning the language and techniques needed to write programs.
     
  9. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    Thank you for the confidence patcooke, but I should have been more clear on what I meant. Sorry been beating my head on the desk for a couple hours on this, kinda made me forget. I am going through a c++ book and doing well at it. I wrote this code as a start for a cmd Tic-Tac-Toe game. Though there is a problem in that I just cant see where it is. For what ever reason the code to get the names of the players runs twice. Also the second time it runs, it runs backwards.
     
  10. ussnorway

    ussnorway Windows Forum Team
    Staff Member Premium Supporter

    Joined:
    May 22, 2012
    Messages:
    2,529
    Likes Received:
    312
    Looks like It doesn't know what playerX and playerO is yet because the two strings are below this step in your code? Try putting the

    first so that the string happens BEFORE the gameplay/ return 0 and it should work... also

    perhaps this should be /// not //

    p.s. just guessing because I can't see it run however you get an eye for code after years of looking at giberish :oops:... good luck with it mate.
     
  11. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    As far as I know, this:

    Code:
    /// Prototype functions ///
    
    string playerX();
    string playerO();
    void  gamePlay();
    
    should allow me to put the functions after the call. Since being that I prototyped it before

    Code:
    * main().
    
    With the

    Code:
    //system("cls");
    
    That was just a comment out. From what I have gathered:

    // or /* */ - makes the comment grey
    /// or /** **/ - makes the comment an off greyish blue.

    If you would like I can send you the source code to look at it yourself. I am using code::blocks. I know its not a huge ultra hacker/programmer IDE. Though it is working and helping me get my start and up and running.Just this one part is confusing the heck out of me.

    PS: I commented out the system clear screen {system("cls")} for the screenshot. Hoping it would give a better idea of what was going on and make it easier to follow the code and what it looked like running.
     
  12. patcooke

    patcooke Microsoft MVP
    Staff Member Premium Supporter Microsoft MVP

    Joined:
    May 16, 2010
    Messages:
    5,454
    Likes Received:
    268
    This is because the functions are called twice - once from main and a second tome from within the function gamePlay.
     
  13. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    Oh, so this:

    Code:
    void gamePlay(){
    cout << playerX() << " and " << playerO();
    }
    
    gets and prints the names for playerX() and playerO(). I thought the cout only printed to the screen. Hmmm, looks like I will have to go back over that part again.
     
  14. ussnorway

    ussnorway Windows Forum Team
    Staff Member Premium Supporter

    Joined:
    May 22, 2012
    Messages:
    2,529
    Likes Received:
    312
    It makes a "box" in the memory with a title of [playerX] + [PlayerO] but that is all... at this point there isn't any value in the box.

    p.s. If you post a link to the full files or whatever tutorial then I'll take a look but it may take some time.
     
  15. zirkoni

    zirkoni Honorable Member

    Joined:
    Oct 8, 2009
    Messages:
    215
    Likes Received:
    10
    playerX() and playerO() are functions. Every time you write playerX() or playerO() in your code the function is called and executed.

    Just remove the lines
    playerX();
    playerO();
    from your main function and you get the functionality you seem to want.
     
  16. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    Sorry it took so long to reply, been a little busy.

    @zirkoni, I see what you are saying. I was under the impression that:

    Code:
    cout << playerX() << " and " << playerO()
    


    would print out the return from the playerX() and playerO() function with space and space, between them. While beating my head on my desk, another programmer came in and pointed out that I was misunderstanding function calls as opposed to variable calls. After assigning global variables to the functions, then calling those variable, it let me print out the return from the functions any where I wanted to. So now the new code looks like:

    Code:
    #include "includeFile.h"
    
    using namespace std;
    
    /// Prototype functions ///
    
    string playerX();
    string playerO();
    void gamePlay(string xPlayer, string oPlayer);
    
    int main(){
    ///Start new game ///
    cout << "Welcome to Tic-Tac-Toe" << endl;
    cout << ".Press F0 to continue." << endl;
    _getch();
    system("cls");
    
    string xPlayer = playerX();
    string oPlayer = playerO();
    
    playerX();
    playerO();
    
    gamePlay(xPlayer, oPlayer);
    
    return 0;
    }
    
    string playerX(){
    /// Declare and initialize ///
    string name = "";
    
    /// Get user names ///
    cout << "Player X: ";
    getline(cin, name, '\n');
    
    return name;
    }
    
    string playerO(){
    /// Declare and initialize ///
    string name = "";
    
    /// Get user names ///
    cout << "Player O: ";
    getline(cin, name, '\n');
    
    return name;
    }
    
    void gamePlay(string xPlayer, string oPlayer){
    cout << xPlayer << " and " << oPlayerO;
    }
    
    I know this is such newbie coding, but this is almost all learned out of just reading a book. Coming from a guy that never completed an assignment in school before getting my degree, that is really good. It is slow going, because my main job closed, and have been looking for a new job since. Even though, I am really enjoying this and hope to make it a permanent part of my career. Though I am so sure you wanted to hear that. Any who, thank you so much for your help. Looking forward to more discussions in the future.
     
  17. ussnorway

    ussnorway Windows Forum Team
    Staff Member Premium Supporter

    Joined:
    May 22, 2012
    Messages:
    2,529
    Likes Received:
    312
    fyi globals can cause issues on the internet (because a tip web server may have 1000s of sites all useing the same code) and are being fazed out for local variables... its not a big problem with games but you need to be aware of it if your code goes on the networks.

    Good luck with the job hunting mate!
     
  18. Christopher Evers

    Joined:
    Oct 17, 2014
    Messages:
    30
    Likes Received:
    3
    @ussnorway

    (O_O) I am glad you mentioned that. Thank you for the heads up. I am looking at all possible ways to do things and keeping my mind open to all possibilities. So I shouldn't have a problem kicking the global variable habit. lOl Thank you for the good luck. Applied at a place for an IT job. I know a few people that can give me a little bit of a nudge and good word, so I hope I get the job. We will see. (^_^)
     
  19. AceInfinity

    AceInfinity Senior Member
    Microsoft MVP

    Joined:
    Aug 12, 2011
    Messages:
    159
    Likes Received:
    11
    C# is not a variant of C. C# is a managed language in which is Microsoft's own version of Java after some dispute about the language. Syntax is similar but C++ branched off of C, and C# branched off of Java. Technically they are all their own lanauges at this point in time as there are discrepancies between C and C++, as well as C# and Java that would reveal conflicts if either of them were to be merged into a single language somehow.

    A comment in C++ is done with '//' so it was originally correct syntax.

    ----

    As for my personal experience with C++, I have a few recommendations and remarks to make about the latest code.

    1. 'using namespace std' is not considered good practice because of a few reasons. First however, it defeats the point of namespaces in terms of isolation. Additionally, it pollutes the global namespace which promotes name conflicts.

    2. conio.h is not a standard header, and because of that, I wouldn't recommend that you use it

    3. The effects of system() are undefined and platform dependent as well. The input string is not encrypted either, which allows for your program to be easily exploited from the standpoint of anything malicious. Most viruses will use other methods however anyways to achieve things, but that doesn't mean the option is not available to an attacker.

    4. PlayerX() and PlayerO() functions return a copy of a temporary std::basic_string<char> object. In the first 2 calls you store the return value, in the 3rd and 4th calls to the functions from main() you don't do anything with them, which makes the function call useless:
    Code:
    string xPlayer = playerX();
    string oPlayer = playerO();
    
    // Here
    playerX();
    playerO();
    Your gameplay function also passes them as copies too just to display them. Once you learn about references and const-correctness you'll see how this can be improved even further.

    NOTE: I would highly not recommend that you use strings for player identification though. You may use it as a display variable, but that's all the strings should be used for. For identifying player 1 vs player 2. You might want to use strongly typed enum instead. Additionally, when checking for whether it's player 1 or player 2's turn, you don't have the internal string character comparison happening in the background with the overloaded == operator or comparison functions.
     
    #19 AceInfinity, Dec 13, 2015
    Last edited: Dec 13, 2015
  20. DeividasVy

    DeividasVy New Member

    Joined:
    May 12, 2016
    Messages:
    3
    Likes Received:
    0
    I found that TheNewBoston C++ tutorials are really noob friendly and they've helped me a great deal in the past.
     

Share This Page

Loading...