Help needed Please! COS110/121 Tuks

Gnome

Executive Member
Joined
Sep 19, 2005
Messages
7,208
Thanks man, of course I should set up Linux first?

Ah crap, on my post above I wrote GCC when I meant Cygwin. Let me start over!

This works on Windows! Basically you install Cygwin which is a Unix environment for Windows and also contains GCC (Gnu Compiler Collection), among other this includes G++ (GNU c++ compiler). This compiler is IDENTICAL to that used in Linux.

Therefore you have the option of coding in Windows yet your code will compile in Linux.

Eclipse C++ is a IDE (Integrated Development Environment) which ties in VERY well with Cygwin. It supports step-through debugging, variable inspection, stack trace, etc. What this means is you write a program in the IDE (looks like a powerful text editor :p ), then you click the compile button, if there are compile errors it will highlight the lines with compile errors and provide you with the appropriate problem reported from GCC.

Once it compiles if add a break-point in your application (you click next to a line of code, this adds a little blue dot next to it) and click start debugging the application will run UNTIL it gets to that break point, at that time it will pause running the application and show you what each variables values are, what's going on with the Stack/Heap. You can then step through EACH line of code, line by line using F5 (step into) and F6 (step over), each time the variables will change as the program progresses.

This allows you to see wtf is happening and it's invaluable, without it she won't make BIT. Even if code compiles that doesn't mean it'll run as you expect.

On Linux itself I'm not 100% sure what they use because I don't use the Informatorium, I do know however Eclipse C++ is NOT installed on the Tuks Linux PC's. I'll ask some of the ppl what they suggest for Linux @ Tuks.

Last but not least even though Eclipse C++ isn't available on Campus that doesn't mean it's not invaluable when working on your programs from home because they'll compile just like that when you take it back to campus and run it on Linux.

Eclipse C++ is available here: http://www.eclipse.org/cdt/
I have it also if you don't want to download.

Cygwin is available here: http://www.cygwin.com/
But there is a older version available on ftp.cs.up.ac.za, that FTP is ONLY available ON campus. It's got quite the directory structure but the file is there somewhere, Cygwin.zip
 

I am Penguin

Executive Member
Joined
Jan 26, 2009
Messages
7,713
Ah crap, on my post above I wrote GCC when I meant Cygwin. Let me start over!

This works on Windows! Basically you install Cygwin which is a Unix environment for Windows and also contains GCC (Gnu Compiler Collection), among other this includes G++ (GNU c++ compiler). This compiler is IDENTICAL to that used in Linux.

Therefore you have the option of coding in Windows yet your code will compile in Linux.

Eclipse C++ is a IDE (Integrated Development Environment) which ties in VERY well with Cygwin. It supports step-through debugging, variable inspection, stack trace, etc. What this means is you write a program in the IDE (looks like a powerful text editor :p ), then you click the compile button, if there are compile errors it will highlight the lines with compile errors and provide you with the appropriate problem reported from GCC.

Once it compiles if add a break-point in your application (you click next to a line of code, this adds a little blue dot next to it) and click start debugging the application will run UNTIL it gets to that break point, at that time it will pause running the application and show you what each variables values are, what's going on with the Stack/Heap. You can then step through EACH line of code, line by line using F5 (step into) and F6 (step over), each time the variables will change as the program progresses.

This allows you to see wtf is happening and it's invaluable, without it she won't make BIT. Even if code compiles that doesn't mean it'll run as you expect.

On Linux itself I'm not 100% sure what they use because I don't use the Informatorium, I do know however Eclipse C++ is NOT installed on the Tuks Linux PC's. I'll ask some of the ppl what they suggest for Linux @ Tuks.

Last but not least even though Eclipse C++ isn't available on Campus that doesn't mean it's not invaluable when working on your programs from home because they'll compile just like that when you take it back to campus and run it on Linux.

Eclipse C++ is available here: http://www.eclipse.org/cdt/
I have it also if you don't want to download.

Cygwin is available here: http://www.cygwin.com/
But there is a older version available on ftp.cs.up.ac.za, that FTP is ONLY available ON campus. It's got quite the directory structure but the file is there somewhere, Cygwin.zip

Thanks, I will download those now.
 

I am Penguin

Executive Member
Joined
Jan 26, 2009
Messages
7,713
Ah crap, on my post above I wrote GCC when I meant Cygwin. Let me start over!

