• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

hateradio

The Most Dangerous Yes Man
What makes you say that? It's an old screenshot I dug up, so I could be mistaken... But it has the distinctive l and 0 characters I expect from Bitstream Vera Sans Mono.
Yeah it's Bitstream, I made an edit. But it's the Serif version.

nvm, I'm going blind staring at the screen at 3am. It is indeed Bitstream Vera Sans Mono.


Edit:

PT Mono is also really nice on occassion.

 

Slavik81

Member
Yeah it's Bitstream, I made an edit. But it's the Serif version.
Opps. I wonder why I took a screenshot with that one... It did look slightly odd, but I figured it was just the rendering on a different machine.

I'll have to scrape together a new image tomorrow.
 

Slavik81

Member
No, wait... There is no way it's the Serif version. The 0 is only like that in Vera Sans Mono.

Edit: You edited. Oh the confusion.
 
Something funny I came across: Why Microsoft can blow off with C#

re: fonts
I prefer not using anti-aliasing on my fonts, but some fonts look ugly without it. I'm no font expert, so I don't know why (I think the word I'm looking for is kerning or hinting). Therefore, I stick to whatever looks good with it off.

PTMono is cool. I discovered it when looking for a free, fixed width font that looks great at small sizes. I needed it for an Android game of mine.
 

Red UFO

Member
Any Android developers in here? How do you put up with this shit? Using the Android SDK with Eclipse on Windows has been a never ending nightmare.
 

Cheeto

Member
Hi guys, I'm web developmentally challenged... can anyone give me a hand? I'm trying to make a form with two tables that the user will fill out. I need each row of the second table to have some fields with various inputs in it but then a textarea below them.

Something like this:
PCYhYeL.png


I'm guessing this will require some kind of special CSS class for table but like I said, I'm web developmentally challenged...
 
Any Android developers in here? How do you put up with this shit? Using the Android SDK with Eclipse on Windows has been a never ending nightmare.

How so? If you're using default SDK classes and gui elements, it's pretty straight forward. Most of the design is handled in XML with functionality done in Java. Environment setup is relatively straightforward in Eclipse too. Keeping dimensions relative can help with variable screen sizes, etc.

I'm not a developer, though. I studied it last semester in college. Seemed quite handy. We used the default SDK with SQLite and I found it relatively quick and painless to use once you use the SDK as intended.
 
How so? If you're using default SDK classes and gui elements, it's pretty straight forward. Most of the design is handled in XML with functionality done in Java. Environment setup is relatively straightforward in Eclipse too. Keeping dimensions relative can help with variable screen sizes, etc.

I'm not a developer, though. I studied it last semester in college. Seemed quite handy. We used the default SDK with SQLite and I found it relatively quick and painless to use once you use the SDK as intended.

He might mean the android emulator...which is a complete piece of shit.
 

nan0

Member
Any Android developers in here? How do you put up with this shit? Using the Android SDK with Eclipse on Windows has been a never ending nightmare.

I put up with it by changing to IntelliJ IDEA. The free Community version works perfectly with the Android plugin.
 
He might mean the android emulator...which is a complete piece of shit.

Yeah, the only real problem I have with the SDK is the emulator, but even then, you could just use any ol' Android device for rapid testing, then use the emulator once or twice for compatibility checks.

I'm curious to see what others' problems with it are, though. I have not used a bunch of SDKs.
 

Fantastical

Death Prophet
Just found out I forgot to submit a programming project 5 days ago. I actually finished it two days early, and just straight up forgot to submit it online.

FML
 

A Human Becoming

More than a Member
I'm starting to feel overwhelmed by Python. If anyone is willing to give me a hand understanding some concepts send me a PM.

EDIT: Look below for the explanation requested.
 

A Human Becoming

More than a Member
Don't do that. Do it publicly so everyone can see and hopefully help someone else.
Okay. I wasn't sure if asking for large explanations was allowed.

So here's the code I'm looking at. It's not mine, I'm just trying to understand how it works:

Code:
import random
import time

def displayIntro():
    print('You are in a land full of dragons. In front of you,')
    print('you see two caves. In one cave, the dragon is friendly')
    print('and will share his treasure with you. The other dragon')
    print('is greedy and hungry, and will eat you on sight.')
    print()

def chooseCave():
    cave = '' #Question 2 here.
    while cave != '1' and cave != '2':
        print('Which cave will you go into? (1 or 2)')
        cave = input()

    return cave #Question 3 here.

def checkCave(chosenCave):
    print('You approach the cave...')
    time.sleep(2)
    print('It is dark and spooky...')
    time.sleep(2)
    print('A large dragon jumps out in front of you! He opens his jaws and...')
    print()
    time.sleep(2)

    friendlyCave = random.randint(1, 2)

    if chosenCave == str(friendlyCave):
         print('Gives you his treasure!')
    else:
         print('Gobbles you down in one bite!')

playAgain = 'yes'
while playAgain == 'yes' or playAgain == 'y':

    displayIntro() #Question 1 here.

    caveNumber = chooseCave()

    checkCave(cave)

    print('Do you want to play again? (yes or no)')
    playAgain = input()

---

Here are my numbered questions that I put a comment next to in the code:

  1. So I understand that functions don't work until they're called. Wouldn't that mean displayIntro isn't called until this line? If so, why is it indented? Isn't it not part of the while statement since that is specifically for playing again?
  2. I still don't quite understand why this is here. For the past week on Codecademy and reading the book I got this code from I've never seen a blank string used (at least in a function).
  3. What does the 'return cave' do exactly? I thought return instructed the code to end the loop. Does 'return cave' instruct not to allow anymore input for that function AND to go onto the next one?

I've been trying to implement aspects of this code into an earlier set of code in the book without any progress. Hope people can help me tackle that next.
 
[*]So I understand that functions don't work until they're called. Wouldn't that mean displayIntro isn't called until this line? If so, why is it indented? Isn't it not part of the while statement since that is specifically for playing again?
[*]I still don't quite understand why this is here. For the past week on Codecademy and reading the book I got this code from I've never seen a blank string used (at least in a function).
[*]What does the 'return cave' do exactly? I thought return instructed the code to end the loop. Does 'return cave' instruct not to allow anymore input for that function AND to go onto the next one?
[/LIST]

I've been trying to implement aspects of this code into an earlier set of code in the book without any progress. Hope people can help me tackle that next.

You have some serious gaps at the fundamental level, I'll try to answer your questions but you should check another tutorial, a book or reread the first few chapters/courses you are following.

1.- They don't get executed until they are called. It's called on that line for the first time. It's indented because it's part of the while cycle or otherwise, it's part of the while cycle because it's indented (this is a specific feature of python which you should totally reread).
2.- He is initializing the variable otherwise it would raise an exception when it's compared to "1" and "2" on the next line. Remove the line and see what happens.
3.- returns ends the execution of the current method and returns the specified value. See what happens when you remove that line.

Python is very easy to code so if you have doubts I'd recommend getting into an interactive console and type the different scenarios to see what happens.
 

Magni

Member
Okay. I wasn't sure if asking for large explanations was allowed.

So here's the code I'm looking at. It's not mine, I'm just trying to understand how it works:

---

Here are my numbered questions that I put a comment next to in the code:

  1. So I understand that functions don't work until they're called. Wouldn't that mean displayIntro isn't called until this line? If so, why is it indented? Isn't it not part of the while statement since that is specifically for playing again?
  2. I still don't quite understand why this is here. For the past week on Codecademy and reading the book I got this code from I've never seen a blank string used (at least in a function).
  3. What does the 'return cave' do exactly? I thought return instructed the code to end the loop. Does 'return cave' instruct not to allow anymore input for that function AND to go onto the next one?

I've been trying to implement aspects of this code into an earlier set of code in the book without any progress. Hope people can help me tackle that next.

Q1: It's indented because it's called in the while loop. Indentation is very important in Python as there isn't curly braces or do..ends as in other languages to delimit code.
Q2: cave is set to the empty string so that you can enter the while loop. It could have been initialized to anything that isn't '1' or '2'. Some languages would have a do..while loop instead, or use a nil or null variable.
Q3: The function returns the chosen cave ('1' or '2'). Thus caveNumber = checkCave() means that caveNumber is set to either '1' or '2'.

There's an error in the code by the way, checkCave should be called with caveNumber, not cave (since cave is never defined).
 

hateradio

The Most Dangerous Yes Man
Hi guys, I'm web developmentally challenged... can anyone give me a hand? I'm trying to make a form with two tables that the user will fill out. I need each row of the second table to have some fields with various inputs in it but then a textarea below them.

Something like this:
http://i.imgur.com/PCYhYeL.png

I'm guessing this will require some kind of special CSS class for table but like I said, I'm web developmentally challenged...
First off: ew, tables.

However, it's not really hard. Just make sure to either group all the inputs you want inside a div or some other block-level element.

In this example, I put the textareas inside a div.

https://pastee.org/bv95a
http://jsfiddle.net/aS4Vb/
 

A Human Becoming

More than a Member
You have some serious gaps at the fundamental level, I'll try to answer your questions but you should check another tutorial, a book or reread the first few chapters/courses you are following.
Hey, I've been learning this for a week, cut me a little slack. :p Codecademy isn't a perfect source either. I'll have to at least re-read this chapter if not the previous one as well. Maybe I should add in notes to the code examples.
1.- They don't get executed until they are called. It's called on that line for the first time. It's indented because it's part of the while cycle or otherwise, it's part of the while cycle because it's indented (this is a specific feature of python which you should totally reread).
But why is it a part of this cycle?
Code:
while playAgain == 'yes' or playAgain == 'y':
Doesn't it initialize the code from the top? I know it doesn't work if it's not indented, I just don't get why it needs to be indented below that line. When you run the program the first time does it ignore this line going straight to displayinfo() ?
2.- He is initializing the variable otherwise it would raise an exception when it's compared to "1" and "2" on the next line. Remove the line and see what happens.
The reason this confuses me is I swear I've seen similar code without the variable assigned like that, but I could be misremembering.
3.- returns ends the execution of the current method and returns the specified value. See what happens when you remove that line.
So what you're saying is when it gets to the next line 1 or 2 has been substituted for chosenCave because of return?
Python is very easy to code so if you have doubts I'd recommend getting into an interactive console and type the different scenarios to see what happens.
That's what I've been doing with this code:
Code:
# This is a guess the number game.
import random

guessesTaken = 0

print('Hello! What is your name?')
myName = input()

number = random.randint(1, 100)
print('Well, ' + myName + ', I am thinking of a number between 1 and 100.')

while guessesTaken < 6:
    print('Take a guess.') # There are four spaces in front of print.
    guess = input()
    guess = int(guess)

    guessesTaken = guessesTaken + 1

    if guess < number:
        print('Your guess is too low.') # There are eight spaces in front of print.

    if guess > number:
        print('Your guess is too high.')

    if guess == number:
        break

if guess == number:
    guessesTaken = str(guessesTaken)
    print('Good job, ' + myName + '! You guessed my number in ' + guessesTaken + ' guesses!')

if guess != number:
    number = str(number)
    print('Nope. The number I was thinking of was ' + number)
I've been trying to get it to repeat the first string if len(myName) < 0 and not myName.isalpha. I also want it to not crash if the input is not .isalpha. I've messed with it quite a bit without progress.
There's an error in the code by the way, checkCave should be called with caveNumber, not cave (since cave is never defined).
My bad. That was caused by me messing around with it.
 

Slavik81

Member
How do you suppress warnings in visual basic? I think it's not letting me compile because im using functions like strcpy, strlen and stuff >__>

EDIT - I meant Visual Studio ><

Just friendly advice: treat warnings as errors regardless of whether or not your compiler is. I know a lot of people who let many, many warnings through without giving them a second thought; this isn't just bad practice, it's straight up dumb. Compile-time warnings are a great way of letting you know you're leaving the backdoor open for a lot of undefined behavior, or just accidents waiting to happen.

Obviously, exceptions to every rule, but yeah.

edit: Not directed at you Nekura; just quoted you for segue purposes ;)
While this is generally true, Microsoft has a number of bad warnings. I'd recommend adding _SCL_SECURE_NO_WARNINGS and _CRT_SECURE_NO_WARNINGS to your preprocessor definitions. Some of what they warn against is good, but they warn about too many perfectly reasonable things for me to deal with them.

