Remove ads, unlock a dark mode theme, and get other perks by upgrading your account. Experience the website the way it's meant to be.

Programming • Page 7

Discussion in 'Technology Forum' started by Dirty Sanchez, Mar 5, 2016.

  1. Timmiluvs

    I play video games fast Prestigious

    My C++ syntax is rusty but the main thing you want to do (you can look up the details/built in functions online) is to read the file line by line. Something like a while loop that goes through every line in the file. You can save that line to a string and then add it to the array. If you only want the first line then you would just do the loop once and break out at the end of the first run (just be warned that if you start back up again later you'll start where you left off in the file).

    Idk if that's what you're aiming to do but it sounds like that's your goal.
     
  2. DeviantRogue

    Take arms, it'll all blow over Prestigious

    Oh fuck me I somehow uploaded the .exe for my last program instead of the .cpp.. raaaaaage
     
    Dirty Sanchez likes this.
  3. LightWithoutHeat

    Trusted

    Anyone know of a jQuery zoom plugin that works with only one image? I'm having a hell of a time finding one.
     
  4. danielalee12 Apr 13, 2016
    (Last edited: Apr 13, 2016)
    danielalee12

    Regular

    Do any of you have a MS in CompSci? I'm thinking about getting one in the future, but not sure if I have the necessary pre-requisites. I would love to talk to someone who's gone through the admissions process :-). Also, there's a lot of debate about an MS. Is it worth it/what are your opinions?
     
  5. The pre-reqs would certainly depend on the program, but I'd guess the pre-reqs would be pretty basic. Off the top of my head, something like: Data structures, Algorithms, OS, maybe a PL/Compiler course and some math, like Calc, Linear and Discrete. Also, I'd recommend against getting an MS unless it's paid for, it just isn't worth that much.
     
  6. TotesAndGoats

    Bear

    I second that.

    Most days I wonder if my BS is really worth as much as it cost me. A lot of the jobs that are in my area now are more worried about what language your proficient in and don't care much about your formal education.
     
    Dirty Sanchez and perceptrons like this.
  7. noxee

    Regular Prestigious

    Not sure if you're still looking, but this is what we've used at work to allow people to zoom in on an image.

    Wheelzoom
     
  8. noxee

    Regular Prestigious

    Is there a specific area of interest that you want to get into. Similar to what other people have said it can be quite costly for very little gain. But if you're interested in getting into maybe research, AI, academia, etc it might be useful. It really depends on what you intend to get out of it.
     
    perceptrons likes this.
  9. noxee

    Regular Prestigious

    Did you work out your file issue?
     
  10. Strikegently

    close cover, strike gently

    It depends on what kind of work you're looking for, but if all they care about is what languages you're fluent in, then it's probably just a codemonkey position.
     
  11. danielalee12

    Regular

    I work as a data analyst now and use Python daily. I've had to build several web apps for my company, but I learned that I love building things more than analyzing data. I want to transition careers and work in a more software engineering role. Since I don't have any background in comp sci besides taking a couple java courses in college, I'm thinking about going to grad school. However, I'm entirely self-taught and am continuing to learn on my own and work on side projects. I'm just weighing pros and cons of going back to school for a MS.
     
  12. TotesAndGoats

    Bear

    Unfortunately, those code monkey positions (right now anyways) are paying double what my full stack/engineer job is paying. So it definitely causes some degree of questioning.
     
  13. You could also look into a post-bac, which has less cachet of a MS, but would probably cover more of what you want it to.
     
  14. noxee

    Regular Prestigious

    For a software engineering role (i.e. designing and building systems) I would be hesitant to recommend a MS mainly because given the level you would be going in at you would be considered over qualified.

    Maybe as an exercise on working out what you need to know, look at all the companies you want to work for see what their requirements for a position are (these are usually negotiable anyway) and see how much of it you can learn from resources online (or outside of university).

    The only caveat to all that is if you find that you learn best in a structured environment maybe something at university would be appropriate. But given that you are working on personal projects outside of work I get the feeling you'd be a motivated self learner.
     
    Jason Tate likes this.
  15. Strikegently

    close cover, strike gently

    Well, if you want to make the transition, check out the "in a Nutshell" series by O'Reilly. They're crash-courses in a language without the added bloat that traditional programming books have; basically, it won't teach you what a for-loop is, it just shows you how a for-loop works in that language.
    The structure for this series is pretty much universal: the first 20 pages shows you the syntax, loops, conditionals, variables, and then the rest of the book is focused on language-specific information. And there's lots of example code, which is great. If you are already comfortable with programming, you can use "in a Nutshell" books to pick up a language in an afternoon.

    I applied for a job last week, and they surprised me in the interview by saying they were in the middle of migrating all of their old Java libraries to C# and that my days would consist of writing C# (the job description was 'Senior Java Developer', mind you). C# in a Nutshell will probably be saving my ass.
     
  16. noxee

    Regular Prestigious

    Interesting "artificial pair programmer"

     
    perceptrons and Jason Tate like this.
  17. -removed-

    Trusted Prestigious

    Excel question. I created a macro and now every time I go to open exce it tells me personal.xsl or whatever is being used. Do I want read only or to notify. How do I fix this without deleting the macro?
     
  18. Borat 2: Vengeance

    The Pitbull of Chorus.fm Prestigious

    I'm in what is effectively Java 1. Is there a more efficient way of making a menu then what I did here? Maybe some kind of loop?

    SavingsAccount sa = new SavingsAccount(100, .05, 2.5);
    Scanner scan = new Scanner(System.in);
    System.out.println("Options Menu");
    System.out.println("1: Deposit");
    System.out.println("2: Withdraw");
    System.out.println("3: View balance");
    System.out.println("4: Exit");
    System.out.println();
    System.out.println("Enter a value 1-4");
    int choice = scan.nextInt();

    while (choice != 4)
    {
    if(choice == 1)

    {
    System.out.println("How much would you like to deposit?");
    int depositAmount = scan.nextInt();
    try
    {
    sa.deposit(depositAmount);

    }

    catch (InvalidDepositAmount e)
    {
    System.out.println("Invalid deposit amount");

    }
    System.out.println("Options Menu");
    System.out.println("1: Deposit");
    System.out.println("2: Withdraw");
    System.out.println("3: View balance");
    System.out.println("4: Exit");
    System.out.println("Enter a value 1-4");
    choice = scan.nextInt();

    }


    if(choice == 2)
    {
    System.out.println("How much would you like to withdraw?");
    int withdrawAmount = scan.nextInt();

    try
    {
    sa.withdraw(withdrawAmount);
    }

    catch (InvalidWithdrawAmount e)
    {
    System.out.println("Invalid deposit amount");
    }

    System.out.println("Options Menu");
    System.out.println("1: Deposit");
    System.out.println("2: Withdraw");
    System.out.println("3: View balance");
    System.out.println("4: Exit");
    System.out.println("Enter a value 1-4");
    choice = scan.nextInt();

    }
    if(choice == 3)
    {
    System.out.println(sa.toString());

    System.out.println("Options Menu");
    System.out.println("1: Deposit");
    System.out.println("2: Withdraw");
    System.out.println("3: View balance");
    System.out.println("4: Exit");
    System.out.println("Enter a value 1-4");
    choice = scan.nextInt();
    }

    }
    if (choice == 4)
    {
    System.exit(0);
    sa.monthlyProcess();
     
  19. Timmiluvs

    I play video games fast Prestigious

    You can split each function of the menu (deposit, withdraw, view balance) into their own methods for ease of calling. The printing of the menu should probably be it's own method for the same purpose (so you don't have to type the same lines over and over again).

    As for looping it, yes, you're going to want to do a loop of some kind. If you know what switch statements are, I'd do this (in pseudocode):

    printMenu()
    choice = scan.nextInt()

    while (choice != 4) {
    switch(choice)
    case 1:
    do deposit related stuff
    case 2:
    do withdraw related stuff
    case 3:
    do view balance related stuff
    default:
    "You gave me a bad input, try again"

    printMenu()
    choice = scan.nextInt()
    }

    If you don't know switch statements, then it can be replaced with a bunch of "if" statements (if 1 do depost, if 2 do withdraw, etc.)

    Hope that helps :p
     
    perceptrons likes this.
  20. TotesAndGoats

    Bear

    Anytime you find yourself repeating code, it needs to be inside of it's own method.
     
    perceptrons likes this.
  21. danielalee12

    Regular

    I feel like i'm hitting a wall in terms of programming. Have you guys ever felt like you can't do better than you already are (not saying that I'm that good), and how did you overcome this obstacle?
     
  22. clucky

    Prestigious Supporter

    Are you working with other people? Having programmers who are better than you code review your code is a really good way to learn how to write better code.
     
  23. danielalee12

    Regular

    Nah I'm by myself, but that's a good idea. I definitely learn a lot more when I'm surrounded by people that are better. Have you done any interesting side projects that has helped better your skills? If so, any suggestions?
     
  24. TotesAndGoats

    Bear

    I just read an article the other day talking about how programming jobs have the highest occurrence of "impostor syndrome" related anxiety. I'll have to see if I can find it again.

    But to answer your question, yes. I've been in the IT industry for almost a decade and am finishing a BS in computer science. Every single day I feel like I have no idea what I'm doing. It can either be really terrifying or really rewarding, just depends on how you look at it.
     
    Snewt likes this.