This works on Windows! Basically you install Cygwin which is a Unix environment for Windows and also contains GCC (Gnu Compiler Collection), among other this includes G++ (GNU c++ compiler). This compiler is IDENTICAL to that used in Linux.

Therefore you have the option of coding in Windows yet your code will compile in Linux.

Eclipse C++ is a IDE (Integrated Development Environment) which ties in VERY well with Cygwin. It supports step-through debugging, variable inspection, stack trace, etc. What this means is you write a program in the IDE (looks like a powerful text editor :p ), then you click the compile button, if there are compile errors it will highlight the lines with compile errors and provide you with the appropriate problem reported from GCC.

Once it compiles if add a break-point in your application (you click next to a line of code, this adds a little blue dot next to it) and click start debugging the application will run UNTIL it gets to that break point, at that time it will pause running the application and show you what each variables values are, what's going on with the Stack/Heap. You can then step through EACH line of code, line by line using F5 (step into) and F6 (step over), each time the variables will change as the program progresses.

This allows you to see wtf is happening and it's invaluable, without it she won't make BIT. Even if code compiles that doesn't mean it'll run as you expect.

On Linux itself I'm not 100% sure what they use because I don't use the Informatorium, I do know however Eclipse C++ is NOT installed on the Tuks Linux PC's. I'll ask some of the ppl what they suggest for Linux @ Tuks.

Last but not least even though Eclipse C++ isn't available on Campus that doesn't mean it's not invaluable when working on your programs from home because they'll compile just like that when you take it back to campus and run it on Linux.

Eclipse C++ is available here: http://www.eclipse.org/cdt/
I have it also if you don't want to download.

Cygwin is available here: http://www.cygwin.com/
But there is a older version available on ftp.cs.up.ac.za, that FTP is ONLY available ON campus. It's got quite the directory structure but the file is there somewhere, Cygwin.zip

Which version of Eclipse should I download/use? Windows or Linux to run on Cygwin? :confused:
 

greggpb

Expert Member
Joined
Apr 22, 2005
Messages
1,818
I would advice she setup her work pc as close to the lab pc as possible..

Kubuntu runs KDE, then install a gcc and a text editor.. using a commandline compiler will give her a much better understanding of what the computer is doing...

or download VirtualPc for windows and run the dev box in a vm..

The last thing I would do is let her run on windows and the uni has moved over to linux and if she does not learn the in's and outs now she will struggle later one.

Linux based is one of the reason's, I would imagine, this course is perceived as so hard.

Maybe someone with a bit more linux knowledge than me could setup a ISO boot disk with the tools and config on it so that she could use any computer in conjunction with a mem stick
?
 
Last edited:

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
What's the scope of COS110 these days? Back in 2002 when I did it, it was "Introduction to Object Orientated Programming using Java", or something like that. The prescribed handbook was *shudder* Java Gently.
 

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
Ah, I see COS121 is still about Design Patterns... :) Back in the day it was still referred to as the infamous COS213. It is, imho, one of the most important modules to teach you best practice in OO programming. I mean, who doesn't use a Factory in at least every single project?
 

I am Penguin

Executive Member
Joined
Jan 26, 2009
Messages
7,713
Ah, I see COS121 is still about Design Patterns... :) Back in the day it was still referred to as the infamous COS213. It is, imho, one of the most important modules to teach you best practice in OO programming. I mean, who doesn't use a Factory in at least every single project?

Nice to know, how can it help me/daughter to get back on track
 

Drake2007

Expert Member
Joined
Oct 23, 2008
Messages
4,413
Object Orientated programming is the key concept of C++ so Farlig is actually fast tracking you/your daughters understanding, she can read up to get her mind around it before the development environment is sorted out.

My suspicion regarding their spec. of KDE is they want her to use KDevelop as her IDE.
 

I am Penguin

Executive Member
Joined
Jan 26, 2009
Messages
7,713
Geez man, I'm just adding to the discussion here. No need to get wound up.

No man Sorry I am not wound up at all. LOL. What I mean is that I noticed that you are a programmer from your prior posts elsewhere and was hoping to get some advise. :D
 

I am Penguin

Executive Member
Joined
Jan 26, 2009
Messages
7,713
Object Orientated programming is the key concept of C++ so Farlig is actually fast tracking you/your daughters understanding, she can read up to get her mind around it before the development environment is sorted out.