If you want to turn on the highest warning level, I'd also consider including no_silly_warnings_please.h.
 

Magni

Member
But why is it a part of this cycle?
Code:
while playAgain == 'yes' or playAgain == 'y':
Doesn't it initialize the code from the top? I know it doesn't work if it's not indented, I just don't get why it needs to be indented below that line. When you run the program the first time does it ignore this line going straight to displayinfo() ?

I'm guessing this is your first foray into programming period?

The function definitions are just that, definitions. No code is run until they are called. Thus the first line of the program to be called is "playAgain = 'yes'" followed by the while loop. Everything after the while declaration is in the loop(since it's indented).
 

Anustart

Member
I'm in a pickle GAF.

I need to come up with a way to paste data into a RichTextBox from a Word document that doesn't bring with it any kind of metadata with the text, just the formatting.

Then I need have a way to automatically alter the length of each line based on pixels. Now, altering the line based on pixels doesn't sound so bad initially, but how would I deal with it if there's more than one font on a line of text and more than one font size? I have no clue how to go about this at all..
 

A Human Becoming

More than a Member
I'm guessing this is your first foray into programming period?
Yes it is. :p One week in.
The function definitions are just that, definitions. No code is run until they are called. Thus the first line of the program to be called is "playAgain = 'yes'" followed by the while loop. Everything after the while declaration is in the loop(since it's indented).
Okay, I FINALLY understand how it works. Being in the while loop just threw me off. First time I've seen it structured like that.
 

heytred

Neo Member
To those of you currently employed in a position as a programmer/developer, what kind of formal education do you guys have?

I ask because I'm currently on Active Duty in the US Army. I work in the communication field, specifically line of site radios (to include IP radios), satellite communications, server maintenance, basic networking, etc. I'll be getting my CompTIA A+, Net+, and Security+ certifications in the next 6 months and then I will be separating from the Military. My main goal is to attend college and get a BS in Computer Science from GA Tech, but I would like to work in the IT field or potentially as a developer while I go to school (I'm currently learning Python as well as increasing my proficiency with Linux).

Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?
 
Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?

Depends on what career path you want to follow. Proof of your work is always going to be more important than anything else though. Contribute to FOSS projects and/or create your own.
 
Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?

Formal education helps. Contributing to open source projects, working on your own hobby projects, etc help more though.
 

heytred

Neo Member
Depends on what career path you want to follow. Proof of your work is always going to be more important than anything else though. Contribute to FOSS projects and/or create your own.

I think that's a big reason I took the dive into the Linux/Ubuntu community. I plan to contribute to some open-source projects to build a bit of a resume while at the same time my own experience. My skills are obviously far too under-developed at this point to really do anything yet. I'm unsure if in the time between now and my separation (~6 months) I'll be able to learn enough to land a job in this career path.

Thank you for your responses! =)
 
I think that's a big reason I took the dive into the Linux/Ubuntu community. I plan to contribute to some open-source projects to build a bit of a resume while at the same time my own experience. My skills are obviously far too under-developed at this point to really do anything yet. I'm unsure if in the time between now and my separation (~6 months) I'll be able to learn enough to land a job in this career path.

Thank you for your responses! =)

It's a high goal to achieve and most probably you won't do it (I didn't do it at least) in your first few years but it's something to keep in mind.
 

heytred

Neo Member
It's a high goal to achieve and most probably you won't do it (I didn't do it at least) in your first few years but it's something to keep in mind.
Maybe not, but I'll do my best. My life really consists of work... and then coming home to study/learn. So... we'll see haha.
 

Godslay

Banned
To those of you currently employed in a position as a programmer/developer, what kind of formal education do you guys have?

I ask because I'm currently on Active Duty in the US Army. I work in the communication field, specifically line of site radios (to include IP radios), satellite communications, server maintenance, basic networking, etc. I'll be getting my CompTIA A+, Net+, and Security+ certifications in the next 6 months and then I will be separating from the Military. My main goal is to attend college and get a BS in Computer Science from GA Tech, but I would like to work in the IT field or potentially as a developer while I go to school (I'm currently learning Python as well as increasing my proficiency with Linux).

Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?

BS of CS, C# and Asp.net developer here. Even with that said, I don't think that you necessarily need that level of education to succeed. In your downtime just read books, and program. The more you code, the better you will get. Code everyday. If you do end up going to school, you will have some of what they will throw at you down, and be more prepared. School will teach you some good problem solving skills, but it won't necessarily teach you how to code if that makes sense.

A person that can actually code is more useful and employable than just a guy with a cs degree.
 

usea

Member
To those of you currently employed in a position as a programmer/developer, what kind of formal education do you guys have?

I ask because I'm currently on Active Duty in the US Army. I work in the communication field, specifically line of site radios (to include IP radios), satellite communications, server maintenance, basic networking, etc. I'll be getting my CompTIA A+, Net+, and Security+ certifications in the next 6 months and then I will be separating from the Military. My main goal is to attend college and get a BS in Computer Science from GA Tech, but I would like to work in the IT field or potentially as a developer while I go to school (I'm currently learning Python as well as increasing my proficiency with Linux).

Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?
As a developer, a college degree goes a long way. If you can code (especially if you're good at it), you can get a job without a degree. But it will be harder. IMO CS is defintiely a field where having a degree is worth it both short term and long term.

I know lots of people who had part time developer jobs while in school. Naturally, they didn't pay anywhere near what a full-time developer earned, but they were pretty decent money and great experience.

What can you do right now to increase your employability? Finish a project that you can show an employer as evidence that you know how to code. Excepting corporate type jobs, most employers just want to know if you can do the job or not. A degree is one signal that you can do the job, and completed projects under your belt is another.
 

heytred

Neo Member
Thanks for the replies, I really appreciate it. Getting my degree is also a big personal goal for me, I was the first person in my family to attend college, and then I left to join the military (I felt like too much of a burden on my family). So school is a must for me - it's my number one goal. As far as working while in school, the intent is purely for experience. My school and housing will be paid for by the military, with cash to spare, so it's all about honing my skills.

With that being said, I'll continue with my current path. Keep learning and increasing my proficiency. I'm sure I'll ask you all some pretty elementary questions in the future, just a head's up. =)

Any resources you suggest outside of LearnPythontheHardWay and CodeAcademy?
 
What can you do right now to increase your employability? Finish a project that you can show an employer as evidence that you know how to code. Excepting corporate type jobs, most employers just want to know if you can do the job or not. A degree is one signal that you can do the job, and completed projects under your belt is another.

I agree. When hiring you look at two main aspects. One is technical skills, which you can cover off from your work history or open source projects. In this regard you can take care of that as planned.

Just as importantly, the other aspect is knowing that this person will sit down for 40 hours a week and actually do the job. Generally commercial coding can be pretty bland and a lot of discipline is required. Will this person document? Will the follow the agile processes properly? Will they test their code even if it is the most boring and simplest bit of code you could imagine?

A degree is an indicator that you are likely prepared to do so. This is because 95% of a degree is pretty much bullshit, but you still did the work and got it done. Ironically having a lot of practical examples but not a degree, could end up counting against you.

Of course there are some places just looking for raw programming talent, but I'd say they are few and far between.
 

heytred

Neo Member
I agree. When hiring you look at two main aspects. One is technical skills, which you can cover off from your work history or open source projects. In this regard you can take care of that as planned.

Just as importantly, the other aspect is knowing that this person will sit down for 40 hours a week and actually do the job. Generally commercial coding can be pretty bland and a lot of discipline is required. Will this person document? Will the follow the agile processes properly? Will they test their code even if it is the most boring and simplest bit of code you could imagine?

A degree is an indicator that you are likely prepared to do so. This is because 95% of a degree is pretty much bullshit, but you still did the work and got it done. Ironically having a lot of practical examples but not a degree, could end up counting against you.

Of course there are some places just looking for raw programming talent, but I'd say they are few and far between.

I'm sure my military experience will help as far as the discipline is concerned as well (at least I hope). I progressed incredibly fast in my short 4 1/2 years while on Active Duty and know how to operate in a professional environment. I'm currently a promote-able Sergeant working as an instructor for signal Lieutenants... or maybe it's just wishful thinking.

Again, thanks all for the replies.
 

Godslay

Banned
Thanks for the replies, I really appreciate it. Getting my degree is also a big personal goal for me, I was the first person in my family to attend college, and then I left to join the military (I felt like too much of a burden on my family). So school is a must for me - it's my number one goal. As far as working while in school, the intent is purely for experience. My school and housing will be paid for by the military, with cash to spare, so it's all about honing my skills.

With that being said, I'll continue with my current path. Keep learning and increasing my proficiency. I'm sure I'll ask you all some pretty elementary questions in the future, just a head's up. =)

Any resources you suggest outside of LearnPythontheHardWay and CodeAcademy?

Coursera is a good one iirc they had some python stuff not too long ago. Udacity does some of their projects in python as well. Good luck.
 

heytred

Neo Member
Coursera is a good one iirc they had some python stuff not too long ago. Udacity does some of their projects in python as well. Good luck.

Awesome, thanks! I'll check it out.

Beyond what I've already listed, I'm also reading Introduction to Computation and Programming Using Python, Spring 2013 Edition which is based on an MIT course.
 

Madtown_

Member
Are you only learning python? Obviously it's early in your path but I'd recommend learning at least one other language well.

Maybe one in the c family. If you're strong in multiple languages it can definitely help your marketability.
 

Ixian

Member
Another thing that helps immensely is knowing someone that works where you're applying. That's how I originally got my foot in the door at my current job, and I've been there for almost five years now. :)
 

bluemax

Banned
To those of you currently employed in a position as a programmer/developer, what kind of formal education do you guys have?

I ask because I'm currently on Active Duty in the US Army. I work in the communication field, specifically line of site radios (to include IP radios), satellite communications, server maintenance, basic networking, etc. I'll be getting my CompTIA A+, Net+, and Security+ certifications in the next 6 months and then I will be separating from the Military. My main goal is to attend college and get a BS in Computer Science from GA Tech, but I would like to work in the IT field or potentially as a developer while I go to school (I'm currently learning Python as well as increasing my proficiency with Linux).

Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?

I feel like the major difference between a lot of people who are self taught or went through trade tech stuff and people with full on CS degrees is the ability to be just a programmer vs being a computer scientist/engineer.

That being said, if you're good you'll find work.

FWIW my dad was active duty military for awhile and then got out and has been working as a programmer for Boeing for over 10 years IIRC, and his formal education includes like 1 semester at Rick's College and a couple of ITT Tech classes.

I work with a guy who was entirely self taught afaik and he's a better programmer than a lot of my college classmates.

Another thing that helps immensely is knowing someone that works where you're applying. That's how I originally got my foot in the door at my current job, and I've been there for almost five years now. :)

This always helps. And the more demonstratable work you have the better.
 
My mantra which I seldomly follow is to try to be competent (at minimum) in the languages that are in demand in the locale that you wish to work.

I research this in the most unscientific manner imaginable, which is to go to Dice.com and do searches for my city and then by language. For example, for the Charlotte NC area, the jobs presently in demand by language are

C# (181)
Java (295)
C++ (281)
Python (24)
Ruby (6)
Objective C (16)
VB + Visual Basic (74)
PHP (39)
Perl (67)

This list is by no means exhaustive, but the simple point is that if you want to work in Charlotte (or insert city), you probably want to know Java, C#, or C++ (or insert language in demand in your desired city).

Obviously, learning other languages and tools is certainly recommended, if only to expose yourself to different methodologies and to make yourself more marketable as a whole. But if you place all of your eggs in the Ruby basket and try to apply in Charlotte, you might be in for a world of hurt. Again, just for example.
 

jokkir

Member
Can someone explain to me when the copy constructor is called here?

Code:
#include <iostream>
#include <cstring>
using namespace std;

class abc {
      char def[15];
   public:
      abc( ) {   strcpy(def, "JGNR");   cout << "A basic ABC" << endl;   }
      abc(const char s[ ]) {   strcpy(def, s);   cout << "A string ABC" << endl;   }
      abc(char c) {   def[0] = c;   def[1] = '\0';   cout << "A char ABC" << endl; }
      abc(const abc &);
      void operator=(abc);    // this abc object accepted by VALUE (copy)!
      friend abc operator++(abc &);
      void out( ) {   cout << def << endl;   }
};
abc::abc(const abc &from) {
   cout << "copy an abc..." << endl;
   int i;
   for(i=0; from.def[i]; i++)
      def[i] = from.def[i] - 2;
   def[i] = '\0';
}
void abc::operator=(abc to) {
   int i, n = strlen(to.def), m = strlen(def);
   for(i = 0; i < m; i++)
      to.def[n + i] = def[m - (i+1)];
   to.def[n + i] = '\0';
   to.out( );
   cout << "------" << endl;
}

abc operator++(abc &a) {
   int i = 0;
   abc c("OG");
   while(a.def[i] != '\0')
      i++;
   for(int j = 0; c.def[j] != '\0'; j++) {
      a.def[i] = c.def[j];
      cout << "i:" << i << " j:" << j << " c.def[" << j << "]:" << c.def[j] << endl;
      i++;
   }
   a.def[i] = '\0';
   a.out( );
   return a;
}
int main( ) {
   abc x, y("NAWIBO-");
   x.out( );
   y = ++x;
   x.out( );
   y.out( );
   return 0;
}

Using Visual Studio, it says it get called in the return part here:
Code:
abc operator++(abc &a) {
   int i = 0;
   abc c("OG");
   while(a.def[i] != '\0')
      i++;
   for(int j = 0; c.def[j] != '\0'; j++) {
      a.def[i] = c.def[j];
      cout << "i:" << i << " j:" << j << " c.def[" << j << "]:" << c.def[j] << endl;
      i++;
   }
   a.def[i] = '\0';
   a.out( );
   return a;
}

Still a bit confused when copy constructors are called >>
 
I feel like the major difference between a lot of people who are self taught or went through trade tech stuff and people with full on CS degrees is the ability to be just a programmer vs being a computer scientist/engineer.

That being said, if you're good you'll find work.

FWIW my dad was active duty military for awhile and then got out and has been working as a programmer for Boeing for over 10 years IIRC, and his formal education includes like 1 semester at Rick's College and a couple of ITT Tech classes.

I work with a guy who was entirely self taught afaik and he's a better programmer than a lot of my college classmates.



This always helps. And the more demonstratable work you have the better.

This is so true, I have met many self taught programmers who can only write scripts to do simple tasks and just understand how to write code but not design software. Then I have met some who just get it, without the formal education.

For example in a software engineering class in college we were tasked with creating software that would be a mobile app for a workout routine. So the first issue is having a logical thinker thinker who can even come up with an application design before even starting to code.

Then we split up all the objects and psuedo coded them up, we had to provide UML stuff so it was necessary. Some people just choked, didn't know how to write UML. The worst was some guys didn't understand even what data they would even want in the object or what functions or functionality the object would need. He was a good coder, but he couldn't actually ever take an idea and design it into a program; and we are talking about a junior in a engineering school's CS program.

So it is all hit and miss, you have to know more than the languages, you can learn all of C++ in a 15 week course. But then understanding data structures, algorithms, sorting algorithms, databases, security & ops, operating systems, parallel computing, software engineering, and design is all just as important as knowing how to write code. Just cause you know English doesn't mean you can write good books, there is more to it than just knowing the languages.

My advice if you are going to do the self taught route, after you learn a language pick a college and look at the undergrad classes required for a degree and try and teach yourself that stuff at least for the first few classes. You can usually find out the book they use, or get a syllabus and learn each item on it yourself online. I actually still have all my syllabuses from my undergrad classes (at MS&T/UMR) in a box if anyone would be interested in a suggested list and order to try them in.
 

heytred

Neo Member
Are you only learning python? Obviously it's early in your path but I'd recommend learning at least one other language well.

Maybe one in the c family. If you're strong in multiple languages it can definitely help your marketability.

As of right now, yes. The plan is to move onto more languages (I was thinking C# then Java), but obviously I want to learn Python and adventure into some practical application before I commit fully to another language. At the moment I'm familiarizing my self with the little differences between a few of the 'top players' as I go, but that's not my focus.

Again, thanks for all the replies. You guys have made me feel even more confident that I'm on the right track.
 

Magni

Member
This is so true, I have met many self taught programmers who can only write scripts to do simple tasks and just understand how to write code but not design software. Then I have met some who just get it, without the formal education.

For example in a software engineering class in college we were tasked with creating software that would be a mobile app for a workout routine. So the first issue is having a logical thinker thinker who can even come up with an application design before even starting to code.

Then we split up all the objects and psuedo coded them up, we had to provide UML stuff so it was necessary. Some people just choked, didn't know how to write UML. The worst was some guys didn't understand even what data they would even want in the object or what functions or functionality the object would need. He was a good coder, but he couldn't actually ever take an idea and design it into a program; and we are talking about a junior in a engineering school's CS program.

So it is all hit and miss, you have to know more than the languages, you can learn all of C++ in a 15 week course. But then understanding data structures, algorithms, sorting algorithms, databases, security & ops, operating systems, parallel computing, software engineering, and design is all just as important as knowing how to write code. Just cause you know English doesn't mean you can write good books, there is more to it than just knowing the languages.

My advice if you are going to do the self taught route, after you learn a language pick a college and look at the undergrad classes required for a degree and try and teach yourself that stuff at least for the first few classes. You can usually find out the book they use, or get a syllabus and learn each item on it yourself online. I actually still have all my syllabuses from my undergrad classes (at MS&T/UMR) in a box if anyone would be interested in a suggested list and order to try them in.

This. I'll be done with my Master's in Software Engineering at the end of the year normally, and we do very little programming, they expect us to learn that ourselves since anyone can program. What we spend time on is the design and quality part.

edit: that doesn't mean we don't have projects, I'm working on a carpooling Android app right now actually, but we just don't spend the lectures dwelling on stuff like syntax and what not. They just gave us some basic rules first semester of undergrad (indent your code, name your variables well, etc etc) and that's it.
 

LukeTim

Member
Programming gaf, I have a problem related to web technologies, and I want to find a good solution.

So, I need to retrieve the client's timezone offset. This is the way I intend to do it:

First, get the client's timezone offset using javascript and send it back to the server:

Code:
<!DOCTYPE html>
<html>
<head>
	<title>Getting Timezone...</title>
	<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript">
		var tz_off = (new Date()).getTimezoneOffset();
		
		$.ajax({
			url: "timezone.php",
			type: "GET",
			data: {
				timezone_offset: tz_off
			},
			beforeSend: function() {
				setTimeout(function() {
					alert('Could Not Get Timezone Information');
					window.location = '../home.php';
				}, 2000);
			}
		});
	</script>
</head>
<body>
	
</body>
</html>

Next, take that GET request and store the data in the $_SESSION variable, and then modify the header to redirect the browser to the homepage:

Code:
<?php
	start_session();
	
	$_SESSION['timezone_offset'] = $_GET['timezone_offset'];
	
	header('Location: home.php');
?>

I was just wondering whether this was the best way to do it. It's the first solution I have come up with, and it seems a little hacky...

Any ideas?
 
Programming gaf, I have a problem related to web technologies, and I want to find a good solution.

So, I need to retrieve the client's timezone offset. This is the way I intend to do it:

First, get the client's timezone offset using javascript and send it back to the server:

Code:
<!DOCTYPE html>
<html>
<head>
	<title>Getting Timezone...</title>
	<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript">
		var tz_off = (new Date()).getTimezoneOffset();
		
		$.ajax({
			url: "timezone.php",
			type: "GET",
			data: {
				timezone_offset: tz_off
			},
			beforeSend: function() {
				setTimeout(function() {
					alert('Could Not Get Timezone Information');
					window.location = '../home.php';
				}, 2000);
			}
		});
	</script>
</head>
<body>
	
</body>
</html>

Next, take that GET request and store the data in the $_SESSION variable, and then modify the header to redirect the browser to the homepage:

Code:
<?php
	start_session();
	
	$_SESSION['timezone_offset'] = $_GET['timezone_offset'];
	
	header('Location: home.php');
?>

I was just wondering whether this was the best way to do it. It's the first solution I have come up with, and it seems a little hacky...

Any ideas?

Why wouldn't you just redirect in javascript after your ajax call?
 
Top Bottom