Computer Science @ PENN

java 1.5 api | java 1.4.2 api | slashdot | webmail | wikipedia
upenn.edu | directories | portal | van pelt library
seas.upenn.edu | engineering library
computer graphics & game dev (SIGGRAPH) | dining philosophers (DP) | science & tech wing (STWING) | women in cs (WICS)
CETS Answers |

CIS399 Spring 2009
Lectures

  • Final Class, Final Class
  • Class 9, Virtualization
  • Class 8, Bootup
  • Class 7, Kernel
  • Bash Code to count characters:
    #!/bin/bash
    
    data=`cat datafile`
    IFS=$'\n'
    x=0
    for i in $data
    do
     chars=`echo "$i" | wc -m`
     temp+=$chars:$x"\n"
     x=$((x+1))
    done
    echo -e $temp | sort -n -r
    
    Perl Code to Translate back and fourth via freetranslation.com and www::mechanize:
    #!/usr/bin/perl
    
    
    my $string;
    foreach (@ARGV){
      $string .= $_. " " ;
    }
    
    if ($string eq ""){
      $string = <>;
    }
    
    
    use WWW::Mechanize;
    my $mech = WWW::Mechanize->new();
    
    $mech->get("http://www.freetranslation.com");
    $mech->submit_form(
      with_fields => {
        srctext => $string,
        language => "English/French"
      });
    
    $data = $mech->content;
    $data =~ m/dsttext".*?>(.*)</;
    $transstring = $1;
    print $1;
    print "\n";
    $mech->get("http://www.freetranslation.com");
    $mech->submit_form(
      with_fields => {
        srctext => $transstring,
        language => "French/English"
      });
    $data = $mech->content;
    $data =~ m/dsttext".*?>(.*)</;
    print $1;
    print "\n";
    
    Sample Makefile (from Duke University):
    #-----Macros---------------------------------
    
    # for cs machines
    #BASEDIR = /usr/project/courses/cps008/lib
    # for acpub machines
    BASEDIR = /afs/acpub.duke.edu/users8/ola/courses/lib
    
    TLIB = $(BASEDIR)/libtapestry.a
    INCLUDES = -I. -I$(BASEDIR)
    
    # set up compiler and options
    CXX = g++
    CXXFLAGS = -g $(INCLUDES)
    
    #-----Suffix Rules---------------------------
    # set up C++ suffixes and relationship between .cc and .o files
    
    .SUFFIXES: .cc
    
    .cc.o:
       ->   $(CXX) $(CXXFLAGS) -c $<
    
    .cc :
       ->   $(CXX) $(CXXFLAGS) $< -o $@ -lm $(TLIB) -lg++
    
    #-----File Dependencies----------------------
    
    SRC = application.cc menu.cc menuitem.cc pixmap.cc usepix.cc \
          readcommand.cc quitcommand.cc filelister.cc templateapp.cc \
          displaycommand.cc
    
    OBJ = $(addsuffix .o, $(basename $(SRC)))
    
    usepix: $(OBJ)
       ->   $(CXX) $(CXXFLAGS) -o $@ $(OBJ) -lm $(TLIB) -lg++
    
    #-----Other stuff----------------------------
    depend:
       ->   makedepend $(CXXFLAGS) -Y $(SRC)
    
    clean:
       ->   rm -f $(OBJ)
    
  • Class 6, Makefiles, SVN, WWW::Mechanize, Network Tools (+Matrix)
  • Class 5, Scripting
  • Class 4, SSH
  • Class 3, Distributions, Distributions (special lecture), Advanced Shell usage.
  • Class 2, Filesystems 2 and Emacs
  • Class 1, Introduction and FileSystems 1

Valid HTML 4.01 Transitional