What Machines can I use
We have specially set up workstations in the 3rd floor of the Jack Brown Hall.
Each lab has tables set up for laptops and the labs are on the Campus WiFi
Network.
The labs are open 9am-10pm except when there is a class in them. The free
times are listed on the door of the lab.
* Keep your password a secret. Brothers and sisters have caused a lot of trouble to some of our users.
* Never give your password over the phone, send it by EMAIL, or into an unchecked web site. Nobody in this department will ever ask for your password or give you a password over the telephone or EMAIL.
* Use the GUI password tool or the 'passwd' command to change your password regularly:
passwd your_user_id
Old Password:
New Password:
New Password:Passwords are input invisibly.
* Make your password unguessable. Any English word or name is easily guessed! Include digits and symbols.
* Log out before you leave.
The screen may be blank. If there is a mouse - move it. Otherwise tap the return key. If this fails look for the on/off switch for the monitor and make sure it is ON.
A "login:" window should appear - input your own login name. This is your personal identifier and is made up of your initials and part of your family name. Click the OK button and you'll be invited to input your password. Input your Password and click the Login button.
How do I finish
Make sure that you
2. if you dialed in, logout/exit(CTRL/D) from from the dial-in system and close your ssh window...
jbh3-1.csci.csusb.eduto get into our network (all other machines are hidden from the Internet). To login to a lab machine type this command in your JBH3-1 terminal window:
ssh jb358-22to use machine number 22 in room JBH358.
You can also use ssh to send files from one machine to another. It has a very nice user interface.
How do I access the Zip Drive/CD-ROM drive
Look for icons on GUI desktop... Note: remote machines can't read your
hardware thru the ssh program -- not a secure feature.
How do I access my Flash drive
Insert the drive and its icon should appear on the desktop. Double click
to open and Right click for a menu of other things you might need
to do. To finish use the right-click menu to "Safely Remove".
What are these Ms in my DOS file
Sometimes you will see some funny characters in a file that came from
a Microsoft computer: ^M and ^Z are special ASCII codes that the MS-DOS
system needs. On many of our machines they can be removed by running a
command like this:
dos2unix <DOSfile >UNIXfile(in 'vi' you can also type in this magic incantation
:g/^V^M/s///where ^V means "hold down the CTRL key and tap V, and ^M is CTRL/M )
You can put in the special DOS characters like this:
unix2dos >UNIXfile <DOSfilegenerates a DOS file on the disk.
What Internet software do you like for MS Windows
I use MS Internet Explorer or Firefox as a browser and SSH for
programming and file transferring files.
Can I use other labs on Campus
Yes. Most computer labs are on the Internet.
SSH is installed on many of them.
Can I plug my PC Ethernet card into your Network
No.
This is an incredible security risk. It takes several
hours of
careful work to set up a new host on the Internet. Inexperienced
users have shut down the campus network by trying to do it themselves.
If you need to do this as part of a special course, contact the
technician and head of department
well before you need it for special training and support.
We have allowed people with specific disabilities to connect their special machines as terminal to one of our workstations. This is fairly secure and easier to set up.
Do you have WiFi
Yes, the campus has put transponders all over the place.
The signal has been getting stronger as they add new ones.
Most of JBH is now well covered. If there is a blank
spot we can ask for the TNS people to fix it.
Can I use a Local Internet Service Provider or AOL
Yes.
Several local services offer a local dial up number and an
Internet account. Make sure that you select one that offers
WWW browsing, Email, and SSH.
Earthlink works well from San Bernardino area but SSH
can be horribly slow. In fact it is as slow as a 1960's teletype --
or sometimes even slowrer:-(
How do I upload or download files from my Home
SSH has a secure file transfer program that uses a Graphical User
Interface (GUI) for most file types.
For small ASCII/Text files use SSH to give you a command line terminal and input this command
cat >new_file_nameThen tell your ssh to Edit->Paste the text copied from a window on you machine. Warning: the CTRL/V short cut doesn't work!
To get your own copy, at home, of a file called filename, the command
cat filenamedisplays the file in the terminal and you can copy/paste the content into the application where you need it.
The above techniques do not work with binary files.
Can I avoid Learning UNIX
If you aren't a CSci major, you may be able to avoid UNIX for the rest of
your career. Meanwhile you can use the KDE Graphical User Interface when
you are in the labs.
Remotely, there is a program that lets you do simple things using a menu. Its called 'umenu'. Dr. Botting and a team of students wrote it to do most of the CSci201 things:
umenuThis is a command on our system that gives you a menu of things you might want to do. Try it, if anything is wrong with it let Dr. Botting know.
Can I copy/change/port our software
The source code for Gnu compilers(gcc or g++), our LISP,
our Prolog, and our Smalltalk are
programs can be copied legally for your own use. You
may make copies of some of the software we have written ourselves or obtained
from the Internet as Freeware. You should not sell these. Don't let people
copy them
without making sure that they will not sell them as well.
How do I get on the Internet
You are on it the moment you login or dial in! All CS UNIX machines can
access the Internet.
How are machines identified
Each machine (a.k.a. node) is given a unique Internet
Protocol (IP) number and also a unique name. The number is a sequence of
four numbers( for example: 139.182.38.10). The first two numbers(139.182) are
shared by all the machines at CSUSB.
One or two special machines keep track of all the names and numbers and are called the 'name servers'. They forms our Domain Name Service (DNS). If they don't recognize the name they pass the problem to the CSUSB DNS, and so on up.
Notice that if a number is not in the DNS data base the machine can not work on the Internet. If the number duplicates another machine's number than both machines can have problems. In a worse case scenario (and this happened) the whole campus network starts to misbehave.
An Internet name starts with the machine's local name and then a list of sub-domains and domains. For example 'jb359-11.csci.csusb.edu' was a machine called jb359-11, on the Comp. Sci. part(csci) of the CSU San Bernardino domain(csusb) of the EDUcational domain of the Internet(edu). Our name servers(whisper, echo,coyote,...) convert the name into the Internet number '139.182.38.10' for us.
What is my account
An account gives you access to machines, an on line identity, and
on line data storage.
The information about accounts is shared by the Network
Information Service (NIS or yp) servers. Accounts are named by a user-id.
A User Id(public) and Password(secret) lets you log in at any of our
workstations and dial-in
servers. You get access to similar operating systems
(UNIXen) and files. You get a home directory to be hold your files. You
will find your mail waiting for you on any machine as well as if it had been
delivered there. In some classes your account can be given
a special public directory on our World Wide Web Server.
Are my files on all machines in this lab
Yes! The Networked File System(NFS) lets us keep your
files on a server and export them to all machines in one
lab.
Is my password the same on all the machines
Yes! The NIS or Yellow Pages(yp) Servers distribute
the account names, passwords, etc. to all systems on the
computer science network that needs them. We use
'passwd' to change passwords. Do
this as often as you can!
How do I use a different machine
Use ssh to login
because it encrypts your password and other
information. To get to a machine called node with login name user_name
try this command:
ssh node -l user_nameIf ssh says that you've not used a machine before and you typed the node correctly, answer "yes" (not just "y"!).
What does xyz://wiz.bang.nuts/dir/file.type mean
This is a Universal Resource Locator or URL. It tells you
and certain programs where and how to find something on the Internet. The
first part 'xyz:' identifies how to do it - the protocol: FTP, mailto, news,
file,...,http. The next
part: '//wiz.bang.nuts' defines which machine to contact. It will
be the machine called "wiz" in the "bang.nuts" domain. The last part
of the URL looks like this:
'/dir/file.type' and indicates where the resource is
on the machine. The last part of the file name '.type'
indicates the type of data in the file.
You can kill most programs by sending a CTRL/C and waiting a while. You can also make a running program suspend and restart it later. Holding down CTRL and tapping the Z suspends the running program and you can then type in commands. The command
fg(foreground) restarts it.
bglets it continue in the background.
stop pico/mail/vi/...
You quit pico by following the menus.
To quit Emacs tap CTRL/X and then CTRL/C.
To quit vi , try Esc(CTRL/[) and then ":q!" and tap Enter/Return. To save your work use: ":qw" and tap Enter/Return.
make a new file
Input the command
cat >new_file_namethen feed it your data (type it, upload it, or paste it). Then tap CTRL/D. If you use an old file name, it is overwritten.
A smart programmer keeps a skeleton file for new projects and starts a new one by copying it:
cp project.cpp new_project.cpp
output a file
To output a file to your screen use:
cat file_nameTo look inside a large file:
more file_name
A text file is printed to a printer like this
a2ps filename | lpr
ls -l file_name
file file_name
ls
ls directory_name
edit a file
Every body has a favorite editor.
In KDE and other GUIs there are three or four editors and word processors that work well.
For beginners using command lines the Pico editor seems to work well:
pico file_nameThis lists the available commands at the foot of the screen.
For power users either vi or emacs editor seems to work well:
vi file_name
emacs file_name
delete a file
To permanently and instantly destroy a file and its contents is as easy as:
rm file_nameThis is safer:
rm -i file_nameTo empty a file, use:
cat /dev/null >file_name
do a quick test run of some code
We have some simple software that makes it easy to test
simple programs. My command
~dick/bin/Q filechooses the right compiler etc. for you. The program that selects the correct operation is called 'quickie' or 'Q'. If you have a "Makefile" then Q searches for 'program' and if it is a target then 'make' is invoked. Given a file name with no known suffix, Q can run an interpreter determined by the first line in the file. Q is a script that describes how to interpret many different kinds of file. For ed/ex a shell escape !Q file_name is used. Similarly for EMACS. Q can also be invoked directly at any shell prompt: $ Q file_name.
set up a hotkey for Q
For 'vi' its easy: Type the command 'Q setup'. A single
keystroke('q') is mapped into commands that
save the current version of the program,
suspend the editor ('vi'), and run the correct
interpreter or compiler for the program being worked on.
Afterward tap the return key to restart 'vi' as it was before the test run.
learn to be a UNIX power user?
Go to one of the CSci Club workshops.
Then take CS360.
avoid core dump files
To disable the creation of core dumps in ksh and bash, add this
line in your .profile and .bash_profile:
ulimit -c 0
If you are using csh or tcsh, put in .cshrc this line
limit coredumpsize 0
If you don't do this you can clean out all existing 'core' files by typing in this command:
find $HOME -type f -name core -exec rm -i '{}' \;
. . . . . . . . . ( end of section How do I ...) <<Contents | End>>
What does RTFM mean
It means "Read The Famous Manuals". Sadly we don't have
man -k keyword
apropos keywordand have to use the Linux Web based "help" pages.
Programs are put in files with a particular suffix ("extension") at the end of the name. Some are as shown below
| Language | Typical file name | Which Machines? |
|---|---|---|
| C | program.c | all |
| C++ | program.cpp | most |
| HTML | file.html | all -- lynx, lincs,... |
| Java | program.java | most |
| LISP | program.lsp | most |
| Pascal | program.p | none |
| Prolog | program.plg | most |
| ASCII Text | file.txt | all |
| MS Word | file.doc | Try JB360 or OpenOffice |
| Compressed | file.type.gz | all -- use gunzip |
| " | file.Z | all - use compress |
| " | file.zip | all -- use gunzip |
| PostScript | file.ps | Print or use "ghostScript" |
| Archive | file.tar | all -- use tar |
| Graphics | file.gif | most -- use xv, the Gimp, etc |
To find out more about the languages above take CS320!
Do we have a list of UNIX commands
The CS360 class there is a list of typical UNIX commands:
[ commands.html ]
There are too many commands for a complete list. You can also
add new commands. Indeed if you compile a program you produce a
new command!
UNIX commands include all the executable files found in a string of
directories including:
bin /bin /usr/bin /usr/local/bin /usr/bsd /usr/ucb /usr/bin/X /share/bin
Here is a quick list of ones that you'll use most. To master UNIX take CS360.
file(guess content), mv(move/rename),
rm(remove), cat(output conCATenated files),
cp(copy), chmod(change mode),...
ls(list), cd(change directory), mkdir(make),
rmdir(remove directory), mv(move/rename directory)
pico,vi,emacs, ex, ed,...
who, finger, w, top, write, talk,...
mail, pine,elm, ...
gcc,g++, javac...
ping(test if alive), ssh, scp, ...
lynx, lincs, netscape, Konqueror
grep, fgrep, egrep, find, ...
sed, awk, perl, java, sh, ...
Do we have any more FAQ
Yes - lots.
[ index.html ]
How do I chat with other users
If they are on the same machine type in one of these commands:
write user_nameIf someone writes or talks to you, respond by a similar command at your terminal. If you don't want to be talked to:
mesg nstops people writing/talking to you.
When you use 'write' type short lines. Type
ofor 'over' and wait for a reply. Type CTRL/D to sign off/hangup.
Can I run a graphics program remotely
If either machine does not run UNIX, and you aren't using Java or
a Web Browser to control your window then you can't. With UNIX
on both machines it can be done. UNIX includes
the XWindows system. It was designed (at least 20 years ago) to allow
windows to be sent across the Internet.
On our UNIX workstations we run XWindows. First your local machine
must let the other remote machine use your display.
To do this, on your machine, run the 'xhost' command for the
machine you want to access
xhost name_of_remote_machine
The remote machine needs to know two things about your "local" machine: the type of terminal you are using and how to find it on the Internet. An Xterminal has type
xtermso input this command at the command prompt on the remote machine
export TERM=xterm
Finally tell the remote node where you want things displayed:
export DISPLAY=your_machine_name:0It tells the other machine to send windows and graphics to your machine.
Do you have any Advice for Project Work
In a terminal window
Q p1.cppif the code is in file p1.cpp in your current working directory.
On other systems you may have to do the steps in 'Q' by hand:
g++ -o p1 p1.cppwill compile it and
./p1will run it. You can repeat the last compilation by typing
!g++into a terminal or use the arrow keys.
Or, for more complex projects with code in many files, you can create a Makefile by using any UNIX editor that contains lines like this
test: p1
./p1
p1 : p1.cpp
g++ -o p1 p1.cpp(be careful to use the <Tab> key to indent the commands.
make testwill update p1 and then execute it for you.
Each project is matched with an examination. In the examination you will have to answer questions about your latest project.
Recently, in CS201, someone desperately downloaded code from the internet that sounded like it might solve the problem. It didn't. It got zero.
Again, in a recent Comp. Sci. course, one student got some code from his brother at another university and then let six friends copy it and make small changes. Six students handed in six variations of the code. It was a solution to a different problem. They all got zero.
University Policy on Plagiarism
Please read page
51-52
of the catalog.
Do's and Don't's for Projects.
THINK. If you rush into code and patch it until it works you may score less than someone who takes time to think about the problem and possible solutions before writing the code. You can make notes using an editor. Start with: What are inputs and outputs? and/or the givens and goals? and/or the before and after conditions? How are these connected? Make notes on this analysis of the problem. What are some possible ways of solving it (designs or algorithms)? Choose one. Turn your notes into comments at the top of a program.
Make it Meaningful. It is up to you to use meaningful identifiers and comments that make it clear why the code is going to work. Don't hand in a separate algorithm or structure chart. Instead your file should include comments that show the design. A function definition should start with a comment saying (1) what it assumes and needs, (2) what it produces or guarantees, plus (3) a very brief algorithm. Make it clear and correct before you make it fast. Check all code before I grade it. If you have a bug: Add comments about the symptoms... remove the comments when fixed. If I find uncommented errors you will loose points. If I find things that I can't understand then you will also loose points.
Most Errors occur when people (1) misunderstand the problem, (2) think of efficiency before correctness. Real problems are not obvious and are not clearly specified. The descriptions of the programs in the book are like this. There are several different programs that will fit what the book asks you to do. I leave the interpretation of them to you yet: (1) K.I.S.S. (= Keep It Simple!). (2) Demonstrate the features and topics described in the book and course at that time. (3) If in doubt A.S.K. (= Always Seek Knowledge). (4) Document (in comments) how you interpret the problem(Analysis)
Always Seek Knowledge (ASK)
I expect you to come and talk to me or other teachers about projects. You
should be careful about talking to other students, however. They do not
know enough to give you good advice. Also beware searching the Internet --
you'll probably find a solution to a differnt problem.
Document It As You Go
Real problems don't have obvious solutions. Whether you know what the code
will look like or not add a comment that says what the program must do --
you can copy the description in the book. This may give you an idea. If
not think up a special case that you can see how to solve. Use comments to
describe the special case and how it case is solved. Make it compile! Add
a simple output to see if the algorithm will work -- nothing else. It
will probably have errors. This is normal. Declare variables and
recompile and test. Add initial values. Test until it runs. Add comments
describing an algorithm. Write code implementing the algorithm. Test.
Divide and conquer
Develop code in small iterations. Tackle one complication at a time.
Test and retest.
Rerun the previous tests.
Don't let the sun rise on bad code!
When the current version passes all tests, look for ways to re-factor code.
For example use the
DRY
( Don't Repeat Yourself )
rule to spot code that can be put in a loop or functions, etc.
Stop!
Stop before you are about to run out of time or when it does every thing that
the book asked for.
How to Fail a Programming Assignment
Carol Edmondson at the University of Tasmania has documented the
following techniques students have used to fail her courses:
You can access our system by using the same system that I have in the class room and office. This is the free Windows SSH client at: [ http://ftp.ssh.com/pub/ssh/ ] Download and install the latest SSHWinClient-3.x.x.exe file. Connect it to
jbh3-1.csci.csusb.eduand log in. You then will need to login to a lab computer like this
ssh jb358-10(you can use any of these machines from JBH3-1).
You won't be able to do graphic programs or use KDE to make things easier.
A key rule:
| Command | Purpose |
|---|---|
| cat >f | Upload or input a file called f. You can type in the code or copy/paste it from your machine. End with Enter and Control/D |
| cat f | List the file f on your screen. |
| g++ -o p p.cpp | Compile a program called p |
| ./p | Execute/run a program called p in this directory(.) |
| make t | Follow a recipe in Makefile to make t |
| cd d | change working directory(folder) to d |
| pwd | Print working directory |
| ls | List the file names in this directory |
| file * | List the files |
| mkdir d | Make a directory called d |
| more f | Display a file f one screen at a time |
| rm f | Remove a file (dangerous....) |
| mv f n | Change f's name to n, or move it to a directory |
| cp f n | Copy f to file n |
| pico f | Edit a file called f (easy to use but not powerful) |
| vi f | Edit a file called f (powerful but not easy to use) |
| emacs f | Edit a file called f (powerful and I can't use it) |
| lynx u | View a web page with URL u while on JBH3-1. |
| links u | View a web page with URL u. |
Who can help me
Your teacher or lab assistant is the first person to talk to. In the evening
and on the weekends an experienced student may be on duty to provide
emergency help. Any faculty member with an open door will be interested
in a program that isn't working properly -- just bring them a print out
of the code and the last test/compilation.
Kwon Soo Han(kwhan) and Nam Kim keeps our systems running.
Where can I make suggestions
Here
[click here
if you can fill this hole]
. . . . . . . . . ( end of section Computer Science FAQs) <<Contents | End>>
Glossary
In the following I use the the Backus-Naur-Form of definition:
term ::= meaning.By using this form I can easily link terms to their definitions... click on a link to see what it means, and then click the Back button on your browser...