Difference: ProjectZero (1 vs. 7)

Revision 72017-01-19 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Spring2017"
Deleted:
<
<

 

Lab 0

Changed:
<
<
Due January 20 at Midnight
>
>
Due January 23 at Midnight

Moodle link

 

Using the CS server for programming

Goal

Line: 12 to 12
  All code and example of run (Copy output and paste into a word document)

Links

Deleted:
<
<
 
Changed:
<
<

Step 1

>
>

Step 1 - Install software

  Windows:
Changed:
<
<
Username: Your email username (before the @)

Password: Your Kenyon ID

>
>
Mac
  • Install TextWrangler (Make sure to install 32-bit version, otherwise SFTP will not be available)
 
Changed:
<
<
Once logged in, change your password with passwd
>
>

Step 2 - Create program File

 
Changed:
<
<

Step 2

>
>
Program:
 
Deleted:
<
<
Review the

Step 3

Copy and build:
 
// my first program in C++

#include <iostream>

Line: 43 to 36
  return 0; }
Added:
>
>
  • Open Notepad++ or TextWrangler
  • Paste in the code above
  • Save as hello.cpp. Make sure to select the file type to be a c++ program.

Step 3 - Copy to Server

With Notepad++

  1. In Notepad++ from the plugin menu open the NppFTP window
  2. in the NppFTP window open a connection to the cslab computer.
    • Use the cslab profile created from the instructions above (also here)
  3. You will start in your home directory (the folder with your username). Right click on your home directory, and select "Create new direcectory". Enter "project0"
  4. Upload the file you will to send ("hello.cpp") by selecting it's tab on the editor screen.
  5. Right click on the folder where you want the file to go in the NppFTP window (Project0)
  6. The file will now be uploaded to the "project0" directory.
With Textwrangler
  1. Make sure the file you want to copy is the one selected (hello.cpp)
  2. In the file menu select "Save to FTP/SFTP Server"
  3. For server put in "cslab.kenyon.edu
  4. Select "SFTP"
  5. Enter your username and password.
  6. The path should /home/students/username (your username)
  7. Save profile as cslab
  8. In the window (which should be at your home folder with your username) click "New Folder"
  9. Type in "Project0" and hit "Create"
  10. Click on "Save"
  11. The file should now be in your folder

Step 4 - Build and run your program

On Windows

  1. Log in with PuTTy
On Mac
  1. Open a terminal window (from your applications directory)
  2. Type "ssh username@cslab.kenyon.edu" (username is your username)
  3. You are now logged in to the server
Change directory to the project0 folder by typing "cd project0"
 
Changed:
<
<
Place code in hello.cpp
g++ -o hello hello.cpp

Run with "./hello"

>
>
Do an "ls" command to list the files in the folder and make sure "hello.cpp" is there.
 
Changed:
<
<
How to put files on the server
>
>
Build the program:
g++ -o hello hello.cpp
 
Changed:
<
<
Use TextWrangler or from a MAC or Win computer.
>
>
Run with "./hello"
 

Step 4

Port your own program

Revision 62017-01-18 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Spring2017"

Line: 16 to 16
 

Step 1

Changed:
<
<
Use SSH to log into cslab.kenyon.edu
>
>
Windows:
 Username: Your email username (before the @)

Password: Your Kenyon ID

Line: 48 to 50
 
How to put files on the server
Changed:
<
<
Use secure copy (scp) or FTP from a MAC or Win computer.
>
>
Use TextWrangler or from a MAC or Win computer.
 

Step 4

Port your own program

Revision 52017-01-18 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Spring2017"

Lab 0

Changed:
<
<
Due January 21 by class time.
>
>
Due January 20 at Midnight
 

Using the CS server for programming

Goal

Revision 42017-01-18 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Spring2017"

Deleted:
<
<
 

Lab 0

Due January 21 by class time.

Using the CS server for programming

Goal

Convert a program from a previous course to work on the CS server

Added:
>
>

Turn in

All code and example of run (Copy output and paste into a word document)

 

Links

Line: 80 to 84
 
Deleted:
<
<
 
META FILEATTACHMENT attachment="UnixCHandout.doc" attr="" comment="" date="1482123935" name="UnixCHandout.doc" path="UnixCHandout.doc" size="68096" user="JimSkon" version="1"
META FILEATTACHMENT attachment="EMACShandout.doc" attr="" comment="" date="1482123935" name="EMACShandout.doc" path="EMACShandout.doc" size="45568" user="JimSkon" version="1"

Revision 32017-01-05 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Spring2017"

Line: 74 to 73
 

Reference

Added:
>
>
 

Revision 22016-12-20 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="Spring2017"

Added:
>
>
 

Lab 0

Due January 21 by class time.
Line: 60 to 61
 
  • a.h
  • b.cpp
  • b.h
Changed:
<
<
  • main.cpp Then:
    user% g++ -c a.cpp user% g++ -c b.cpp user% g++ -c main.cpp user% g++ -o main a.o b.o main.o
>
>
  • main.cpp Then:

user% g++ -c a.cpp 
user% g++ -c b.cpp 
user% g++ -c main.cpp 
user% g++ -o main a.o b.o main.o
 

Turn in

  1. Screen shoot(s) of your running program

Revision 12016-12-19 - JimSkon

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="Spring2017"

Lab 0

Due January 21 by class time.

Using the CS server for programming

Goal

Convert a program from a previous course to work on the CS server

Links

Step 1

Use SSH to log into cslab.kenyon.edu

Username: Your email username (before the @)

Password: Your Kenyon ID

Once logged in, change your password with passwd

Step 2

Review the

Step 3

Copy and build:
// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}

Place code in hello.cpp
g++ -o hello hello.cpp

Run with "./hello"

How to put files on the server

Use secure copy (scp) or FTP from a MAC or Win computer.

Step 4

Port your own program

You goal is to select a program from Data Structures and get it to run on the our Linux Server. The program must be at least 100 lines of code.

If your program has multiple source files, copy them all, includeing the .h files, and then do the following:

Assume you have the following sources:

  • a.cpp
  • a.h
  • b.cpp
  • b.h
  • main.cpp Then:
    user% g++ -c a.cpp user% g++ -c b.cpp user% g++ -c main.cpp user% g++ -o main a.o b.o main.o

Turn in

  1. Screen shoot(s) of your running program
  2. A brief writeup of your experience: What problems you encountered, what you learned.

Reference

META FILEATTACHMENT attachment="UnixCHandout.doc" attr="" comment="" date="1482123935" name="UnixCHandout.doc" path="UnixCHandout.doc" size="68096" user="JimSkon" version="1"
META FILEATTACHMENT attachment="EMACShandout.doc" attr="" comment="" date="1482123935" name="EMACShandout.doc" path="EMACShandout.doc" size="45568" user="JimSkon" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback