Tag Archive for Reference

Pass a stream to a function #2

void myfunction(ifstream &fp, ...)  // use this
void myfunction(ifstream fp, ...)   // not this

source

List JQuery Functions with JQuery & Firebug

jQuery.fn.each(console.log(i));

source

*nix – basic commands

# For more details on a command see the man page for the command. For example, to see more information about the command rm, enter the command
man rm


# To display a list of commands related to a topic enter
man -k topic
# or
apropos topic

# Remember: UNIX COMMANDS ARE CASE SENSITIVE!

#  |||||||||||| ACCOUNT |||||||||||||||||

passwd            # ... set a new password for your account
assets            # ... view information on resource use by your account, including connectivity time, cpu use, and disk space. (Availableon C&C systems only.)


# ||||||||||||| DIRECTORIES ||||||||||||||||||

# DO:                        TO:
# ---------------   ---------------------------------------------
pwd               # ... find out what your current working directory is
mkdir playdir     # ... create a new subdirectory called 'playdir'
rmdir junkdir     # ... remove subdirectory 'junkdir' (must be empty of files and subdirectories)
cd /usr/bin       # ... change to '/usr/bin' directory
cd ..             # ... change to directory one level above current working directory
cd                # ... change to home directory for the account you are using
du                # ... display the number of disk blocks in use (the total combined size of all files) in each directory and subdirectory.


# |||||||||||||||| FILES |||||||||||||||||||

# DO:                        TO:
# ---------------   ---------------------------------------------
ls                # ... list files in the current working directory
ls notes          # ... list file in the subdirectory named 'notes'
ls -l             # ... list all files in the current working directory, along with each file's permission, owner, size in bytes and date of last modification.
ls -a             # ... list files in the current working directory, including dot files (those files with names beginning with a period)
ls -F             # ... list files in the current working directory, indicating executable files with an asterisk (*) and subdirectories with a /
find docs -name *.memo -print # ... list all files in the directory 'docs' and any subdirectories of 'docs' with filenames ending in '.memo'. The  is necessary before the * to insure that is is interpreted as a wild character.
cp file1 file2    # ... copy the file 'file1' to a file named 'file2' (original file remains intact with the same name)
mv oldf newf      # ... move the file 'oldfile' to a file named 'newfile' (equivalent to renaming a file)
rm badfile        # ... remove the file 'badfile' (the file is permanently removed and cannot be recovered)
rm -i *.c         # ... remove all files in the current directory with the suffix '.c' and be asked for confirmation on each file
chmod a+r resul   # ... grant read access of the file 'resul' to all users
cat shortfile     # ... display the file 'shortfile'
more longfile     # ... display the file 'longfile', a screenful at a time
head big          # ... display the first ten lines of file 'big'
head -25 big      # ... display the first 25 lines of file 'big'
tail big          # ... display the last ten lines of file 'big'
tail -25 big      # ... display the last 25 lines of file 'big'
grep done tasks   # ... display all lines within file 'tasks' containing the string 'done'



# |||||||||||||||||||| JOBS ||||||||||||||||||||||

# DO:                        TO:
# ---------------   ---------------------------------------------
ps                # ... list the status of your jobs by process identifier (PID)
ps -aux           # ... list the status of all jobs by process identifier (PID)
jobs              # ... list the status of all jobs by job number
z                 # ... suspend the job currently running in the foreground
bg                # ... resume the most recently suspended job into the background
bg %2             # ... resume job number 2 in the background
fg %2             # ... resume job number 2 in the foreground
fg %3             # ... bring job number 3, which is running in the background, into the foreground
kill %2           # ... kill job number 2
kill 1234         # ... kill job with PID 1234



# ||||||||||||||||||||| NETWORKING |||||||||||||||||||||

# DO:                        TO:
# ---------------   ---------------------------------------------
ssh becker.u      # ... establish an interactive session on computer 'becker'

ftp sun.latin.washington.edu # ... transfer a file to or from computer 'sun.latin.washington.edu'



# |||||||||||| COMMS WITH OTHERS |||||||||||

# DO:                        TO:
# ---------------   ---------------------------------------------
who               # ... find out who is logged on to the computer
w                 # ... find out who is logged on to the computer and what they are doing
finger suzz       # ... display information about user 'suzz'
biff y            # ... be notified if mail arrives. To turn off notification, enter the command 'biff n'
pine              # ... start pine mailer.  Pine is an alternative to 'mail' that many people find easier to use than 'mail'




# ||||||||||||||| MISC ||||||||||||||||||

# DO:                        TO:
# ---------------   ---------------------------------------------
cal 6 1990        # ... display a calendar of June, 1990.
date              # ... display current date and time
script            # ... start recording of all screen interactions
exit              # ... stop script recording (text from recorded session will be in a file named typescript )
alias dir ls -Fal # ... alias 'dir' to represent the command 'ls -Fal'
unalias dir       # ... remove the alias for 'dir'
alias             # ... show all current aliases



# |||||||||||| CONTROL CODES (USED WHEN AT UNIX COMMAND LINE) ||||||||||||

# DO:                        TO:
# ---------------   ---------------------------------------------
u           # Delete entire line
w           # Delete the preceding word
h           # Delete the preceding character
c           # Abort the program currently running
z           # Suspend the program currently running (use fg or bg to resume the program in the foreground or background, respectively)

# Redirecting and Piping

cc myprog.c > listing    # ... run C compiler on 'myprog.c' source file, redirecting compilation messages to a file named 'listing'. The resulting file would NOT include any diagnostic messages.
cc myprog.c >& listing   # ... run C compiler on 'myprog.c' source file, redirect compilation messages, including diagnostic messages, into a file named 'listing'.
ps -aux | more   # ... list all current jobs on the system, piping the result to more for viewing one screen at a time
cat frog >> rat    # ... concatenate the contents of file 'frog' onto the end of file 'rat'

source

Using gotoandplay from a custom class

//This code will do the following : parent.parent.gotoAndStop(2);
var my_parent:MovieClip=parent.parent as MovieClip;
my_parent.nextSection=2;
my_parent.gotoAndStop(my_parent.nextSection)

source

jQuery UI Tabs Reference

$(document).ready(function(){
$('#example > ul').tabs();
});

====

// add slide effect to a tab
$('#example > ul').tabs({ fxSlide: true });

// add a fast fade effect to a tab
$('#example > ul').tabs({ fxFade: true, fxSpeed: 'fast' });

// add a slide and fade effect
$('#example > ul').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'normal' });

// disable one of the tabs (no-zero-based index)
$('#example > ul').tabs({ disabled: [3] });

// start with one of the tabs selected (no-zero-based index)
$('#example > ul').tabs(2);

// start with one of the tabs selected and another disabled
$('#example > ul').tabs(2, { disabled: [1] });

source

Simple LISP reference

(print 'hi)

(print "hello world")

(defun f(x)
(cond ((null x) 'null)
('T 'not-null) ) )

(f 'blah)

(f NIL)

(defun g()
(print 'hi)
(print 'bye) )

(g)

(setq x 5)

(equal x 5)

(print x)

(print 'x)

(+ '5 '3)

(if 'T 1 2)

(if NIL 1 2)

(and 'T 'T)

(or 'T NIL)

(if (and 'T 'T) 1 2)

(car '(1 2 3 4 5))

(cdr '(1 2 3 4 5))

source