My suspicion regarding their spec. of KDE is they want her to use KDevelop as her IDE.

Ok, how can we get the right understanding about the OOP. The problem is that the Fisch marking the practicals does not give any marks when compiling her failed attempts and thus she are losing interest, fast. Therefore I need to get het going fast to be able to practise at home. The time allocated at varsity seems to be a issue. Long days and spreaded classes is getting to her.
 

I am Penguin

Executive Member
Joined
Jan 26, 2009
Messages
7,713
Ah crap, on my post above I wrote GCC when I meant Cygwin. Let me start over!

This works on Windows! Basically you install Cygwin which is a Unix environment for Windows and also contains GCC (Gnu Compiler Collection), among other this includes G++ (GNU c++ compiler). This compiler is IDENTICAL to that used in Linux.

Therefore you have the option of coding in Windows yet your code will compile in Linux.

Eclipse C++ is a IDE (Integrated Development Environment) which ties in VERY well with Cygwin. It supports step-through debugging, variable inspection, stack trace, etc. What this means is you write a program in the IDE (looks like a powerful text editor :p ), then you click the compile button, if there are compile errors it will highlight the lines with compile errors and provide you with the appropriate problem reported from GCC.

Once it compiles if add a break-point in your application (you click next to a line of code, this adds a little blue dot next to it) and click start debugging the application will run UNTIL it gets to that break point, at that time it will pause running the application and show you what each variables values are, what's going on with the Stack/Heap. You can then step through EACH line of code, line by line using F5 (step into) and F6 (step over), each time the variables will change as the program progresses.

This allows you to see wtf is happening and it's invaluable, without it she won't make BIT. Even if code compiles that doesn't mean it'll run as you expect.

On Linux itself I'm not 100% sure what they use because I don't use the Informatorium, I do know however Eclipse C++ is NOT installed on the Tuks Linux PC's. I'll ask some of the ppl what they suggest for Linux @ Tuks.

Last but not least even though Eclipse C++ isn't available on Campus that doesn't mean it's not invaluable when working on your programs from home because they'll compile just like that when you take it back to campus and run it on Linux.

Eclipse C++ is available here: http://www.eclipse.org/cdt/
I have it also if you don't want to download.

Cygwin is available here: http://www.cygwin.com/
But there is a older version available on ftp.cs.up.ac.za, that FTP is ONLY available ON campus. It's got quite the directory structure but the file is there somewhere, Cygwin.zip

Got the Cygwin running on Win7, now how to use it?

I need Eclipse 3.5 which version?

Eclipse IDE for C/C++ Developers (79 MB)

http://www.eclipse.org/downloads/

An IDE for C/C++ developers with Mylyn integration. More...
Downloads: 165,331 Windows
Mac Carbon 32bit
Mac Cocoa 32bit
Linux 32bit 64bit

and CDT 6.0 I presume

http://www.eclipse.org/cdt/downloads.php

Now how do I use run it in Cygwin?
 

Drake2007

Expert Member
Joined
Oct 23, 2008
Messages
4,413
As far as OOP, don't laugh but there is "OOP for dummies" that explains it very well.

Too many ways to skin the cat, the options are:
Eclipse and gcc cygwin etc - IMO complicated to set up and slow
Debian with virtual PC or vmware - Need plenty RAM
Dual boot Debian with XP/Win7 - can break current OSs

So which route/s have you taken and what have you got at this point?
Maybe others can comment here to help make the decision.
 

greggpb

Expert Member
Joined
Apr 22, 2005
Messages
1,818
I remember My Programming lecturer marked in binary, for projects...
Didn't work = 0
Worked = 1

Back to you daughter, being a programmer the complier is you friend you should have complied a project 100 times before it gets to your lecturer.. also moving around to different environment will give you a better understanding of what is required and linked in..
 

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
No man Sorry I am not wound up at all. LOL. What I mean is that I noticed that you are a programmer from your prior posts elsewhere and was hoping to get some advise. :D

Haha, sorry for the hostile reply then. I read some sarcasm where it wasn't supposed to be...

Anyway, OOP in a nutshell can be likened to regarding the entities you want to interact with as objects. An example might be as follows:

Are you programming an application dealing with pets? Define a "base class" called "Pet" with attributes common to each type of pet. These attributes are commonly referred to as the Properties of the class. Common attributes to all types of pets might be things like:
- Weight
- Colour
- Species

Next, you can define the behavior of the object. These behaviorAlso define common types of behavior that can be associated with all pet-types, like:
- Eat
- Sleep
- Move

You can specify default implementations for each type of behavior, for instance Move. The default implementation for a pet could be to walk, but other types of pets, like birds and fish, would fly or swim. You can override the Move implementation in the sub / derived classes.

Next, you can define sub- or derived classes, inheriting from the Pet base-class. These sub-classes can again be as generic or specific as you want, depending on the complexity you are building into the application. You could, for instance, have a Bird class inheriting from the Pet class, with extra properties associated with it, like:
- Wingspan
- Speed

You can override the default Move behavioral implementation to implement a flight behavior, but the method name would still be "Move". This little trick that allows different behaviors to be implemented with a single method-call to all objects stemming from a specific base-class, is called Polymorphism. It really becomes useful in more complex applications. You can then also add any other behavioral methods to the sub-class to denote behavior specific to the pet-type.

So yeah, in a nutshell, that is a very simple example of what Object Orientation is about. Think of your entities as objects, what attributes or properties they possess and how they behave. Hope it helps!
 

Gnome

Executive Member
Joined
Sep 19, 2005
Messages
7,208
Ok well I'm just gonna try add some constructive:

You write the code, you have the expected output, now all you have to do is write code that generates that output, test before uploading. Getting 0 because of compilation errors shouldn't be happening because you can check that it compiles.

I know sometimes you test the output and it's correct according to the specs they provide yet there is something wrong but I can honestly say I've never gotten 0 with code that followed the output provided in the practical, it might not have been full marks but not 0.

Next up is just basic programming concepts, it doesn't help you try and pass COS110/COS121 and you barely scrapped by on COS131 because that means you already had issues there, that's just gonna exasperate the situation.

Most of the people I met in 3rd year and knew how to program got 90%+ for COS131/130. If you do well in that module you'll do well in COS110/COS121, they really aren't difficult it's just lots of work (nothing compared to say 3rd year but relatively speaking)

Got the Cygwin running on Win7, now how to use it?

I need Eclipse 3.5 which version?

Eclipse IDE for C/C++ Developers (79 MB)

http://www.eclipse.org/downloads/

An IDE for C/C++ developers with Mylyn integration. More...
Downloads: 165,331 Windows
Mac Carbon 32bit
Mac Cocoa 32bit
Linux 32bit 64bit

and CDT 6.0 I presume

http://www.eclipse.org/cdt/downloads.php

Now how do I use run it in Cygwin?

You only need to setup the environmental variable (google), your path environmental variable should point to your cygwin path\bin, example from my computer:

path=c:\windows;c:\windows\system32;c:\cygwin\bin

As you can see there are plenty of other paths there too, now you simply add cygwin to it as above, each path is separated by semi-colon.

Once complete install Eclipse for C++

Because the path has been setup you don't need to do anything else.

Just go new C++ project, click Hello World, then from there start changing it.

Also make sure that you have GCC and Make selected in Cygwin (when installing, I think you can add extra components after installation), else it won't work, I usually just install everything since the binary is available from campus (200 odd mb)
 

I am Penguin

Executive Member
Joined
Jan 26, 2009
Messages
7,713
Last edited:

sn3rd

Expert Member
Joined
Jan 18, 2008
Messages
4,305
Thanks to you, Farlig and others for helping

Sorry but it's still unclear! Which version of Eclipse should I download and install From here?

http://www.eclipse.org/downloads/

An IDE for C/C++ developers with Mylyn integration.

Eclipse IDE for C/C++ Developers
Windows ???
Linux 32bit
Linux 64bit

and CDT 6.0 I presume? How does this integrate with Eclipse/Cygwin (Linux)?

http://www.eclipse.org/cdt/downloads.php

Eclipse is just the Integrated Development Environment (IDE). It helps to speed up the development process by providing you with little nice-to-haves like code-completion, tabbed viewing, etc. Once you have the IDE in place, you still need to have a compiler in order to change the C++ (man-readable) into binary (machine-readable).

If she's going to be working on Linux, she likely needs the Linux version. 32-bit / 64-bit shouldn't make too much difference if she's submitting source code. Having a 64-bit compiler simply optimises the executable to run on 64-bit capable machines. So 32-bit is a safe bet.
 
Top